@rotki/ui-library 2.25.1 → 2.26.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/components/date-time-picker/RuiDateTimePicker.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/date-time-picker/RuiDateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-styles.d.ts +6 -0
- package/dist/components/forms/auto-complete/RuiAutoComplete.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/auto-complete/auto-complete-styles.d.ts +6 -0
- package/dist/components/forms/category-picker/category-picker-styles.d.ts +6 -0
- package/dist/components/forms/select/RuiMenuSelect.js.map +1 -1
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/forms/select/RuiMenuSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/forms/select/menu-select-styles.d.ts +6 -0
- package/dist/components/forms/text-input-styles.d.ts +3 -0
- package/dist/components/forms/text-input-styles.js +3 -1
- package/dist/components/forms/text-input-styles.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/overlays/menu/RuiMenu.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/components/overlays/menu/RuiMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiDataTable.js.map +1 -1
- package/dist/components/tables/RuiDataTable.vue.d.ts +12 -1
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js +71 -17
- package/dist/components/tables/RuiDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/tables/RuiTableHead.js.map +1 -1
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js +38 -13
- package/dist/components/tables/RuiTableHead.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.js.map +1 -1
- package/dist/components/tables/RuiTablePagination.vue.d.ts +3 -3
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js +65 -14
- package/dist/components/tables/RuiTablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableBody.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableBody.vue.d.ts +7 -1
- package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js +45 -9
- package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableCell.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js +13 -2
- package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableErrorRow.js +7 -0
- package/dist/components/tables/data-table/RuiDataTableErrorRow.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableErrorRow.vue.d.ts +21 -0
- package/dist/components/tables/data-table/RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/tables/data-table/RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js +12 -1
- package/dist/components/tables/data-table/RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableGroupRow.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js +52 -20
- package/dist/components/tables/data-table/RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableRow.js.map +1 -1
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js +29 -14
- package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tables/data-table/context.d.ts +10 -0
- package/dist/components/tables/data-table/context.js +2 -0
- package/dist/components/tables/data-table/context.js.map +1 -1
- package/dist/components/tables/data-table-styles.d.ts +15 -9
- package/dist/components/tables/data-table-styles.js +29 -6
- package/dist/components/tables/data-table-styles.js.map +1 -1
- package/dist/components/tables/table-props.d.ts +1 -2
- package/dist/components/tables/table-props.js +2 -10
- package/dist/components/tables/table-props.js.map +1 -1
- package/dist/components/tables/use-pagination-navigation.js +1 -1
- package/dist/components/tables/use-pagination-navigation.js.map +1 -1
- package/dist/composables/sticky-header.d.ts +0 -1
- package/dist/composables/sticky-header.js +56 -8
- package/dist/composables/sticky-header.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/library-icons.json +1 -1
- package/dist/style.css +115 -38
- package/dist/web-types.json +139 -3
- package/package.json +1 -1
package/dist/components/tables/data-table/RuiDataTableBody.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,26 +1,62 @@
|
|
|
1
1
|
import { useDataTableColumns, useDataTableRowIdentity, useDataTableStyling } from "./context.js";
|
|
2
2
|
import RuiDataTableEmptyRow_default from "./RuiDataTableEmptyRow.js";
|
|
3
|
+
import RuiDataTableErrorRow_default from "./RuiDataTableErrorRow.js";
|
|
3
4
|
import RuiDataTableGroupRow_default from "./RuiDataTableGroupRow.js";
|
|
4
5
|
import RuiDataTableLoadingRow_default from "./RuiDataTableLoadingRow.js";
|
|
5
6
|
import RuiDataTableRow_default from "./RuiDataTableRow.js";
|
|
6
7
|
import { isRow } from "../../../composables/tables/data-table/types.js";
|
|
7
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createSlots, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, unref, withCtx } from "vue";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createSlots, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, unref, withCtx } from "vue";
|
|
8
9
|
//#region src/components/tables/data-table/RuiDataTableBody.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var _hoisted_1 = ["data-stale"];
|
|
9
11
|
var RuiDataTableBody_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
10
12
|
__name: "RuiDataTableBody",
|
|
11
13
|
props: {
|
|
12
14
|
filtered: {},
|
|
13
15
|
loading: { type: Boolean },
|
|
14
16
|
noData: { type: Boolean },
|
|
15
|
-
empty: {}
|
|
17
|
+
empty: {},
|
|
18
|
+
error: {},
|
|
19
|
+
errorTitle: {},
|
|
20
|
+
retryText: {}
|
|
16
21
|
},
|
|
17
|
-
|
|
22
|
+
emits: ["retry"],
|
|
23
|
+
setup(__props, { emit: __emit }) {
|
|
24
|
+
const emit = __emit;
|
|
18
25
|
const { classes, colspan } = useDataTableStyling();
|
|
19
26
|
const { itemSlotKeys } = useDataTableColumns();
|
|
20
27
|
const { getRowId } = useDataTableRowIdentity();
|
|
28
|
+
/**
|
|
29
|
+
* Loading outranks a failure, which outranks the empty state: rows that did
|
|
30
|
+
* not arrive are not rows that are not there. Rows kept from an earlier read
|
|
31
|
+
* stay below the error.
|
|
32
|
+
*/
|
|
33
|
+
const showError = computed(() => !!__props.error && !__props.loading);
|
|
34
|
+
/**
|
|
35
|
+
* Rows shown while a read is in flight are the previous result, so they dim
|
|
36
|
+
* until it lands. An empty table shows its loading row instead, undimmed.
|
|
37
|
+
*/
|
|
38
|
+
const stale = computed(() => __props.loading && !__props.noData);
|
|
21
39
|
return (_ctx, _cache) => {
|
|
22
|
-
return openBlock(), createElementBlock("tbody", {
|
|
40
|
+
return openBlock(), createElementBlock("tbody", {
|
|
41
|
+
class: normalizeClass(["transition-opacity duration-150", [unref(classes).tbody, { "opacity-50": unref(stale) }]]),
|
|
42
|
+
"data-stale": unref(stale) || void 0
|
|
43
|
+
}, [
|
|
23
44
|
_ctx.$slots["body.prepend"] ? renderSlot(_ctx.$slots, "body.prepend", { colspan: unref(colspan) }, void 0, void 0, 0) : createCommentVNode("", true),
|
|
45
|
+
unref(showError) ? (openBlock(), createBlock(RuiDataTableErrorRow_default, {
|
|
46
|
+
key: 1,
|
|
47
|
+
message: __props.error,
|
|
48
|
+
title: __props.errorTitle,
|
|
49
|
+
"retry-text": __props.retryText,
|
|
50
|
+
onRetry: _cache[0] || (_cache[0] = ($event) => emit("retry"))
|
|
51
|
+
}, createSlots({ _: 2 }, [_ctx.$slots.error ? {
|
|
52
|
+
name: "error",
|
|
53
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "error")]),
|
|
54
|
+
key: "0"
|
|
55
|
+
} : void 0]), 1032, [
|
|
56
|
+
"message",
|
|
57
|
+
"title",
|
|
58
|
+
"retry-text"
|
|
59
|
+
])) : createCommentVNode("", true),
|
|
24
60
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.filtered, (row, index) => {
|
|
25
61
|
return openBlock(), createElementBlock(Fragment, null, [!unref(isRow)(row) ? (openBlock(), createBlock(RuiDataTableGroupRow_default, {
|
|
26
62
|
key: `group-${row.identifier}`,
|
|
@@ -48,9 +84,9 @@ var RuiDataTableBody_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
48
84
|
key: "0"
|
|
49
85
|
} : void 0]), 1032, ["row", "index"]))], 64);
|
|
50
86
|
}), 256)),
|
|
51
|
-
__props.loading && __props.noData ? (openBlock(), createBlock(RuiDataTableLoadingRow_default, { key:
|
|
52
|
-
__props.noData && __props.empty && !__props.loading ? (openBlock(), createBlock(RuiDataTableEmptyRow_default, {
|
|
53
|
-
key:
|
|
87
|
+
__props.loading && __props.noData ? (openBlock(), createBlock(RuiDataTableLoadingRow_default, { key: 2 })) : createCommentVNode("", true),
|
|
88
|
+
__props.noData && __props.empty && !__props.loading && !unref(showError) ? (openBlock(), createBlock(RuiDataTableEmptyRow_default, {
|
|
89
|
+
key: 3,
|
|
54
90
|
empty: __props.empty
|
|
55
91
|
}, createSlots({ _: 2 }, [_ctx.$slots["no-data"] ? {
|
|
56
92
|
name: "no-data",
|
|
@@ -61,8 +97,8 @@ var RuiDataTableBody_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
61
97
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty-description")]),
|
|
62
98
|
key: "1"
|
|
63
99
|
} : void 0]), 1032, ["empty"])) : createCommentVNode("", true),
|
|
64
|
-
_ctx.$slots["body.append"] ? renderSlot(_ctx.$slots, "body.append", { colspan: unref(colspan) }, void 0, void 0,
|
|
65
|
-
],
|
|
100
|
+
_ctx.$slots["body.append"] ? renderSlot(_ctx.$slots, "body.append", { colspan: unref(colspan) }, void 0, void 0, 4) : createCommentVNode("", true)
|
|
101
|
+
], 10, _hoisted_1);
|
|
66
102
|
};
|
|
67
103
|
}
|
|
68
104
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableBody.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../src/components/tables/data-table/RuiDataTableBody.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableRowIdentity, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableEmptyRow from '@/components/tables/data-table/RuiDataTableEmptyRow.vue';\nimport RuiDataTableGroupRow from '@/components/tables/data-table/RuiDataTableGroupRow.vue';\nimport RuiDataTableLoadingRow from '@/components/tables/data-table/RuiDataTableLoadingRow.vue';\nimport RuiDataTableRow from '@/components/tables/data-table/RuiDataTableRow.vue';\nimport { type GroupHeader, isRow } from '@/composables/tables/data-table/types';\n\
|
|
1
|
+
{"version":3,"file":"RuiDataTableBody.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../src/components/tables/data-table/RuiDataTableBody.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableRowIdentity, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableEmptyRow from '@/components/tables/data-table/RuiDataTableEmptyRow.vue';\nimport RuiDataTableErrorRow from '@/components/tables/data-table/RuiDataTableErrorRow.vue';\nimport RuiDataTableGroupRow from '@/components/tables/data-table/RuiDataTableGroupRow.vue';\nimport RuiDataTableLoadingRow from '@/components/tables/data-table/RuiDataTableLoadingRow.vue';\nimport RuiDataTableRow from '@/components/tables/data-table/RuiDataTableRow.vue';\nimport { type GroupHeader, isRow } from '@/composables/tables/data-table/types';\n\nconst { error, loading, noData } = defineProps<{\n filtered: (T | GroupHeader<T>)[];\n loading: boolean;\n noData: boolean;\n empty: { label?: string; description?: string };\n error: string;\n errorTitle: string;\n retryText: string;\n}>();\n\nconst emit = defineEmits<{\n retry: [];\n}>();\n\ndefineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'body.prepend'?: (props: { colspan: number }) => any;\n 'body.append'?: (props: { colspan: number }) => any;\n 'group.header'?: (props: {\n colspan: number;\n header: GroupHeader<T>;\n isOpen: boolean;\n toggle: () => void;\n }) => any;\n 'group.header.content'?: (props: { header: GroupHeader<T>; groupKey: string }) => any;\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n 'no-data'?: () => any;\n 'empty-description'?: () => any;\n 'error'?: () => any;\n }\n>>();\n\nconst { classes, colspan } = useDataTableStyling();\nconst { itemSlotKeys } = useDataTableColumns<T>();\nconst { getRowId } = useDataTableRowIdentity<T>();\n\n/**\n * Loading outranks a failure, which outranks the empty state: rows that did\n * not arrive are not rows that are not there. Rows kept from an earlier read\n * stay below the error.\n */\nconst showError = computed<boolean>(() => !!error && !loading);\n\n/**\n * Rows shown while a read is in flight are the previous result, so they dim\n * until it lands. An empty table shows its loading row instead, undimmed.\n */\nconst stale = computed<boolean>(() => loading && !noData);\n</script>\n\n<template>\n <tbody\n class=\"transition-opacity duration-150\"\n :class=\"[classes.tbody, { 'opacity-50': stale }]\"\n :data-stale=\"stale || undefined\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n v-if=\"$slots['body.prepend']\"\n :colspan=\"colspan\"\n name=\"body.prepend\"\n />\n <RuiDataTableErrorRow\n v-if=\"showError\"\n :message=\"error\"\n :title=\"errorTitle\"\n :retry-text=\"retryText\"\n @retry=\"emit('retry')\"\n >\n <template\n v-if=\"$slots.error\"\n #error\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot name=\"error\" />\n </template>\n </RuiDataTableErrorRow>\n <template v-for=\"(row, index) in filtered\">\n <RuiDataTableGroupRow\n v-if=\"!isRow(row)\"\n :key=\"`group-${row.identifier}`\"\n :row=\"row\"\n >\n <template\n v-if=\"$slots['group.header']\"\n #group.header=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header\"\n v-bind=\"slotData\"\n />\n </template>\n <template\n v-if=\"$slots['group.header.content']\"\n #group.header.content=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header.content\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableGroupRow>\n <RuiDataTableRow\n v-else\n :key=\"`row-${getRowId(row)}`\"\n :row=\"row\"\n :index=\"index\"\n >\n <template\n v-for=\"key in itemSlotKeys\"\n #[`item.${key}`]=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n :name=\"`item.${key}`\"\n v-bind=\"slotData\"\n />\n </template>\n <template\n v-if=\"$slots['expanded-item']\"\n #expanded-item=\"slotData\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"expanded-item\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableRow>\n </template>\n <RuiDataTableLoadingRow v-if=\"loading && noData\" />\n <RuiDataTableEmptyRow\n v-if=\"noData && empty && !loading && !showError\"\n :empty=\"empty\"\n >\n <template\n v-if=\"$slots['no-data']\"\n #no-data\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot name=\"no-data\" />\n </template>\n <template\n v-if=\"$slots['empty-description']\"\n #empty-description\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot name=\"empty-description\" />\n </template>\n </RuiDataTableEmptyRow>\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n v-if=\"$slots['body.append']\"\n :colspan=\"colspan\"\n name=\"body.append\"\n />\n </tbody>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,OAAO;EAsBb,MAAM,EAAE,SAAS,YAAY,oBAAoB;EACjD,MAAM,EAAE,iBAAiB,oBAAuB;EAChD,MAAM,EAAE,aAAa,wBAA2B;;;;;;EAOhD,MAAM,YAAY,eAAwB,CAAC,CAAC,QAAA,SAAS,CAAC,QAAA,OAAO;;;;;EAM7D,MAAM,QAAQ,eAAwB,QAAA,WAAW,CAAC,QAAA,MAAM;;GAItD,OAAA,UAAA,GAAA,mBA2GQ,SAAA;IA1GN,OAAK,eAAA,CAAC,mCAAiC,CAC9B,MAAA,OAAA,CAAO,CAAC,OAAK,EAAA,cAAkB,MAAA,KAA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setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst { column } = defineProps<{\n column: TableColumn<T>;\n row: T;\n index: number;\n rowId?: T[keyof T];\n}>();\n\ndefineSlots<{\n default?: (props: { column: TableColumn<T>; row: T; index: number }) => any;\n}>();\n\nconst { cellValue, columnAttr, itemSlotKeys } = useDataTableColumns<T>();\nconst { isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { isMobile } = useDataTableStyling();\n\n/**\n * The built-in toggle is only a fallback for a consumer that does not drive\n * the expand column itself. One that provides `#item.expand` owns the decision\n * per row, rendering nothing for a row that cannot expand among them, so an\n * empty slot must not fall back to a toggle they deliberately withheld.\n */\nconst ownsExpandColumn = computed<boolean>(() => itemSlotKeys.has('expand'));\n\nconst mobileLabel = computed<string>(() => {\n const label = column[columnAttr];\n return label === undefined || label === null ? '' : String(label);\n});\nconst showMobileLabel = computed<boolean>(() => get(isMobile) && column.key !== 'expand' && get(mobileLabel).length > 0);\n</script>\n\n<template>\n <td\n :class=\"[\n column.tdClass,\n column.cellClass,\n isMobile ? 'flex items-start justify-between gap-4 text-right' : '',\n ]\"\n :colspan=\"column.colspan ?? 1\"\n :rowspan=\"column.rowspan ?? 1\"\n >\n <span\n v-if=\"showMobileLabel\"\n aria-hidden=\"true\"\n class=\"shrink-0 text-left
|
|
1
|
+
{"version":3,"file":"RuiDataTableCell.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableCell.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst { column, row } = defineProps<{\n column: TableColumn<T>;\n row: T;\n index: number;\n rowId?: T[keyof T];\n}>();\n\ndefineSlots<{\n default?: (props: { column: TableColumn<T>; row: T; index: number }) => any;\n}>();\n\nconst { cellValue, columnAttr, itemSlotKeys } = useDataTableColumns<T>();\nconst { isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { isMobile } = useDataTableStyling();\n\n/**\n * The built-in toggle is only a fallback for a consumer that does not drive\n * the expand column itself. One that provides `#item.expand` owns the decision\n * per row, rendering nothing for a row that cannot expand among them, so an\n * empty slot must not fall back to a toggle they deliberately withheld.\n */\nconst ownsExpandColumn = computed<boolean>(() => itemSlotKeys.has('expand'));\n\nconst mobileLabel = computed<string>(() => {\n const label = column[columnAttr];\n return label === undefined || label === null ? '' : String(label);\n});\nconst showMobileLabel = computed<boolean>(() => get(isMobile) && column.key !== 'expand' && get(mobileLabel).length > 0);\n\n/** A stacked card shows a placeholder for an empty value rather than a bare label. */\nconst showMobilePlaceholder = computed<boolean>(() => {\n if (!get(showMobileLabel))\n return false;\n const value = cellValue(row, column.key);\n return value === undefined || value === null || value === '';\n});\n</script>\n\n<template>\n <td\n :class=\"[\n column.tdClass,\n column.cellClass,\n isMobile ? 'flex items-start justify-between gap-4 text-right' : '',\n ]\"\n :colspan=\"column.colspan ?? 1\"\n :rowspan=\"column.rowspan ?? 1\"\n >\n <span\n v-if=\"showMobileLabel\"\n aria-hidden=\"true\"\n class=\"shrink-0 text-left text-caption text-rui-text-secondary\"\n data-id=\"cell-label\"\n >\n {{ mobileLabel }}\n </span>\n <div :class=\"isMobile ? 'min-w-0 ml-auto' : 'contents'\">\n <slot\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n >\n <RuiExpandButton\n v-if=\"column.key === 'expand' && !ownsExpandColumn\"\n :expanded=\"rowId !== undefined && isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <span\n v-else-if=\"showMobilePlaceholder\"\n class=\"text-rui-text-disabled\"\n data-id=\"cell-placeholder\"\n >\n –\n </span>\n <template v-else-if=\"column.key !== 'expand'\">\n {{ cellValue(row, column.key) }}\n </template>\n </slot>\n </div>\n </td>\n</template>\n"],"mappings":""}
|
package/dist/components/tables/data-table/RuiDataTableCell.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -7,9 +7,14 @@ var _hoisted_1 = ["colspan", "rowspan"];
|
|
|
7
7
|
var _hoisted_2 = {
|
|
8
8
|
key: 0,
|
|
9
9
|
"aria-hidden": "true",
|
|
10
|
-
class: "shrink-0 text-left
|
|
10
|
+
class: "shrink-0 text-left text-caption text-rui-text-secondary",
|
|
11
11
|
"data-id": "cell-label"
|
|
12
12
|
};
|
|
13
|
+
var _hoisted_3 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "text-rui-text-disabled",
|
|
16
|
+
"data-id": "cell-placeholder"
|
|
17
|
+
};
|
|
13
18
|
var RuiDataTableCell_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14
19
|
__name: "RuiDataTableCell",
|
|
15
20
|
props: {
|
|
@@ -34,6 +39,12 @@ var RuiDataTableCell_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
34
39
|
return label === void 0 || label === null ? "" : String(label);
|
|
35
40
|
});
|
|
36
41
|
const showMobileLabel = computed(() => get(isMobile) && __props.column.key !== "expand" && get(mobileLabel).length > 0);
|
|
42
|
+
/** A stacked card shows a placeholder for an empty value rather than a bare label. */
|
|
43
|
+
const showMobilePlaceholder = computed(() => {
|
|
44
|
+
if (!get(showMobileLabel)) return false;
|
|
45
|
+
const value = cellValue(__props.row, __props.column.key);
|
|
46
|
+
return value === void 0 || value === null || value === "";
|
|
47
|
+
});
|
|
37
48
|
return (_ctx, _cache) => {
|
|
38
49
|
return openBlock(), createElementBlock("td", {
|
|
39
50
|
class: normalizeClass([
|
|
@@ -51,7 +62,7 @@ var RuiDataTableCell_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
51
62
|
key: 0,
|
|
52
63
|
expanded: __props.rowId !== void 0 && unref(isExpanded)(__props.rowId),
|
|
53
64
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(onToggleExpand)(__props.row))
|
|
54
|
-
}, null, 8, ["expanded"])) : __props.column.key !== "expand" ? (openBlock(), createElementBlock(Fragment, { key:
|
|
65
|
+
}, null, 8, ["expanded"])) : unref(showMobilePlaceholder) ? (openBlock(), createElementBlock("span", _hoisted_3, " – ")) : __props.column.key !== "expand" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(unref(cellValue)(__props.row, __props.column.key)), 1)], 64)) : createCommentVNode("", true)])], 2)], 10, _hoisted_1);
|
|
55
66
|
};
|
|
56
67
|
}
|
|
57
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableCell.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst { column } = defineProps<{\n column: TableColumn<T>;\n row: T;\n index: number;\n rowId?: T[keyof T];\n}>();\n\ndefineSlots<{\n default?: (props: { column: TableColumn<T>; row: T; index: number }) => any;\n}>();\n\nconst { cellValue, columnAttr, itemSlotKeys } = useDataTableColumns<T>();\nconst { isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { isMobile } = useDataTableStyling();\n\n/**\n * The built-in toggle is only a fallback for a consumer that does not drive\n * the expand column itself. One that provides `#item.expand` owns the decision\n * per row, rendering nothing for a row that cannot expand among them, so an\n * empty slot must not fall back to a toggle they deliberately withheld.\n */\nconst ownsExpandColumn = computed<boolean>(() => itemSlotKeys.has('expand'));\n\nconst mobileLabel = computed<string>(() => {\n const label = column[columnAttr];\n return label === undefined || label === null ? '' : String(label);\n});\nconst showMobileLabel = computed<boolean>(() => get(isMobile) && column.key !== 'expand' && get(mobileLabel).length > 0);\n</script>\n\n<template>\n <td\n :class=\"[\n column.tdClass,\n column.cellClass,\n isMobile ? 'flex items-start justify-between gap-4 text-right' : '',\n ]\"\n :colspan=\"column.colspan ?? 1\"\n :rowspan=\"column.rowspan ?? 1\"\n >\n <span\n v-if=\"showMobileLabel\"\n aria-hidden=\"true\"\n class=\"shrink-0 text-left
|
|
1
|
+
{"version":3,"file":"RuiDataTableCell.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableCell.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst { column, row } = defineProps<{\n column: TableColumn<T>;\n row: T;\n index: number;\n rowId?: T[keyof T];\n}>();\n\ndefineSlots<{\n default?: (props: { column: TableColumn<T>; row: T; index: number }) => any;\n}>();\n\nconst { cellValue, columnAttr, itemSlotKeys } = useDataTableColumns<T>();\nconst { isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { isMobile } = useDataTableStyling();\n\n/**\n * The built-in toggle is only a fallback for a consumer that does not drive\n * the expand column itself. One that provides `#item.expand` owns the decision\n * per row, rendering nothing for a row that cannot expand among them, so an\n * empty slot must not fall back to a toggle they deliberately withheld.\n */\nconst ownsExpandColumn = computed<boolean>(() => itemSlotKeys.has('expand'));\n\nconst mobileLabel = computed<string>(() => {\n const label = column[columnAttr];\n return label === undefined || label === null ? '' : String(label);\n});\nconst showMobileLabel = computed<boolean>(() => get(isMobile) && column.key !== 'expand' && get(mobileLabel).length > 0);\n\n/** A stacked card shows a placeholder for an empty value rather than a bare label. */\nconst showMobilePlaceholder = computed<boolean>(() => {\n if (!get(showMobileLabel))\n return false;\n const value = cellValue(row, column.key);\n return value === undefined || value === null || value === '';\n});\n</script>\n\n<template>\n <td\n :class=\"[\n column.tdClass,\n column.cellClass,\n isMobile ? 'flex items-start justify-between gap-4 text-right' : '',\n ]\"\n :colspan=\"column.colspan ?? 1\"\n :rowspan=\"column.rowspan ?? 1\"\n >\n <span\n v-if=\"showMobileLabel\"\n aria-hidden=\"true\"\n class=\"shrink-0 text-left text-caption text-rui-text-secondary\"\n data-id=\"cell-label\"\n >\n {{ mobileLabel }}\n </span>\n <div :class=\"isMobile ? 'min-w-0 ml-auto' : 'contents'\">\n <slot\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n >\n <RuiExpandButton\n v-if=\"column.key === 'expand' && !ownsExpandColumn\"\n :expanded=\"rowId !== undefined && isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <span\n v-else-if=\"showMobilePlaceholder\"\n class=\"text-rui-text-disabled\"\n data-id=\"cell-placeholder\"\n >\n –\n </span>\n <template v-else-if=\"column.key !== 'expand'\">\n {{ cellValue(row, column.key) }}\n </template>\n </slot>\n </div>\n </td>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,EAAE,WAAW,YAAY,iBAAiB,oBAAuB;EACvE,MAAM,EAAE,YAAY,mBAAmB,sBAAyB;EAChE,MAAM,EAAE,aAAa,oBAAoB;;;;;;;EAQzC,MAAM,mBAAmB,eAAwB,aAAa,IAAI,QAAQ,CAAC;EAE3E,MAAM,cAAc,eAAuB;GACzC,MAAM,QAAQ,QAAA,OAAO;GACrB,OAAO,UAAU,KAAA,KAAa,UAAU,OAAO,KAAK,OAAO,KAAK;EAClE,CAAC;EACD,MAAM,kBAAkB,eAAwB,IAAI,QAAQ,KAAK,QAAA,OAAO,QAAQ,YAAY,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC;;EAGvH,MAAM,wBAAwB,eAAwB;GACpD,IAAI,CAAC,IAAI,eAAe,GACtB,OAAO;GACT,MAAM,QAAQ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@@
|
|
|
1
|
+
import RuiDataTableErrorRow_vue_vue_type_script_setup_true_lang_default from "./RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/tables/data-table/RuiDataTableErrorRow.vue
|
|
3
|
+
var RuiDataTableErrorRow_default = RuiDataTableErrorRow_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { RuiDataTableErrorRow_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=RuiDataTableErrorRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuiDataTableErrorRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableErrorRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiTableErrorState from '@/components/tables/RuiTableErrorState.vue';\n\ndefineProps<{\n message: string;\n title: string;\n retryText: string;\n}>();\n\nconst emit = defineEmits<{\n retry: [];\n}>();\n\ndefineSlots<{\n error?: () => any;\n}>();\n\nconst { classes, colspan } = useDataTableStyling();\n</script>\n\n<template>\n <tr\n :class=\"classes.trEmpty\"\n data-id=\"row-error\"\n >\n <td\n :class=\"classes.td\"\n :colspan=\"colspan\"\n >\n <slot name=\"error\">\n <RuiTableErrorState\n :action-text=\"retryText\"\n :message=\"message\"\n :title=\"title\"\n @action=\"emit('retry')\"\n />\n </slot>\n </td>\n </tr>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
message: string;
|
|
3
|
+
title: string;
|
|
4
|
+
retryText: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
error?: () => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
retry: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onRetry?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useDataTableStyling } from "./context.js";
|
|
2
|
+
import RuiTableErrorState_default from "../RuiTableErrorState.js";
|
|
3
|
+
import { createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, unref } from "vue";
|
|
4
|
+
//#region src/components/tables/data-table/RuiDataTableErrorRow.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = ["colspan"];
|
|
6
|
+
var RuiDataTableErrorRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
|
+
__name: "RuiDataTableErrorRow",
|
|
8
|
+
props: {
|
|
9
|
+
message: {},
|
|
10
|
+
title: {},
|
|
11
|
+
retryText: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["retry"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const emit = __emit;
|
|
16
|
+
const { classes, colspan } = useDataTableStyling();
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createElementBlock("tr", {
|
|
19
|
+
class: normalizeClass(unref(classes).trEmpty),
|
|
20
|
+
"data-id": "row-error"
|
|
21
|
+
}, [createElementVNode("td", {
|
|
22
|
+
class: normalizeClass(unref(classes).td),
|
|
23
|
+
colspan: unref(colspan)
|
|
24
|
+
}, [renderSlot(_ctx.$slots, "error", {}, () => [createVNode(RuiTableErrorState_default, {
|
|
25
|
+
"action-text": __props.retryText,
|
|
26
|
+
message: __props.message,
|
|
27
|
+
title: __props.title,
|
|
28
|
+
onAction: _cache[0] || (_cache[0] = ($event) => emit("retry"))
|
|
29
|
+
}, null, 8, [
|
|
30
|
+
"action-text",
|
|
31
|
+
"message",
|
|
32
|
+
"title"
|
|
33
|
+
])])], 10, _hoisted_1)], 2);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { RuiDataTableErrorRow_vue_vue_type_script_setup_true_lang_default as default };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuiDataTableErrorRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableErrorRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiTableErrorState from '@/components/tables/RuiTableErrorState.vue';\n\ndefineProps<{\n message: string;\n title: string;\n retryText: string;\n}>();\n\nconst emit = defineEmits<{\n retry: [];\n}>();\n\ndefineSlots<{\n error?: () => any;\n}>();\n\nconst { classes, colspan } = useDataTableStyling();\n</script>\n\n<template>\n <tr\n :class=\"classes.trEmpty\"\n data-id=\"row-error\"\n >\n <td\n :class=\"classes.td\"\n :colspan=\"colspan\"\n >\n <slot name=\"error\">\n <RuiTableErrorState\n :action-text=\"retryText\"\n :message=\"message\"\n :title=\"title\"\n @action=\"emit('retry')\"\n />\n </slot>\n </td>\n </tr>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAUA,MAAM,OAAO;EAQb,MAAM,EAAE,SAAS,YAAY,oBAAoB;;GAI/C,OAAA,UAAA,GAAA,mBAiBK,MAAA;IAhBF,OAAK,eAAE,MAAA,OAAA,CAAO,CAAC,OAAO;IACvB,WAAQ;GAER,GAAA,CAAA,mBAYK,MAAA;IAXF,OAAK,eAAE,MAAA,OAAA,CAAO,CAAC,EAAE;IACjB,SAAS,MAAA,OAAA;GAEV,GAAA,CAAA,WAOO,KAAA,QAAA,SAAA,CAAA,SAAA,CANL,YAKE,4BAAA;IAJC,eAAa,QAAA;IACb,SAAS,QAAA;IACT,OAAO,QAAA;IACP,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableExpandedRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableExpandedRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\n\ndefineProps<{\n row: T;\n index: number;\n}>();\n\ndefineSlots<{\n 'expanded-item': (props: { row: T; index: number }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the expanded content attaches beneath its card: matching side\n * borders and a rounded, bordered bottom edge. It carries no top border, since\n * the parent card's flattened bottom edge is the divider, and `!border-b`\n * defeats the `divide-y-0` on the mobile tbody.\n */\nconst mobileExpandedClass = 'block border-x !border-b border-black/[0.12] dark:border-white/[0.12] rounded-b-lg mb-3 overflow-hidden';\n</script>\n\n<template>\n <tr\n :class=\"[classes.trExpandable, isMobile ? mobileExpandedClass : '']\"\n data-id=\"row-expanded\"\n >\n <td\n :colspan=\"colspan\"\n :class=\"classes.td\"\n >\n <slot\n
|
|
1
|
+
{"version":3,"file":"RuiDataTableExpandedRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableExpandedRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\n\ndefineProps<{\n row: T;\n index: number;\n}>();\n\ndefineSlots<{\n 'expanded-item': (props: { row: T; index: number }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the expanded content attaches beneath its card: matching side\n * borders and a rounded, bordered bottom edge. It carries no top border, since\n * the parent card's flattened bottom edge is the divider, and `!border-b`\n * defeats the `divide-y-0` on the mobile tbody.\n */\nconst mobileExpandedClass = 'block border-x !border-b border-black/[0.12] dark:border-white/[0.12] rounded-b-lg mb-3 overflow-hidden';\n\n/**\n * Caps the panel to the table's visible width, less the cell's 16px sides, and\n * pins it to the left edge while the table scrolls sideways. Wider content,\n * such as a nested table, scrolls inside its own scroller. Where the table\n * resets `--rui-table-viewport` the calc is invalid and the width stays auto.\n */\nconst panelStyle = { width: 'calc(var(--rui-table-viewport) - 2rem)' };\n</script>\n\n<template>\n <tr\n :class=\"[classes.trExpandable, isMobile ? mobileExpandedClass : '']\"\n data-id=\"row-expanded\"\n >\n <td\n :colspan=\"colspan\"\n :class=\"classes.td\"\n >\n <div\n :class=\"{ 'sticky left-4': !isMobile }\"\n :style=\"panelStyle\"\n data-id=\"expanded-panel\"\n >\n <slot\n name=\"expanded-item\"\n :row=\"row\"\n :index=\"index\"\n />\n </div>\n </td>\n </tr>\n</template>\n"],"mappings":""}
|
|
@@ -3,6 +3,12 @@ import { createElementBlock, createElementVNode, defineComponent, normalizeClass
|
|
|
3
3
|
//#region src/components/tables/data-table/RuiDataTableExpandedRow.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = ["colspan"];
|
|
5
5
|
var mobileExpandedClass = "block border-x !border-b border-black/[0.12] dark:border-white/[0.12] rounded-b-lg mb-3 overflow-hidden";
|
|
6
|
+
/**
|
|
7
|
+
* Caps the panel to the table's visible width, less the cell's 16px sides, and
|
|
8
|
+
* pins it to the left edge while the table scrolls sideways. Wider content,
|
|
9
|
+
* such as a nested table, scrolls inside its own scroller. Where the table
|
|
10
|
+
* resets `--rui-table-viewport` the calc is invalid and the width stays auto.
|
|
11
|
+
*/
|
|
6
12
|
var RuiDataTableExpandedRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
13
|
__name: "RuiDataTableExpandedRow",
|
|
8
14
|
props: {
|
|
@@ -17,6 +23,7 @@ var RuiDataTableExpandedRow_vue_vue_type_script_setup_true_lang_default = /*@__P
|
|
|
17
23
|
* the parent card's flattened bottom edge is the divider, and `!border-b`
|
|
18
24
|
* defeats the `divide-y-0` on the mobile tbody.
|
|
19
25
|
*/
|
|
26
|
+
const panelStyle = { width: "calc(var(--rui-table-viewport) - 2rem)" };
|
|
20
27
|
return (_ctx, _cache) => {
|
|
21
28
|
return openBlock(), createElementBlock("tr", {
|
|
22
29
|
class: normalizeClass([unref(classes).trExpandable, unref(isMobile) ? mobileExpandedClass : ""]),
|
|
@@ -24,10 +31,14 @@ var RuiDataTableExpandedRow_vue_vue_type_script_setup_true_lang_default = /*@__P
|
|
|
24
31
|
}, [createElementVNode("td", {
|
|
25
32
|
colspan: unref(colspan),
|
|
26
33
|
class: normalizeClass(unref(classes).td)
|
|
34
|
+
}, [createElementVNode("div", {
|
|
35
|
+
class: normalizeClass({ "sticky left-4": !unref(isMobile) }),
|
|
36
|
+
style: panelStyle,
|
|
37
|
+
"data-id": "expanded-panel"
|
|
27
38
|
}, [renderSlot(_ctx.$slots, "expanded-item", {
|
|
28
39
|
row: __props.row,
|
|
29
40
|
index: __props.index
|
|
30
|
-
})], 10, _hoisted_1)], 2);
|
|
41
|
+
})], 2)], 10, _hoisted_1)], 2);
|
|
31
42
|
};
|
|
32
43
|
}
|
|
33
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableExpandedRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\n\ndefineProps<{\n row: T;\n index: number;\n}>();\n\ndefineSlots<{\n 'expanded-item': (props: { row: T; index: number }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the expanded content attaches beneath its card: matching side\n * borders and a rounded, bordered bottom edge. It carries no top border, since\n * the parent card's flattened bottom edge is the divider, and `!border-b`\n * defeats the `divide-y-0` on the mobile tbody.\n */\nconst mobileExpandedClass = 'block border-x !border-b border-black/[0.12] dark:border-white/[0.12] rounded-b-lg mb-3 overflow-hidden';\n</script>\n\n<template>\n <tr\n :class=\"[classes.trExpandable, isMobile ? mobileExpandedClass : '']\"\n data-id=\"row-expanded\"\n >\n <td\n :colspan=\"colspan\"\n :class=\"classes.td\"\n >\n <slot\n
|
|
1
|
+
{"version":3,"file":"RuiDataTableExpandedRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableExpandedRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport { useDataTableStyling } from '@/components/tables/data-table/context';\n\ndefineProps<{\n row: T;\n index: number;\n}>();\n\ndefineSlots<{\n 'expanded-item': (props: { row: T; index: number }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the expanded content attaches beneath its card: matching side\n * borders and a rounded, bordered bottom edge. It carries no top border, since\n * the parent card's flattened bottom edge is the divider, and `!border-b`\n * defeats the `divide-y-0` on the mobile tbody.\n */\nconst mobileExpandedClass = 'block border-x !border-b border-black/[0.12] dark:border-white/[0.12] rounded-b-lg mb-3 overflow-hidden';\n\n/**\n * Caps the panel to the table's visible width, less the cell's 16px sides, and\n * pins it to the left edge while the table scrolls sideways. Wider content,\n * such as a nested table, scrolls inside its own scroller. Where the table\n * resets `--rui-table-viewport` the calc is invalid and the width stays auto.\n */\nconst panelStyle = { width: 'calc(var(--rui-table-viewport) - 2rem)' };\n</script>\n\n<template>\n <tr\n :class=\"[classes.trExpandable, isMobile ? mobileExpandedClass : '']\"\n data-id=\"row-expanded\"\n >\n <td\n :colspan=\"colspan\"\n :class=\"classes.td\"\n >\n <div\n :class=\"{ 'sticky left-4': !isMobile }\"\n :style=\"panelStyle\"\n data-id=\"expanded-panel\"\n >\n <slot\n name=\"expanded-item\"\n :row=\"row\"\n :index=\"index\"\n />\n </div>\n </td>\n </tr>\n</template>\n"],"mappings":";;;;AAoBA,IAAM,sBAAsB;;;;;;;;;;;;;;EAR5B,MAAM,EAAE,SAAS,SAAS,aAAa,oBAAoB;;;;;;;EAgB3D,MAAM,aAAa,EAAE,OAAO,yCAAyC;;GAInE,OAAA,UAAA,GAAA,mBAoBK,MAAA;IAnBF,OAAK,eAAA,CAAG,MAAA,OAAA,CAAO,CAAC,cAAc,MAAA,QAAA,IAAW,sBAAmB,EAAA,CAAA;IAC7D,WAAQ;GAER,GAAA,CAAA,mBAeK,MAAA;IAdF,SAAS,MAAA,OAAA;IACT,OAAK,eAAE,MAAA,OAAA,CAAO,CAAC,EAAE;GAElB,GAAA,CAAA,mBAUM,OAAA;IATH,OAAK,eAAA,EAAA,iBAAA,CAAsB,MAAA,QAAA,EAAQ,CAAA;IACnC,OAAO;IACR,WAAQ;GAER,GAAA,CAAA,WAIE,KAAA,QAAA,iBAAA;IAFC,KAAK,QAAA;IACL,OAAO,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableGroupRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableGroupRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiTooltip from '@/components/overlays/tooltip/RuiTooltip.vue';\nimport { useDataTableGrouping, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\nimport { GroupExpandButtonPosition } from '@/components/tables/table-props';\n\nconst { row } = defineProps<{\n row: GroupHeader<T>;\n}>();\n\ndefineSlots<{\n 'group.header'?: (props: {\n colspan: number;\n header: GroupHeader<T>;\n isOpen: boolean;\n toggle: () => void;\n }) => any;\n 'group.header.content'?: (props: { header: GroupHeader<T>; groupKey: string }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the group header reads as a rounded section label, separated from\n * the previous group's cards above and its own below, aligned to the card\n * content padding.\n */\nconst mobileGroupClass = 'mt-6 first:mt-0 mb-2 rounded-lg';\nconst {\n groupExpandButtonPosition,\n groupKey,\n isExpandedGroup,\n onCopyGroup,\n onToggleExpandGroup,\n onUngroup,\n} = useDataTableGrouping<T>();\n\nconst isOpen = computed<boolean>(() => isExpandedGroup(row.group));\n</script>\n\n<template>\n <tr\n :class=\"[classes.trGroup, isMobile ? mobileGroupClass : '']\"\n data-id=\"row-group\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header\"\n :colspan=\"colspan\"\n :header=\"row\"\n :is-open=\"isOpen\"\n :toggle=\"() => onToggleExpandGroup(row.group, row.identifier)\"\n >\n <td\n :class=\"[classes.td,
|
|
1
|
+
{"version":3,"file":"RuiDataTableGroupRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableGroupRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiTooltip from '@/components/overlays/tooltip/RuiTooltip.vue';\nimport { useDataTableGrouping, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\nimport { GroupExpandButtonPosition } from '@/components/tables/table-props';\n\nconst { row } = defineProps<{\n row: GroupHeader<T>;\n}>();\n\ndefineSlots<{\n 'group.header'?: (props: {\n colspan: number;\n header: GroupHeader<T>;\n isOpen: boolean;\n toggle: () => void;\n }) => any;\n 'group.header.content'?: (props: { header: GroupHeader<T>; groupKey: string }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the group header reads as a rounded section label, separated from\n * the previous group's cards above and its own below, aligned to the card\n * content padding.\n */\nconst mobileGroupClass = 'mt-6 first:mt-0 mb-2 rounded-lg';\nconst {\n getGroupSize,\n groupExpandButtonPosition,\n groupKey,\n groupLabels,\n isExpandedGroup,\n onCopyGroup,\n onToggleExpandGroup,\n onUngroup,\n} = useDataTableGrouping<T>();\n\nconst isOpen = computed<boolean>(() => isExpandedGroup(row.group));\nconst groupSize = computed<number>(() => getGroupSize(row.identifier));\n\n/** One label/value pair per grouped column, e.g. `Username: amartin`. */\nconst groupParts = computed<{ key: string; label: string; value: string }[]>(() => {\n const values = new Map<string, unknown>(Object.entries(row.group));\n return get(groupLabels).map(({ key, label }) => {\n const value = values.get(key);\n return { key, label, value: value === undefined || value === null ? '' : String(value) };\n });\n});\n</script>\n\n<template>\n <tr\n :class=\"[classes.trGroup, isMobile ? mobileGroupClass : '']\"\n data-id=\"row-group\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header\"\n :colspan=\"colspan\"\n :header=\"row\"\n :is-open=\"isOpen\"\n :toggle=\"() => onToggleExpandGroup(row.group, row.identifier)\"\n >\n <td\n class=\"!px-4 !py-2\"\n :class=\"[classes.td, { 'h-auto': !isMobile }]\"\n :colspan=\"colspan\"\n >\n <div class=\"flex items-center gap-2\">\n <!-- the edge controls pull in by their own padding so their icons sit on the cell grid -->\n <RuiExpandButton\n v-if=\"groupExpandButtonPosition === GroupExpandButtonPosition.start\"\n class=\"-ml-1.5\"\n :expanded=\"isOpen\"\n @click=\"onToggleExpandGroup(row.group, row.identifier)\"\n />\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n :group-key=\"groupKey ?? ''\"\n name=\"group.header.content\"\n :header=\"row\"\n >\n <span\n class=\"flex flex-wrap items-baseline gap-x-3\"\n data-id=\"group-label\"\n >\n <span\n v-for=\"part in groupParts\"\n :key=\"part.key\"\n >\n <span class=\"text-rui-text-secondary\">{{ part.label }}:</span>\n <span class=\"font-medium ml-1\">{{ part.value }}</span>\n </span>\n </span>\n <span\n class=\"rounded-full bg-black/[0.06] dark:bg-white/[0.08] px-2 text-caption text-rui-text-secondary\"\n data-id=\"group-size\"\n >\n {{ groupSize }}\n </span>\n <RuiButton\n size=\"sm\"\n variant=\"text\"\n icon\n data-id=\"group-copy-button\"\n @click=\"onCopyGroup(row)\"\n >\n <RuiIcon\n name=\"lu-copy\"\n size=\"16\"\n />\n </RuiButton>\n </slot>\n <RuiTooltip\n :options=\"{ placement: 'top' }\"\n class=\"ml-auto\"\n :class=\"{ '-mr-1.5': groupExpandButtonPosition !== GroupExpandButtonPosition.end }\"\n >\n <template #activator>\n <RuiButton\n size=\"sm\"\n variant=\"text\"\n icon\n data-id=\"group-ungroup-button\"\n @click=\"onUngroup()\"\n >\n <RuiIcon\n name=\"lu-ungroup\"\n size=\"16\"\n />\n </RuiButton>\n </template>\n Ungroup\n </RuiTooltip>\n <RuiExpandButton\n v-if=\"groupExpandButtonPosition === GroupExpandButtonPosition.end\"\n class=\"-mr-1.5\"\n :expanded=\"isOpen\"\n @click=\"onToggleExpandGroup(row.group, row.identifier)\"\n />\n </div>\n </td>\n </slot>\n </tr>\n</template>\n"],"mappings":""}
|
|
@@ -4,10 +4,21 @@ import RuiTooltip_default from "../../overlays/tooltip/RuiTooltip.js";
|
|
|
4
4
|
import { useDataTableGrouping, useDataTableStyling } from "./context.js";
|
|
5
5
|
import RuiExpandButton_default from "../RuiExpandButton.js";
|
|
6
6
|
import { GroupExpandButtonPosition } from "../table-props.js";
|
|
7
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
8
|
+
import { get } from "@vueuse/shared";
|
|
8
9
|
//#region src/components/tables/data-table/RuiDataTableGroupRow.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
var _hoisted_1 = ["colspan"];
|
|
10
11
|
var _hoisted_2 = { class: "flex items-center gap-2" };
|
|
12
|
+
var _hoisted_3 = {
|
|
13
|
+
class: "flex flex-wrap items-baseline gap-x-3",
|
|
14
|
+
"data-id": "group-label"
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_4 = { class: "text-rui-text-secondary" };
|
|
17
|
+
var _hoisted_5 = { class: "font-medium ml-1" };
|
|
18
|
+
var _hoisted_6 = {
|
|
19
|
+
class: "rounded-full bg-black/[0.06] dark:bg-white/[0.08] px-2 text-caption text-rui-text-secondary",
|
|
20
|
+
"data-id": "group-size"
|
|
21
|
+
};
|
|
11
22
|
var mobileGroupClass = "mt-6 first:mt-0 mb-2 rounded-lg";
|
|
12
23
|
var RuiDataTableGroupRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
24
|
__name: "RuiDataTableGroupRow",
|
|
@@ -19,8 +30,21 @@ var RuiDataTableGroupRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
19
30
|
* the previous group's cards above and its own below, aligned to the card
|
|
20
31
|
* content padding.
|
|
21
32
|
*/
|
|
22
|
-
const { groupExpandButtonPosition, groupKey, isExpandedGroup, onCopyGroup, onToggleExpandGroup, onUngroup } = useDataTableGrouping();
|
|
33
|
+
const { getGroupSize, groupExpandButtonPosition, groupKey, groupLabels, isExpandedGroup, onCopyGroup, onToggleExpandGroup, onUngroup } = useDataTableGrouping();
|
|
23
34
|
const isOpen = computed(() => isExpandedGroup(__props.row.group));
|
|
35
|
+
const groupSize = computed(() => getGroupSize(__props.row.identifier));
|
|
36
|
+
/** One label/value pair per grouped column, e.g. `Username: amartin`. */
|
|
37
|
+
const groupParts = computed(() => {
|
|
38
|
+
const values = new Map(Object.entries(__props.row.group));
|
|
39
|
+
return get(groupLabels).map(({ key, label }) => {
|
|
40
|
+
const value = values.get(key);
|
|
41
|
+
return {
|
|
42
|
+
key,
|
|
43
|
+
label,
|
|
44
|
+
value: value === void 0 || value === null ? "" : String(value)
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
});
|
|
24
48
|
return (_ctx, _cache) => {
|
|
25
49
|
return openBlock(), createElementBlock("tr", {
|
|
26
50
|
class: normalizeClass([unref(classes).trGroup, unref(isMobile) ? mobileGroupClass : ""]),
|
|
@@ -31,33 +55,40 @@ var RuiDataTableGroupRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
31
55
|
isOpen: unref(isOpen),
|
|
32
56
|
toggle: () => unref(onToggleExpandGroup)(__props.row.group, __props.row.identifier)
|
|
33
57
|
}, () => [createElementVNode("td", {
|
|
34
|
-
class: normalizeClass([
|
|
58
|
+
class: normalizeClass(["!px-4 !py-2", [unref(classes).td, { "h-auto": !unref(isMobile) }]]),
|
|
35
59
|
colspan: unref(colspan)
|
|
36
60
|
}, [createElementVNode("div", _hoisted_2, [
|
|
37
61
|
unref(groupExpandButtonPosition) === unref(GroupExpandButtonPosition).start ? (openBlock(), createBlock(RuiExpandButton_default, {
|
|
38
62
|
key: 0,
|
|
63
|
+
class: "-ml-1.5",
|
|
39
64
|
expanded: unref(isOpen),
|
|
40
65
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(onToggleExpandGroup)(__props.row.group, __props.row.identifier))
|
|
41
66
|
}, null, 8, ["expanded"])) : createCommentVNode("", true),
|
|
42
67
|
renderSlot(_ctx.$slots, "group.header.content", {
|
|
43
68
|
groupKey: unref(groupKey) ?? "",
|
|
44
69
|
header: __props.row
|
|
45
|
-
}, () => [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
}, () => [
|
|
71
|
+
createElementVNode("span", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(groupParts), (part) => {
|
|
72
|
+
return openBlock(), createElementBlock("span", { key: part.key }, [createElementVNode("span", _hoisted_4, toDisplayString(part.label) + ":", 1), createElementVNode("span", _hoisted_5, toDisplayString(part.value), 1)]);
|
|
73
|
+
}), 128))]),
|
|
74
|
+
createElementVNode("span", _hoisted_6, toDisplayString(unref(groupSize)), 1),
|
|
75
|
+
createVNode(RuiButton_default, {
|
|
76
|
+
size: "sm",
|
|
77
|
+
variant: "text",
|
|
78
|
+
icon: "",
|
|
79
|
+
"data-id": "group-copy-button",
|
|
80
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(onCopyGroup)(__props.row))
|
|
81
|
+
}, {
|
|
82
|
+
default: withCtx(() => [createVNode(RuiIcon_default, {
|
|
83
|
+
name: "lu-copy",
|
|
84
|
+
size: "16"
|
|
85
|
+
})]),
|
|
86
|
+
_: 1
|
|
87
|
+
})
|
|
88
|
+
]),
|
|
58
89
|
createVNode(RuiTooltip_default, {
|
|
59
90
|
options: { placement: "top" },
|
|
60
|
-
class: "ml-auto mr-
|
|
91
|
+
class: normalizeClass(["ml-auto", { "-mr-1.5": unref(groupExpandButtonPosition) !== unref(GroupExpandButtonPosition).end }])
|
|
61
92
|
}, {
|
|
62
93
|
activator: withCtx(() => [createVNode(RuiButton_default, {
|
|
63
94
|
size: "sm",
|
|
@@ -67,16 +98,17 @@ var RuiDataTableGroupRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
67
98
|
onClick: _cache[2] || (_cache[2] = ($event) => unref(onUngroup)())
|
|
68
99
|
}, {
|
|
69
100
|
default: withCtx(() => [createVNode(RuiIcon_default, {
|
|
70
|
-
name: "lu-
|
|
71
|
-
size: "
|
|
101
|
+
name: "lu-ungroup",
|
|
102
|
+
size: "16"
|
|
72
103
|
})]),
|
|
73
104
|
_: 1
|
|
74
105
|
})]),
|
|
75
106
|
default: withCtx(() => [_cache[4] || (_cache[4] = createTextVNode(" Ungroup ", -1))]),
|
|
76
107
|
_: 1
|
|
77
|
-
}),
|
|
108
|
+
}, 8, ["class"]),
|
|
78
109
|
unref(groupExpandButtonPosition) === unref(GroupExpandButtonPosition).end ? (openBlock(), createBlock(RuiExpandButton_default, {
|
|
79
110
|
key: 1,
|
|
111
|
+
class: "-mr-1.5",
|
|
80
112
|
expanded: unref(isOpen),
|
|
81
113
|
onClick: _cache[3] || (_cache[3] = ($event) => unref(onToggleExpandGroup)(__props.row.group, __props.row.identifier))
|
|
82
114
|
}, null, 8, ["expanded"])) : createCommentVNode("", true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableGroupRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiTooltip from '@/components/overlays/tooltip/RuiTooltip.vue';\nimport { useDataTableGrouping, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\nimport { GroupExpandButtonPosition } from '@/components/tables/table-props';\n\nconst { row } = defineProps<{\n row: GroupHeader<T>;\n}>();\n\ndefineSlots<{\n 'group.header'?: (props: {\n colspan: number;\n header: GroupHeader<T>;\n isOpen: boolean;\n toggle: () => void;\n }) => any;\n 'group.header.content'?: (props: { header: GroupHeader<T>; groupKey: string }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the group header reads as a rounded section label, separated from\n * the previous group's cards above and its own below, aligned to the card\n * content padding.\n */\nconst mobileGroupClass = 'mt-6 first:mt-0 mb-2 rounded-lg';\nconst {\n groupExpandButtonPosition,\n groupKey,\n isExpandedGroup,\n onCopyGroup,\n onToggleExpandGroup,\n onUngroup,\n} = useDataTableGrouping<T>();\n\nconst isOpen = computed<boolean>(() => isExpandedGroup(row.group));\n</script>\n\n<template>\n <tr\n :class=\"[classes.trGroup, isMobile ? mobileGroupClass : '']\"\n data-id=\"row-group\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header\"\n :colspan=\"colspan\"\n :header=\"row\"\n :is-open=\"isOpen\"\n :toggle=\"() => onToggleExpandGroup(row.group, row.identifier)\"\n >\n <td\n :class=\"[classes.td,
|
|
1
|
+
{"version":3,"file":"RuiDataTableGroupRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableGroupRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiTooltip from '@/components/overlays/tooltip/RuiTooltip.vue';\nimport { useDataTableGrouping, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\nimport { GroupExpandButtonPosition } from '@/components/tables/table-props';\n\nconst { row } = defineProps<{\n row: GroupHeader<T>;\n}>();\n\ndefineSlots<{\n 'group.header'?: (props: {\n colspan: number;\n header: GroupHeader<T>;\n isOpen: boolean;\n toggle: () => void;\n }) => any;\n 'group.header.content'?: (props: { header: GroupHeader<T>; groupKey: string }) => any;\n}>();\n\nconst { classes, colspan, isMobile } = useDataTableStyling();\n\n/**\n * On mobile the group header reads as a rounded section label, separated from\n * the previous group's cards above and its own below, aligned to the card\n * content padding.\n */\nconst mobileGroupClass = 'mt-6 first:mt-0 mb-2 rounded-lg';\nconst {\n getGroupSize,\n groupExpandButtonPosition,\n groupKey,\n groupLabels,\n isExpandedGroup,\n onCopyGroup,\n onToggleExpandGroup,\n onUngroup,\n} = useDataTableGrouping<T>();\n\nconst isOpen = computed<boolean>(() => isExpandedGroup(row.group));\nconst groupSize = computed<number>(() => getGroupSize(row.identifier));\n\n/** One label/value pair per grouped column, e.g. `Username: amartin`. */\nconst groupParts = computed<{ key: string; label: string; value: string }[]>(() => {\n const values = new Map<string, unknown>(Object.entries(row.group));\n return get(groupLabels).map(({ key, label }) => {\n const value = values.get(key);\n return { key, label, value: value === undefined || value === null ? '' : String(value) };\n });\n});\n</script>\n\n<template>\n <tr\n :class=\"[classes.trGroup, isMobile ? mobileGroupClass : '']\"\n data-id=\"row-group\"\n >\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n name=\"group.header\"\n :colspan=\"colspan\"\n :header=\"row\"\n :is-open=\"isOpen\"\n :toggle=\"() => onToggleExpandGroup(row.group, row.identifier)\"\n >\n <td\n class=\"!px-4 !py-2\"\n :class=\"[classes.td, { 'h-auto': !isMobile }]\"\n :colspan=\"colspan\"\n >\n <div class=\"flex items-center gap-2\">\n <!-- the edge controls pull in by their own padding so their icons sit on the cell grid -->\n <RuiExpandButton\n v-if=\"groupExpandButtonPosition === GroupExpandButtonPosition.start\"\n class=\"-ml-1.5\"\n :expanded=\"isOpen\"\n @click=\"onToggleExpandGroup(row.group, row.identifier)\"\n />\n <!-- eslint-disable-next-line vue/require-explicit-slots -- defined via Partial<Record<...>> in defineSlots -->\n <slot\n :group-key=\"groupKey ?? ''\"\n name=\"group.header.content\"\n :header=\"row\"\n >\n <span\n class=\"flex flex-wrap items-baseline gap-x-3\"\n data-id=\"group-label\"\n >\n <span\n v-for=\"part in groupParts\"\n :key=\"part.key\"\n >\n <span class=\"text-rui-text-secondary\">{{ part.label }}:</span>\n <span class=\"font-medium ml-1\">{{ part.value }}</span>\n </span>\n </span>\n <span\n class=\"rounded-full bg-black/[0.06] dark:bg-white/[0.08] px-2 text-caption text-rui-text-secondary\"\n data-id=\"group-size\"\n >\n {{ groupSize }}\n </span>\n <RuiButton\n size=\"sm\"\n variant=\"text\"\n icon\n data-id=\"group-copy-button\"\n @click=\"onCopyGroup(row)\"\n >\n <RuiIcon\n name=\"lu-copy\"\n size=\"16\"\n />\n </RuiButton>\n </slot>\n <RuiTooltip\n :options=\"{ placement: 'top' }\"\n class=\"ml-auto\"\n :class=\"{ '-mr-1.5': groupExpandButtonPosition !== GroupExpandButtonPosition.end }\"\n >\n <template #activator>\n <RuiButton\n size=\"sm\"\n variant=\"text\"\n icon\n data-id=\"group-ungroup-button\"\n @click=\"onUngroup()\"\n >\n <RuiIcon\n name=\"lu-ungroup\"\n size=\"16\"\n />\n </RuiButton>\n </template>\n Ungroup\n </RuiTooltip>\n <RuiExpandButton\n v-if=\"groupExpandButtonPosition === GroupExpandButtonPosition.end\"\n class=\"-mr-1.5\"\n :expanded=\"isOpen\"\n @click=\"onToggleExpandGroup(row.group, row.identifier)\"\n />\n </div>\n </td>\n </slot>\n </tr>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,mBAAmB;;;;;EAPzB,MAAM,EAAE,SAAS,SAAS,aAAa,oBAAoB;;;;;;EAQ3D,MAAM,EACJ,cACA,2BACA,UACA,aACA,iBACA,aACA,qBACA,cACE,qBAAwB;EAE5B,MAAM,SAAS,eAAwB,gBAAgB,QAAA,IAAI,KAAK,CAAC;EACjE,MAAM,YAAY,eAAuB,aAAa,QAAA,IAAI,UAAU,CAAC;;EAGrE,MAAM,aAAa,eAAgE;GACjF,MAAM,SAAS,IAAI,IAAqB,OAAO,QAAQ,QAAA,IAAI,KAAK,CAAC;GACjE,OAAO,IAAI,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,YAAY;IAC9C,MAAM,QAAQ,OAAO,IAAI,GAAG;I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