vueless 0.0.683 → 0.0.685
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
package/ui.data-table/UTable.vue
CHANGED
|
@@ -406,6 +406,20 @@ function onToggleExpand(row: Row, expanded: boolean) {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
+
function isRowSelectedWithin(rowIndex: number) {
|
|
410
|
+
const prevRow = sortedRows.value[rowIndex - 1];
|
|
411
|
+
const isPrevRowSelected = prevRow && selectedRows.value.find((rowId) => rowId === prevRow.id);
|
|
412
|
+
const isRowsSelected = selectedRows.value.find(
|
|
413
|
+
(rowId) => rowId === sortedRows.value[rowIndex].id,
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
if (prevRow) {
|
|
417
|
+
return isPrevRowSelected && isRowsSelected;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return isRowsSelected;
|
|
421
|
+
}
|
|
422
|
+
|
|
409
423
|
defineExpose({
|
|
410
424
|
/**
|
|
411
425
|
* Allows to clear selected rows.
|
|
@@ -438,6 +452,7 @@ const {
|
|
|
438
452
|
bodyRowBeforeCellAttrs,
|
|
439
453
|
footerAttrs,
|
|
440
454
|
bodyRowDateDividerAttrs,
|
|
455
|
+
bodyRowCheckedDateDividerAttrs,
|
|
441
456
|
headerCellBaseAttrs,
|
|
442
457
|
headerCellCheckboxAttrs,
|
|
443
458
|
headerActionsCheckboxAttrs,
|
|
@@ -446,6 +461,7 @@ const {
|
|
|
446
461
|
headerCounterAttrs,
|
|
447
462
|
bodyEmptyStateAttrs,
|
|
448
463
|
bodyDateDividerAttrs,
|
|
464
|
+
bodySelectedDateDividerAttrs,
|
|
449
465
|
bodyCellDateDividerAttrs,
|
|
450
466
|
headerActionsCounterAttrs,
|
|
451
467
|
stickyHeaderCounterAttrs,
|
|
@@ -666,7 +682,10 @@ const {
|
|
|
666
682
|
</td>
|
|
667
683
|
</tr>
|
|
668
684
|
|
|
669
|
-
<tr
|
|
685
|
+
<tr
|
|
686
|
+
v-if="isShownDateDivider(rowIndex) && !isRowSelectedWithin(rowIndex) && row.rowDate"
|
|
687
|
+
v-bind="bodyRowDateDividerAttrs"
|
|
688
|
+
>
|
|
670
689
|
<td v-bind="bodyCellDateDividerAttrs" :colspan="colsCount">
|
|
671
690
|
<UDivider
|
|
672
691
|
size="xs"
|
|
@@ -676,6 +695,19 @@ const {
|
|
|
676
695
|
</td>
|
|
677
696
|
</tr>
|
|
678
697
|
|
|
698
|
+
<tr
|
|
699
|
+
v-if="isShownDateDivider(rowIndex) && isRowSelectedWithin(rowIndex) && row.rowDate"
|
|
700
|
+
v-bind="bodyRowCheckedDateDividerAttrs"
|
|
701
|
+
>
|
|
702
|
+
<td v-bind="bodyCellDateDividerAttrs" :colspan="colsCount">
|
|
703
|
+
<UDivider
|
|
704
|
+
size="xs"
|
|
705
|
+
:label="getDateDividerLabel(row.rowDate)"
|
|
706
|
+
v-bind="bodySelectedDateDividerAttrs"
|
|
707
|
+
/>
|
|
708
|
+
</td>
|
|
709
|
+
</tr>
|
|
710
|
+
|
|
679
711
|
<UTableRow
|
|
680
712
|
v-model:selected-rows="selectedRows"
|
|
681
713
|
:selectable="selectable"
|
package/ui.data-table/config.ts
CHANGED
|
@@ -50,6 +50,7 @@ export default /*tw*/ {
|
|
|
50
50
|
bodyRowBeforeCell: "{>bodyCellBase} py-1",
|
|
51
51
|
bodyRowAfter: "!p-0",
|
|
52
52
|
bodyRowDateDivider: "",
|
|
53
|
+
bodyRowCheckedDateDivider: "{>bodyRowChecked} {>bodyRowChecked}",
|
|
53
54
|
bodyCellBase: {
|
|
54
55
|
base: "p-4 truncate align-top",
|
|
55
56
|
variants: {
|
|
@@ -78,6 +79,10 @@ export default /*tw*/ {
|
|
|
78
79
|
base: "{UDivider}",
|
|
79
80
|
label: "py-0",
|
|
80
81
|
},
|
|
82
|
+
bodySelectedDateDivider: {
|
|
83
|
+
base: "{>bodyDateDivider}",
|
|
84
|
+
label: "bg-gray-200 transition",
|
|
85
|
+
},
|
|
81
86
|
bodyEmptyState: "{UEmpty} my-8",
|
|
82
87
|
footer: {
|
|
83
88
|
base: "group/footer border-t border-solid border-gray-200",
|
|
@@ -261,7 +261,10 @@ function getDatePeriodState(date: DatePeriodRange) {
|
|
|
261
261
|
</div>
|
|
262
262
|
|
|
263
263
|
<div v-if="isDatePeriodOutOfRange" v-bind="attrs.periodDateListAttrs.value">
|
|
264
|
-
<template
|
|
264
|
+
<template
|
|
265
|
+
v-for="date in periodDateList"
|
|
266
|
+
:key="date.title + date.startRange.toISOString() + date.endRange.toISOString()"
|
|
267
|
+
>
|
|
265
268
|
<UButton
|
|
266
269
|
v-if="getDatePeriodState(date).isSelected && getDatePeriodState(date).isCurrentDate"
|
|
267
270
|
filled
|