@schukai/monster 3.95.0 → 3.95.2

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.
@@ -53,6 +53,8 @@ class Dom extends Datasource {
53
53
  *
54
54
  * @property {Object} templates Template definitions
55
55
  * @property {string} templates.main Main template
56
+ * @property {Object} features Feature definitions
57
+ * @property {boolean} features.autoInit Automatically initializes the component
56
58
  */
57
59
  get defaults() {
58
60
  return Object.assign({}, super.defaults, {
@@ -63,11 +65,19 @@ class Dom extends Datasource {
63
65
  features: {
64
66
  autoInit: true,
65
67
  },
68
+
69
+ /** @private */
70
+ sys: {
71
+ pagination: {
72
+ pages: 1,
73
+ objectsPerPage: 10,
74
+ currentPage: 1,
75
+ }
76
+ }
66
77
  });
67
78
  }
68
79
 
69
80
  /**
70
- *
71
81
  * @return {void}
72
82
  */
73
83
  [assembleMethodSymbol]() {
@@ -76,6 +86,17 @@ class Dom extends Datasource {
76
86
  updateDataSource.call(this);
77
87
  }
78
88
 
89
+ /**
90
+ * This method set the current page of the pagination
91
+ *
92
+ * @param {string} page
93
+ * @return {Dom}
94
+ */
95
+ setParameters({page}) {
96
+ this.setOption("sys.pagination.currentPage", page);
97
+ return this;
98
+ }
99
+
79
100
  /**
80
101
  *
81
102
  * @return {CSSStyleSheet[]}
@@ -108,6 +129,13 @@ class Dom extends Datasource {
108
129
  updateDataSource.call(this);
109
130
  }
110
131
  }
132
+
133
+ /**
134
+ * @return {int}
135
+ */
136
+ currentPage() {
137
+ return this.getOption("sys.pagination.currentPage");
138
+ }
111
139
  }
112
140
 
113
141
  /**
@@ -170,7 +198,15 @@ function updateDataSource() {
170
198
  data = [];
171
199
  }
172
200
 
201
+ // set pagination
202
+ this.setOption("sys.pagination.objectsPerPage", 1 );
203
+ this.setOption("sys.pagination.pages", data.length);
204
+ this.setOption("sys.pagination.currentPage", 1);
205
+
206
+ /** call setter */
173
207
  this.data = data;
208
+
209
+
174
210
  }
175
211
 
176
212
  /**