ywana-core8 0.0.280 → 0.0.283

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.
package/dist/index.cjs CHANGED
@@ -3284,7 +3284,9 @@ var Dialog = function Dialog(props) {
3284
3284
  */
3285
3285
 
3286
3286
  var View = function View(props) {
3287
- var icon = props.icon,
3287
+ var id = props.id,
3288
+ className = props.className,
3289
+ icon = props.icon,
3288
3290
  title = props.title,
3289
3291
  toolbar = props.toolbar,
3290
3292
  menu = props.menu,
@@ -3307,7 +3309,8 @@ var View = function View(props) {
3307
3309
  }
3308
3310
 
3309
3311
  return /*#__PURE__*/React__default["default"].createElement("section", {
3310
- className: "view"
3312
+ id: id,
3313
+ className: "view " + className
3311
3314
  }, /*#__PURE__*/React__default["default"].createElement("header", null, canCollapse ? /*#__PURE__*/React__default["default"].createElement(Icon, {
3312
3315
  icon: "expand_more",
3313
3316
  size: "small",
@@ -4443,6 +4446,10 @@ var CreateContentDialog = function CreateContentDialog(_ref) {
4443
4446
  }));
4444
4447
  };
4445
4448
 
4449
+ /**
4450
+ * Collection Page
4451
+ */
4452
+
4446
4453
  function _catch$1(body, recover) {
4447
4454
  try {
4448
4455
  var result = body();
@@ -4456,12 +4463,11 @@ function _catch$1(body, recover) {
4456
4463
 
4457
4464
  return result;
4458
4465
  }
4459
-
4460
- var http$1 = HTTPClient(window.API || process.env.REACT_APP_API, Session);
4461
4466
  /**
4462
- * Collection Page
4467
+ * Collection List
4463
4468
  */
4464
4469
 
4470
+
4465
4471
  var CollectionPage = function CollectionPage(props) {
4466
4472
  var reload = function reload() {
4467
4473
  try {
@@ -4571,9 +4577,6 @@ var CollectionPage = function CollectionPage(props) {
4571
4577
  delay: delay
4572
4578
  })));
4573
4579
  };
4574
- /**
4575
- * Collection List
4576
- */
4577
4580
 
4578
4581
  var CollectionList = function CollectionList(props) {
4579
4582
  var select = function select(id) {
@@ -4823,7 +4826,7 @@ var CollectionEditor = function CollectionEditor(props) {
4823
4826
  */
4824
4827
 
4825
4828
 
4826
- var CollectionContext = function CollectionContext(url, field) {
4829
+ var CollectionContext = function CollectionContext(url, field, host) {
4827
4830
  var API = CollectionAPI(url);
4828
4831
  return {
4829
4832
  all: [],
@@ -4946,6 +4949,7 @@ var CollectionContext = function CollectionContext(url, field) {
4946
4949
  */
4947
4950
 
4948
4951
  var CollectionAPI = function CollectionAPI(url) {
4952
+ var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
4949
4953
  return {
4950
4954
  all: function all(filters) {
4951
4955
  var queryParams = "?";
@@ -4969,29 +4973,29 @@ var CollectionAPI = function CollectionAPI(url) {
4969
4973
  queryParams = queryParams.concat(filterQuery);
4970
4974
  }
4971
4975
 
4972
- return http$1.GET(url);
4976
+ return http.GET(url);
4973
4977
  },
4974
4978
  find: function find(id) {
4975
- return http$1.GET(url + "/" + id);
4979
+ return http.GET(url + "/" + id);
4976
4980
  },
4977
4981
  create: function create(form) {
4978
4982
  var body = JSON.stringify(form);
4979
- return http$1.POST(url, body);
4983
+ return http.POST(url, body);
4980
4984
  },
4981
4985
  update: function update(form) {
4982
4986
  var body = JSON.stringify(form);
4983
- return http$1.PUT(url + "/" + form.id, body);
4987
+ return http.PUT(url + "/" + form.id, body);
4984
4988
  },
4985
4989
  patch: function patch(id, form) {
4986
4990
  var body = JSON.stringify(form);
4987
- return http$1.PATCH(url + "/" + id, body);
4991
+ return http.PATCH(url + "/" + id, body);
4988
4992
  },
4989
4993
  updateProperty: function updateProperty(id, propertyName, form) {
4990
4994
  var body = JSON.stringify(form);
4991
- return http$1.PUT(url + "/" + id + "/" + propertyName, body);
4995
+ return http.PUT(url + "/" + id + "/" + propertyName, body);
4992
4996
  },
4993
4997
  remove: function remove(id) {
4994
- return http$1.DELETE(url + "/" + id);
4998
+ return http.DELETE(url + "/" + id);
4995
4999
  }
4996
5000
  };
4997
5001
  };
@@ -5080,6 +5084,10 @@ var EntityViewer = function EntityViewer(props) {
5080
5084
  })));
5081
5085
  };
5082
5086
 
5087
+ /**
5088
+ * Table Page
5089
+ */
5090
+
5083
5091
  function _catch(body, recover) {
5084
5092
  try {
5085
5093
  var result = body();
@@ -5093,12 +5101,11 @@ function _catch(body, recover) {
5093
5101
 
5094
5102
  return result;
5095
5103
  }
5096
-
5097
- var http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
5098
5104
  /**
5099
- * Table Page
5105
+ * TableRowEditor
5100
5106
  */
5101
5107
 
5108
+
5102
5109
  var TablePage = function TablePage(props) {
5103
5110
  var playScenario = function playScenario() {
5104
5111
  try {
@@ -5158,6 +5165,7 @@ var TablePage = function TablePage(props) {
5158
5165
  schema = props.schema,
5159
5166
  url = props.url,
5160
5167
  field = props.field,
5168
+ host = props.host,
5161
5169
  _props$autosave = props.autosave,
5162
5170
  autosave = _props$autosave === void 0 ? true : _props$autosave,
5163
5171
  _props$delay = props.delay,
@@ -5212,7 +5220,7 @@ var TablePage = function TablePage(props) {
5212
5220
  }, [form]);
5213
5221
  React.useEffect(function () {
5214
5222
  try {
5215
- var context = TableContext(url, field);
5223
+ var context = TableContext(url, field, host);
5216
5224
  return Promise.resolve(context.load()).then(function () {
5217
5225
  setPageContext(context);
5218
5226
  });
@@ -5324,9 +5332,6 @@ var TablePage = function TablePage(props) {
5324
5332
  canDelete: canDelete
5325
5333
  })), renderAside());
5326
5334
  };
5327
- /**
5328
- * TableRowEditor
5329
- */
5330
5335
 
5331
5336
  var TableRowEditor = function TableRowEditor(props) {
5332
5337
  var name = props.name,
@@ -5708,8 +5713,8 @@ var TableEditor = function TableEditor(props) {
5708
5713
  * Table Context
5709
5714
  */
5710
5715
 
5711
- var TableContext = function TableContext(url, field) {
5712
- var API = TableAPI(url);
5716
+ var TableContext = function TableContext(url, field, host) {
5717
+ var API = TableAPI(url, host);
5713
5718
  return {
5714
5719
  all: [],
5715
5720
  checked: new Set([]),
@@ -5824,7 +5829,8 @@ var TableContext = function TableContext(url, field) {
5824
5829
  */
5825
5830
 
5826
5831
 
5827
- var TableAPI = function TableAPI(url) {
5832
+ var TableAPI = function TableAPI(url, host) {
5833
+ var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
5828
5834
  return {
5829
5835
  all: function all(filters) {
5830
5836
  var queryParams = "?";