@monoui/vuejs 1.1.34 → 1.1.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monoui/vuejs",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
4
4
  "description": "This project will contain MonoFor UI Framework",
5
5
  "main": "./dist/main.js",
6
6
  "repository": "git@gitlab.com:monoui/vuejs.git",
@@ -495,11 +495,10 @@ export default {
495
495
  this.addPopStateListener();
496
496
  },
497
497
  async mounted() {
498
- var filterPrefix = this.getHistoryName("f-");
499
- var sortingPrefix = this.getHistoryName("s-");
500
- let url = new URL(window.location).toString();
501
- if (url.indexOf(filterPrefix) >= 0 || url.indexOf(sortingPrefix) >= 0) {
502
- this.loadHistory();
498
+ const filterParams = this.getHistoryParameters("f-");
499
+ const sortingParams = this.getHistoryParameters("s-");
500
+ if (filterParams || sortingParams) {
501
+ this.loadHistory(filterParams, sortingParams);
503
502
  }
504
503
  if (this.autoLoad) {
505
504
  await this.getValues();
@@ -517,7 +516,7 @@ export default {
517
516
  this.loadHistory();
518
517
  this.getValues(false);
519
518
  },
520
- loadHistory() {
519
+ loadHistory(filterParams, sortingParams) {
521
520
  this.settings.currentPage = this.getHistoryParameter("page", 1);
522
521
  this.settings.itemPerPage = this.getHistoryParameter(
523
522
  "limit",
@@ -529,8 +528,8 @@ export default {
529
528
  ""
530
529
  );
531
530
  }
532
- this.loadHistoryFilters();
533
- this.loadHistorySorting();
531
+ this.loadHistoryFilters(filterParams);
532
+ this.loadHistorySorting(sortingParams);
534
533
  },
535
534
  sortableIcon(column) {
536
535
  const currentSort = this.sorting.find(x => x.Column === column);
@@ -882,15 +881,15 @@ export default {
882
881
  console.error(error);
883
882
  }
884
883
  },
885
- loadHistoryFilters() {
886
- const parameters = this.getHistoryParameters("f-");
887
- if (!parameters) return;
884
+ loadHistoryFilters(filterParams) {
885
+ if (!filterParams) filterParams = this.getHistoryParameters("f-");
886
+ if (!filterParams) return;
888
887
 
889
888
  const trimName = this.getHistoryName("f-");
890
- const names = Object.keys(parameters);
889
+ const names = Object.keys(filterParams);
891
890
  this.filters.splice(0, this.filters.length);
892
891
  for (const paramName of names) {
893
- const value = parameters[paramName];
892
+ const value = filterParams[paramName];
894
893
  const column = paramName.replace(trimName, "");
895
894
  if (value) {
896
895
  this.filters.push({
@@ -900,15 +899,15 @@ export default {
900
899
  }
901
900
  }
902
901
  },
903
- loadHistorySorting() {
904
- const parameters = this.getHistoryParameters("s-");
905
- if (!parameters) return;
902
+ loadHistorySorting(sortingParams) {
903
+ if (!sortingParams) sortingParams = this.getHistoryParameters("s-");
904
+ if (!sortingParams) return;
906
905
 
907
906
  const trimName = this.getHistoryName("s-");
908
- const names = Object.keys(parameters);
907
+ const names = Object.keys(sortingParams);
909
908
  this.sorting.splice(0, this.sorting.length);
910
909
  for (const paramName of names) {
911
- var paramValue = parameters[paramName];
910
+ var paramValue = sortingParams[paramName];
912
911
  let value = undefined;
913
912
  if (paramValue && paramValue === "1") value = true;
914
913
  else if (paramValue && paramValue === "0") value = false;