ywana-core8 0.0.281 → 0.0.284
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 +31 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +31 -27
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +31 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -8
- package/src/domain/TablePage.js +7 -7
- package/src/site/view.css +2 -0
package/dist/index.cjs
CHANGED
@@ -4446,6 +4446,10 @@ var CreateContentDialog = function CreateContentDialog(_ref) {
|
|
4446
4446
|
}));
|
4447
4447
|
};
|
4448
4448
|
|
4449
|
+
/**
|
4450
|
+
* Collection Page
|
4451
|
+
*/
|
4452
|
+
|
4449
4453
|
function _catch$1(body, recover) {
|
4450
4454
|
try {
|
4451
4455
|
var result = body();
|
@@ -4459,12 +4463,11 @@ function _catch$1(body, recover) {
|
|
4459
4463
|
|
4460
4464
|
return result;
|
4461
4465
|
}
|
4462
|
-
|
4463
|
-
var http$1 = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
4464
4466
|
/**
|
4465
|
-
* Collection
|
4467
|
+
* Collection List
|
4466
4468
|
*/
|
4467
4469
|
|
4470
|
+
|
4468
4471
|
var CollectionPage = function CollectionPage(props) {
|
4469
4472
|
var reload = function reload() {
|
4470
4473
|
try {
|
@@ -4485,6 +4488,7 @@ var CollectionPage = function CollectionPage(props) {
|
|
4485
4488
|
name = _props$name === void 0 ? "Collection 1" : _props$name,
|
4486
4489
|
schema = props.schema,
|
4487
4490
|
url = props.url,
|
4491
|
+
host = props.host,
|
4488
4492
|
groupBy = props.groupBy,
|
4489
4493
|
editor = props.editor,
|
4490
4494
|
field = props.field,
|
@@ -4500,7 +4504,7 @@ var CollectionPage = function CollectionPage(props) {
|
|
4500
4504
|
pageContext = _useContext[0],
|
4501
4505
|
setPageContext = _useContext[1];
|
4502
4506
|
|
4503
|
-
var context = CollectionContext(url, field);
|
4507
|
+
var context = CollectionContext(url, field, host);
|
4504
4508
|
React.useEffect(function () {
|
4505
4509
|
try {
|
4506
4510
|
return Promise.resolve(context.load()).then(function () {
|
@@ -4574,9 +4578,6 @@ var CollectionPage = function CollectionPage(props) {
|
|
4574
4578
|
delay: delay
|
4575
4579
|
})));
|
4576
4580
|
};
|
4577
|
-
/**
|
4578
|
-
* Collection List
|
4579
|
-
*/
|
4580
4581
|
|
4581
4582
|
var CollectionList = function CollectionList(props) {
|
4582
4583
|
var select = function select(id) {
|
@@ -4826,8 +4827,8 @@ var CollectionEditor = function CollectionEditor(props) {
|
|
4826
4827
|
*/
|
4827
4828
|
|
4828
4829
|
|
4829
|
-
var CollectionContext = function CollectionContext(url, field) {
|
4830
|
-
var API = CollectionAPI(url);
|
4830
|
+
var CollectionContext = function CollectionContext(url, field, host) {
|
4831
|
+
var API = CollectionAPI(url, host);
|
4831
4832
|
return {
|
4832
4833
|
all: [],
|
4833
4834
|
selected: null,
|
@@ -4948,7 +4949,8 @@ var CollectionContext = function CollectionContext(url, field) {
|
|
4948
4949
|
* Collection API
|
4949
4950
|
*/
|
4950
4951
|
|
4951
|
-
var CollectionAPI = function CollectionAPI(url) {
|
4952
|
+
var CollectionAPI = function CollectionAPI(url, host) {
|
4953
|
+
var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
4952
4954
|
return {
|
4953
4955
|
all: function all(filters) {
|
4954
4956
|
var queryParams = "?";
|
@@ -4972,29 +4974,29 @@ var CollectionAPI = function CollectionAPI(url) {
|
|
4972
4974
|
queryParams = queryParams.concat(filterQuery);
|
4973
4975
|
}
|
4974
4976
|
|
4975
|
-
return http
|
4977
|
+
return http.GET(url);
|
4976
4978
|
},
|
4977
4979
|
find: function find(id) {
|
4978
|
-
return http
|
4980
|
+
return http.GET(url + "/" + id);
|
4979
4981
|
},
|
4980
4982
|
create: function create(form) {
|
4981
4983
|
var body = JSON.stringify(form);
|
4982
|
-
return http
|
4984
|
+
return http.POST(url, body);
|
4983
4985
|
},
|
4984
4986
|
update: function update(form) {
|
4985
4987
|
var body = JSON.stringify(form);
|
4986
|
-
return http
|
4988
|
+
return http.PUT(url + "/" + form.id, body);
|
4987
4989
|
},
|
4988
4990
|
patch: function patch(id, form) {
|
4989
4991
|
var body = JSON.stringify(form);
|
4990
|
-
return http
|
4992
|
+
return http.PATCH(url + "/" + id, body);
|
4991
4993
|
},
|
4992
4994
|
updateProperty: function updateProperty(id, propertyName, form) {
|
4993
4995
|
var body = JSON.stringify(form);
|
4994
|
-
return http
|
4996
|
+
return http.PUT(url + "/" + id + "/" + propertyName, body);
|
4995
4997
|
},
|
4996
4998
|
remove: function remove(id) {
|
4997
|
-
return http
|
4999
|
+
return http.DELETE(url + "/" + id);
|
4998
5000
|
}
|
4999
5001
|
};
|
5000
5002
|
};
|
@@ -5083,6 +5085,10 @@ var EntityViewer = function EntityViewer(props) {
|
|
5083
5085
|
})));
|
5084
5086
|
};
|
5085
5087
|
|
5088
|
+
/**
|
5089
|
+
* Table Page
|
5090
|
+
*/
|
5091
|
+
|
5086
5092
|
function _catch(body, recover) {
|
5087
5093
|
try {
|
5088
5094
|
var result = body();
|
@@ -5096,12 +5102,11 @@ function _catch(body, recover) {
|
|
5096
5102
|
|
5097
5103
|
return result;
|
5098
5104
|
}
|
5099
|
-
|
5100
|
-
var http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
5101
5105
|
/**
|
5102
|
-
*
|
5106
|
+
* TableRowEditor
|
5103
5107
|
*/
|
5104
5108
|
|
5109
|
+
|
5105
5110
|
var TablePage = function TablePage(props) {
|
5106
5111
|
var playScenario = function playScenario() {
|
5107
5112
|
try {
|
@@ -5161,6 +5166,7 @@ var TablePage = function TablePage(props) {
|
|
5161
5166
|
schema = props.schema,
|
5162
5167
|
url = props.url,
|
5163
5168
|
field = props.field,
|
5169
|
+
host = props.host,
|
5164
5170
|
_props$autosave = props.autosave,
|
5165
5171
|
autosave = _props$autosave === void 0 ? true : _props$autosave,
|
5166
5172
|
_props$delay = props.delay,
|
@@ -5215,7 +5221,7 @@ var TablePage = function TablePage(props) {
|
|
5215
5221
|
}, [form]);
|
5216
5222
|
React.useEffect(function () {
|
5217
5223
|
try {
|
5218
|
-
var context = TableContext(url, field);
|
5224
|
+
var context = TableContext(url, field, host);
|
5219
5225
|
return Promise.resolve(context.load()).then(function () {
|
5220
5226
|
setPageContext(context);
|
5221
5227
|
});
|
@@ -5327,9 +5333,6 @@ var TablePage = function TablePage(props) {
|
|
5327
5333
|
canDelete: canDelete
|
5328
5334
|
})), renderAside());
|
5329
5335
|
};
|
5330
|
-
/**
|
5331
|
-
* TableRowEditor
|
5332
|
-
*/
|
5333
5336
|
|
5334
5337
|
var TableRowEditor = function TableRowEditor(props) {
|
5335
5338
|
var name = props.name,
|
@@ -5711,8 +5714,8 @@ var TableEditor = function TableEditor(props) {
|
|
5711
5714
|
* Table Context
|
5712
5715
|
*/
|
5713
5716
|
|
5714
|
-
var TableContext = function TableContext(url, field) {
|
5715
|
-
var API = TableAPI(url);
|
5717
|
+
var TableContext = function TableContext(url, field, host) {
|
5718
|
+
var API = TableAPI(url, host);
|
5716
5719
|
return {
|
5717
5720
|
all: [],
|
5718
5721
|
checked: new Set([]),
|
@@ -5827,7 +5830,8 @@ var TableContext = function TableContext(url, field) {
|
|
5827
5830
|
*/
|
5828
5831
|
|
5829
5832
|
|
5830
|
-
var TableAPI = function TableAPI(url) {
|
5833
|
+
var TableAPI = function TableAPI(url, host) {
|
5834
|
+
var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
5831
5835
|
return {
|
5832
5836
|
all: function all(filters) {
|
5833
5837
|
var queryParams = "?";
|