@monoui/vuejs 1.1.78 → 1.1.79
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/main.js +5 -5
- package/package.json +1 -1
- package/src/components/Table/Table.vue +30 -23
package/package.json
CHANGED
|
@@ -418,14 +418,6 @@ import IconSorting from "./Icons/Sorting.vue";
|
|
|
418
418
|
import IconSortingAZ from "./Icons/SortingAZ.vue";
|
|
419
419
|
import IconSortingArrows from "./Icons/SortingArrows.vue";
|
|
420
420
|
|
|
421
|
-
const defaultTimeFrame = {
|
|
422
|
-
enabled: false,
|
|
423
|
-
title: "All",
|
|
424
|
-
column: "CreatedDate",
|
|
425
|
-
frame: 3,
|
|
426
|
-
options: [3, 6, 9, 12, "Clear"]
|
|
427
|
-
};
|
|
428
|
-
|
|
429
421
|
export default {
|
|
430
422
|
name: "mui-table",
|
|
431
423
|
components: {
|
|
@@ -629,17 +621,17 @@ export default {
|
|
|
629
621
|
comingFromPopState: false,
|
|
630
622
|
skipWatch: false,
|
|
631
623
|
selectedCorrelationId: null,
|
|
632
|
-
emptyGuid: "00000000-0000-0000-0000-000000000000"
|
|
624
|
+
emptyGuid: "00000000-0000-0000-0000-000000000000",
|
|
625
|
+
finalTimeFrame: {
|
|
626
|
+
enabled: false,
|
|
627
|
+
column: "CreatedDate",
|
|
628
|
+
title: "All",
|
|
629
|
+
frame: 3,
|
|
630
|
+
options: [3, 6, 9, 12, "Clear"]
|
|
631
|
+
}
|
|
633
632
|
};
|
|
634
633
|
},
|
|
635
634
|
computed: {
|
|
636
|
-
finalTimeFrame() {
|
|
637
|
-
return {
|
|
638
|
-
...defaultTimeFrame,
|
|
639
|
-
...this.timeFrame
|
|
640
|
-
};
|
|
641
|
-
},
|
|
642
|
-
|
|
643
635
|
filteredPerPageValues() {
|
|
644
636
|
const values = [];
|
|
645
637
|
for (const value of this.perPageValues) {
|
|
@@ -668,6 +660,22 @@ export default {
|
|
|
668
660
|
async mounted() {
|
|
669
661
|
if (this.history) this.loadHistory();
|
|
670
662
|
|
|
663
|
+
if (this.timeFrame) {
|
|
664
|
+
if (this.timeFrame.enabled) this.finalTimeFrame.enabled = true;
|
|
665
|
+
|
|
666
|
+
if (this.timeFrame.column)
|
|
667
|
+
this.finalTimeFrame.column = this.timeFrame.column;
|
|
668
|
+
|
|
669
|
+
if (this.timeFrame.title)
|
|
670
|
+
this.finalTimeFrame.title = this.timeFrame.title;
|
|
671
|
+
|
|
672
|
+
if (this.timeFrame.frame)
|
|
673
|
+
this.finalTimeFrame.frame = this.timeFrame.frame;
|
|
674
|
+
|
|
675
|
+
if (this.timeFrame.options && this.timeFrame.options.length > 0)
|
|
676
|
+
this.finalTimeFrame.options = this.timeFrame.options;
|
|
677
|
+
}
|
|
678
|
+
|
|
671
679
|
if (this.finalTimeFrame && this.finalTimeFrame.enabled) {
|
|
672
680
|
this.applyTimeFrameFilter(this.finalTimeFrame.frame);
|
|
673
681
|
}
|
|
@@ -677,6 +685,12 @@ export default {
|
|
|
677
685
|
}
|
|
678
686
|
},
|
|
679
687
|
methods: {
|
|
688
|
+
getTimeFrameTitle() {
|
|
689
|
+
if (this.finalTimeFrame.frame)
|
|
690
|
+
return this.getMonthLabel(this.finalTimeFrame.frame, true);
|
|
691
|
+
return this.finalTimeFrame.title;
|
|
692
|
+
},
|
|
693
|
+
|
|
680
694
|
getMonthLabel(lbl, align = false) {
|
|
681
695
|
if (lbl === "Clear") return lbl;
|
|
682
696
|
|
|
@@ -684,12 +698,6 @@ export default {
|
|
|
684
698
|
return lbl < 10 ? `\u00A0${lbl} months` : `${lbl} months`;
|
|
685
699
|
},
|
|
686
700
|
|
|
687
|
-
getTimeFrameTitle() {
|
|
688
|
-
if (this.finalTimeFrame.frame)
|
|
689
|
-
return this.getMonthLabel(this.finalTimeFrame.frame, true);
|
|
690
|
-
return this.finalTimeFrame.title;
|
|
691
|
-
},
|
|
692
|
-
|
|
693
701
|
applyTimeFrameFilter(opt) {
|
|
694
702
|
const existingIndex = this.filters.findIndex(
|
|
695
703
|
f => f.Column === this.finalTimeFrame.column
|
|
@@ -702,7 +710,6 @@ export default {
|
|
|
702
710
|
}
|
|
703
711
|
} else {
|
|
704
712
|
this.finalTimeFrame.frame = opt;
|
|
705
|
-
|
|
706
713
|
if (existingIndex !== -1) {
|
|
707
714
|
// Update existing filter
|
|
708
715
|
this.$set(this.filters, existingIndex, {
|