ywana-core8 0.0.438 → 0.0.441

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.
@@ -4681,6 +4681,7 @@ var CollectionPage = function CollectionPage(props) {
4681
4681
  name = _props$name === void 0 ? "Collection 1" : _props$name,
4682
4682
  schema = props.schema,
4683
4683
  url = props.url,
4684
+ page = props.page,
4684
4685
  host = props.host,
4685
4686
  groupBy = props.groupBy,
4686
4687
  editor = props.editor,
@@ -4698,7 +4699,7 @@ var CollectionPage = function CollectionPage(props) {
4698
4699
  pageContext = _useContext[0],
4699
4700
  setPageContext = _useContext[1];
4700
4701
 
4701
- var context = CollectionContext(url, field, host);
4702
+ var context = CollectionContext(url, field, host, page);
4702
4703
  useEffect(function () {
4703
4704
  try {
4704
4705
  return Promise.resolve(context.load()).then(function () {
@@ -5020,7 +5021,7 @@ var CollectionEditor = function CollectionEditor(props) {
5020
5021
  */
5021
5022
 
5022
5023
 
5023
- var CollectionContext = function CollectionContext(url, field, host) {
5024
+ var CollectionContext = function CollectionContext(url, field, host, page) {
5024
5025
  var API = CollectionAPI(url, host);
5025
5026
  return {
5026
5027
  all: [],
@@ -5030,7 +5031,7 @@ var CollectionContext = function CollectionContext(url, field, host) {
5030
5031
  var _this2 = this;
5031
5032
 
5032
5033
  var _temp2 = _catch$1(function () {
5033
- return Promise.resolve(API.all()).then(function (data) {
5034
+ return Promise.resolve(API.all(null, page)).then(function (data) {
5034
5035
  _this2.all = field ? data[field] : data;
5035
5036
  });
5036
5037
  }, function (error) {
@@ -5145,8 +5146,8 @@ var CollectionContext = function CollectionContext(url, field, host) {
5145
5146
  var CollectionAPI = function CollectionAPI(url, host) {
5146
5147
  var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
5147
5148
  return {
5148
- all: function all(filters) {
5149
- var queryParams = "?";
5149
+ all: function all(filters, page) {
5150
+ var queryParams = page ? "?page=" + page + "&" : "?";
5150
5151
 
5151
5152
  if (filters) {
5152
5153
  var filterQuery = Object.keys(filters).reduce(function (query, key) {
@@ -5167,7 +5168,7 @@ var CollectionAPI = function CollectionAPI(url, host) {
5167
5168
  queryParams = queryParams.concat(filterQuery);
5168
5169
  }
5169
5170
 
5170
- return http.GET(url);
5171
+ return http.GET(url + queryParams);
5171
5172
  },
5172
5173
  find: function find(id) {
5173
5174
  return http.GET(url + "/" + id);
@@ -5239,6 +5240,7 @@ var FieldViewer = function FieldViewer(props) {
5239
5240
  _field$visible = field.visible,
5240
5241
  visible = _field$visible === void 0 ? true : _field$visible;
5241
5242
  if (!visible) return null;
5243
+ if (optional && !value) return null;
5242
5244
 
5243
5245
  switch (type) {
5244
5246
  case TYPES.STRING: