mediacube-ui 0.1.343 → 0.1.345
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/patterns/McTable/McTable/McTable.vue +26 -34
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.345](https://github.com/MediaCubeCo/mcui/compare/v0.1.344...v0.1.345) (2024-12-10)
|
|
6
|
+
|
|
7
|
+
### [0.1.344](https://github.com/MediaCubeCo/mcui/compare/v0.1.343...v0.1.344) (2024-12-09)
|
|
8
|
+
|
|
5
9
|
### [0.1.343](https://github.com/MediaCubeCo/mcui/compare/v0.1.342...v0.1.343) (2024-12-06)
|
|
6
10
|
|
|
7
11
|
### [0.1.342](https://github.com/MediaCubeCo/mcui/compare/v0.1.341...v0.1.342) (2024-11-29)
|
package/package.json
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
import noTableDataIcon from '../../../assets/img/no_table_data.png'
|
|
57
57
|
import _throttle from 'lodash/throttle'
|
|
58
58
|
import _isEmpty from 'lodash/isEmpty'
|
|
59
|
+
import _isEqual from 'lodash/isEqual'
|
|
59
60
|
|
|
60
61
|
import McTitle from '../../../elements/McTitle/McTitle'
|
|
61
62
|
import McSvgIcon from '../../../elements/McSvgIcon/McSvgIcon'
|
|
@@ -317,17 +318,14 @@ export default {
|
|
|
317
318
|
return !this.scrollable && this.hasMore
|
|
318
319
|
},
|
|
319
320
|
canShowFooter() {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return false
|
|
328
|
-
}
|
|
321
|
+
switch (this.footerInfo) {
|
|
322
|
+
case 'total':
|
|
323
|
+
return true
|
|
324
|
+
case 'loaded':
|
|
325
|
+
return !this.hasMore && !this.$attrs.loading && !!this.items.length
|
|
326
|
+
default:
|
|
327
|
+
return false
|
|
329
328
|
}
|
|
330
|
-
return !!this.items.length
|
|
331
329
|
},
|
|
332
330
|
tag() {
|
|
333
331
|
return `vxe-${this.componentTag}`
|
|
@@ -343,7 +341,7 @@ export default {
|
|
|
343
341
|
},
|
|
344
342
|
wrapperStyles() {
|
|
345
343
|
return {
|
|
346
|
-
width:
|
|
344
|
+
width: 'auto',
|
|
347
345
|
height: this.$attrs.height ? this.getFixedHeight(this.$attrs.height) : 'auto',
|
|
348
346
|
'max-height': this.$attrs['max-height'] ? this.getFixedHeight(this.$attrs['max-height']) : 'none',
|
|
349
347
|
}
|
|
@@ -391,9 +389,14 @@ export default {
|
|
|
391
389
|
deep: true,
|
|
392
390
|
},
|
|
393
391
|
items: {
|
|
394
|
-
handler: async function(newVal) {
|
|
395
|
-
|
|
396
|
-
newVal
|
|
392
|
+
handler: async function(newVal, oldVal) {
|
|
393
|
+
if (_isEqual(newVal, oldVal)) return
|
|
394
|
+
if (newVal.length !== oldVal.length) {
|
|
395
|
+
newVal && (await this.loadData(true))
|
|
396
|
+
} else {
|
|
397
|
+
newVal && (await this.setFirstColsWidth())
|
|
398
|
+
await this.reloadData()
|
|
399
|
+
}
|
|
397
400
|
},
|
|
398
401
|
deep: true,
|
|
399
402
|
},
|
|
@@ -427,8 +430,8 @@ export default {
|
|
|
427
430
|
reloadData() {
|
|
428
431
|
this.$refs.xTable.reloadData(this.items)
|
|
429
432
|
},
|
|
430
|
-
updateData() {
|
|
431
|
-
this.$refs.xTable.updateData()
|
|
433
|
+
async updateData() {
|
|
434
|
+
await this.$refs.xTable.updateData()
|
|
432
435
|
},
|
|
433
436
|
checkOccupancy() {
|
|
434
437
|
if (!this.$refs.xTable || !this.items?.length) return
|
|
@@ -516,29 +519,14 @@ export default {
|
|
|
516
519
|
toggleColumns(val) {
|
|
517
520
|
if (val) {
|
|
518
521
|
const columns = this.$refs.xTable.getColumns()
|
|
519
|
-
|
|
520
|
-
const hideColumns = columns.filter((col, i) => {
|
|
521
|
-
const isFixedCol = col.fixed === 'left'
|
|
522
|
-
/**
|
|
523
|
-
* Скрываем все столбцы кроме фиксированного и его соседа, чтобы не было рассинхрона при выходе из карточки
|
|
524
|
-
* т.к. когда остается 1 столбец, то фикс - размаунтится, а потом при выходе из карточки перерендеривается
|
|
525
|
-
* и скроллит в самый верх
|
|
526
|
-
* */
|
|
527
|
-
if (isFixedCol) fixedColNeigbhorIndex = i + 1
|
|
528
|
-
switch (true) {
|
|
529
|
-
case i === fixedColNeigbhorIndex:
|
|
530
|
-
return
|
|
531
|
-
default:
|
|
532
|
-
return !isFixedCol
|
|
533
|
-
}
|
|
534
|
-
})
|
|
522
|
+
const hideColumns = columns.filter(col => col.fixed !== 'left')
|
|
535
523
|
hideColumns.forEach(col => (col.visible = false))
|
|
536
524
|
this.$refs.xTable.refreshColumn()
|
|
537
525
|
} else {
|
|
538
526
|
this.$refs.xTable.resetColumn()
|
|
539
527
|
}
|
|
540
|
-
|
|
541
|
-
|
|
528
|
+
this.$refs.xTable.recalculate()
|
|
529
|
+
this.$refs.xTable.syncData() // Синхронит данные таблиц (фикс колонка === отдельная таблица)
|
|
542
530
|
this.checkHorizontalScroll()
|
|
543
531
|
},
|
|
544
532
|
getFixedHeight(val) {
|
|
@@ -696,6 +684,10 @@ export default {
|
|
|
696
684
|
.vxe-table--body-wrapper,
|
|
697
685
|
.vxe-table--footer-wrapper {
|
|
698
686
|
overflow-x: hidden;
|
|
687
|
+
width: fit-content;
|
|
688
|
+
}
|
|
689
|
+
.vxe-table--footer {
|
|
690
|
+
display: none;
|
|
699
691
|
}
|
|
700
692
|
}
|
|
701
693
|
&--clickable {
|