@iankibetsh/shframework 5.3.7 → 5.3.9

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/library.js CHANGED
@@ -4162,7 +4162,10 @@ const useUserStore = pinia.defineStore('user-store', {
4162
4162
  } catch (error) {
4163
4163
  user= null;
4164
4164
  }
4165
- if (user) {
4165
+ if(typeof user !== 'object'){
4166
+ user = null;
4167
+ }
4168
+ if (user ) {
4166
4169
  user.isAllowedTo = function (slug) {
4167
4170
  if (this.permissions) {
4168
4171
  let permissions = [];
@@ -5209,7 +5212,8 @@ const __default__ = {
5209
5212
  range: null,
5210
5213
  from: null,
5211
5214
  to: null,
5212
- period: null
5215
+ period: null,
5216
+ lastId: null
5213
5217
  }
5214
5218
  },
5215
5219
  mounted(){
@@ -5375,6 +5379,7 @@ const __default__ = {
5375
5379
  from: this.from,
5376
5380
  to: this.to,
5377
5381
  period: this.period,
5382
+ lastId: this.lastId,
5378
5383
  };
5379
5384
  shApis.doPost(this.endPoint, data).then(res => {
5380
5385
  this.downloading = false;
@@ -5414,7 +5419,8 @@ const __default__ = {
5414
5419
  from: this.from,
5415
5420
  to: this.to,
5416
5421
  period: this.period,
5417
- exact: this.exactMatch
5422
+ exact: this.exactMatch,
5423
+ lastId: this.lastId
5418
5424
  };
5419
5425
  // remove empty values
5420
5426
  Object.keys(data).forEach(key => {
@@ -5439,6 +5445,7 @@ const __default__ = {
5439
5445
  if (this.page < 2 && this.cacheKey) {
5440
5446
  shStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
5441
5447
  }
5448
+
5442
5449
  this.pagination_data = {
5443
5450
  current: response.current_page,
5444
5451
  start: response.from,
@@ -5451,6 +5458,8 @@ const __default__ = {
5451
5458
  if (!this.headers && response.total > 0) {
5452
5459
  this.tableHeaders = Object.keys(response.data[0]);
5453
5460
  }
5461
+ // get id value of the last record
5462
+ this.lastId = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5454
5463
  if (append) {
5455
5464
  this.records.push(...response.data);
5456
5465
  let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
package/dist/library.mjs CHANGED
@@ -4150,7 +4150,10 @@ const useUserStore = defineStore('user-store', {
4150
4150
  } catch (error) {
4151
4151
  user= null;
4152
4152
  }
4153
- if (user) {
4153
+ if(typeof user !== 'object'){
4154
+ user = null;
4155
+ }
4156
+ if (user ) {
4154
4157
  user.isAllowedTo = function (slug) {
4155
4158
  if (this.permissions) {
4156
4159
  let permissions = [];
@@ -5197,7 +5200,8 @@ const __default__ = {
5197
5200
  range: null,
5198
5201
  from: null,
5199
5202
  to: null,
5200
- period: null
5203
+ period: null,
5204
+ lastId: null
5201
5205
  }
5202
5206
  },
5203
5207
  mounted(){
@@ -5363,6 +5367,7 @@ const __default__ = {
5363
5367
  from: this.from,
5364
5368
  to: this.to,
5365
5369
  period: this.period,
5370
+ lastId: this.lastId,
5366
5371
  };
5367
5372
  shApis.doPost(this.endPoint, data).then(res => {
5368
5373
  this.downloading = false;
@@ -5402,7 +5407,8 @@ const __default__ = {
5402
5407
  from: this.from,
5403
5408
  to: this.to,
5404
5409
  period: this.period,
5405
- exact: this.exactMatch
5410
+ exact: this.exactMatch,
5411
+ lastId: this.lastId
5406
5412
  };
5407
5413
  // remove empty values
5408
5414
  Object.keys(data).forEach(key => {
@@ -5427,6 +5433,7 @@ const __default__ = {
5427
5433
  if (this.page < 2 && this.cacheKey) {
5428
5434
  shStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
5429
5435
  }
5436
+
5430
5437
  this.pagination_data = {
5431
5438
  current: response.current_page,
5432
5439
  start: response.from,
@@ -5439,6 +5446,8 @@ const __default__ = {
5439
5446
  if (!this.headers && response.total > 0) {
5440
5447
  this.tableHeaders = Object.keys(response.data[0]);
5441
5448
  }
5449
+ // get id value of the last record
5450
+ this.lastId = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5442
5451
  if (append) {
5443
5452
  this.records.push(...response.data);
5444
5453
  let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.3.7",
3
+ "version": "5.3.9",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",