ywana-core8 0.0.576 → 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.
@@ -7368,11 +7368,11 @@ var TablePage2 = function TablePage2(props) {
7368
7368
  children = props.children;
7369
7369
 
7370
7370
  var _useContext = useContext(PageContext),
7371
+ pageContext = _useContext[0],
7371
7372
  setPageContext = _useContext[1];
7372
7373
 
7373
7374
  var context = TableContext$1(url, field, host, urlQuery, params);
7374
- var _pageContext = pageContext,
7375
- selected = _pageContext.selected;
7375
+ var selected = pageContext.selected;
7376
7376
  var timer = useRef(null);
7377
7377
 
7378
7378
  var _useState = useState(selected),
@@ -7693,16 +7693,6 @@ var TableQueries$1 = function TableQueries(props) {
7693
7693
 
7694
7694
 
7695
7695
  var TableFilters$1 = function TableFilters(props) {
7696
- var reload = function reload() {
7697
- try {
7698
- return Promise.resolve(pageContext.load(form)).then(function () {
7699
- setPageContext(Object.assign({}, pageContext));
7700
- });
7701
- } catch (e) {
7702
- return Promise.reject(e);
7703
- }
7704
- };
7705
-
7706
7696
  var change = function change(next) {
7707
7697
  try {
7708
7698
  setForm(next);
@@ -7746,10 +7736,13 @@ var TableFilters$1 = function TableFilters(props) {
7746
7736
  return filterSchema;
7747
7737
  }, [schema]);
7748
7738
  useEffect(function () {
7749
- if (filters) setForm(filters);
7739
+ if (filters && !equal(filters, form)) setForm(filters);
7750
7740
  }, [filters]);
7751
7741
  useEffect(function () {
7752
- reload();
7742
+ if (pageContext.changeFilters && !equal(filters, form)) {
7743
+ pageContext.changeFilters(form);
7744
+ setPageContext(Object.assign({}, pageContext));
7745
+ }
7753
7746
  }, [form]);
7754
7747
 
7755
7748
  function clear() {
@@ -7818,7 +7811,7 @@ var TableEditor$1 = function TableEditor(props) {
7818
7811
  var remove = function remove(id) {
7819
7812
  try {
7820
7813
  return Promise.resolve(site.confirm("Are you sure ?")).then(function (confirm) {
7821
- var _temp5 = function () {
7814
+ var _temp7 = function () {
7822
7815
  if (confirm) {
7823
7816
  return Promise.resolve(pageContext.remove(id)).then(function () {
7824
7817
  pageContext.clear();
@@ -7827,7 +7820,7 @@ var TableEditor$1 = function TableEditor(props) {
7827
7820
  }
7828
7821
  }();
7829
7822
 
7830
- if (_temp5 && _temp5.then) return _temp5.then(function () {});
7823
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
7831
7824
  });
7832
7825
  } catch (e) {
7833
7826
  return Promise.reject(e);
@@ -7841,7 +7834,8 @@ var TableEditor$1 = function TableEditor(props) {
7841
7834
  setPageContext = _useContext5[1];
7842
7835
 
7843
7836
  var _pageContext$all = pageContext.all,
7844
- all = _pageContext$all === void 0 ? [] : _pageContext$all;
7837
+ all = _pageContext$all === void 0 ? [] : _pageContext$all,
7838
+ filters = pageContext.filters;
7845
7839
  var icon = props.icon,
7846
7840
  title = props.title,
7847
7841
  schema = props.schema,
@@ -7849,7 +7843,8 @@ var TableEditor$1 = function TableEditor(props) {
7849
7843
  canDelete = props.canDelete,
7850
7844
  filter = props.filter,
7851
7845
  actions = props.actions,
7852
- className = props.className;
7846
+ className = props.className,
7847
+ tabbedBy = props.tabbedBy;
7853
7848
 
7854
7849
  var _useState4 = useState(props.groupBy),
7855
7850
  groupBy = _useState4[0],
@@ -7861,6 +7856,21 @@ var TableEditor$1 = function TableEditor(props) {
7861
7856
  useEffect(function () {
7862
7857
  try {
7863
7858
  var _temp4 = function () {
7859
+ if (filters) {
7860
+ return Promise.resolve(pageContext.load(filters)).then(function () {
7861
+ setPageContext(Object.assign({}, pageContext));
7862
+ });
7863
+ }
7864
+ }();
7865
+
7866
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
7867
+ } catch (e) {
7868
+ return Promise.reject(e);
7869
+ }
7870
+ }, [filters]);
7871
+ useEffect(function () {
7872
+ try {
7873
+ var _temp6 = function () {
7864
7874
  if (tab) {
7865
7875
  var _filter2;
7866
7876
 
@@ -7872,7 +7882,7 @@ var TableEditor$1 = function TableEditor(props) {
7872
7882
  }
7873
7883
  }();
7874
7884
 
7875
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
7885
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
7876
7886
  } catch (e) {
7877
7887
  return Promise.reject(e);
7878
7888
  }
@@ -8067,7 +8077,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8067
8077
  try {
8068
8078
  var _this2 = this;
8069
8079
 
8070
- var _temp7 = _catch$1(function () {
8080
+ var _temp9 = _catch$1(function () {
8071
8081
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
8072
8082
  var field = filter[key];
8073
8083
 
@@ -8091,7 +8101,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8091
8101
  console.log(error);
8092
8102
  });
8093
8103
 
8094
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
8104
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
8095
8105
  } catch (e) {
8096
8106
  return Promise.reject(e);
8097
8107
  }
@@ -8126,7 +8136,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8126
8136
  try {
8127
8137
  var _this5 = this;
8128
8138
 
8129
- var _temp9 = _catch$1(function () {
8139
+ var _temp11 = _catch$1(function () {
8130
8140
  return Promise.resolve(API.create(form)).then(function () {
8131
8141
  return Promise.resolve(_this5.load()).then(function () {});
8132
8142
  });
@@ -8134,7 +8144,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8134
8144
  console.log(error);
8135
8145
  });
8136
8146
 
8137
- return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
8147
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
8138
8148
  } catch (e) {
8139
8149
  return Promise.reject(e);
8140
8150
  }
@@ -8143,7 +8153,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8143
8153
  try {
8144
8154
  var _this7 = this;
8145
8155
 
8146
- var _temp11 = _catch$1(function () {
8156
+ var _temp13 = _catch$1(function () {
8147
8157
  return Promise.resolve(API.update(form)).then(function () {
8148
8158
  return Promise.resolve(_this7.load()).then(function () {});
8149
8159
  });
@@ -8151,7 +8161,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8151
8161
  console.log(error);
8152
8162
  });
8153
8163
 
8154
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
8164
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
8155
8165
  } catch (e) {
8156
8166
  return Promise.reject(e);
8157
8167
  }
@@ -8160,7 +8170,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8160
8170
  try {
8161
8171
  var _this9 = this;
8162
8172
 
8163
- var _temp13 = _catch$1(function () {
8173
+ var _temp15 = _catch$1(function () {
8164
8174
  return Promise.resolve(API.remove(id)).then(function () {
8165
8175
  return Promise.resolve(_this9.load()).then(function () {});
8166
8176
  });
@@ -8168,7 +8178,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8168
8178
  console.log(error);
8169
8179
  });
8170
8180
 
8171
- return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
8181
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
8172
8182
  } catch (e) {
8173
8183
  return Promise.reject(e);
8174
8184
  }
@@ -8180,7 +8190,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8180
8190
  try {
8181
8191
  var _this11 = this;
8182
8192
 
8183
- var _temp15 = _catch$1(function () {
8193
+ var _temp17 = _catch$1(function () {
8184
8194
  return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
8185
8195
  _this11.queries = _API$queries;
8186
8196
  });
@@ -8188,7 +8198,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8188
8198
  console.log(error);
8189
8199
  });
8190
8200
 
8191
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
8201
+ return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
8192
8202
  } catch (e) {
8193
8203
  return Promise.reject(e);
8194
8204
  }
@@ -8197,7 +8207,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8197
8207
  try {
8198
8208
  var _this13 = this;
8199
8209
 
8200
- var _temp17 = _catch$1(function () {
8210
+ var _temp19 = _catch$1(function () {
8201
8211
  return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
8202
8212
  return Promise.resolve(_this13.loadQueries(user)).then(function () {});
8203
8213
  });
@@ -8205,7 +8215,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8205
8215
  console.log(error);
8206
8216
  });
8207
8217
 
8208
- return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
8218
+ return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
8209
8219
  } catch (e) {
8210
8220
  return Promise.reject(e);
8211
8221
  }
@@ -8214,7 +8224,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8214
8224
  try {
8215
8225
  var _this15 = this;
8216
8226
 
8217
- var _temp19 = _catch$1(function () {
8227
+ var _temp21 = _catch$1(function () {
8218
8228
  return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
8219
8229
  return Promise.resolve(_this15.loadQueries(user)).then(function () {});
8220
8230
  });
@@ -8222,7 +8232,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8222
8232
  console.log(error);
8223
8233
  });
8224
8234
 
8225
- return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
8235
+ return Promise.resolve(_temp21 && _temp21.then ? _temp21.then(function () {}) : void 0);
8226
8236
  } catch (e) {
8227
8237
  return Promise.reject(e);
8228
8238
  }
@@ -8257,7 +8267,7 @@ var TableAPI$1 = function TableAPI(url, host, params) {
8257
8267
  }, "");
8258
8268
  return query.concat(param);
8259
8269
  } else {
8260
- return query.concat(key + "=%" + filters[key] + "%&");
8270
+ return query.concat(key + "=" + filters[key] + "&");
8261
8271
  }
8262
8272
  }, "");
8263
8273
  queryParams = queryParams.concat(filterQuery);