ywana-core8 0.0.437 → 0.0.440
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 +38 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +18 -18
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +38 -30
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +38 -30
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -7
- package/src/html/table.js +3 -0
- package/src/html/table.test.js +4 -3
package/dist/index.umd.js
CHANGED
@@ -1412,6 +1412,30 @@
|
|
1412
1412
|
return Content;
|
1413
1413
|
}();
|
1414
1414
|
|
1415
|
+
var ColorField = function ColorField(props) {
|
1416
|
+
var id = props.id,
|
1417
|
+
_props$label = props.label,
|
1418
|
+
label = _props$label === void 0 ? "Color" : _props$label,
|
1419
|
+
value = props.value,
|
1420
|
+
onChange = props.onChange;
|
1421
|
+
|
1422
|
+
function change(event) {
|
1423
|
+
var color = event.target.value;
|
1424
|
+
if (onChange) onChange(id, color);
|
1425
|
+
}
|
1426
|
+
|
1427
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
1428
|
+
className: "color-field"
|
1429
|
+
}, /*#__PURE__*/React__default["default"].createElement("label", {
|
1430
|
+
htmlFor: id
|
1431
|
+
}, label), /*#__PURE__*/React__default["default"].createElement("input", {
|
1432
|
+
id: id,
|
1433
|
+
type: "color",
|
1434
|
+
onChange: change,
|
1435
|
+
value: value
|
1436
|
+
}));
|
1437
|
+
};
|
1438
|
+
|
1415
1439
|
var isFunction$1 = function isFunction(value) {
|
1416
1440
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
1417
1441
|
};
|
@@ -1811,6 +1835,13 @@
|
|
1811
1835
|
var locale = window.navigator.userLanguage || window.navigator.language;
|
1812
1836
|
|
1813
1837
|
switch (format) {
|
1838
|
+
case FORMATS.COLOR:
|
1839
|
+
text = /*#__PURE__*/React__default["default"].createElement("input", {
|
1840
|
+
type: "color",
|
1841
|
+
value: text,
|
1842
|
+
disabled: true
|
1843
|
+
});
|
1844
|
+
|
1814
1845
|
case FORMATS.URL:
|
1815
1846
|
text = /*#__PURE__*/React__default["default"].createElement("a", {
|
1816
1847
|
href: text,
|
@@ -3741,30 +3772,6 @@
|
|
3741
3772
|
});
|
3742
3773
|
};
|
3743
3774
|
|
3744
|
-
var ColorField = function ColorField(props) {
|
3745
|
-
var id = props.id,
|
3746
|
-
_props$label = props.label,
|
3747
|
-
label = _props$label === void 0 ? "Color" : _props$label,
|
3748
|
-
value = props.value,
|
3749
|
-
onChange = props.onChange;
|
3750
|
-
|
3751
|
-
function change(event) {
|
3752
|
-
var color = event.target.value;
|
3753
|
-
if (onChange) onChange(id, color);
|
3754
|
-
}
|
3755
|
-
|
3756
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
3757
|
-
className: "color-field"
|
3758
|
-
}, /*#__PURE__*/React__default["default"].createElement("label", {
|
3759
|
-
htmlFor: id
|
3760
|
-
}, label), /*#__PURE__*/React__default["default"].createElement("input", {
|
3761
|
-
id: id,
|
3762
|
-
type: "color",
|
3763
|
-
onChange: change,
|
3764
|
-
value: value
|
3765
|
-
}));
|
3766
|
-
};
|
3767
|
-
|
3768
3775
|
/**
|
3769
3776
|
* Content Editor
|
3770
3777
|
*/
|
@@ -4677,6 +4684,7 @@
|
|
4677
4684
|
name = _props$name === void 0 ? "Collection 1" : _props$name,
|
4678
4685
|
schema = props.schema,
|
4679
4686
|
url = props.url,
|
4687
|
+
page = props.page,
|
4680
4688
|
host = props.host,
|
4681
4689
|
groupBy = props.groupBy,
|
4682
4690
|
editor = props.editor,
|
@@ -4694,7 +4702,7 @@
|
|
4694
4702
|
pageContext = _useContext[0],
|
4695
4703
|
setPageContext = _useContext[1];
|
4696
4704
|
|
4697
|
-
var context = CollectionContext(url, field, host);
|
4705
|
+
var context = CollectionContext(url, field, host, page);
|
4698
4706
|
React.useEffect(function () {
|
4699
4707
|
try {
|
4700
4708
|
return Promise.resolve(context.load()).then(function () {
|
@@ -5016,7 +5024,7 @@
|
|
5016
5024
|
*/
|
5017
5025
|
|
5018
5026
|
|
5019
|
-
var CollectionContext = function CollectionContext(url, field, host) {
|
5027
|
+
var CollectionContext = function CollectionContext(url, field, host, page) {
|
5020
5028
|
var API = CollectionAPI(url, host);
|
5021
5029
|
return {
|
5022
5030
|
all: [],
|
@@ -5026,7 +5034,7 @@
|
|
5026
5034
|
var _this2 = this;
|
5027
5035
|
|
5028
5036
|
var _temp2 = _catch$1(function () {
|
5029
|
-
return Promise.resolve(API.all()).then(function (data) {
|
5037
|
+
return Promise.resolve(API.all(null, page)).then(function (data) {
|
5030
5038
|
_this2.all = field ? data[field] : data;
|
5031
5039
|
});
|
5032
5040
|
}, function (error) {
|
@@ -5141,8 +5149,8 @@
|
|
5141
5149
|
var CollectionAPI = function CollectionAPI(url, host) {
|
5142
5150
|
var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
5143
5151
|
return {
|
5144
|
-
all: function all(filters) {
|
5145
|
-
var queryParams = "?";
|
5152
|
+
all: function all(filters, page) {
|
5153
|
+
var queryParams = page ? "?page=" + page + "&" : "?";
|
5146
5154
|
|
5147
5155
|
if (filters) {
|
5148
5156
|
var filterQuery = Object.keys(filters).reduce(function (query, key) {
|
@@ -5163,7 +5171,7 @@
|
|
5163
5171
|
queryParams = queryParams.concat(filterQuery);
|
5164
5172
|
}
|
5165
5173
|
|
5166
|
-
return http.GET(url);
|
5174
|
+
return http.GET(url + queryParams);
|
5167
5175
|
},
|
5168
5176
|
find: function find(id) {
|
5169
5177
|
return http.GET(url + "/" + id);
|