@iankibetsh/shframework 5.1.1 → 5.1.3

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
@@ -4259,16 +4259,19 @@ const actionSuccessful = (res)=>{
4259
4259
  res.actionType = 'silentAction';
4260
4260
  emit('actionSuccessful',res);
4261
4261
  emit('success',res);
4262
- shRepo.showToast(res.message ?? props.successMessage);
4262
+ if(props.successMessage || res.message){
4263
+ shRepo.showToast(res.message ?? props.successMessage);
4264
+ }
4263
4265
  };
4264
4266
 
4265
4267
  const actionFailed = reason =>{
4266
- console.log(reason);
4267
4268
  processing.value = false;
4268
4269
  reason.actionType = 'silentAction';
4269
4270
  emit('actionFailed', reason);
4270
4271
  emit('failed', reason);
4271
- shRepo.showToast(reason.value.error.message ?? props.failMessage,'error');
4272
+ if (props.failMessage || reason.value?.message) {
4273
+ shRepo.showToast(reason.value.message ?? props.failMessage,'error');
4274
+ }
4272
4275
  };
4273
4276
  function runAction () {
4274
4277
  processing.value = true;
@@ -5213,11 +5216,11 @@ const _hoisted_70 = { key: 0 };
5213
5216
 
5214
5217
  const __default__ = {
5215
5218
  name: 'sh-table',
5216
- props: ['endPoint', 'headers','disableMobileResponsive', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','selectedRange','noRecordsMessage'],
5219
+ props: ['endPoint','orderBy','orderMethod', 'headers','disableMobileResponsive', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','selectedRange','noRecordsMessage'],
5217
5220
  data(){
5218
5221
  return {
5219
- order_by: '',
5220
- order_method: '',
5222
+ order_by: this.orderBy,
5223
+ order_method: this.orderMethod,
5221
5224
  per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
5222
5225
  page: 1,
5223
5226
  exactMatch: false,
@@ -5427,7 +5430,7 @@ const __default__ = {
5427
5430
  } else if (!append) {
5428
5431
  this.loading = 'loading';
5429
5432
  }
5430
- const data = {
5433
+ let data = {
5431
5434
  order_by: this.order_by,
5432
5435
  order_method: this.order_method,
5433
5436
  per_page: this.per_page,
@@ -5439,6 +5442,12 @@ const __default__ = {
5439
5442
  period: this.period,
5440
5443
  exact: this.exactMatch
5441
5444
  };
5445
+ // remove empty values
5446
+ Object.keys(data).forEach(key => {
5447
+ if (data[key] === null || data[key] === '') {
5448
+ delete data[key];
5449
+ }
5450
+ });
5442
5451
  if (this.pagination_data) {
5443
5452
  this.pagination_data.loading = 1;
5444
5453
  }
package/dist/library.mjs CHANGED
@@ -4247,16 +4247,19 @@ const actionSuccessful = (res)=>{
4247
4247
  res.actionType = 'silentAction';
4248
4248
  emit('actionSuccessful',res);
4249
4249
  emit('success',res);
4250
- shRepo.showToast(res.message ?? props.successMessage);
4250
+ if(props.successMessage || res.message){
4251
+ shRepo.showToast(res.message ?? props.successMessage);
4252
+ }
4251
4253
  };
4252
4254
 
4253
4255
  const actionFailed = reason =>{
4254
- console.log(reason);
4255
4256
  processing.value = false;
4256
4257
  reason.actionType = 'silentAction';
4257
4258
  emit('actionFailed', reason);
4258
4259
  emit('failed', reason);
4259
- shRepo.showToast(reason.value.error.message ?? props.failMessage,'error');
4260
+ if (props.failMessage || reason.value?.message) {
4261
+ shRepo.showToast(reason.value.message ?? props.failMessage,'error');
4262
+ }
4260
4263
  };
4261
4264
  function runAction () {
4262
4265
  processing.value = true;
@@ -5201,11 +5204,11 @@ const _hoisted_70 = { key: 0 };
5201
5204
 
5202
5205
  const __default__ = {
5203
5206
  name: 'sh-table',
5204
- props: ['endPoint', 'headers','disableMobileResponsive', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','selectedRange','noRecordsMessage'],
5207
+ props: ['endPoint','orderBy','orderMethod', 'headers','disableMobileResponsive', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','selectedRange','noRecordsMessage'],
5205
5208
  data(){
5206
5209
  return {
5207
- order_by: '',
5208
- order_method: '',
5210
+ order_by: this.orderBy,
5211
+ order_method: this.orderMethod,
5209
5212
  per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
5210
5213
  page: 1,
5211
5214
  exactMatch: false,
@@ -5415,7 +5418,7 @@ const __default__ = {
5415
5418
  } else if (!append) {
5416
5419
  this.loading = 'loading';
5417
5420
  }
5418
- const data = {
5421
+ let data = {
5419
5422
  order_by: this.order_by,
5420
5423
  order_method: this.order_method,
5421
5424
  per_page: this.per_page,
@@ -5427,6 +5430,12 @@ const __default__ = {
5427
5430
  period: this.period,
5428
5431
  exact: this.exactMatch
5429
5432
  };
5433
+ // remove empty values
5434
+ Object.keys(data).forEach(key => {
5435
+ if (data[key] === null || data[key] === '') {
5436
+ delete data[key];
5437
+ }
5438
+ });
5430
5439
  if (this.pagination_data) {
5431
5440
  this.pagination_data.loading = 1;
5432
5441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",