@iankibetsh/shframework 5.3.6 → 5.3.8

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
@@ -3968,22 +3968,24 @@ return (_ctx, _cache) => {
3968
3968
  }, [
3969
3969
  vue.renderSlot(_ctx.$slots, "default")
3970
3970
  ], 10 /* CLASS, PROPS */, _hoisted_1$i),
3971
- vue.createVNode(script$p, {
3972
- "modal-size": __props.modalSize,
3973
- "modal-id": vue.unref(realModalId),
3974
- "modal-title": __props.modalTitle
3975
- }, {
3976
- default: vue.withCtx(() => [
3977
- (vue.openBlock(), vue.createBlock(script$q, vue.mergeProps({
3978
- onSuccess: success,
3979
- onFieldChanged: fieldChanged,
3980
- onFormSubmitted: formSubmitted,
3981
- onFormError: formError,
3982
- key: JSON.stringify(__props.currentData ?? {})
3983
- }, props), null, 16 /* FULL_PROPS */))
3984
- ]),
3985
- _: 1 /* STABLE */
3986
- }, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
3971
+ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
3972
+ vue.createVNode(script$p, {
3973
+ "modal-size": __props.modalSize,
3974
+ "modal-id": vue.unref(realModalId),
3975
+ "modal-title": __props.modalTitle
3976
+ }, {
3977
+ default: vue.withCtx(() => [
3978
+ (vue.openBlock(), vue.createBlock(script$q, vue.mergeProps({
3979
+ onSuccess: success,
3980
+ onFieldChanged: fieldChanged,
3981
+ onFormSubmitted: formSubmitted,
3982
+ onFormError: formError,
3983
+ key: JSON.stringify(__props.currentData ?? {})
3984
+ }, props), null, 16 /* FULL_PROPS */))
3985
+ ]),
3986
+ _: 1 /* STABLE */
3987
+ }, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
3988
+ ]))
3987
3989
  ], 64 /* STABLE_FRAGMENT */))
3988
3990
  }
3989
3991
  }
@@ -5207,7 +5209,8 @@ const __default__ = {
5207
5209
  range: null,
5208
5210
  from: null,
5209
5211
  to: null,
5210
- period: null
5212
+ period: null,
5213
+ lastId: null
5211
5214
  }
5212
5215
  },
5213
5216
  mounted(){
@@ -5373,6 +5376,7 @@ const __default__ = {
5373
5376
  from: this.from,
5374
5377
  to: this.to,
5375
5378
  period: this.period,
5379
+ lastId: this.lastId,
5376
5380
  };
5377
5381
  shApis.doPost(this.endPoint, data).then(res => {
5378
5382
  this.downloading = false;
@@ -5412,7 +5416,8 @@ const __default__ = {
5412
5416
  from: this.from,
5413
5417
  to: this.to,
5414
5418
  period: this.period,
5415
- exact: this.exactMatch
5419
+ exact: this.exactMatch,
5420
+ lastId: this.lastId
5416
5421
  };
5417
5422
  // remove empty values
5418
5423
  Object.keys(data).forEach(key => {
@@ -5437,6 +5442,7 @@ const __default__ = {
5437
5442
  if (this.page < 2 && this.cacheKey) {
5438
5443
  shStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
5439
5444
  }
5445
+
5440
5446
  this.pagination_data = {
5441
5447
  current: response.current_page,
5442
5448
  start: response.from,
@@ -5449,6 +5455,8 @@ const __default__ = {
5449
5455
  if (!this.headers && response.total > 0) {
5450
5456
  this.tableHeaders = Object.keys(response.data[0]);
5451
5457
  }
5458
+ // get id value of the last record
5459
+ this.lastId = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5452
5460
  if (append) {
5453
5461
  this.records.push(...response.data);
5454
5462
  let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
package/dist/library.mjs CHANGED
@@ -3,7 +3,7 @@ import moment from 'moment';
3
3
  import Swal from 'sweetalert2';
4
4
  import { Modal, Offcanvas } from 'bootstrap';
5
5
  import NProgress from 'nprogress';
6
- import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, watch, unref, normalizeClass, createBlock, resolveDynamicComponent, resolveComponent, inject, mergeProps, renderSlot, normalizeStyle, computed, createVNode, withCtx, vModelCheckbox, shallowRef, normalizeProps, markRaw, isRef } from 'vue';
6
+ import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, watch, unref, normalizeClass, createBlock, resolveDynamicComponent, resolveComponent, inject, mergeProps, renderSlot, normalizeStyle, computed, Teleport, createVNode, withCtx, vModelCheckbox, shallowRef, normalizeProps, markRaw, isRef } from 'vue';
7
7
  import _ from 'lodash';
8
8
  import { defineStore, storeToRefs } from 'pinia';
9
9
  import { useRoute, useRouter } from 'vue-router';
@@ -3956,22 +3956,24 @@ return (_ctx, _cache) => {
3956
3956
  }, [
3957
3957
  renderSlot(_ctx.$slots, "default")
3958
3958
  ], 10 /* CLASS, PROPS */, _hoisted_1$i),
3959
- createVNode(script$p, {
3960
- "modal-size": __props.modalSize,
3961
- "modal-id": unref(realModalId),
3962
- "modal-title": __props.modalTitle
3963
- }, {
3964
- default: withCtx(() => [
3965
- (openBlock(), createBlock(script$q, mergeProps({
3966
- onSuccess: success,
3967
- onFieldChanged: fieldChanged,
3968
- onFormSubmitted: formSubmitted,
3969
- onFormError: formError,
3970
- key: JSON.stringify(__props.currentData ?? {})
3971
- }, props), null, 16 /* FULL_PROPS */))
3972
- ]),
3973
- _: 1 /* STABLE */
3974
- }, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
3959
+ (openBlock(), createBlock(Teleport, { to: "body" }, [
3960
+ createVNode(script$p, {
3961
+ "modal-size": __props.modalSize,
3962
+ "modal-id": unref(realModalId),
3963
+ "modal-title": __props.modalTitle
3964
+ }, {
3965
+ default: withCtx(() => [
3966
+ (openBlock(), createBlock(script$q, mergeProps({
3967
+ onSuccess: success,
3968
+ onFieldChanged: fieldChanged,
3969
+ onFormSubmitted: formSubmitted,
3970
+ onFormError: formError,
3971
+ key: JSON.stringify(__props.currentData ?? {})
3972
+ }, props), null, 16 /* FULL_PROPS */))
3973
+ ]),
3974
+ _: 1 /* STABLE */
3975
+ }, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
3976
+ ]))
3975
3977
  ], 64 /* STABLE_FRAGMENT */))
3976
3978
  }
3977
3979
  }
@@ -5195,7 +5197,8 @@ const __default__ = {
5195
5197
  range: null,
5196
5198
  from: null,
5197
5199
  to: null,
5198
- period: null
5200
+ period: null,
5201
+ lastId: null
5199
5202
  }
5200
5203
  },
5201
5204
  mounted(){
@@ -5361,6 +5364,7 @@ const __default__ = {
5361
5364
  from: this.from,
5362
5365
  to: this.to,
5363
5366
  period: this.period,
5367
+ lastId: this.lastId,
5364
5368
  };
5365
5369
  shApis.doPost(this.endPoint, data).then(res => {
5366
5370
  this.downloading = false;
@@ -5400,7 +5404,8 @@ const __default__ = {
5400
5404
  from: this.from,
5401
5405
  to: this.to,
5402
5406
  period: this.period,
5403
- exact: this.exactMatch
5407
+ exact: this.exactMatch,
5408
+ lastId: this.lastId
5404
5409
  };
5405
5410
  // remove empty values
5406
5411
  Object.keys(data).forEach(key => {
@@ -5425,6 +5430,7 @@ const __default__ = {
5425
5430
  if (this.page < 2 && this.cacheKey) {
5426
5431
  shStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
5427
5432
  }
5433
+
5428
5434
  this.pagination_data = {
5429
5435
  current: response.current_page,
5430
5436
  start: response.from,
@@ -5437,6 +5443,8 @@ const __default__ = {
5437
5443
  if (!this.headers && response.total > 0) {
5438
5444
  this.tableHeaders = Object.keys(response.data[0]);
5439
5445
  }
5446
+ // get id value of the last record
5447
+ this.lastId = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5440
5448
  if (append) {
5441
5449
  this.records.push(...response.data);
5442
5450
  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.6",
3
+ "version": "5.3.8",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",