evui 3.4.0 → 3.4.1
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/evui.common.js +108 -65
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +108 -65
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/grid/Grid.vue +53 -18
- package/src/components/grid/style/grid.scss +3 -0
- package/src/components/grid/uses.js +12 -1
package/package.json
CHANGED
|
@@ -105,24 +105,57 @@
|
|
|
105
105
|
{{ column.caption }}
|
|
106
106
|
<!-- Sort Icon -->
|
|
107
107
|
<span @click.stop="onSort(column)">
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
108
|
+
<template v-if="!!$slots.sortIcon">
|
|
109
|
+
<span
|
|
110
|
+
v-if="column.sortable === undefined ? true : column.sortable"
|
|
111
|
+
class="column-sort__icon column-sort__icon--basic"
|
|
112
|
+
:style="{
|
|
113
|
+
height: `${rowHeight}px`,
|
|
114
|
+
'line-height': `${rowHeight}px`,
|
|
115
|
+
}"
|
|
116
|
+
>
|
|
117
|
+
<slot name="sortIcon" />
|
|
118
|
+
</span>
|
|
119
|
+
<span
|
|
120
|
+
v-if="sortField === column.field"
|
|
121
|
+
:class="[{
|
|
122
|
+
'column-sort__icon': true,
|
|
123
|
+
'column-sort__icon--asc': sortOrder === 'asc',
|
|
124
|
+
'column-sort__icon--desc': sortOrder === 'desc',
|
|
125
|
+
}]"
|
|
126
|
+
:style="{
|
|
127
|
+
height: `${rowHeight}px`,
|
|
128
|
+
'line-height': `${rowHeight}px`,
|
|
129
|
+
}"
|
|
130
|
+
>
|
|
131
|
+
<slot :name="`sortIcon_${sortOrder}`" />
|
|
132
|
+
</span>
|
|
133
|
+
</template>
|
|
134
|
+
<template v-else>
|
|
135
|
+
<grid-sort-button
|
|
136
|
+
v-if="column.sortable === undefined ? true : column.sortable"
|
|
137
|
+
class="column-sort__icon column-sort__icon--basic"
|
|
138
|
+
:icon="'basic'"
|
|
139
|
+
:style="{
|
|
140
|
+
height: `${rowHeight}px`,
|
|
141
|
+
'line-height': `${rowHeight}px`,
|
|
142
|
+
}"
|
|
143
|
+
/>
|
|
144
|
+
<grid-sort-button
|
|
145
|
+
v-if="sortField === column.field"
|
|
146
|
+
:class="[{
|
|
147
|
+
'column-sort__icon': true,
|
|
148
|
+
'column-sort__icon--asc': sortOrder === 'asc',
|
|
149
|
+
'column-sort__icon--desc': sortOrder === 'desc',
|
|
150
|
+
}]"
|
|
151
|
+
:icon="sortOrder"
|
|
152
|
+
:style="{
|
|
153
|
+
height: `${rowHeight}px`,
|
|
154
|
+
'line-height': `${rowHeight}px`,
|
|
155
|
+
visibility: !!sortOrder ? hidden : true,
|
|
156
|
+
}"
|
|
157
|
+
/>
|
|
158
|
+
</template>
|
|
126
159
|
</span>
|
|
127
160
|
</span>
|
|
128
161
|
<!-- Column Resize -->
|
|
@@ -598,6 +631,7 @@ export default {
|
|
|
598
631
|
|
|
599
632
|
const {
|
|
600
633
|
setColumnSetting,
|
|
634
|
+
initColumnSettingInfo,
|
|
601
635
|
onApplyColumn,
|
|
602
636
|
setColumnHidden,
|
|
603
637
|
} = columnSettingEvent({
|
|
@@ -633,6 +667,7 @@ export default {
|
|
|
633
667
|
() => {
|
|
634
668
|
sortInfo.isSorting = false;
|
|
635
669
|
sortInfo.sortField = '';
|
|
670
|
+
initColumnSettingInfo();
|
|
636
671
|
setSort();
|
|
637
672
|
}, { deep: true },
|
|
638
673
|
);
|
|
@@ -900,6 +900,13 @@ export const columnSettingEvent = (params) => {
|
|
|
900
900
|
const setColumnSetting = () => {
|
|
901
901
|
columnSettingInfo.isShowColumnSetting = true;
|
|
902
902
|
};
|
|
903
|
+
const initColumnSettingInfo = () => {
|
|
904
|
+
stores.filteredColumns.length = 0;
|
|
905
|
+
columnSettingInfo.isShowColumnSetting = false;
|
|
906
|
+
columnSettingInfo.isFilteringColumn = false;
|
|
907
|
+
columnSettingInfo.visibleColumnIdx = [];
|
|
908
|
+
columnSettingInfo.hiddenColumn = '';
|
|
909
|
+
};
|
|
903
910
|
const setFilteringColumn = () => {
|
|
904
911
|
columnSettingInfo.visibleColumnIdx = stores.filteredColumns.map(column => column.index);
|
|
905
912
|
|
|
@@ -919,10 +926,14 @@ export const columnSettingEvent = (params) => {
|
|
|
919
926
|
const setColumnHidden = (val) => {
|
|
920
927
|
const columns = columnSettingInfo.isFilteringColumn
|
|
921
928
|
? stores.filteredColumns : stores.originColumns;
|
|
929
|
+
|
|
930
|
+
if (columns.length === 1) {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
922
933
|
stores.filteredColumns = columns.filter(column => column.field !== val);
|
|
923
934
|
columnSettingInfo.hiddenColumn = val;
|
|
924
935
|
setFilteringColumn();
|
|
925
936
|
};
|
|
926
937
|
|
|
927
|
-
return { setColumnSetting, onApplyColumn, setColumnHidden };
|
|
938
|
+
return { setColumnSetting, initColumnSettingInfo, onApplyColumn, setColumnHidden };
|
|
928
939
|
};
|