@monoui/vuejs 1.1.33 → 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.33",
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,42 +881,42 @@ export default {
882
881
  console.error(error);
883
882
  }
884
883
  },
885
- loadHistoryFilters() {
886
- const parameters = this.getHistoryParameters("f-");
884
+ loadHistoryFilters(filterParams) {
885
+ if (!filterParams) filterParams = this.getHistoryParameters("f-");
886
+ if (!filterParams) return;
887
+
887
888
  const trimName = this.getHistoryName("f-");
888
- const names = Object.keys(parameters);
889
- if (parameters && parameters.length > 0) {
890
- this.filters.splice(0, this.filters.length);
891
- for (const paramName of names) {
892
- const value = parameters[paramName];
893
- const column = paramName.replace(trimName, "");
894
- if (value) {
895
- this.filters.push({
896
- Column: column,
897
- Value: value
898
- });
899
- }
889
+ const names = Object.keys(filterParams);
890
+ this.filters.splice(0, this.filters.length);
891
+ for (const paramName of names) {
892
+ const value = filterParams[paramName];
893
+ const column = paramName.replace(trimName, "");
894
+ if (value) {
895
+ this.filters.push({
896
+ Column: column,
897
+ Value: value
898
+ });
900
899
  }
901
900
  }
902
901
  },
903
- loadHistorySorting() {
904
- const parameters = this.getHistoryParameters("s-");
902
+ loadHistorySorting(sortingParams) {
903
+ if (!sortingParams) sortingParams = this.getHistoryParameters("s-");
904
+ if (!sortingParams) return;
905
+
905
906
  const trimName = this.getHistoryName("s-");
906
- const names = Object.keys(parameters);
907
- if (parameters && parameters.length > 0) {
908
- this.sorting.splice(0, this.sorting.length);
909
- for (const paramName of names) {
910
- var paramValue = parameters[paramName];
911
- let value = undefined;
912
- if (paramValue && paramValue === "1") value = true;
913
- else if (paramValue && paramValue === "0") value = false;
914
- const column = paramName.replace(trimName, "");
907
+ const names = Object.keys(sortingParams);
908
+ this.sorting.splice(0, this.sorting.length);
909
+ for (const paramName of names) {
910
+ var paramValue = sortingParams[paramName];
911
+ let value = undefined;
912
+ if (paramValue && paramValue === "1") value = true;
913
+ else if (paramValue && paramValue === "0") value = false;
914
+ const column = paramName.replace(trimName, "");
915
915
 
916
- this.sorting.push({
917
- Column: column,
918
- Asc: value
919
- });
920
- }
916
+ this.sorting.push({
917
+ Column: column,
918
+ Asc: value
919
+ });
921
920
  }
922
921
  },
923
922
  replaceHistory(state, storage = this.historyStorage) {