@mozaic-ds/vue 0.30.0-beta.0 → 0.31.0
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/mozaic-vue.adeo.css +1 -1
- package/dist/mozaic-vue.adeo.umd.js +145 -122
- package/dist/mozaic-vue.common.js +145 -122
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +145 -122
- package/dist/mozaic-vue.umd.js.map +1 -1
- package/dist/mozaic-vue.umd.min.js +2 -2
- package/dist/mozaic-vue.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/datatable/MDataTable.vue +262 -228
- package/src/components/quantityselector/MQuantitySelector.vue +2 -2
- package/src/components/tabs/MTab.vue +103 -85
- package/src/components/tags/MTag.vue +3 -1
- package/src/components/textinput/MTextInputField.vue +3 -0
package/package.json
CHANGED
|
@@ -1,111 +1,119 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="mc-data-table" :class="getClasses">
|
|
2
|
+
<div ref="datatable" class="mc-data-table" :class="getClasses">
|
|
3
3
|
<slot />
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
|
|
5
|
+
<div class="mc-datatable__container">
|
|
6
|
+
<div class="mc-data-table__body" :style="bodyStyleAttr">
|
|
7
|
+
<table aria-describedby="data" :class="getTableClasses">
|
|
8
|
+
<thead>
|
|
9
|
+
<tr v-if="!hideHeader">
|
|
10
|
+
<th
|
|
11
|
+
v-for="(header, index) in getHeaders"
|
|
12
|
+
:key="`header-${index}`"
|
|
13
|
+
:class="header.cssClass"
|
|
14
|
+
scope="col"
|
|
15
|
+
>
|
|
16
|
+
<div class="header">
|
|
17
|
+
<slot
|
|
18
|
+
:name="`header.${header.dataFieldExpr}`"
|
|
19
|
+
:header="header"
|
|
20
|
+
>
|
|
21
|
+
{{ header.caption }}
|
|
22
|
+
</slot>
|
|
23
|
+
<div
|
|
24
|
+
v-if="sorting.mode !== 'none' && header.allowSorting"
|
|
25
|
+
class="header__sort"
|
|
26
|
+
:class="header.sortOrder"
|
|
27
|
+
@click="!loading && onSortClick({ e: $event, header })"
|
|
28
|
+
>
|
|
29
|
+
<m-icon
|
|
30
|
+
:name="'ArrowArrowTop16'"
|
|
31
|
+
:class="{ active: header.sortOrder === 'asc' }"
|
|
32
|
+
/>
|
|
33
|
+
<m-icon
|
|
34
|
+
:name="'ArrowArrowBottom16'"
|
|
35
|
+
:class="{ active: header.sortOrder === 'desc' }"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
31
38
|
</div>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
34
|
-
</
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
:class="rowClasses(item)"
|
|
41
|
-
>
|
|
42
|
-
<td
|
|
43
|
-
v-for="(header, index) in getHeaders"
|
|
44
|
-
:key="`${index}-${getItemValue(item, dataKeyExpr)}-${
|
|
45
|
-
header.dataFieldExpr
|
|
46
|
-
}`"
|
|
47
|
-
:class="header.cssClass"
|
|
48
|
-
@click="
|
|
49
|
-
allowRowClick && onRowClick({ event: $event, item: item })
|
|
50
|
-
"
|
|
39
|
+
</th>
|
|
40
|
+
</tr>
|
|
41
|
+
</thead>
|
|
42
|
+
<tbody>
|
|
43
|
+
<tr
|
|
44
|
+
v-for="(item, rowIndex) in getSource"
|
|
45
|
+
:key="item[dataKeyExpr]"
|
|
46
|
+
:class="rowClasses(item)"
|
|
51
47
|
>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
48
|
+
<td
|
|
49
|
+
v-for="(header, index) in getHeaders"
|
|
50
|
+
:key="`${index}-${getItemValue(item, dataKeyExpr)}-${
|
|
51
|
+
header.dataFieldExpr
|
|
52
|
+
}`"
|
|
53
|
+
:class="header.cssClass"
|
|
54
|
+
@click="
|
|
55
|
+
allowRowClick && onRowClick({ event: $event, item: item })
|
|
56
|
+
"
|
|
56
57
|
>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<div class="mc-data-table__footer__item-per-page">
|
|
74
|
-
<m-select
|
|
75
|
-
:id="'itemPerPage'"
|
|
76
|
-
:disabled="loading"
|
|
77
|
-
:options="getPageSizes"
|
|
78
|
-
:value="getPageValue"
|
|
79
|
-
@change="onPageSizeChanged"
|
|
80
|
-
>
|
|
81
|
-
<template #text="{ option }">
|
|
82
|
-
<slot name="pager.text" :pager="option">
|
|
83
|
-
{{ option.text }}
|
|
84
|
-
</slot>
|
|
85
|
-
</template>
|
|
86
|
-
</m-select>
|
|
58
|
+
<slot
|
|
59
|
+
:name="`item.${header.dataFieldExpr}`"
|
|
60
|
+
:item="item"
|
|
61
|
+
:index="rowIndex"
|
|
62
|
+
>
|
|
63
|
+
{{ getItemValue(item, header.dataFieldExpr) }}
|
|
64
|
+
</slot>
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr v-if="getSource.length == 0">
|
|
68
|
+
<td :colspan="getHeaders.length">
|
|
69
|
+
<slot name="no-data" />
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
</tbody>
|
|
73
|
+
</table>
|
|
87
74
|
</div>
|
|
88
75
|
<div
|
|
89
|
-
v-if="pagingOptions.
|
|
90
|
-
class="mc-data-
|
|
76
|
+
v-if="pagingOptions.enabled && total != null"
|
|
77
|
+
class="mc-data-table__footer"
|
|
91
78
|
>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
<div class="mc-data-table__footer__item-per-page">
|
|
80
|
+
<m-select
|
|
81
|
+
id="itemPerPage"
|
|
82
|
+
:disabled="loading"
|
|
83
|
+
:options="getPageSizes"
|
|
84
|
+
:value="getPageValue"
|
|
85
|
+
size="s"
|
|
86
|
+
@change="onPageSizeChanged"
|
|
87
|
+
>
|
|
88
|
+
<template #text="{ option }">
|
|
89
|
+
<slot name="pager.text" :pager="option">
|
|
90
|
+
{{ option.text }}
|
|
91
|
+
</slot>
|
|
92
|
+
</template>
|
|
93
|
+
</m-select>
|
|
94
|
+
</div>
|
|
95
|
+
<div
|
|
96
|
+
v-if="pagingOptions.displayTotal"
|
|
97
|
+
class="mc-data-table__footer__display-total-item"
|
|
102
98
|
>
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
<span class="strong">{{ getTotalStringCurrentCount }}</span> /
|
|
100
|
+
<span class="strong">{{ total }}</span>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="mc-data-table__footer__pagination">
|
|
103
|
+
<m-pagination
|
|
104
|
+
:disabled="loading"
|
|
105
|
+
:length="getPagingSize"
|
|
106
|
+
:page-label="pagingOptions.pageLabel"
|
|
107
|
+
:value="pagingOptions.index"
|
|
108
|
+
@on-update-page="onUpdatePage"
|
|
109
|
+
>
|
|
110
|
+
<template #text="{ option }">
|
|
111
|
+
<slot name="paging.text" :paging="option">
|
|
112
|
+
{{ option.text }}
|
|
113
|
+
</slot>
|
|
114
|
+
</template>
|
|
115
|
+
</m-pagination>
|
|
116
|
+
</div>
|
|
109
117
|
</div>
|
|
110
118
|
</div>
|
|
111
119
|
</div>
|
|
@@ -305,6 +313,7 @@ export default {
|
|
|
305
313
|
data: null,
|
|
306
314
|
loading: false,
|
|
307
315
|
created: false,
|
|
316
|
+
bodyStyleAttr: '',
|
|
308
317
|
};
|
|
309
318
|
},
|
|
310
319
|
|
|
@@ -458,6 +467,7 @@ export default {
|
|
|
458
467
|
mounted() {
|
|
459
468
|
this.load();
|
|
460
469
|
this.created = true;
|
|
470
|
+
this.bodyStyleAttr = this.$refs.datatable.attributes.style.value;
|
|
461
471
|
},
|
|
462
472
|
|
|
463
473
|
methods: {
|
|
@@ -587,137 +597,190 @@ export default {
|
|
|
587
597
|
|
|
588
598
|
<style lang="scss">
|
|
589
599
|
/* stylelint-disable */
|
|
590
|
-
$local-config: (
|
|
591
|
-
font-path: '~@mozaic-ds/web-fonts',
|
|
592
|
-
);
|
|
593
|
-
|
|
594
600
|
@import 'settings-tools/_all-settings';
|
|
595
601
|
|
|
596
602
|
.mc-data-table {
|
|
597
|
-
@include set-font-
|
|
603
|
+
@include set-font-family;
|
|
598
604
|
|
|
599
|
-
|
|
600
|
-
background-color: $color-grey-000;
|
|
601
|
-
padding: 2px 0;
|
|
602
|
-
background-clip: padding-box;
|
|
603
|
-
display: flex;
|
|
604
|
-
flex-direction: column;
|
|
605
|
+
$parent: get-parent-selector(&);
|
|
605
606
|
|
|
606
|
-
|
|
607
|
+
background-color: $color-background-datatable-container;
|
|
608
|
+
box-sizing: border-box;
|
|
609
|
+
|
|
610
|
+
*,
|
|
611
|
+
::after,
|
|
612
|
+
::before {
|
|
613
|
+
box-sizing: inherit;
|
|
614
|
+
}
|
|
607
615
|
|
|
608
616
|
&__body {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
text-align: center;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
617
|
+
@include set-datatable-scrollbar();
|
|
618
|
+
|
|
619
|
+
overflow-x: auto;
|
|
620
|
+
overflow-y: hidden;
|
|
621
|
+
|
|
622
|
+
table {
|
|
623
|
+
@include set-datatable-base();
|
|
624
|
+
|
|
625
|
+
& > thead,
|
|
626
|
+
& > tbody {
|
|
627
|
+
background-color: $color-grey-000;
|
|
623
628
|
}
|
|
624
629
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
&
|
|
641
|
-
display: flex;
|
|
630
|
+
thead {
|
|
631
|
+
th,
|
|
632
|
+
td {
|
|
633
|
+
@include set-datatable-head-label();
|
|
634
|
+
|
|
635
|
+
height: map-get($datatabke-default-celle-size, 'height');
|
|
636
|
+
|
|
637
|
+
.header {
|
|
638
|
+
align-items: center;
|
|
639
|
+
display: flex;
|
|
640
|
+
height: 100%;
|
|
641
|
+
font-family: inherit;
|
|
642
|
+
justify-content: space-between;
|
|
643
|
+
width: 100%;
|
|
644
|
+
|
|
645
|
+
&__sort {
|
|
642
646
|
align-items: center;
|
|
647
|
+
display: flex;
|
|
648
|
+
flex-direction: column;
|
|
649
|
+
height: $mu150;
|
|
650
|
+
justify-content: space-around;
|
|
651
|
+
margin-left: $mu050;
|
|
652
|
+
width: $mu150;
|
|
653
|
+
cursor: pointer;
|
|
654
|
+
|
|
655
|
+
&::after,
|
|
656
|
+
&::before {
|
|
657
|
+
background-color: $color-background-arrow-default;
|
|
658
|
+
content: '';
|
|
659
|
+
flex-shrink: 0;
|
|
660
|
+
height: $mu050;
|
|
661
|
+
width: $mu075;
|
|
662
|
+
}
|
|
643
663
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
width: 24px;
|
|
664
|
+
&::before {
|
|
665
|
+
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
|
|
666
|
+
}
|
|
648
667
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
position: absolute;
|
|
653
|
-
cursor: pointer;
|
|
668
|
+
&::after {
|
|
669
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
670
|
+
}
|
|
654
671
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
672
|
+
&.asc {
|
|
673
|
+
&::before {
|
|
674
|
+
background-color: $color-background-arrow-active;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
658
677
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
678
|
+
&.desc {
|
|
679
|
+
&::after {
|
|
680
|
+
background-color: $color-background-arrow-active;
|
|
662
681
|
}
|
|
663
682
|
}
|
|
683
|
+
|
|
684
|
+
& svg {
|
|
685
|
+
display: none;
|
|
686
|
+
opacity: 0;
|
|
687
|
+
}
|
|
664
688
|
}
|
|
665
689
|
}
|
|
666
690
|
}
|
|
667
691
|
}
|
|
668
692
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
&:
|
|
672
|
-
|
|
693
|
+
tbody {
|
|
694
|
+
tr {
|
|
695
|
+
&:hover {
|
|
696
|
+
background-color: $color-background-datatable-cell-hover;
|
|
673
697
|
}
|
|
674
698
|
|
|
675
699
|
&.mc-data-table__body__row--clickable {
|
|
676
700
|
cursor: pointer;
|
|
677
701
|
|
|
678
|
-
&:hover {
|
|
679
|
-
background-color: $color-grey-100;
|
|
680
|
-
opacity: 0.8;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
702
|
&:active {
|
|
684
|
-
background-color: $color-
|
|
685
|
-
opacity: 0.8;
|
|
703
|
+
background-color: $color-background-datatable-cell-selected;
|
|
686
704
|
}
|
|
687
705
|
}
|
|
688
706
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
font-weight: normal;
|
|
692
|
-
font-size: 13px;
|
|
693
|
-
line-height: 18px;
|
|
694
|
-
height: 40px;
|
|
695
|
-
padding: 0 1rem;
|
|
696
|
-
white-space: nowrap;
|
|
697
|
-
text-overflow: ellipsis;
|
|
707
|
+
&.row-selected {
|
|
708
|
+
background-color: $color-background-datatable-cell-selected;
|
|
698
709
|
}
|
|
699
710
|
}
|
|
711
|
+
|
|
712
|
+
th,
|
|
713
|
+
td {
|
|
714
|
+
@include set-font-scale('04', 'm'); // 14px / 18px
|
|
715
|
+
|
|
716
|
+
color: $color-font-tbody-cell;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
tr {
|
|
721
|
+
height: map-get($datatabke-default-celle-size, 'height');
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
th,
|
|
725
|
+
td {
|
|
726
|
+
border-bottom: get-border(s) solid $color-grey-300;
|
|
727
|
+
text-align: left;
|
|
728
|
+
vertical-align: middle;
|
|
729
|
+
padding: 0 $mu100;
|
|
700
730
|
}
|
|
701
731
|
}
|
|
702
732
|
}
|
|
703
733
|
|
|
734
|
+
// sticky
|
|
735
|
+
&--fixed-header {
|
|
736
|
+
#{$parent} {
|
|
737
|
+
&__body {
|
|
738
|
+
table {
|
|
739
|
+
> thead {
|
|
740
|
+
@include set-box-shadow('l');
|
|
741
|
+
|
|
742
|
+
top: 0;
|
|
743
|
+
z-index: 2;
|
|
744
|
+
position: sticky;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
> tbody {
|
|
748
|
+
tr:last-child {
|
|
749
|
+
th,
|
|
750
|
+
td {
|
|
751
|
+
border-bottom: transparent;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// manage scroll
|
|
761
|
+
&[style*='height'] {
|
|
762
|
+
.mc-data-table__body {
|
|
763
|
+
overflow-y: auto;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// footer
|
|
768
|
+
|
|
704
769
|
&__footer {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
display: flex;
|
|
770
|
+
@include set-box-shadow('s');
|
|
771
|
+
|
|
708
772
|
align-items: center;
|
|
709
|
-
|
|
773
|
+
background-color: $color-grey-000;
|
|
774
|
+
display: flex;
|
|
775
|
+
padding: $mu075 $mu100;
|
|
776
|
+
gap: $mu100;
|
|
710
777
|
|
|
711
|
-
@
|
|
778
|
+
@media screen and (max-width: ($screen-m - 1)) {
|
|
779
|
+
flex-direction: column;
|
|
780
|
+
}
|
|
712
781
|
|
|
713
782
|
&__item-per-page {
|
|
714
|
-
|
|
715
|
-
width: auto;
|
|
716
|
-
font-size: 0.875rem;
|
|
717
|
-
line-height: 1.1428571;
|
|
718
|
-
padding: calc(0.5rem - 1px) 2.25rem calc(0.5rem - 1px)
|
|
719
|
-
calc(0.5rem - 1px);
|
|
720
|
-
}
|
|
783
|
+
flex-shrink: 0;
|
|
721
784
|
}
|
|
722
785
|
|
|
723
786
|
&__display-total-item {
|
|
@@ -725,54 +788,25 @@ $local-config: (
|
|
|
725
788
|
min-width: 150px;
|
|
726
789
|
padding: 0.5rem 2.25rem;
|
|
727
790
|
font-size: 0.875rem;
|
|
791
|
+
|
|
728
792
|
.strong {
|
|
729
793
|
font-weight: bold;
|
|
730
794
|
}
|
|
731
795
|
}
|
|
732
796
|
|
|
733
797
|
&__pagination {
|
|
734
|
-
|
|
735
|
-
width: 100%;
|
|
736
|
-
display: flex;
|
|
737
|
-
justify-content: flex-end;
|
|
738
|
-
|
|
739
|
-
& .mc-pagination {
|
|
740
|
-
.mc-pagination__button {
|
|
741
|
-
min-width: 2rem;
|
|
742
|
-
min-height: 2rem;
|
|
743
|
-
|
|
744
|
-
.mc-pagination__button-icon {
|
|
745
|
-
height: 1rem;
|
|
746
|
-
width: 1rem;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
.mc-select {
|
|
751
|
-
font-size: 0.875rem;
|
|
752
|
-
line-height: 1.1428571;
|
|
753
|
-
padding: calc(0.5rem - 1px) 2.25rem calc(0.5rem - 1px)
|
|
754
|
-
calc(0.5rem - 1px);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
798
|
+
margin-left: auto;
|
|
757
799
|
}
|
|
758
800
|
}
|
|
801
|
+
}
|
|
759
802
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
& th {
|
|
768
|
-
position: sticky;
|
|
769
|
-
top: 0;
|
|
770
|
-
z-index: 1;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
803
|
+
.mc-datatable {
|
|
804
|
+
&__container {
|
|
805
|
+
@include set-border-radius();
|
|
806
|
+
@include set-box-shadow('s');
|
|
807
|
+
|
|
808
|
+
background-color: $color-background-datatable-container;
|
|
809
|
+
overflow: hidden;
|
|
776
810
|
}
|
|
777
811
|
}
|
|
778
812
|
/* stylelint-enable */
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
:size="small ? 's' : null"
|
|
30
30
|
:disabled="disabled"
|
|
31
31
|
role="spinbutton"
|
|
32
|
-
@
|
|
32
|
+
@change="handle"
|
|
33
33
|
@focus="onFocus"
|
|
34
34
|
@keypress="integerOnly && formatValue($event)"
|
|
35
35
|
v-on="$listeners"
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
if (this.currentValue > this.valuemax) {
|
|
131
131
|
this.currentValue = this.valuemax;
|
|
132
132
|
}
|
|
133
|
-
if (this.currentValue
|
|
133
|
+
if (this.currentValue <= this.valuemin) {
|
|
134
134
|
this.currentValue = this.valuemin;
|
|
135
135
|
}
|
|
136
136
|
this.$emit('input', this.currentValue);
|