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.umd.js
CHANGED
@@ -4441,6 +4441,10 @@
|
|
4441
4441
|
}));
|
4442
4442
|
};
|
4443
4443
|
|
4444
|
+
/**
|
4445
|
+
* Collection Page
|
4446
|
+
*/
|
4447
|
+
|
4444
4448
|
function _catch$1(body, recover) {
|
4445
4449
|
try {
|
4446
4450
|
var result = body();
|
@@ -4454,12 +4458,11 @@
|
|
4454
4458
|
|
4455
4459
|
return result;
|
4456
4460
|
}
|
4457
|
-
|
4458
|
-
var http$1 = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
4459
4461
|
/**
|
4460
|
-
* Collection
|
4462
|
+
* Collection List
|
4461
4463
|
*/
|
4462
4464
|
|
4465
|
+
|
4463
4466
|
var CollectionPage = function CollectionPage(props) {
|
4464
4467
|
var reload = function reload() {
|
4465
4468
|
try {
|
@@ -4480,6 +4483,7 @@
|
|
4480
4483
|
name = _props$name === void 0 ? "Collection 1" : _props$name,
|
4481
4484
|
schema = props.schema,
|
4482
4485
|
url = props.url,
|
4486
|
+
host = props.host,
|
4483
4487
|
groupBy = props.groupBy,
|
4484
4488
|
editor = props.editor,
|
4485
4489
|
field = props.field,
|
@@ -4495,7 +4499,7 @@
|
|
4495
4499
|
pageContext = _useContext[0],
|
4496
4500
|
setPageContext = _useContext[1];
|
4497
4501
|
|
4498
|
-
var context = CollectionContext(url, field);
|
4502
|
+
var context = CollectionContext(url, field, host);
|
4499
4503
|
React.useEffect(function () {
|
4500
4504
|
try {
|
4501
4505
|
return Promise.resolve(context.load()).then(function () {
|
@@ -4569,9 +4573,6 @@
|
|
4569
4573
|
delay: delay
|
4570
4574
|
})));
|
4571
4575
|
};
|
4572
|
-
/**
|
4573
|
-
* Collection List
|
4574
|
-
*/
|
4575
4576
|
|
4576
4577
|
var CollectionList = function CollectionList(props) {
|
4577
4578
|
var select = function select(id) {
|
@@ -4821,8 +4822,8 @@
|
|
4821
4822
|
*/
|
4822
4823
|
|
4823
4824
|
|
4824
|
-
var CollectionContext = function CollectionContext(url, field) {
|
4825
|
-
var API = CollectionAPI(url);
|
4825
|
+
var CollectionContext = function CollectionContext(url, field, host) {
|
4826
|
+
var API = CollectionAPI(url, host);
|
4826
4827
|
return {
|
4827
4828
|
all: [],
|
4828
4829
|
selected: null,
|
@@ -4943,7 +4944,8 @@
|
|
4943
4944
|
* Collection API
|
4944
4945
|
*/
|
4945
4946
|
|
4946
|
-
var CollectionAPI = function CollectionAPI(url) {
|
4947
|
+
var CollectionAPI = function CollectionAPI(url, host) {
|
4948
|
+
var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
4947
4949
|
return {
|
4948
4950
|
all: function all(filters) {
|
4949
4951
|
var queryParams = "?";
|
@@ -4967,29 +4969,29 @@
|
|
4967
4969
|
queryParams = queryParams.concat(filterQuery);
|
4968
4970
|
}
|
4969
4971
|
|
4970
|
-
return http
|
4972
|
+
return http.GET(url);
|
4971
4973
|
},
|
4972
4974
|
find: function find(id) {
|
4973
|
-
return http
|
4975
|
+
return http.GET(url + "/" + id);
|
4974
4976
|
},
|
4975
4977
|
create: function create(form) {
|
4976
4978
|
var body = JSON.stringify(form);
|
4977
|
-
return http
|
4979
|
+
return http.POST(url, body);
|
4978
4980
|
},
|
4979
4981
|
update: function update(form) {
|
4980
4982
|
var body = JSON.stringify(form);
|
4981
|
-
return http
|
4983
|
+
return http.PUT(url + "/" + form.id, body);
|
4982
4984
|
},
|
4983
4985
|
patch: function patch(id, form) {
|
4984
4986
|
var body = JSON.stringify(form);
|
4985
|
-
return http
|
4987
|
+
return http.PATCH(url + "/" + id, body);
|
4986
4988
|
},
|
4987
4989
|
updateProperty: function updateProperty(id, propertyName, form) {
|
4988
4990
|
var body = JSON.stringify(form);
|
4989
|
-
return http
|
4991
|
+
return http.PUT(url + "/" + id + "/" + propertyName, body);
|
4990
4992
|
},
|
4991
4993
|
remove: function remove(id) {
|
4992
|
-
return http
|
4994
|
+
return http.DELETE(url + "/" + id);
|
4993
4995
|
}
|
4994
4996
|
};
|
4995
4997
|
};
|
@@ -5078,6 +5080,10 @@
|
|
5078
5080
|
})));
|
5079
5081
|
};
|
5080
5082
|
|
5083
|
+
/**
|
5084
|
+
* Table Page
|
5085
|
+
*/
|
5086
|
+
|
5081
5087
|
function _catch(body, recover) {
|
5082
5088
|
try {
|
5083
5089
|
var result = body();
|
@@ -5091,12 +5097,11 @@
|
|
5091
5097
|
|
5092
5098
|
return result;
|
5093
5099
|
}
|
5094
|
-
|
5095
|
-
var http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
5096
5100
|
/**
|
5097
|
-
*
|
5101
|
+
* TableRowEditor
|
5098
5102
|
*/
|
5099
5103
|
|
5104
|
+
|
5100
5105
|
var TablePage = function TablePage(props) {
|
5101
5106
|
var playScenario = function playScenario() {
|
5102
5107
|
try {
|
@@ -5156,6 +5161,7 @@
|
|
5156
5161
|
schema = props.schema,
|
5157
5162
|
url = props.url,
|
5158
5163
|
field = props.field,
|
5164
|
+
host = props.host,
|
5159
5165
|
_props$autosave = props.autosave,
|
5160
5166
|
autosave = _props$autosave === void 0 ? true : _props$autosave,
|
5161
5167
|
_props$delay = props.delay,
|
@@ -5210,7 +5216,7 @@
|
|
5210
5216
|
}, [form]);
|
5211
5217
|
React.useEffect(function () {
|
5212
5218
|
try {
|
5213
|
-
var context = TableContext(url, field);
|
5219
|
+
var context = TableContext(url, field, host);
|
5214
5220
|
return Promise.resolve(context.load()).then(function () {
|
5215
5221
|
setPageContext(context);
|
5216
5222
|
});
|
@@ -5322,9 +5328,6 @@
|
|
5322
5328
|
canDelete: canDelete
|
5323
5329
|
})), renderAside());
|
5324
5330
|
};
|
5325
|
-
/**
|
5326
|
-
* TableRowEditor
|
5327
|
-
*/
|
5328
5331
|
|
5329
5332
|
var TableRowEditor = function TableRowEditor(props) {
|
5330
5333
|
var name = props.name,
|
@@ -5706,8 +5709,8 @@
|
|
5706
5709
|
* Table Context
|
5707
5710
|
*/
|
5708
5711
|
|
5709
|
-
var TableContext = function TableContext(url, field) {
|
5710
|
-
var API = TableAPI(url);
|
5712
|
+
var TableContext = function TableContext(url, field, host) {
|
5713
|
+
var API = TableAPI(url, host);
|
5711
5714
|
return {
|
5712
5715
|
all: [],
|
5713
5716
|
checked: new Set([]),
|
@@ -5822,7 +5825,8 @@
|
|
5822
5825
|
*/
|
5823
5826
|
|
5824
5827
|
|
5825
|
-
var TableAPI = function TableAPI(url) {
|
5828
|
+
var TableAPI = function TableAPI(url, host) {
|
5829
|
+
var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
5826
5830
|
return {
|
5827
5831
|
all: function all(filters) {
|
5828
5832
|
var queryParams = "?";
|