ywana-core8 0.0.578 → 0.0.579

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.
@@ -8815,6 +8815,16 @@ var TableQueries = function TableQueries(props) {
8815
8815
 
8816
8816
 
8817
8817
  var TableFilters = function TableFilters(props) {
8818
+ var reload = function reload() {
8819
+ try {
8820
+ return Promise.resolve(pageContext.load(form, likes)).then(function () {
8821
+ setPageContext(Object.assign({}, pageContext));
8822
+ });
8823
+ } catch (e) {
8824
+ return Promise.reject(e);
8825
+ }
8826
+ };
8827
+
8818
8828
  var change = function change(next) {
8819
8829
  try {
8820
8830
  setForm(next);
@@ -8857,7 +8867,7 @@ var TableFilters = function TableFilters(props) {
8857
8867
  delete filterSchema.flows;
8858
8868
  return filterSchema;
8859
8869
  }, [schema]);
8860
- useMemo(function () {
8870
+ var likes = useMemo(function () {
8861
8871
  var fields = Object.values(schema);
8862
8872
  return fields.reduce(function (likes, field) {
8863
8873
  if (field.like === true) likes.push(field.id);
@@ -8865,13 +8875,10 @@ var TableFilters = function TableFilters(props) {
8865
8875
  }, []);
8866
8876
  }, [schema]);
8867
8877
  useEffect(function () {
8868
- if (filters && !equal(filters, form)) setForm(filters);
8878
+ if (filters) setForm(filters);
8869
8879
  }, [filters]);
8870
8880
  useEffect(function () {
8871
- if (pageContext.changeFilters && !equal(filters, form)) {
8872
- pageContext.changeFilters(form);
8873
- setPageContext(Object.assign({}, pageContext));
8874
- }
8881
+ reload();
8875
8882
  }, [form]);
8876
8883
 
8877
8884
  function clear() {
@@ -8940,7 +8947,7 @@ var TableEditor = function TableEditor(props) {
8940
8947
  var remove = function remove(id) {
8941
8948
  try {
8942
8949
  return Promise.resolve(site.confirm("Are you sure ?")).then(function (confirm) {
8943
- var _temp5 = function () {
8950
+ var _temp3 = function () {
8944
8951
  if (confirm) {
8945
8952
  return Promise.resolve(pageContext.remove(id)).then(function () {
8946
8953
  pageContext.clear();
@@ -8949,7 +8956,7 @@ var TableEditor = function TableEditor(props) {
8949
8956
  }
8950
8957
  }();
8951
8958
 
8952
- if (_temp5 && _temp5.then) return _temp5.then(function () {});
8959
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
8953
8960
  });
8954
8961
  } catch (e) {
8955
8962
  return Promise.reject(e);
@@ -8963,8 +8970,7 @@ var TableEditor = function TableEditor(props) {
8963
8970
  setPageContext = _useContext5[1];
8964
8971
 
8965
8972
  var _pageContext$all = pageContext.all,
8966
- all = _pageContext$all === void 0 ? [] : _pageContext$all,
8967
- filters = pageContext.filters;
8973
+ all = _pageContext$all === void 0 ? [] : _pageContext$all;
8968
8974
  var icon = props.icon,
8969
8975
  title = props.title,
8970
8976
  schema = props.schema,
@@ -8979,22 +8985,6 @@ var TableEditor = function TableEditor(props) {
8979
8985
  groupBy = _useState5[0],
8980
8986
  setGroupBy = _useState5[1];
8981
8987
 
8982
- useEffect(function () {
8983
- try {
8984
- var _temp4 = function () {
8985
- if (filters) {
8986
- return Promise.resolve(pageContext.load(filters)).then(function () {
8987
- setPageContext(Object.assign({}, pageContext));
8988
- });
8989
- }
8990
- }();
8991
-
8992
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
8993
- } catch (e) {
8994
- return Promise.reject(e);
8995
- }
8996
- }, [filters]);
8997
-
8998
8988
  function changeGroup(id, value) {
8999
8989
  setGroupBy(value);
9000
8990
  }
@@ -9177,7 +9167,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9177
9167
  try {
9178
9168
  var _this2 = this;
9179
9169
 
9180
- var _temp7 = _catch(function () {
9170
+ var _temp5 = _catch(function () {
9181
9171
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
9182
9172
  var field = filter[key];
9183
9173
 
@@ -9206,7 +9196,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9206
9196
  console.log(error);
9207
9197
  });
9208
9198
 
9209
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
9199
+ return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(function () {}) : void 0);
9210
9200
  } catch (e) {
9211
9201
  return Promise.reject(e);
9212
9202
  }
@@ -9244,7 +9234,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9244
9234
  try {
9245
9235
  var _this5 = this;
9246
9236
 
9247
- var _temp9 = _catch(function () {
9237
+ var _temp7 = _catch(function () {
9248
9238
  return Promise.resolve(API.create(form)).then(function () {
9249
9239
  return Promise.resolve(_this5.load({}, [])).then(function () {});
9250
9240
  });
@@ -9252,7 +9242,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9252
9242
  console.log(error);
9253
9243
  });
9254
9244
 
9255
- return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
9245
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
9256
9246
  } catch (e) {
9257
9247
  return Promise.reject(e);
9258
9248
  }
@@ -9261,7 +9251,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9261
9251
  try {
9262
9252
  var _this7 = this;
9263
9253
 
9264
- var _temp11 = _catch(function () {
9254
+ var _temp9 = _catch(function () {
9265
9255
  return Promise.resolve(API.update(form)).then(function () {
9266
9256
  return Promise.resolve(_this7.load()).then(function () {});
9267
9257
  });
@@ -9269,7 +9259,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9269
9259
  console.log(error);
9270
9260
  });
9271
9261
 
9272
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
9262
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
9273
9263
  } catch (e) {
9274
9264
  return Promise.reject(e);
9275
9265
  }
@@ -9278,7 +9268,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9278
9268
  try {
9279
9269
  var _this9 = this;
9280
9270
 
9281
- var _temp13 = _catch(function () {
9271
+ var _temp11 = _catch(function () {
9282
9272
  return Promise.resolve(API.remove(id)).then(function () {
9283
9273
  return Promise.resolve(_this9.load()).then(function () {});
9284
9274
  });
@@ -9286,7 +9276,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9286
9276
  console.log(error);
9287
9277
  });
9288
9278
 
9289
- return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
9279
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
9290
9280
  } catch (e) {
9291
9281
  return Promise.reject(e);
9292
9282
  }
@@ -9298,7 +9288,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9298
9288
  try {
9299
9289
  var _this11 = this;
9300
9290
 
9301
- var _temp15 = _catch(function () {
9291
+ var _temp13 = _catch(function () {
9302
9292
  return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9303
9293
  _this11.queries = _API$queries;
9304
9294
  });
@@ -9306,7 +9296,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9306
9296
  console.log(error);
9307
9297
  });
9308
9298
 
9309
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
9299
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
9310
9300
  } catch (e) {
9311
9301
  return Promise.reject(e);
9312
9302
  }
@@ -9315,7 +9305,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9315
9305
  try {
9316
9306
  var _this13 = this;
9317
9307
 
9318
- var _temp17 = _catch(function () {
9308
+ var _temp15 = _catch(function () {
9319
9309
  return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9320
9310
  return Promise.resolve(_this13.loadQueries(user)).then(function () {});
9321
9311
  });
@@ -9323,7 +9313,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9323
9313
  console.log(error);
9324
9314
  });
9325
9315
 
9326
- return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
9316
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
9327
9317
  } catch (e) {
9328
9318
  return Promise.reject(e);
9329
9319
  }
@@ -9332,7 +9322,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9332
9322
  try {
9333
9323
  var _this15 = this;
9334
9324
 
9335
- var _temp19 = _catch(function () {
9325
+ var _temp17 = _catch(function () {
9336
9326
  return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
9337
9327
  return Promise.resolve(_this15.loadQueries(user)).then(function () {});
9338
9328
  });
@@ -9340,7 +9330,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9340
9330
  console.log(error);
9341
9331
  });
9342
9332
 
9343
- return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
9333
+ return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
9344
9334
  } catch (e) {
9345
9335
  return Promise.reject(e);
9346
9336
  }