@websy/websy-designs 1.4.6 → 1.4.7

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.
@@ -36,7 +36,7 @@
36
36
  /* global XMLHttpRequest fetch ENV */
37
37
  class APIService {
38
38
  constructor (baseUrl = '', options = {}) {
39
- this.baseUrl = baseUrl
39
+ this.baseUrl = baseUrl
40
40
  this.options = Object.assign({}, {
41
41
  fieldValueSeparator: ':'
42
42
  }, options)
@@ -58,8 +58,24 @@ class APIService {
58
58
  const url = this.buildUrl(entity, id)
59
59
  return this.run('DELETE', url)
60
60
  }
61
- get (entity, id, query) {
62
- const url = this.buildUrl(entity, id, query)
61
+ get (entity, id, query, offset, limit) {
62
+ let url = this.buildUrl(entity, id, query)
63
+ if (offset) {
64
+ if (url.indexOf('?') !== -1) {
65
+ url += `&offset=${offset}`
66
+ }
67
+ else {
68
+ url += `?offset=${offset}`
69
+ }
70
+ }
71
+ if (limit) {
72
+ if (url.indexOf('?') !== -1) {
73
+ url += `&limit=${limit}`
74
+ }
75
+ else {
76
+ url += `?limit=${limit}`
77
+ }
78
+ }
63
79
  return this.run('GET', url)
64
80
  }
65
81
  update (entity, id, data) {
@@ -1198,7 +1214,14 @@ class WebsyDatePicker {
1198
1214
  selectRange (index, confirm = true) {
1199
1215
  if (this.options.ranges[this.options.mode][index]) {
1200
1216
  this.selectedRangeDates = [...this.options.ranges[this.options.mode][index].range]
1201
- this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => d.getTime())
1217
+ this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => {
1218
+ if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
1219
+ return d.getTime()
1220
+ }
1221
+ else {
1222
+ return d
1223
+ }
1224
+ })
1202
1225
  this.selectedRange = +index
1203
1226
  this.highlightRange()
1204
1227
  this.updateRange()