ywana-core8 0.0.575 → 0.0.578

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.
@@ -2935,7 +2935,8 @@ var Planner = function Planner(_ref) {
2935
2935
  }
2936
2936
 
2937
2937
  function showThisWeek() {
2938
- var element = document.querySelector(".thisMonday");
2938
+ var element = thisMondayElement.current; //const element = document.querySelector(".thisMonday")
2939
+
2939
2940
  if (element) element.scrollIntoView({
2940
2941
  behavior: 'smooth',
2941
2942
  block: 'start',
@@ -7367,11 +7368,11 @@ var TablePage2 = function TablePage2(props) {
7367
7368
  children = props.children;
7368
7369
 
7369
7370
  var _useContext = useContext(PageContext),
7371
+ pageContext = _useContext[0],
7370
7372
  setPageContext = _useContext[1];
7371
7373
 
7372
7374
  var context = TableContext$1(url, field, host, urlQuery, params);
7373
- var _pageContext = pageContext,
7374
- selected = _pageContext.selected;
7375
+ var selected = pageContext.selected;
7375
7376
  var timer = useRef(null);
7376
7377
 
7377
7378
  var _useState = useState(selected),
@@ -7692,16 +7693,6 @@ var TableQueries$1 = function TableQueries(props) {
7692
7693
 
7693
7694
 
7694
7695
  var TableFilters$1 = function TableFilters(props) {
7695
- var reload = function reload() {
7696
- try {
7697
- return Promise.resolve(pageContext.load(form)).then(function () {
7698
- setPageContext(Object.assign({}, pageContext));
7699
- });
7700
- } catch (e) {
7701
- return Promise.reject(e);
7702
- }
7703
- };
7704
-
7705
7696
  var change = function change(next) {
7706
7697
  try {
7707
7698
  setForm(next);
@@ -7745,10 +7736,13 @@ var TableFilters$1 = function TableFilters(props) {
7745
7736
  return filterSchema;
7746
7737
  }, [schema]);
7747
7738
  useEffect(function () {
7748
- if (filters) setForm(filters);
7739
+ if (filters && !equal(filters, form)) setForm(filters);
7749
7740
  }, [filters]);
7750
7741
  useEffect(function () {
7751
- reload();
7742
+ if (pageContext.changeFilters && !equal(filters, form)) {
7743
+ pageContext.changeFilters(form);
7744
+ setPageContext(Object.assign({}, pageContext));
7745
+ }
7752
7746
  }, [form]);
7753
7747
 
7754
7748
  function clear() {
@@ -7817,7 +7811,7 @@ var TableEditor$1 = function TableEditor(props) {
7817
7811
  var remove = function remove(id) {
7818
7812
  try {
7819
7813
  return Promise.resolve(site.confirm("Are you sure ?")).then(function (confirm) {
7820
- var _temp5 = function () {
7814
+ var _temp7 = function () {
7821
7815
  if (confirm) {
7822
7816
  return Promise.resolve(pageContext.remove(id)).then(function () {
7823
7817
  pageContext.clear();
@@ -7826,7 +7820,7 @@ var TableEditor$1 = function TableEditor(props) {
7826
7820
  }
7827
7821
  }();
7828
7822
 
7829
- if (_temp5 && _temp5.then) return _temp5.then(function () {});
7823
+ if (_temp7 && _temp7.then) return _temp7.then(function () {});
7830
7824
  });
7831
7825
  } catch (e) {
7832
7826
  return Promise.reject(e);
@@ -7840,7 +7834,8 @@ var TableEditor$1 = function TableEditor(props) {
7840
7834
  setPageContext = _useContext5[1];
7841
7835
 
7842
7836
  var _pageContext$all = pageContext.all,
7843
- all = _pageContext$all === void 0 ? [] : _pageContext$all;
7837
+ all = _pageContext$all === void 0 ? [] : _pageContext$all,
7838
+ filters = pageContext.filters;
7844
7839
  var icon = props.icon,
7845
7840
  title = props.title,
7846
7841
  schema = props.schema,
@@ -7848,7 +7843,8 @@ var TableEditor$1 = function TableEditor(props) {
7848
7843
  canDelete = props.canDelete,
7849
7844
  filter = props.filter,
7850
7845
  actions = props.actions,
7851
- className = props.className;
7846
+ className = props.className,
7847
+ tabbedBy = props.tabbedBy;
7852
7848
 
7853
7849
  var _useState4 = useState(props.groupBy),
7854
7850
  groupBy = _useState4[0],
@@ -7860,6 +7856,21 @@ var TableEditor$1 = function TableEditor(props) {
7860
7856
  useEffect(function () {
7861
7857
  try {
7862
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 () {
7863
7874
  if (tab) {
7864
7875
  var _filter2;
7865
7876
 
@@ -7871,7 +7882,7 @@ var TableEditor$1 = function TableEditor(props) {
7871
7882
  }
7872
7883
  }();
7873
7884
 
7874
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
7885
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
7875
7886
  } catch (e) {
7876
7887
  return Promise.reject(e);
7877
7888
  }
@@ -8066,7 +8077,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8066
8077
  try {
8067
8078
  var _this2 = this;
8068
8079
 
8069
- var _temp7 = _catch$1(function () {
8080
+ var _temp9 = _catch$1(function () {
8070
8081
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
8071
8082
  var field = filter[key];
8072
8083
 
@@ -8090,7 +8101,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8090
8101
  console.log(error);
8091
8102
  });
8092
8103
 
8093
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
8104
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
8094
8105
  } catch (e) {
8095
8106
  return Promise.reject(e);
8096
8107
  }
@@ -8125,7 +8136,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8125
8136
  try {
8126
8137
  var _this5 = this;
8127
8138
 
8128
- var _temp9 = _catch$1(function () {
8139
+ var _temp11 = _catch$1(function () {
8129
8140
  return Promise.resolve(API.create(form)).then(function () {
8130
8141
  return Promise.resolve(_this5.load()).then(function () {});
8131
8142
  });
@@ -8133,7 +8144,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8133
8144
  console.log(error);
8134
8145
  });
8135
8146
 
8136
- return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
8147
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
8137
8148
  } catch (e) {
8138
8149
  return Promise.reject(e);
8139
8150
  }
@@ -8142,7 +8153,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8142
8153
  try {
8143
8154
  var _this7 = this;
8144
8155
 
8145
- var _temp11 = _catch$1(function () {
8156
+ var _temp13 = _catch$1(function () {
8146
8157
  return Promise.resolve(API.update(form)).then(function () {
8147
8158
  return Promise.resolve(_this7.load()).then(function () {});
8148
8159
  });
@@ -8150,7 +8161,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8150
8161
  console.log(error);
8151
8162
  });
8152
8163
 
8153
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
8164
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
8154
8165
  } catch (e) {
8155
8166
  return Promise.reject(e);
8156
8167
  }
@@ -8159,7 +8170,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8159
8170
  try {
8160
8171
  var _this9 = this;
8161
8172
 
8162
- var _temp13 = _catch$1(function () {
8173
+ var _temp15 = _catch$1(function () {
8163
8174
  return Promise.resolve(API.remove(id)).then(function () {
8164
8175
  return Promise.resolve(_this9.load()).then(function () {});
8165
8176
  });
@@ -8167,7 +8178,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8167
8178
  console.log(error);
8168
8179
  });
8169
8180
 
8170
- return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
8181
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
8171
8182
  } catch (e) {
8172
8183
  return Promise.reject(e);
8173
8184
  }
@@ -8179,7 +8190,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8179
8190
  try {
8180
8191
  var _this11 = this;
8181
8192
 
8182
- var _temp15 = _catch$1(function () {
8193
+ var _temp17 = _catch$1(function () {
8183
8194
  return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
8184
8195
  _this11.queries = _API$queries;
8185
8196
  });
@@ -8187,7 +8198,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8187
8198
  console.log(error);
8188
8199
  });
8189
8200
 
8190
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
8201
+ return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
8191
8202
  } catch (e) {
8192
8203
  return Promise.reject(e);
8193
8204
  }
@@ -8196,7 +8207,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8196
8207
  try {
8197
8208
  var _this13 = this;
8198
8209
 
8199
- var _temp17 = _catch$1(function () {
8210
+ var _temp19 = _catch$1(function () {
8200
8211
  return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
8201
8212
  return Promise.resolve(_this13.loadQueries(user)).then(function () {});
8202
8213
  });
@@ -8204,7 +8215,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8204
8215
  console.log(error);
8205
8216
  });
8206
8217
 
8207
- return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
8218
+ return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
8208
8219
  } catch (e) {
8209
8220
  return Promise.reject(e);
8210
8221
  }
@@ -8213,7 +8224,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8213
8224
  try {
8214
8225
  var _this15 = this;
8215
8226
 
8216
- var _temp19 = _catch$1(function () {
8227
+ var _temp21 = _catch$1(function () {
8217
8228
  return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
8218
8229
  return Promise.resolve(_this15.loadQueries(user)).then(function () {});
8219
8230
  });
@@ -8221,7 +8232,7 @@ var TableContext$1 = function TableContext(url, field, host, urlQuery, params) {
8221
8232
  console.log(error);
8222
8233
  });
8223
8234
 
8224
- return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
8235
+ return Promise.resolve(_temp21 && _temp21.then ? _temp21.then(function () {}) : void 0);
8225
8236
  } catch (e) {
8226
8237
  return Promise.reject(e);
8227
8238
  }
@@ -8256,7 +8267,7 @@ var TableAPI$1 = function TableAPI(url, host, params) {
8256
8267
  }, "");
8257
8268
  return query.concat(param);
8258
8269
  } else {
8259
- return query.concat(key + "=%" + filters[key] + "%&");
8270
+ return query.concat(key + "=" + filters[key] + "&");
8260
8271
  }
8261
8272
  }, "");
8262
8273
  queryParams = queryParams.concat(filterQuery);
@@ -8804,16 +8815,6 @@ var TableQueries = function TableQueries(props) {
8804
8815
 
8805
8816
 
8806
8817
  var TableFilters = function TableFilters(props) {
8807
- var reload = function reload() {
8808
- try {
8809
- return Promise.resolve(pageContext.load(form, likes)).then(function () {
8810
- setPageContext(Object.assign({}, pageContext));
8811
- });
8812
- } catch (e) {
8813
- return Promise.reject(e);
8814
- }
8815
- };
8816
-
8817
8818
  var change = function change(next) {
8818
8819
  try {
8819
8820
  setForm(next);
@@ -8856,7 +8857,7 @@ var TableFilters = function TableFilters(props) {
8856
8857
  delete filterSchema.flows;
8857
8858
  return filterSchema;
8858
8859
  }, [schema]);
8859
- var likes = useMemo(function () {
8860
+ useMemo(function () {
8860
8861
  var fields = Object.values(schema);
8861
8862
  return fields.reduce(function (likes, field) {
8862
8863
  if (field.like === true) likes.push(field.id);
@@ -8864,10 +8865,13 @@ var TableFilters = function TableFilters(props) {
8864
8865
  }, []);
8865
8866
  }, [schema]);
8866
8867
  useEffect(function () {
8867
- if (filters) setForm(filters);
8868
+ if (filters && !equal(filters, form)) setForm(filters);
8868
8869
  }, [filters]);
8869
8870
  useEffect(function () {
8870
- reload();
8871
+ if (pageContext.changeFilters && !equal(filters, form)) {
8872
+ pageContext.changeFilters(form);
8873
+ setPageContext(Object.assign({}, pageContext));
8874
+ }
8871
8875
  }, [form]);
8872
8876
 
8873
8877
  function clear() {
@@ -8936,7 +8940,7 @@ var TableEditor = function TableEditor(props) {
8936
8940
  var remove = function remove(id) {
8937
8941
  try {
8938
8942
  return Promise.resolve(site.confirm("Are you sure ?")).then(function (confirm) {
8939
- var _temp3 = function () {
8943
+ var _temp5 = function () {
8940
8944
  if (confirm) {
8941
8945
  return Promise.resolve(pageContext.remove(id)).then(function () {
8942
8946
  pageContext.clear();
@@ -8945,7 +8949,7 @@ var TableEditor = function TableEditor(props) {
8945
8949
  }
8946
8950
  }();
8947
8951
 
8948
- if (_temp3 && _temp3.then) return _temp3.then(function () {});
8952
+ if (_temp5 && _temp5.then) return _temp5.then(function () {});
8949
8953
  });
8950
8954
  } catch (e) {
8951
8955
  return Promise.reject(e);
@@ -8959,7 +8963,8 @@ var TableEditor = function TableEditor(props) {
8959
8963
  setPageContext = _useContext5[1];
8960
8964
 
8961
8965
  var _pageContext$all = pageContext.all,
8962
- all = _pageContext$all === void 0 ? [] : _pageContext$all;
8966
+ all = _pageContext$all === void 0 ? [] : _pageContext$all,
8967
+ filters = pageContext.filters;
8963
8968
  var icon = props.icon,
8964
8969
  title = props.title,
8965
8970
  schema = props.schema,
@@ -8974,6 +8979,22 @@ var TableEditor = function TableEditor(props) {
8974
8979
  groupBy = _useState5[0],
8975
8980
  setGroupBy = _useState5[1];
8976
8981
 
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
+
8977
8998
  function changeGroup(id, value) {
8978
8999
  setGroupBy(value);
8979
9000
  }
@@ -9156,7 +9177,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9156
9177
  try {
9157
9178
  var _this2 = this;
9158
9179
 
9159
- var _temp5 = _catch(function () {
9180
+ var _temp7 = _catch(function () {
9160
9181
  var filters = filter ? Object.keys(filter).reduce(function (filters, key) {
9161
9182
  var field = filter[key];
9162
9183
 
@@ -9185,7 +9206,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9185
9206
  console.log(error);
9186
9207
  });
9187
9208
 
9188
- return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(function () {}) : void 0);
9209
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
9189
9210
  } catch (e) {
9190
9211
  return Promise.reject(e);
9191
9212
  }
@@ -9223,7 +9244,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9223
9244
  try {
9224
9245
  var _this5 = this;
9225
9246
 
9226
- var _temp7 = _catch(function () {
9247
+ var _temp9 = _catch(function () {
9227
9248
  return Promise.resolve(API.create(form)).then(function () {
9228
9249
  return Promise.resolve(_this5.load({}, [])).then(function () {});
9229
9250
  });
@@ -9231,7 +9252,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9231
9252
  console.log(error);
9232
9253
  });
9233
9254
 
9234
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
9255
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
9235
9256
  } catch (e) {
9236
9257
  return Promise.reject(e);
9237
9258
  }
@@ -9240,7 +9261,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9240
9261
  try {
9241
9262
  var _this7 = this;
9242
9263
 
9243
- var _temp9 = _catch(function () {
9264
+ var _temp11 = _catch(function () {
9244
9265
  return Promise.resolve(API.update(form)).then(function () {
9245
9266
  return Promise.resolve(_this7.load()).then(function () {});
9246
9267
  });
@@ -9248,7 +9269,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9248
9269
  console.log(error);
9249
9270
  });
9250
9271
 
9251
- return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function () {}) : void 0);
9272
+ return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
9252
9273
  } catch (e) {
9253
9274
  return Promise.reject(e);
9254
9275
  }
@@ -9257,7 +9278,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9257
9278
  try {
9258
9279
  var _this9 = this;
9259
9280
 
9260
- var _temp11 = _catch(function () {
9281
+ var _temp13 = _catch(function () {
9261
9282
  return Promise.resolve(API.remove(id)).then(function () {
9262
9283
  return Promise.resolve(_this9.load()).then(function () {});
9263
9284
  });
@@ -9265,7 +9286,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9265
9286
  console.log(error);
9266
9287
  });
9267
9288
 
9268
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
9289
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
9269
9290
  } catch (e) {
9270
9291
  return Promise.reject(e);
9271
9292
  }
@@ -9277,7 +9298,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9277
9298
  try {
9278
9299
  var _this11 = this;
9279
9300
 
9280
- var _temp13 = _catch(function () {
9301
+ var _temp15 = _catch(function () {
9281
9302
  return Promise.resolve(API.queries(user, urlQuery)).then(function (_API$queries) {
9282
9303
  _this11.queries = _API$queries;
9283
9304
  });
@@ -9285,7 +9306,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9285
9306
  console.log(error);
9286
9307
  });
9287
9308
 
9288
- return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
9309
+ return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
9289
9310
  } catch (e) {
9290
9311
  return Promise.reject(e);
9291
9312
  }
@@ -9294,7 +9315,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9294
9315
  try {
9295
9316
  var _this13 = this;
9296
9317
 
9297
- var _temp15 = _catch(function () {
9318
+ var _temp17 = _catch(function () {
9298
9319
  return Promise.resolve(API.createQuery(query, urlQuery)).then(function () {
9299
9320
  return Promise.resolve(_this13.loadQueries(user)).then(function () {});
9300
9321
  });
@@ -9302,7 +9323,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9302
9323
  console.log(error);
9303
9324
  });
9304
9325
 
9305
- return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(function () {}) : void 0);
9326
+ return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
9306
9327
  } catch (e) {
9307
9328
  return Promise.reject(e);
9308
9329
  }
@@ -9311,7 +9332,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9311
9332
  try {
9312
9333
  var _this15 = this;
9313
9334
 
9314
- var _temp17 = _catch(function () {
9335
+ var _temp19 = _catch(function () {
9315
9336
  return Promise.resolve(API.removeQuery(id, urlQuery)).then(function () {
9316
9337
  return Promise.resolve(_this15.loadQueries(user)).then(function () {});
9317
9338
  });
@@ -9319,7 +9340,7 @@ var TableContext = function TableContext(url, field, host, urlQuery) {
9319
9340
  console.log(error);
9320
9341
  });
9321
9342
 
9322
- return Promise.resolve(_temp17 && _temp17.then ? _temp17.then(function () {}) : void 0);
9343
+ return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
9323
9344
  } catch (e) {
9324
9345
  return Promise.reject(e);
9325
9346
  }