@rotki/ui-library 2.25.1 → 2.26.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/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/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 -14
- 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 +28 -5
- 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/index.js +1 -1
- package/dist/library-icons.json +1 -1
- package/dist/style.css +109 -38
- package/dist/web-types.json +139 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * `!border-y` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n const shared = 'relative flex flex-col border !border-y border-black/[0.12] dark:border-white/[0.12] overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-lg mb-0`\n : `${shared} rounded-lg mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[
|
|
1
|
+
{"version":3,"file":"RuiDataTableRow.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/** Selection wins over the open-panel shade, so a selected row still reads as selected. */\nconst stateClass = computed<string>(() => {\n if (get(selected))\n return get(classes).trSelected;\n if (get(expanded))\n return get(classes).trExpandedParent;\n return get(classes).tr;\n});\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * Without a selection checkbox the header bar would hold only the pinned\n * actions, so they float in the card's top-right corner instead and the first\n * field row makes room for them.\n */\nconst compactMobileHeader = computed<boolean>(() =>\n get(showMobileHeader) && !get(selectedData) && get(bodyColumns).length > 0,\n);\n\n/** Room for each floating action, about one small icon button wide. */\nconst firstRowInset = computed<Record<string, string> | undefined>(() =>\n get(compactMobileHeader) ? { paddingRight: `${get(mobileHeaderColumns).length * 2 + 1}rem` } : undefined,\n);\n\n/**\n * `!border-y` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n const shared = 'relative flex flex-col border !border-y border-black/[0.12] dark:border-white/[0.12] overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-lg mb-0`\n : `${shared} rounded-lg mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[stateClass, rowClass, isMobile ? mobileCardClass : '']\"\n :aria-selected=\"selectedData ? selected : undefined\"\n data-id=\"row\"\n >\n <!-- Mobile card header: checkbox on the left, pinned action columns on the right -->\n <td\n v-if=\"showMobileHeader\"\n :class=\"compactMobileHeader\n ? 'absolute top-0 right-0 z-[1] flex items-center gap-1 px-2 py-1'\n : 'flex items-center justify-between gap-2 px-4 py-2 border-b border-black/[0.12] dark:border-white/[0.12]'\"\n data-id=\"mobile-card-header\"\n >\n <RuiCheckbox\n v-if=\"selectedData\"\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n <span v-else-if=\"!compactMobileHeader\" />\n\n <div\n v-if=\"mobileHeaderColumns.length > 0\"\n class=\"flex items-center gap-1 min-w-0\"\n >\n <template\n v-for=\"(column, headerIndex) in mobileHeaderColumns\"\n :key=\"`header-${headerIndex}`\"\n >\n <slot\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n :name=\"`item.${column.key.toString()}`\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n />\n <RuiExpandButton\n v-else-if=\"column.key === 'expand'\"\n :expanded=\"isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <template v-else>\n {{ cellValue(row, column.key) }}\n </template>\n </template>\n </div>\n </td>\n\n <!-- Desktop checkbox cell -->\n <td\n v-else-if=\"selectedData && !isMobile\"\n :class=\"classes.checkbox\"\n colspan=\"1\"\n rowspan=\"1\"\n >\n <RuiCheckbox\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n </td>\n\n <RuiDataTableCell\n v-for=\"(column, subIndex) in bodyColumns\"\n :key=\"subIndex\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n :row-id=\"rowId\"\n :style=\"subIndex === 0 ? firstRowInset : undefined\"\n >\n <template\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n #default=\"slotData\"\n >\n <slot\n :name=\"`item.${column.key.toString()}`\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableCell>\n </tr>\n\n <RuiDataTableExpandedRow\n v-if=\"expanded\"\n :row=\"row\"\n :index=\"index\"\n >\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 </RuiDataTableExpandedRow>\n</template>\n"],"mappings":""}
|
package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,17 +3,12 @@ import { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, us
|
|
|
3
3
|
import RuiExpandButton_default from "../RuiExpandButton.js";
|
|
4
4
|
import RuiDataTableCell_default from "./RuiDataTableCell.js";
|
|
5
5
|
import RuiDataTableExpandedRow_default from "./RuiDataTableExpandedRow.js";
|
|
6
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, openBlock, renderList, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
6
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, renderList, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
7
7
|
import { get } from "@vueuse/shared";
|
|
8
8
|
//#region src/components/tables/data-table/RuiDataTableRow.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var _hoisted_1 = ["aria-selected"];
|
|
10
|
-
var _hoisted_2 = {
|
|
11
|
-
|
|
12
|
-
class: "flex items-center justify-between gap-2 px-4 py-2 border-b border-black/[0.12] dark:border-white/[0.12]",
|
|
13
|
-
"data-id": "mobile-card-header"
|
|
14
|
-
};
|
|
15
|
-
var _hoisted_3 = { key: 1 };
|
|
16
|
-
var _hoisted_4 = {
|
|
10
|
+
var _hoisted_2 = { key: 1 };
|
|
11
|
+
var _hoisted_3 = {
|
|
17
12
|
key: 2,
|
|
18
13
|
class: "flex items-center gap-1 min-w-0"
|
|
19
14
|
};
|
|
@@ -35,6 +30,12 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
35
30
|
const disabled = computed(() => isDisabledRow(get(rowId)));
|
|
36
31
|
const expanded = computed(() => get(expandable) && !!slots["expanded-item"] && isExpanded(get(rowId)));
|
|
37
32
|
const rowClass = computed(() => typeof itemClass === "string" ? itemClass : itemClass(__props.row));
|
|
33
|
+
/** Selection wins over the open-panel shade, so a selected row still reads as selected. */
|
|
34
|
+
const stateClass = computed(() => {
|
|
35
|
+
if (get(selected)) return get(classes).trSelected;
|
|
36
|
+
if (get(expanded)) return get(classes).trExpandedParent;
|
|
37
|
+
return get(classes).tr;
|
|
38
|
+
});
|
|
38
39
|
/**
|
|
39
40
|
* A column is pinned to the mobile card header when it is flagged
|
|
40
41
|
* `mobileHeader`, typically an action column, or when it is the
|
|
@@ -64,6 +65,14 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
64
65
|
const bodyColumns = computed(() => get(isMobile) ? get(columns).filter((column) => !isMobileHeaderColumn(column)) : get(columns));
|
|
65
66
|
const showMobileHeader = computed(() => get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0));
|
|
66
67
|
/**
|
|
68
|
+
* Without a selection checkbox the header bar would hold only the pinned
|
|
69
|
+
* actions, so they float in the card's top-right corner instead and the first
|
|
70
|
+
* field row makes room for them.
|
|
71
|
+
*/
|
|
72
|
+
const compactMobileHeader = computed(() => get(showMobileHeader) && !get(selectedData) && get(bodyColumns).length > 0);
|
|
73
|
+
/** Room for each floating action, about one small icon button wide. */
|
|
74
|
+
const firstRowInset = computed(() => get(compactMobileHeader) ? { paddingRight: `${get(mobileHeaderColumns).length * 2 + 1}rem` } : void 0);
|
|
75
|
+
/**
|
|
67
76
|
* `!border-y` defeats the `divide-y-0` on the mobile tbody, which otherwise
|
|
68
77
|
* zeroes the top and bottom border on every card except the first. An expanded
|
|
69
78
|
* card flattens its bottom edge so the expanded panel attaches flush beneath
|
|
@@ -79,13 +88,17 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
79
88
|
return (_ctx, _cache) => {
|
|
80
89
|
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("tr", {
|
|
81
90
|
class: normalizeClass([
|
|
82
|
-
unref(
|
|
91
|
+
unref(stateClass),
|
|
83
92
|
unref(rowClass),
|
|
84
93
|
unref(isMobile) ? unref(mobileCardClass) : ""
|
|
85
94
|
]),
|
|
86
95
|
"aria-selected": unref(selectedData) ? unref(selected) : void 0,
|
|
87
96
|
"data-id": "row"
|
|
88
|
-
}, [unref(showMobileHeader) ? (openBlock(), createElementBlock("td",
|
|
97
|
+
}, [unref(showMobileHeader) ? (openBlock(), createElementBlock("td", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: normalizeClass(unref(compactMobileHeader) ? "absolute top-0 right-0 z-[1] flex items-center gap-1 px-2 py-1" : "flex items-center justify-between gap-2 px-4 py-2 border-b border-black/[0.12] dark:border-white/[0.12]"),
|
|
100
|
+
"data-id": "mobile-card-header"
|
|
101
|
+
}, [unref(selectedData) ? (openBlock(), createBlock(RuiCheckbox_default, {
|
|
89
102
|
key: 0,
|
|
90
103
|
"data-id": `table-toggle-check-${__props.index}`,
|
|
91
104
|
"model-value": unref(selected),
|
|
@@ -101,7 +114,7 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
101
114
|
"model-value",
|
|
102
115
|
"disabled",
|
|
103
116
|
"size"
|
|
104
|
-
])) : (openBlock(), createElementBlock("span",
|
|
117
|
+
])) : !unref(compactMobileHeader) ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true), unref(mobileHeaderColumns).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(mobileHeaderColumns), (column, headerIndex) => {
|
|
105
118
|
return openBlock(), createElementBlock(Fragment, { key: `header-${headerIndex}` }, [unref(itemSlotKeys).has(column.key.toString()) ? renderSlot(_ctx.$slots, `item.${column.key.toString()}`, {
|
|
106
119
|
column,
|
|
107
120
|
row: __props.row,
|
|
@@ -111,7 +124,7 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
111
124
|
expanded: unref(isExpanded)(unref(rowId)),
|
|
112
125
|
onClick: _cache[2] || (_cache[2] = ($event) => unref(onToggleExpand)(__props.row))
|
|
113
126
|
}, null, 8, ["expanded"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(unref(cellValue)(__props.row, column.key)), 1)], 64))], 64);
|
|
114
|
-
}), 128))])) : createCommentVNode("", true)])) : unref(selectedData) && !unref(isMobile) ? (openBlock(), createElementBlock("td", {
|
|
127
|
+
}), 128))])) : createCommentVNode("", true)], 2)) : unref(selectedData) && !unref(isMobile) ? (openBlock(), createElementBlock("td", {
|
|
115
128
|
key: 1,
|
|
116
129
|
class: normalizeClass(unref(classes).checkbox),
|
|
117
130
|
colspan: "1",
|
|
@@ -137,7 +150,8 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
137
150
|
column,
|
|
138
151
|
row: __props.row,
|
|
139
152
|
index: __props.index,
|
|
140
|
-
"row-id": unref(rowId)
|
|
153
|
+
"row-id": unref(rowId),
|
|
154
|
+
style: normalizeStyle(subIndex === 0 ? unref(firstRowInset) : void 0)
|
|
141
155
|
}, createSlots({ _: 2 }, [unref(itemSlotKeys).has(column.key.toString()) ? {
|
|
142
156
|
name: "default",
|
|
143
157
|
fn: withCtx((slotData) => [renderSlot(_ctx.$slots, `item.${column.key.toString()}`, mergeProps({ ref_for: true }, slotData))]),
|
|
@@ -146,7 +160,8 @@ var RuiDataTableRow_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
146
160
|
"column",
|
|
147
161
|
"row",
|
|
148
162
|
"index",
|
|
149
|
-
"row-id"
|
|
163
|
+
"row-id",
|
|
164
|
+
"style"
|
|
150
165
|
]);
|
|
151
166
|
}), 128))], 10, _hoisted_1), unref(expanded) ? (openBlock(), createBlock(RuiDataTableExpandedRow_default, {
|
|
152
167
|
key: 0,
|
package/dist/components/tables/data-table/RuiDataTableRow.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiDataTableRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * `!border-y` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n const shared = 'relative flex flex-col border !border-y border-black/[0.12] dark:border-white/[0.12] overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-lg mb-0`\n : `${shared} rounded-lg mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[selected ? classes.trSelected : classes.tr, rowClass, isMobile ? mobileCardClass : '']\"\n :aria-selected=\"selectedData ? selected : undefined\"\n data-id=\"row\"\n >\n <!-- Mobile card header: checkbox on the left, pinned action columns on the right -->\n <td\n v-if=\"showMobileHeader\"\n class=\"flex items-center justify-between gap-2 px-4 py-2 border-b border-black/[0.12] dark:border-white/[0.12]\"\n data-id=\"mobile-card-header\"\n >\n <RuiCheckbox\n v-if=\"selectedData\"\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n <span v-else />\n\n <div\n v-if=\"mobileHeaderColumns.length > 0\"\n class=\"flex items-center gap-1 min-w-0\"\n >\n <template\n v-for=\"(column, headerIndex) in mobileHeaderColumns\"\n :key=\"`header-${headerIndex}`\"\n >\n <slot\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n :name=\"`item.${column.key.toString()}`\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n />\n <RuiExpandButton\n v-else-if=\"column.key === 'expand'\"\n :expanded=\"isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <template v-else>\n {{ cellValue(row, column.key) }}\n </template>\n </template>\n </div>\n </td>\n\n <!-- Desktop checkbox cell -->\n <td\n v-else-if=\"selectedData && !isMobile\"\n :class=\"classes.checkbox\"\n colspan=\"1\"\n rowspan=\"1\"\n >\n <RuiCheckbox\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n </td>\n\n <RuiDataTableCell\n v-for=\"(column, subIndex) in bodyColumns\"\n :key=\"subIndex\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n :row-id=\"rowId\"\n >\n <template\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n #default=\"slotData\"\n >\n <slot\n :name=\"`item.${column.key.toString()}`\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableCell>\n </tr>\n\n <RuiDataTableExpandedRow\n v-if=\"expanded\"\n :row=\"row\"\n :index=\"index\"\n >\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 </RuiDataTableExpandedRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ,SAAA;EAMd,MAAM,EAAE,SAAS,OAAO,aAAa,oBAAoB;EACzD,MAAM,EAAE,WAAW,SAAS,iBAAiB,oBAAuB;EACpE,MAAM,EAAE,eAAe,YAAY,iBAAiB,UAAU,iBAAiB,sBAAyB;EACxG,MAAM,EAAE,YAAY,YAAY,mBAAmB,sBAAyB;EAC5E,MAAM,EAAE,UAAU,cAAc,wBAA2B;EAE3D,MAAM,QAAQ,eAA2B,SAAS,QAAA,GAAG,CAAC;EACtD,MAAM,WAAW,eAAwB,WAAW,IAAI,KAAK,CAAC,CAAC;EAC/D,MAAM,WAAW,eAAwB,cAAc,IAAI,KAAK,CAAC,CAAC;EAClE,MAAM,WAAW,eAAwB,IAAI,UAAU,KAAK,CAAC,CAAC,MAAM,oBAAoB,WAAW,IAAI,KAAK,CAAC,CAAC;EAC9G,MAAM,WAAW,eAAuB,OAAO,cAAc,WAAW,YAAY,UAAU,QAAA,GAAG,CAAC;;;;;;EAOlG,SAAS,qBAAqB,QAAiC;GAC7D,OAAO,CAAC,CAAC,OAAO,gBAAgB,OAAO,QAAQ;EACjD;;;;;;;;EASA,SAAS,6BAA6B,QAAiC;GACrE,IAAI,OAAO,QAAQ,UACjB,OAAO;GACT,IAAI,aAAa,IAAI,OAAO,IAAI,SAAS,CAAC,GACxC,OAAO;GACT,MAAM,QAAQ,UAAU,QAAA,KAAK,OAAO,GAAG;GACvC,OAAO,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU;EAC5D;;;;;EAMA,MAAM,sBAAsB,eAC1B,IAAI,QAAQ,IAAI,IAAI,OAAO,CAAC,CAAC,QAAO,WAAU,qBAAqB,MAAM,KAAK,6BAA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ACN,OAAM;IACN,gBAAA;IACC,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,QAAA,CAAQ,CAAC,QAAQ,MAAA,KAAA,GAAK,IAAA;IAC1C,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,eAAA,CAAe,CAAC,QAAQ,MAAA,KAAA,GAAO,QAAA,KAAK;;;;;;GAIhD,CAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,IAAA,UAAA,IAAA,GAAA,mBAiBmB,UAAA,MAAA,WAhBY,MAAA,WAAA,IAArB,QAAQ,aAAQ;IAD1B,OAAA,UAAA,GAAA,YAiBmB,0BAAA;KAfhB,KAAK;KACG;KACR,KAAK,QAAA;KACL,OAAO,QAAA;KACP,UAAQ,MAAA,KAAA;IAGD,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAA,YAAA,CAAY,CAAC,IAAI,OAAO,IAAI,SAAQ,CAAA,IAAA;KACzC,MAAA;KAED,IAAA,SAFU,aAAQ,CAElB,WAGE,KAAA,QAAA,QAFe,OAAO,IAAI,SAAQ,KADpC,WAGE,EAAA,SAAA,KAAA,GADQ,QAAQ,CAAA,CAAA,CAAA;;;;;;;;GAOhB,CAAA,GAAA,GAAA,EAAA,GAAA,IAAA,UAAA,GAAA,MAAA,QAAA,KADR,UAAA,GAAA,YAe0B,iCAAA;;IAbvB,KAAK,QAAA;IACL,OAAO,QAAA;GAGA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAK,mBAAA;IACV,MAAA;IAGD,IAAA,SAHgB,aAAQ,CAGxB,WAGE,KAAA,QAAA,iBAAA,eAAA,mBADQ,QAAQ,CAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"RuiDataTableRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../src/components/tables/data-table/RuiDataTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup generic=\"T extends object\">\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport RuiCheckbox from '@/components/forms/checkbox/RuiCheckbox.vue';\nimport { useDataTableColumns, useDataTableExpansion, useDataTableRowIdentity, useDataTableSelection, useDataTableStyling } from '@/components/tables/data-table/context';\nimport RuiDataTableCell from '@/components/tables/data-table/RuiDataTableCell.vue';\nimport RuiDataTableExpandedRow from '@/components/tables/data-table/RuiDataTableExpandedRow.vue';\nimport RuiExpandButton from '@/components/tables/RuiExpandButton.vue';\n\nconst {\n row,\n index,\n} = defineProps<{\n row: T;\n index: number;\n}>();\n\nconst slots = defineSlots<Partial<\n Record<`item.${string}`, (props: { column: TableColumn<T>; row: T; index: number }) => any> & {\n 'expanded-item'?: (props: { row: T; index: number }) => any;\n }\n>>();\n\nconst { classes, dense, isMobile } = useDataTableStyling();\nconst { cellValue, columns, itemSlotKeys } = useDataTableColumns<T>();\nconst { isDisabledRow, isSelected, onCheckboxClick, onSelect, selectedData } = useDataTableSelection<T>();\nconst { expandable, isExpanded, onToggleExpand } = useDataTableExpansion<T>();\nconst { getRowId, itemClass } = useDataTableRowIdentity<T>();\n\nconst rowId = computed<T[keyof T]>(() => getRowId(row));\nconst selected = computed<boolean>(() => isSelected(get(rowId)));\nconst disabled = computed<boolean>(() => isDisabledRow(get(rowId)));\nconst expanded = computed<boolean>(() => get(expandable) && !!slots['expanded-item'] && isExpanded(get(rowId)));\nconst rowClass = computed<string>(() => typeof itemClass === 'string' ? itemClass : itemClass(row));\n\n/** Selection wins over the open-panel shade, so a selected row still reads as selected. */\nconst stateClass = computed<string>(() => {\n if (get(selected))\n return get(classes).trSelected;\n if (get(expanded))\n return get(classes).trExpandedParent;\n return get(classes).tr;\n});\n\n/**\n * A column is pinned to the mobile card header when it is flagged\n * `mobileHeader`, typically an action column, or when it is the\n * auto-generated expand column.\n */\nfunction isMobileHeaderColumn(column: TableColumn<T>): boolean {\n return !!column.mobileHeader || column.key === 'expand';\n}\n\n/**\n * A pinned column only earns a spot in the header if it renders something: the\n * expand toggle, a provided item slot, or a non-empty cell value. Without this,\n * a pinned column with no content, such as an action column whose\n * `#item.action` slot a nested table does not provide, leaves an empty header\n * bar with just its divider line.\n */\nfunction mobileHeaderColumnHasContent(column: TableColumn<T>): boolean {\n if (column.key === 'expand')\n return true;\n if (itemSlotKeys.has(column.key.toString()))\n return true;\n const value = cellValue(row, column.key);\n return value !== undefined && value !== null && value !== '';\n}\n\n/**\n * In the stacked mobile layout, header columns render in the card header row\n * instead of as a label/value pair. Everything else stacks below in the body.\n */\nconst mobileHeaderColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => isMobileHeaderColumn(column) && mobileHeaderColumnHasContent(column)) : [],\n);\nconst bodyColumns = computed<TableColumn<T>[]>(() =>\n get(isMobile) ? get(columns).filter(column => !isMobileHeaderColumn(column)) : get(columns),\n);\nconst showMobileHeader = computed<boolean>(() =>\n get(isMobile) && (!!get(selectedData) || get(mobileHeaderColumns).length > 0),\n);\n\n/**\n * Without a selection checkbox the header bar would hold only the pinned\n * actions, so they float in the card's top-right corner instead and the first\n * field row makes room for them.\n */\nconst compactMobileHeader = computed<boolean>(() =>\n get(showMobileHeader) && !get(selectedData) && get(bodyColumns).length > 0,\n);\n\n/** Room for each floating action, about one small icon button wide. */\nconst firstRowInset = computed<Record<string, string> | undefined>(() =>\n get(compactMobileHeader) ? { paddingRight: `${get(mobileHeaderColumns).length * 2 + 1}rem` } : undefined,\n);\n\n/**\n * `!border-y` defeats the `divide-y-0` on the mobile tbody, which otherwise\n * zeroes the top and bottom border on every card except the first. An expanded\n * card flattens its bottom edge so the expanded panel attaches flush beneath\n * it.\n *\n * These bindings do not run through the class merger, so each state picks its\n * own utilities rather than emitting conflicting ones.\n */\nconst mobileCardClass = computed<string>(() => {\n const shared = 'relative flex flex-col border !border-y border-black/[0.12] dark:border-white/[0.12] overflow-hidden';\n return get(expanded)\n ? `${shared} rounded-t-lg mb-0`\n : `${shared} rounded-lg mb-3 last:mb-0`;\n});\n</script>\n\n<template>\n <tr\n :class=\"[stateClass, rowClass, isMobile ? mobileCardClass : '']\"\n :aria-selected=\"selectedData ? selected : undefined\"\n data-id=\"row\"\n >\n <!-- Mobile card header: checkbox on the left, pinned action columns on the right -->\n <td\n v-if=\"showMobileHeader\"\n :class=\"compactMobileHeader\n ? 'absolute top-0 right-0 z-[1] flex items-center gap-1 px-2 py-1'\n : 'flex items-center justify-between gap-2 px-4 py-2 border-b border-black/[0.12] dark:border-white/[0.12]'\"\n data-id=\"mobile-card-header\"\n >\n <RuiCheckbox\n v-if=\"selectedData\"\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n <span v-else-if=\"!compactMobileHeader\" />\n\n <div\n v-if=\"mobileHeaderColumns.length > 0\"\n class=\"flex items-center gap-1 min-w-0\"\n >\n <template\n v-for=\"(column, headerIndex) in mobileHeaderColumns\"\n :key=\"`header-${headerIndex}`\"\n >\n <slot\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n :name=\"`item.${column.key.toString()}`\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n />\n <RuiExpandButton\n v-else-if=\"column.key === 'expand'\"\n :expanded=\"isExpanded(rowId)\"\n @click=\"onToggleExpand(row)\"\n />\n <template v-else>\n {{ cellValue(row, column.key) }}\n </template>\n </template>\n </div>\n </td>\n\n <!-- Desktop checkbox cell -->\n <td\n v-else-if=\"selectedData && !isMobile\"\n :class=\"classes.checkbox\"\n colspan=\"1\"\n rowspan=\"1\"\n >\n <RuiCheckbox\n :data-id=\"`table-toggle-check-${index}`\"\n :model-value=\"selected\"\n :disabled=\"disabled\"\n :size=\"dense ? 'sm' : undefined\"\n color=\"primary\"\n class=\"select-none\"\n hide-details\n @update:model-value=\"onSelect($event, rowId, true)\"\n @click=\"onCheckboxClick($event, rowId, index)\"\n />\n </td>\n\n <RuiDataTableCell\n v-for=\"(column, subIndex) in bodyColumns\"\n :key=\"subIndex\"\n :column=\"column\"\n :row=\"row\"\n :index=\"index\"\n :row-id=\"rowId\"\n :style=\"subIndex === 0 ? firstRowInset : undefined\"\n >\n <template\n v-if=\"itemSlotKeys.has(column.key.toString())\"\n #default=\"slotData\"\n >\n <slot\n :name=\"`item.${column.key.toString()}`\"\n v-bind=\"slotData\"\n />\n </template>\n </RuiDataTableCell>\n </tr>\n\n <RuiDataTableExpandedRow\n v-if=\"expanded\"\n :row=\"row\"\n :index=\"index\"\n >\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 </RuiDataTableExpandedRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ,SAAA;EAMd,MAAM,EAAE,SAAS,OAAO,aAAa,oBAAoB;EACzD,MAAM,EAAE,WAAW,SAAS,iBAAiB,oBAAuB;EACpE,MAAM,EAAE,eAAe,YAAY,iBAAiB,UAAU,iBAAiB,sBAAyB;EACxG,MAAM,EAAE,YAAY,YAAY,mBAAmB,sBAAyB;EAC5E,MAAM,EAAE,UAAU,cAAc,wBAA2B;EAE3D,MAAM,QAAQ,eAA2B,SAAS,QAAA,GAAG,CAAC;EACtD,MAAM,WAAW,eAAwB,WAAW,IAAI,KAAK,CAAC,CAAC;EAC/D,MAAM,WAAW,eAAwB,cAAc,IAAI,KAAK,CAAC,CAAC;EAClE,MAAM,WAAW,eAAwB,IAAI,UAAU,KAAK,CAAC,CAAC,MAAM,oBAAoB,WAAW,IAAI,KAAK,CAAC,CAAC;EAC9G,MAAM,WAAW,eAAuB,OAAO,cAAc,WAAW,YAAY,UAAU,QAAA,GAAG,CAAC;;EAGlG,MAAM,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IAAA,UAAA,IAAA,GAAA,mBAkBmB,UAAA,MAAA,WAjBY,MAAA,WAAA,IAArB,QAAQ,aAAQ;IAD1B,OAAA,UAAA,GAAA,YAkBmB,0BAAA;KAhBhB,KAAK;KACG;KACR,KAAK,QAAA;KACL,OAAO,QAAA;KACP,UAAQ,MAAA,KAAA;KACR,OAAK,eAAE,aAAQ,IAAS,MAAA,aAAA,IAAgB,KAAA,CAAS;IAG1C,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAA,YAAA,CAAY,CAAC,IAAI,OAAO,IAAI,SAAQ,CAAA,IAAA;KACzC,MAAA;KAED,IAAA,SAFU,aAAQ,CAElB,WAGE,KAAA,QAAA,QAFe,OAAO,IAAI,SAAQ,KADpC,WAGE,EAAA,SAAA,KAAA,GADQ,QAAQ,CAAA,CAAA,CAAA;;;;;;;;;GAOhB,CAAA,GAAA,GAAA,EAAA,GAAA,IAAA,UAAA,GAAA,MAAA,QAAA,KADR,UAAA,GAAA,YAe0B,iCAAA;;IAbvB,KAAK,QAAA;IACL,OAAO,QAAA;GAGA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,MAAK,mBAAA;IACV,MAAA;IAGD,IAAA,SAHgB,aAAQ,CAGxB,WAGE,KAAA,QAAA,iBAAA,eAAA,mBADQ,QAAQ,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -7,6 +7,8 @@ export interface DataTableClasses {
|
|
|
7
7
|
tr: string;
|
|
8
8
|
trSelected: string;
|
|
9
9
|
trExpandable: string;
|
|
10
|
+
/** a row whose expanded panel is open, shaded to match the panel */
|
|
11
|
+
trExpandedParent: string;
|
|
10
12
|
trGroup: string;
|
|
11
13
|
trEmpty: string;
|
|
12
14
|
checkbox: string;
|
|
@@ -39,9 +41,17 @@ export interface DataTableExpansionContext<T extends object = any, IdType extend
|
|
|
39
41
|
isExpanded: (id: T[IdType]) => boolean;
|
|
40
42
|
onToggleExpand: (row: T) => void;
|
|
41
43
|
}
|
|
44
|
+
export interface DataTableGroupLabel {
|
|
45
|
+
key: string;
|
|
46
|
+
/** the grouped column's visible label, or the key when no column defines one */
|
|
47
|
+
label: string;
|
|
48
|
+
}
|
|
42
49
|
export interface DataTableGroupingContext<T extends object = any> {
|
|
43
50
|
groupExpandButtonPosition: GroupExpandButtonPosition;
|
|
44
51
|
groupKey: ComputedRef<string | undefined>;
|
|
52
|
+
groupLabels: ComputedRef<DataTableGroupLabel[]>;
|
|
53
|
+
/** the number of rows in the group, across all pages */
|
|
54
|
+
getGroupSize: (identifier: string) => number;
|
|
45
55
|
isExpandedGroup: (group: Partial<T>) => boolean;
|
|
46
56
|
onToggleExpandGroup: (group: Partial<T>, identifier: string) => void;
|
|
47
57
|
onUngroup: () => void;
|
|
@@ -84,6 +84,8 @@ function provideDataTableContext(context) {
|
|
|
84
84
|
provideDataTableGrouping({
|
|
85
85
|
groupExpandButtonPosition: context.groupExpandButtonPosition,
|
|
86
86
|
groupKey: context.groupKey,
|
|
87
|
+
groupLabels: context.groupLabels,
|
|
88
|
+
getGroupSize: context.getGroupSize,
|
|
87
89
|
isExpandedGroup: context.isExpandedGroup,
|
|
88
90
|
onToggleExpandGroup: context.onToggleExpandGroup,
|
|
89
91
|
onUngroup: context.onUngroup,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../../../../src/components/tables/data-table/context.ts"],"sourcesContent":["import type { ComputedRef, Ref } from 'vue';\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport type { GroupExpandButtonPosition } from '@/components/tables/table-props';\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\n\nexport interface DataTableClasses {\n td: string;\n tr: string;\n trSelected: string;\n trExpandable: string;\n trGroup: string;\n trEmpty: string;\n checkbox: string;\n tbody: string;\n tbodyLoader: string;\n}\n\n// --- Per-concern context interfaces ---\n\nexport interface DataTableStylingContext {\n classes: ComputedRef<DataTableClasses>;\n colspan: ComputedRef<number>;\n dense: boolean;\n /** whether the table is currently rendered in its stacked mobile layout */\n isMobile: ComputedRef<boolean>;\n}\n\nexport interface DataTableColumnsContext<T extends object = any> {\n columns: ComputedRef<TableColumn<T>[]>;\n cellValue: (row: T, key: TableColumn<T>['key']) => T[keyof T];\n itemSlotKeys: Set<string>;\n /** the column definition attribute used as the visible label (e.g. `label`) */\n columnAttr: keyof TableColumn<T>;\n}\n\nexport interface DataTableSelectionContext<T extends object = any, IdType extends keyof T = keyof T> {\n selectedData: Ref<T[IdType][] | undefined>;\n isSelected: (id: T[IdType]) => boolean;\n isDisabledRow: (id: T[IdType]) => boolean;\n onSelect: (selected: boolean, id: T[IdType], userAction: boolean) => void;\n onCheckboxClick: (event: MouseEvent, id: T[IdType], index: number) => void;\n}\n\nexport interface DataTableExpansionContext<T extends object = any, IdType extends keyof T = keyof T> {\n expandable: ComputedRef<boolean>;\n isExpanded: (id: T[IdType]) => boolean;\n onToggleExpand: (row: T) => void;\n}\n\nexport interface DataTableGroupingContext<T extends object = any> {\n groupExpandButtonPosition: GroupExpandButtonPosition;\n groupKey: ComputedRef<string | undefined>;\n isExpandedGroup: (group: Partial<T>) => boolean;\n onToggleExpandGroup: (group: Partial<T>, identifier: string) => void;\n onUngroup: () => void;\n onCopyGroup: (header: GroupHeader<T>) => void;\n}\n\nexport interface DataTableRowIdentityContext<T extends object = any, IdType extends keyof T = keyof T> {\n getRowId: (row: T) => T[IdType];\n itemClass: ((item: T) => string) | string;\n}\n\n// --- Backward-compatible merged type ---\n\nexport type DataTableContext<T extends object = any, IdType extends keyof T = keyof T> =\n DataTableStylingContext &\n DataTableColumnsContext<T> &\n DataTableSelectionContext<T, IdType> &\n DataTableExpansionContext<T, IdType> &\n DataTableGroupingContext<T> &\n DataTableRowIdentityContext<T, IdType>;\n\n// --- Per-concern symbols ---\n\nconst DATA_TABLE_STYLING = Symbol('data-table-styling');\nconst DATA_TABLE_COLUMNS = Symbol('data-table-columns');\nconst DATA_TABLE_SELECTION = Symbol('data-table-selection');\nconst DATA_TABLE_EXPANSION = Symbol('data-table-expansion');\nconst DATA_TABLE_GROUPING = Symbol('data-table-grouping');\nconst DATA_TABLE_ROW_IDENTITY = Symbol('data-table-row-identity');\nconst DATA_TABLE_NESTED = Symbol('data-table-nested');\n\n// --- Per-concern provide/use pairs ---\n\nfunction injectOrThrow<C>(key: symbol, name: string): C {\n const context = inject<C>(key);\n if (context === undefined)\n throw new Error(`${name} must be used within a RuiDataTable`);\n\n return context;\n}\n\nexport function provideDataTableStyling(context: DataTableStylingContext): void {\n provide(DATA_TABLE_STYLING, context);\n}\n\nexport function useDataTableStyling(): DataTableStylingContext {\n return injectOrThrow<DataTableStylingContext>(DATA_TABLE_STYLING, 'useDataTableStyling');\n}\n\nexport function provideDataTableColumns<T extends object>(context: DataTableColumnsContext<T>): void {\n provide(DATA_TABLE_COLUMNS, context);\n}\n\nexport function useDataTableColumns<T extends object = any>(): DataTableColumnsContext<T> {\n return injectOrThrow<DataTableColumnsContext<T>>(DATA_TABLE_COLUMNS, 'useDataTableColumns');\n}\n\nexport function provideDataTableSelection<T extends object, IdType extends keyof T>(context: DataTableSelectionContext<T, IdType>): void {\n provide(DATA_TABLE_SELECTION, context);\n}\n\nexport function useDataTableSelection<T extends object = any, IdType extends keyof T = keyof T>(): DataTableSelectionContext<T, IdType> {\n return injectOrThrow<DataTableSelectionContext<T, IdType>>(DATA_TABLE_SELECTION, 'useDataTableSelection');\n}\n\nexport function provideDataTableExpansion<T extends object, IdType extends keyof T>(context: DataTableExpansionContext<T, IdType>): void {\n provide(DATA_TABLE_EXPANSION, context);\n}\n\nexport function useDataTableExpansion<T extends object = any, IdType extends keyof T = keyof T>(): DataTableExpansionContext<T, IdType> {\n return injectOrThrow<DataTableExpansionContext<T, IdType>>(DATA_TABLE_EXPANSION, 'useDataTableExpansion');\n}\n\nexport function provideDataTableGrouping<T extends object>(context: DataTableGroupingContext<T>): void {\n provide(DATA_TABLE_GROUPING, context);\n}\n\nexport function useDataTableGrouping<T extends object = any>(): DataTableGroupingContext<T> {\n return injectOrThrow<DataTableGroupingContext<T>>(DATA_TABLE_GROUPING, 'useDataTableGrouping');\n}\n\nexport function provideDataTableRowIdentity<T extends object, IdType extends keyof T>(context: DataTableRowIdentityContext<T, IdType>): void {\n provide(DATA_TABLE_ROW_IDENTITY, context);\n}\n\nexport function useDataTableRowIdentity<T extends object = any, IdType extends keyof T = keyof T>(): DataTableRowIdentityContext<T, IdType> {\n return injectOrThrow<DataTableRowIdentityContext<T, IdType>>(DATA_TABLE_ROW_IDENTITY, 'useDataTableRowIdentity');\n}\n\n/** Marks descendant data tables as nested (e.g. rendered inside an expanded row). */\nexport function provideDataTableNested(): void {\n provide(DATA_TABLE_NESTED, true);\n}\n\n/** True when this data table is rendered inside another data table. */\nexport function useDataTableNested(): boolean {\n return inject<boolean>(DATA_TABLE_NESTED, false);\n}\n\n// --- Backward-compatible facade ---\n\nexport function provideDataTableContext<T extends object, IdType extends keyof T>(context: DataTableContext<T, IdType>): void {\n provideDataTableStyling({ classes: context.classes, colspan: context.colspan, dense: context.dense, isMobile: context.isMobile });\n provideDataTableColumns<T>({ columns: context.columns, cellValue: context.cellValue, itemSlotKeys: context.itemSlotKeys, columnAttr: context.columnAttr });\n provideDataTableSelection<T, IdType>({ selectedData: context.selectedData, isSelected: context.isSelected, isDisabledRow: context.isDisabledRow, onSelect: context.onSelect, onCheckboxClick: context.onCheckboxClick });\n provideDataTableExpansion<T, IdType>({ expandable: context.expandable, isExpanded: context.isExpanded, onToggleExpand: context.onToggleExpand });\n provideDataTableGrouping<T>({ groupExpandButtonPosition: context.groupExpandButtonPosition, groupKey: context.groupKey, isExpandedGroup: context.isExpandedGroup, onToggleExpandGroup: context.onToggleExpandGroup, onUngroup: context.onUngroup, onCopyGroup: context.onCopyGroup });\n provideDataTableRowIdentity<T, IdType>({ getRowId: context.getRowId, itemClass: context.itemClass });\n}\n\nexport function useDataTableContext<T extends object, IdType extends keyof T = keyof T>(): DataTableContext<T, IdType> {\n return {\n ...useDataTableStyling(),\n ...useDataTableColumns<T>(),\n ...useDataTableSelection<T, IdType>(),\n ...useDataTableExpansion<T, IdType>(),\n ...useDataTableGrouping<T>(),\n ...useDataTableRowIdentity<T, IdType>(),\n };\n}\n"],"mappings":";;AA2EA,IAAM,qBAAqB,OAAO,oBAAoB;AACtD,IAAM,qBAAqB,OAAO,oBAAoB;AACtD,IAAM,uBAAuB,OAAO,sBAAsB;AAC1D,IAAM,uBAAuB,OAAO,sBAAsB;AAC1D,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAM,0BAA0B,OAAO,yBAAyB;AAChE,IAAM,oBAAoB,OAAO,mBAAmB;AAIpD,SAAS,cAAiB,KAAa,MAAiB;CACtD,MAAM,UAAU,OAAU,GAAG;CAC7B,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,GAAG,KAAK,oCAAoC;CAE9D,OAAO;AACT;AAEA,SAAgB,wBAAwB,SAAwC;CAC9E,QAAQ,oBAAoB,OAAO;AACrC;AAEA,SAAgB,sBAA+C;CAC7D,OAAO,cAAuC,oBAAoB,qBAAqB;AACzF;AAEA,SAAgB,wBAA0C,SAA2C;CACnG,QAAQ,oBAAoB,OAAO;AACrC;AAEA,SAAgB,sBAA0E;CACxF,OAAO,cAA0C,oBAAoB,qBAAqB;AAC5F;AAEA,SAAgB,0BAAoE,SAAqD;CACvI,QAAQ,sBAAsB,OAAO;AACvC;AAEA,SAAgB,wBAAwH;CACtI,OAAO,cAAoD,sBAAsB,uBAAuB;AAC1G;AAEA,SAAgB,0BAAoE,SAAqD;CACvI,QAAQ,sBAAsB,OAAO;AACvC;AAEA,SAAgB,wBAAwH;CACtI,OAAO,cAAoD,sBAAsB,uBAAuB;AAC1G;AAEA,SAAgB,yBAA2C,SAA4C;CACrG,QAAQ,qBAAqB,OAAO;AACtC;AAEA,SAAgB,uBAA4E;CAC1F,OAAO,cAA2C,qBAAqB,sBAAsB;AAC/F;AAEA,SAAgB,4BAAsE,SAAuD;CAC3I,QAAQ,yBAAyB,OAAO;AAC1C;AAEA,SAAgB,0BAA4H;CAC1I,OAAO,cAAsD,yBAAyB,yBAAyB;AACjH;;AAGA,SAAgB,yBAA+B;CAC7C,QAAQ,mBAAmB,IAAI;AACjC;;AAGA,SAAgB,qBAA8B;CAC5C,OAAO,OAAgB,mBAAmB,KAAK;AACjD;AAIA,SAAgB,wBAAkE,SAA4C;CAC5H,wBAAwB;EAAE,SAAS,QAAQ;EAAS,SAAS,QAAQ;EAAS,OAAO,QAAQ;EAAO,UAAU,QAAQ;CAAS,CAAC;CAChI,wBAA2B;EAAE,SAAS,QAAQ;EAAS,WAAW,QAAQ;EAAW,cAAc,QAAQ;EAAc,YAAY,QAAQ;CAAW,CAAC;CACzJ,0BAAqC;EAAE,cAAc,QAAQ;EAAc,YAAY,QAAQ;EAAY,eAAe,QAAQ;EAAe,UAAU,QAAQ;EAAU,iBAAiB,QAAQ;CAAgB,CAAC;CACvN,0BAAqC;EAAE,YAAY,QAAQ;EAAY,YAAY,QAAQ;EAAY,gBAAgB,QAAQ;CAAe,CAAC;CAC/I,yBAA4B;EAAE,2BAA2B,QAAQ;EAA2B,UAAU,QAAQ;EAAU,iBAAiB,QAAQ;EAAiB,qBAAqB,QAAQ;EAAqB,WAAW,QAAQ;EAAW,aAAa,QAAQ;CAAY,CAAC;CACpR,4BAAuC;EAAE,UAAU,QAAQ;EAAU,WAAW,QAAQ;CAAU,CAAC;AACrG"}
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../../src/components/tables/data-table/context.ts"],"sourcesContent":["import type { ComputedRef, Ref } from 'vue';\nimport type { TableColumn } from '@/components/tables/RuiTableHead.vue';\nimport type { GroupExpandButtonPosition } from '@/components/tables/table-props';\nimport type { GroupHeader } from '@/composables/tables/data-table/types';\n\nexport interface DataTableClasses {\n td: string;\n tr: string;\n trSelected: string;\n trExpandable: string;\n /** a row whose expanded panel is open, shaded to match the panel */\n trExpandedParent: string;\n trGroup: string;\n trEmpty: string;\n checkbox: string;\n tbody: string;\n tbodyLoader: string;\n}\n\n// --- Per-concern context interfaces ---\n\nexport interface DataTableStylingContext {\n classes: ComputedRef<DataTableClasses>;\n colspan: ComputedRef<number>;\n dense: boolean;\n /** whether the table is currently rendered in its stacked mobile layout */\n isMobile: ComputedRef<boolean>;\n}\n\nexport interface DataTableColumnsContext<T extends object = any> {\n columns: ComputedRef<TableColumn<T>[]>;\n cellValue: (row: T, key: TableColumn<T>['key']) => T[keyof T];\n itemSlotKeys: Set<string>;\n /** the column definition attribute used as the visible label (e.g. `label`) */\n columnAttr: keyof TableColumn<T>;\n}\n\nexport interface DataTableSelectionContext<T extends object = any, IdType extends keyof T = keyof T> {\n selectedData: Ref<T[IdType][] | undefined>;\n isSelected: (id: T[IdType]) => boolean;\n isDisabledRow: (id: T[IdType]) => boolean;\n onSelect: (selected: boolean, id: T[IdType], userAction: boolean) => void;\n onCheckboxClick: (event: MouseEvent, id: T[IdType], index: number) => void;\n}\n\nexport interface DataTableExpansionContext<T extends object = any, IdType extends keyof T = keyof T> {\n expandable: ComputedRef<boolean>;\n isExpanded: (id: T[IdType]) => boolean;\n onToggleExpand: (row: T) => void;\n}\n\nexport interface DataTableGroupLabel {\n key: string;\n /** the grouped column's visible label, or the key when no column defines one */\n label: string;\n}\n\nexport interface DataTableGroupingContext<T extends object = any> {\n groupExpandButtonPosition: GroupExpandButtonPosition;\n groupKey: ComputedRef<string | undefined>;\n groupLabels: ComputedRef<DataTableGroupLabel[]>;\n /** the number of rows in the group, across all pages */\n getGroupSize: (identifier: string) => number;\n isExpandedGroup: (group: Partial<T>) => boolean;\n onToggleExpandGroup: (group: Partial<T>, identifier: string) => void;\n onUngroup: () => void;\n onCopyGroup: (header: GroupHeader<T>) => void;\n}\n\nexport interface DataTableRowIdentityContext<T extends object = any, IdType extends keyof T = keyof T> {\n getRowId: (row: T) => T[IdType];\n itemClass: ((item: T) => string) | string;\n}\n\n// --- Backward-compatible merged type ---\n\nexport type DataTableContext<T extends object = any, IdType extends keyof T = keyof T> =\n DataTableStylingContext &\n DataTableColumnsContext<T> &\n DataTableSelectionContext<T, IdType> &\n DataTableExpansionContext<T, IdType> &\n DataTableGroupingContext<T> &\n DataTableRowIdentityContext<T, IdType>;\n\n// --- Per-concern symbols ---\n\nconst DATA_TABLE_STYLING = Symbol('data-table-styling');\nconst DATA_TABLE_COLUMNS = Symbol('data-table-columns');\nconst DATA_TABLE_SELECTION = Symbol('data-table-selection');\nconst DATA_TABLE_EXPANSION = Symbol('data-table-expansion');\nconst DATA_TABLE_GROUPING = Symbol('data-table-grouping');\nconst DATA_TABLE_ROW_IDENTITY = Symbol('data-table-row-identity');\nconst DATA_TABLE_NESTED = Symbol('data-table-nested');\n\n// --- Per-concern provide/use pairs ---\n\nfunction injectOrThrow<C>(key: symbol, name: string): C {\n const context = inject<C>(key);\n if (context === undefined)\n throw new Error(`${name} must be used within a RuiDataTable`);\n\n return context;\n}\n\nexport function provideDataTableStyling(context: DataTableStylingContext): void {\n provide(DATA_TABLE_STYLING, context);\n}\n\nexport function useDataTableStyling(): DataTableStylingContext {\n return injectOrThrow<DataTableStylingContext>(DATA_TABLE_STYLING, 'useDataTableStyling');\n}\n\nexport function provideDataTableColumns<T extends object>(context: DataTableColumnsContext<T>): void {\n provide(DATA_TABLE_COLUMNS, context);\n}\n\nexport function useDataTableColumns<T extends object = any>(): DataTableColumnsContext<T> {\n return injectOrThrow<DataTableColumnsContext<T>>(DATA_TABLE_COLUMNS, 'useDataTableColumns');\n}\n\nexport function provideDataTableSelection<T extends object, IdType extends keyof T>(context: DataTableSelectionContext<T, IdType>): void {\n provide(DATA_TABLE_SELECTION, context);\n}\n\nexport function useDataTableSelection<T extends object = any, IdType extends keyof T = keyof T>(): DataTableSelectionContext<T, IdType> {\n return injectOrThrow<DataTableSelectionContext<T, IdType>>(DATA_TABLE_SELECTION, 'useDataTableSelection');\n}\n\nexport function provideDataTableExpansion<T extends object, IdType extends keyof T>(context: DataTableExpansionContext<T, IdType>): void {\n provide(DATA_TABLE_EXPANSION, context);\n}\n\nexport function useDataTableExpansion<T extends object = any, IdType extends keyof T = keyof T>(): DataTableExpansionContext<T, IdType> {\n return injectOrThrow<DataTableExpansionContext<T, IdType>>(DATA_TABLE_EXPANSION, 'useDataTableExpansion');\n}\n\nexport function provideDataTableGrouping<T extends object>(context: DataTableGroupingContext<T>): void {\n provide(DATA_TABLE_GROUPING, context);\n}\n\nexport function useDataTableGrouping<T extends object = any>(): DataTableGroupingContext<T> {\n return injectOrThrow<DataTableGroupingContext<T>>(DATA_TABLE_GROUPING, 'useDataTableGrouping');\n}\n\nexport function provideDataTableRowIdentity<T extends object, IdType extends keyof T>(context: DataTableRowIdentityContext<T, IdType>): void {\n provide(DATA_TABLE_ROW_IDENTITY, context);\n}\n\nexport function useDataTableRowIdentity<T extends object = any, IdType extends keyof T = keyof T>(): DataTableRowIdentityContext<T, IdType> {\n return injectOrThrow<DataTableRowIdentityContext<T, IdType>>(DATA_TABLE_ROW_IDENTITY, 'useDataTableRowIdentity');\n}\n\n/** Marks descendant data tables as nested (e.g. rendered inside an expanded row). */\nexport function provideDataTableNested(): void {\n provide(DATA_TABLE_NESTED, true);\n}\n\n/** True when this data table is rendered inside another data table. */\nexport function useDataTableNested(): boolean {\n return inject<boolean>(DATA_TABLE_NESTED, false);\n}\n\n// --- Backward-compatible facade ---\n\nexport function provideDataTableContext<T extends object, IdType extends keyof T>(context: DataTableContext<T, IdType>): void {\n provideDataTableStyling({ classes: context.classes, colspan: context.colspan, dense: context.dense, isMobile: context.isMobile });\n provideDataTableColumns<T>({ columns: context.columns, cellValue: context.cellValue, itemSlotKeys: context.itemSlotKeys, columnAttr: context.columnAttr });\n provideDataTableSelection<T, IdType>({ selectedData: context.selectedData, isSelected: context.isSelected, isDisabledRow: context.isDisabledRow, onSelect: context.onSelect, onCheckboxClick: context.onCheckboxClick });\n provideDataTableExpansion<T, IdType>({ expandable: context.expandable, isExpanded: context.isExpanded, onToggleExpand: context.onToggleExpand });\n provideDataTableGrouping<T>({ groupExpandButtonPosition: context.groupExpandButtonPosition, groupKey: context.groupKey, groupLabels: context.groupLabels, getGroupSize: context.getGroupSize, isExpandedGroup: context.isExpandedGroup, onToggleExpandGroup: context.onToggleExpandGroup, onUngroup: context.onUngroup, onCopyGroup: context.onCopyGroup });\n provideDataTableRowIdentity<T, IdType>({ getRowId: context.getRowId, itemClass: context.itemClass });\n}\n\nexport function useDataTableContext<T extends object, IdType extends keyof T = keyof T>(): DataTableContext<T, IdType> {\n return {\n ...useDataTableStyling(),\n ...useDataTableColumns<T>(),\n ...useDataTableSelection<T, IdType>(),\n ...useDataTableExpansion<T, IdType>(),\n ...useDataTableGrouping<T>(),\n ...useDataTableRowIdentity<T, IdType>(),\n };\n}\n"],"mappings":";;AAsFA,IAAM,qBAAqB,OAAO,oBAAoB;AACtD,IAAM,qBAAqB,OAAO,oBAAoB;AACtD,IAAM,uBAAuB,OAAO,sBAAsB;AAC1D,IAAM,uBAAuB,OAAO,sBAAsB;AAC1D,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAM,0BAA0B,OAAO,yBAAyB;AAChE,IAAM,oBAAoB,OAAO,mBAAmB;AAIpD,SAAS,cAAiB,KAAa,MAAiB;CACtD,MAAM,UAAU,OAAU,GAAG;CAC7B,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,GAAG,KAAK,oCAAoC;CAE9D,OAAO;AACT;AAEA,SAAgB,wBAAwB,SAAwC;CAC9E,QAAQ,oBAAoB,OAAO;AACrC;AAEA,SAAgB,sBAA+C;CAC7D,OAAO,cAAuC,oBAAoB,qBAAqB;AACzF;AAEA,SAAgB,wBAA0C,SAA2C;CACnG,QAAQ,oBAAoB,OAAO;AACrC;AAEA,SAAgB,sBAA0E;CACxF,OAAO,cAA0C,oBAAoB,qBAAqB;AAC5F;AAEA,SAAgB,0BAAoE,SAAqD;CACvI,QAAQ,sBAAsB,OAAO;AACvC;AAEA,SAAgB,wBAAwH;CACtI,OAAO,c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Q;CAAU,CAAC;AACrG"}
|
|
@@ -16,9 +16,8 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
dense: {
|
|
19
|
-
true: {
|
|
20
|
-
|
|
21
|
-
};
|
|
19
|
+
true: {};
|
|
20
|
+
false: {};
|
|
22
21
|
};
|
|
23
22
|
striped: {
|
|
24
23
|
true: {
|
|
@@ -35,6 +34,9 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
35
34
|
expandable: {
|
|
36
35
|
tr: string;
|
|
37
36
|
};
|
|
37
|
+
expandedParent: {
|
|
38
|
+
tr: string;
|
|
39
|
+
};
|
|
38
40
|
group: {
|
|
39
41
|
tr: string;
|
|
40
42
|
};
|
|
@@ -76,9 +78,8 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
76
78
|
};
|
|
77
79
|
};
|
|
78
80
|
dense: {
|
|
79
|
-
true: {
|
|
80
|
-
|
|
81
|
-
};
|
|
81
|
+
true: {};
|
|
82
|
+
false: {};
|
|
82
83
|
};
|
|
83
84
|
striped: {
|
|
84
85
|
true: {
|
|
@@ -95,6 +96,9 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
95
96
|
expandable: {
|
|
96
97
|
tr: string;
|
|
97
98
|
};
|
|
99
|
+
expandedParent: {
|
|
100
|
+
tr: string;
|
|
101
|
+
};
|
|
98
102
|
group: {
|
|
99
103
|
tr: string;
|
|
100
104
|
};
|
|
@@ -136,9 +140,8 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
136
140
|
};
|
|
137
141
|
};
|
|
138
142
|
dense: {
|
|
139
|
-
true: {
|
|
140
|
-
|
|
141
|
-
};
|
|
143
|
+
true: {};
|
|
144
|
+
false: {};
|
|
142
145
|
};
|
|
143
146
|
striped: {
|
|
144
147
|
true: {
|
|
@@ -155,6 +158,9 @@ export declare const dataTableStyles: import("tailwind-variants").TVReturnType<{
|
|
|
155
158
|
expandable: {
|
|
156
159
|
tr: string;
|
|
157
160
|
};
|
|
161
|
+
expandedParent: {
|
|
162
|
+
tr: string;
|
|
163
|
+
};
|
|
158
164
|
group: {
|
|
159
165
|
tr: string;
|
|
160
166
|
};
|
|
@@ -7,7 +7,7 @@ var dataTableStyles = tv({
|
|
|
7
7
|
table: "min-w-full table-fixed divide-y divide-black/[0.12] dark:divide-white/[0.12] whitespace-nowrap mx-auto my-0 max-w-fit relative border-black/[0.12] dark:border-white/[0.12]",
|
|
8
8
|
tbody: "divide-y divide-black/[0.12] dark:divide-white/[0.12]",
|
|
9
9
|
tr: "hover:bg-black/[0.04] dark:hover:bg-white/[0.04]",
|
|
10
|
-
td: "
|
|
10
|
+
td: "[:where(&)]:px-4 text-rui-text text-body-2 tabular-nums [text-wrap:initial]",
|
|
11
11
|
checkbox: "px-2 w-[3.625rem] max-w-[3.625rem] [&_label]:ml-0",
|
|
12
12
|
tbodyLoader: "text-center"
|
|
13
13
|
},
|
|
@@ -18,13 +18,17 @@ var dataTableStyles = tv({
|
|
|
18
18
|
md: { wrapper: "rounded-[.75rem]" },
|
|
19
19
|
lg: { wrapper: "rounded-[1rem]" }
|
|
20
20
|
},
|
|
21
|
-
dense: {
|
|
22
|
-
|
|
21
|
+
dense: {
|
|
22
|
+
true: {},
|
|
23
|
+
false: {}
|
|
24
|
+
},
|
|
25
|
+
striped: { true: { tbody: "[:where(&>tr:nth-child(even))]:bg-rui-grey-50 dark:[:where(&>tr:nth-child(even))]:bg-rui-grey-900" } },
|
|
23
26
|
rowVariant: {
|
|
24
27
|
selected: { tr: "bg-rui-primary/[0.08] dark:bg-rui-dark-primary/[0.08]" },
|
|
25
28
|
empty: { tr: "hover:bg-transparent" },
|
|
26
|
-
expandable: { tr: "bg-
|
|
27
|
-
|
|
29
|
+
expandable: { tr: "bg-rui-grey-50 hover:bg-rui-grey-50 dark:bg-white/[0.03] dark:hover:bg-white/[0.03] !border-t-0" },
|
|
30
|
+
expandedParent: { tr: "bg-rui-grey-50 dark:bg-white/[0.03]" },
|
|
31
|
+
group: { tr: "bg-rui-grey-100 dark:bg-white/[0.05]" }
|
|
28
32
|
},
|
|
29
33
|
mobile: { true: {
|
|
30
34
|
wrapper: "divide-y-0 border-0 rounded-none overflow-visible",
|
|
@@ -34,6 +38,25 @@ var dataTableStyles = tv({
|
|
|
34
38
|
tr: "block",
|
|
35
39
|
td: "block px-4 py-2"
|
|
36
40
|
} }
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* A fixed row height keeps a row of plain text as tall as one holding an
|
|
44
|
+
* icon button. Padding and floor sit in `:where()` so a consumer's `cellClass`
|
|
45
|
+
* (`py-0` is common) still wins at any stylesheet order, and each density
|
|
46
|
+
* sets its own because the class merger cannot dedupe these.
|
|
47
|
+
*/
|
|
48
|
+
compoundVariants: [{
|
|
49
|
+
dense: false,
|
|
50
|
+
mobile: false,
|
|
51
|
+
class: { td: "[:where(&)]:py-3 [:where(&)]:h-[3.25rem]" }
|
|
52
|
+
}, {
|
|
53
|
+
dense: true,
|
|
54
|
+
mobile: false,
|
|
55
|
+
class: { td: "[:where(&)]:py-1 [:where(&)]:h-9" }
|
|
56
|
+
}],
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
dense: false,
|
|
59
|
+
mobile: false
|
|
37
60
|
}
|
|
38
61
|
});
|
|
39
62
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const dataTableStyles = tv({\n slots: {\n wrapper: 'relative divide-y divide-black/[0.12] dark:divide-white/[0.12] overflow-hidden',\n scroller: 'overflow-x-auto overflow-y-hidden [clip-path:inset(0_0_0_0)]',\n table: 'min-w-full table-fixed divide-y divide-black/[0.12] dark:divide-white/[0.12] whitespace-nowrap mx-auto my-0 max-w-fit relative border-black/[0.12] dark:border-white/[0.12]',\n tbody: 'divide-y divide-black/[0.12] dark:divide-white/[0.12]',\n tr: 'hover:bg-black/[0.04] dark:hover:bg-white/[0.04]',\n td: '
|
|
1
|
+
{"version":3,"file":"data-table-styles.js","names":[],"sources":["../../../src/components/tables/data-table-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const dataTableStyles = tv({\n slots: {\n wrapper: 'relative divide-y divide-black/[0.12] dark:divide-white/[0.12] overflow-hidden',\n scroller: 'overflow-x-auto overflow-y-hidden [clip-path:inset(0_0_0_0)]',\n table: 'min-w-full table-fixed divide-y divide-black/[0.12] dark:divide-white/[0.12] whitespace-nowrap mx-auto my-0 max-w-fit relative border-black/[0.12] dark:border-white/[0.12]',\n tbody: 'divide-y divide-black/[0.12] dark:divide-white/[0.12]',\n tr: 'hover:bg-black/[0.04] dark:hover:bg-white/[0.04]',\n td: '[:where(&)]:px-4 text-rui-text text-body-2 tabular-nums [text-wrap:initial]',\n checkbox: 'px-2 w-[3.625rem] max-w-[3.625rem] [&_label]:ml-0',\n tbodyLoader: 'text-center',\n },\n variants: {\n outlined: {\n true: { wrapper: 'border border-black/[0.12] dark:border-white/[0.12]' },\n },\n rounded: {\n sm: { wrapper: 'rounded-[.25rem]' },\n md: { wrapper: 'rounded-[.75rem]' },\n lg: { wrapper: 'rounded-[1rem]' },\n },\n dense: {\n true: {},\n false: {},\n },\n // `:where()` keeps the stripe below every row state (selected, hover, expanded, group)\n striped: {\n true: { tbody: '[:where(&>tr:nth-child(even))]:bg-rui-grey-50 dark:[:where(&>tr:nth-child(even))]:bg-rui-grey-900' },\n },\n rowVariant: {\n selected: { tr: 'bg-rui-primary/[0.08] dark:bg-rui-dark-primary/[0.08]' },\n empty: { tr: 'hover:bg-transparent' },\n // `!border-t-0` drops the divider so the panel joins the row that opened it\n expandable: { tr: 'bg-rui-grey-50 hover:bg-rui-grey-50 dark:bg-white/[0.03] dark:hover:bg-white/[0.03] !border-t-0' },\n expandedParent: { tr: 'bg-rui-grey-50 dark:bg-white/[0.03]' },\n group: { tr: 'bg-rui-grey-100 dark:bg-white/[0.05]' },\n },\n mobile: {\n true: {\n wrapper: 'divide-y-0 border-0 rounded-none overflow-visible',\n scroller: 'overflow-visible [clip-path:none]',\n table: 'block min-w-0 max-w-none w-full whitespace-normal divide-y-0 border-0',\n tbody: 'block divide-y-0',\n tr: 'block',\n td: 'block px-4 py-2',\n },\n },\n },\n /**\n * A fixed row height keeps a row of plain text as tall as one holding an\n * icon button. Padding and floor sit in `:where()` so a consumer's `cellClass`\n * (`py-0` is common) still wins at any stylesheet order, and each density\n * sets its own because the class merger cannot dedupe these.\n */\n compoundVariants: [\n { dense: false, mobile: false, class: { td: '[:where(&)]:py-3 [:where(&)]:h-[3.25rem]' } },\n { dense: true, mobile: false, class: { td: '[:where(&)]:py-1 [:where(&)]:h-9' } },\n ],\n defaultVariants: {\n dense: false,\n mobile: false,\n },\n});\n"],"mappings":";;AAEA,IAAa,kBAAkB,GAAG;CAChC,OAAO;EACL,SAAS;EACT,UAAU;EACV,OAAO;EACP,OAAO;EACP,IAAI;EACJ,IAAI;EACJ,UAAU;EACV,aAAa;CACf;CACA,UAAU;EACR,UAAU,EACR,MAAM,EAAE,SAAS,sDAAsD,EACzE;EACA,SAAS;GACP,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,mBAAmB;GAClC,IAAI,EAAE,SAAS,iBAAiB;EAClC;EACA,OAAO;GACL,MAAM,CAAC;GACP,OAAO,CAAC;EACV;EAEA,SAAS,EACP,MAAM,EAAE,OAAO,oGAAoG,EACrH;EACA,YAAY;GACV,UAAU,EAAE,IAAI,wDAAwD;GACxE,OAAO,EAAE,IAAI,uBAAuB;GAEpC,YAAY,EAAE,IAAI,kGAAkG;GACpH,gBAAgB,EAAE,IAAI,sCAAsC;GAC5D,OAAO,EAAE,IAAI,uCAAuC;EACtD;EACA,QAAQ,EACN,MAAM;GACJ,SAAS;GACT,UAAU;GACV,OAAO;GACP,OAAO;GACP,IAAI;GACJ,IAAI;EACN,EACF;CACF;;;;;;;CAOA,kBAAkB,CAChB;EAAE,OAAO;EAAO,QAAQ;EAAO,OAAO,EAAE,IAAI,2CAA2C;CAAE,GACzF;EAAE,OAAO;EAAM,QAAQ;EAAO,OAAO,EAAE,IAAI,mCAAmC;CAAE,CAClF;CACA,iBAAiB;EACf,OAAO;EACP,QAAQ;CACV;AACF,CAAC"}
|
|
@@ -16,9 +16,8 @@ export declare const SortDirection: {
|
|
|
16
16
|
export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];
|
|
17
17
|
/**
|
|
18
18
|
* Returns alignment Tailwind classes for a table cell.
|
|
19
|
-
* When sortable, adds reduced padding for the sort button.
|
|
20
19
|
*/
|
|
21
|
-
export declare function getAlignClass(align?: TableAlign
|
|
20
|
+
export declare function getAlignClass(align?: TableAlign): string;
|
|
22
21
|
/**
|
|
23
22
|
* Returns extra class for sort button when column is center-aligned.
|
|
24
23
|
*/
|
|
@@ -17,19 +17,11 @@ var ALIGN_CLASSES = {
|
|
|
17
17
|
[TableAlign.center]: "text-center",
|
|
18
18
|
[TableAlign.end]: "text-right rtl:text-left"
|
|
19
19
|
};
|
|
20
|
-
var SORTABLE_ALIGN_CLASSES = {
|
|
21
|
-
[TableAlign.start]: "pl-3",
|
|
22
|
-
[TableAlign.center]: "px-3",
|
|
23
|
-
[TableAlign.end]: "pr-3"
|
|
24
|
-
};
|
|
25
20
|
/**
|
|
26
21
|
* Returns alignment Tailwind classes for a table cell.
|
|
27
|
-
* When sortable, adds reduced padding for the sort button.
|
|
28
22
|
*/
|
|
29
|
-
function getAlignClass(align = TableAlign.start
|
|
30
|
-
|
|
31
|
-
if (sortable) return `${classes} ${SORTABLE_ALIGN_CLASSES[align]}`;
|
|
32
|
-
return classes;
|
|
23
|
+
function getAlignClass(align = TableAlign.start) {
|
|
24
|
+
return ALIGN_CLASSES[align];
|
|
33
25
|
}
|
|
34
26
|
/**
|
|
35
27
|
* Returns extra class for sort button when column is center-aligned.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-props.js","names":[],"sources":["../../../src/components/tables/table-props.ts"],"sourcesContent":["export const TableAlign = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TableAlign = (typeof TableAlign)[keyof typeof TableAlign];\n\nexport const GroupExpandButtonPosition = {\n start: 'start',\n end: 'end',\n} as const;\n\nexport type GroupExpandButtonPosition = (typeof GroupExpandButtonPosition)[keyof typeof GroupExpandButtonPosition];\n\nexport const SortDirection = {\n asc: 'asc',\n desc: 'desc',\n} as const;\n\nexport type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\nconst ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'text-left rtl:text-right',\n [TableAlign.center]: 'text-center',\n [TableAlign.end]: 'text-right rtl:text-left',\n};\n\
|
|
1
|
+
{"version":3,"file":"table-props.js","names":[],"sources":["../../../src/components/tables/table-props.ts"],"sourcesContent":["export const TableAlign = {\n start: 'start',\n center: 'center',\n end: 'end',\n} as const;\n\nexport type TableAlign = (typeof TableAlign)[keyof typeof TableAlign];\n\nexport const GroupExpandButtonPosition = {\n start: 'start',\n end: 'end',\n} as const;\n\nexport type GroupExpandButtonPosition = (typeof GroupExpandButtonPosition)[keyof typeof GroupExpandButtonPosition];\n\nexport const SortDirection = {\n asc: 'asc',\n desc: 'desc',\n} as const;\n\nexport type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\nconst ALIGN_CLASSES: Record<TableAlign, string> = {\n [TableAlign.start]: 'text-left rtl:text-right',\n [TableAlign.center]: 'text-center',\n [TableAlign.end]: 'text-right rtl:text-left',\n};\n\n/**\n * Returns alignment Tailwind classes for a table cell.\n */\nexport function getAlignClass(align: TableAlign = TableAlign.start): string {\n return ALIGN_CLASSES[align];\n}\n\n/**\n * Returns extra class for sort button when column is center-aligned.\n */\nexport function getSortButtonAlignClass(align: TableAlign = TableAlign.start): string | undefined {\n return align === TableAlign.center ? 'ml-6' : undefined;\n}\n"],"mappings":";AAAA,IAAa,aAAa;CACxB,OAAO;CACP,QAAQ;CACR,KAAK;AACP;AAIA,IAAa,4BAA4B;CACvC,OAAO;CACP,KAAK;AACP;AAIA,IAAa,gBAAgB;CAC3B,KAAK;CACL,MAAM;AACR;AAIA,IAAM,gBAA4C;EAC/C,WAAW,QAAQ;EACnB,WAAW,SAAS;EACpB,WAAW,MAAM;AACpB;;;;AAKA,SAAgB,cAAc,QAAoB,WAAW,OAAe;CAC1E,OAAO,cAAc;AACvB;;;;AAKA,SAAgB,wBAAwB,QAAoB,WAAW,OAA2B;CAChG,OAAO,UAAU,WAAW,SAAS,SAAS,KAAA;AAChD"}
|
|
@@ -21,7 +21,7 @@ function usePaginationNavigation(modelValue, tableDefaults, rangesThreshold = 50
|
|
|
21
21
|
const { limit, total } = get(modelValue);
|
|
22
22
|
const start = (page - 1) * limit + 1;
|
|
23
23
|
const end = Math.min(page * limit, total);
|
|
24
|
-
return `${formatInteger(start)}
|
|
24
|
+
return `${formatInteger(start)}–${formatInteger(end)}`;
|
|
25
25
|
}
|
|
26
26
|
const useInputJump = computed(() => {
|
|
27
27
|
const threshold = toValue(rangesThreshold);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination-navigation.js","names":[],"sources":["../../../src/components/tables/use-pagination-navigation.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, WritableComputedRef } from 'vue';\nimport type { TableOptions } from '@/composables/defaults/table';\nimport { formatInteger } from '@/utils/helpers';\n\ninterface LimitEntry { limit: number }\n\ninterface PageRange { page: number; text: string }\n\nexport interface TablePaginationData {\n page: number;\n total: number;\n limit: number;\n limits?: number[];\n}\n\nexport interface UsePaginationNavigationReturn {\n limits: ComputedRef<LimitEntry[]>;\n currentLimit: WritableComputedRef<number>;\n pages: ComputedRef<number>;\n ranges: ComputedRef<PageRange[]>;\n indicatorText: ComputedRef<string>;\n currentRange: WritableComputedRef<number>;\n useInputJump: ComputedRef<boolean>;\n hasPrev: ComputedRef<boolean>;\n hasNext: ComputedRef<boolean>;\n onPrev: () => void;\n onNext: () => void;\n onFirst: () => void;\n onLast: () => void;\n}\n\nexport function usePaginationNavigation(\n modelValue: Ref<TablePaginationData>,\n tableDefaults: TableOptions,\n rangesThreshold: MaybeRefOrGetter<number> = 500,\n): UsePaginationNavigationReturn {\n const limits = computed<LimitEntry[]>(() =>\n (get(modelValue).limits ?? get(tableDefaults.limits)).map(limit => ({ limit })),\n );\n\n const currentLimit = computed<number>({\n get: () => get(modelValue).limit,\n set: limit =>\n set(modelValue, {\n ...get(modelValue),\n limit,\n page: 1,\n }),\n });\n\n const pages = computed<number>(() => {\n const { limit, total } = get(modelValue);\n if (!total)\n return 0;\n\n return Math.ceil(total / limit);\n });\n\n function pageRangeText(page: number): string {\n const { limit, total } = get(modelValue);\n const start = (page - 1) * limit + 1;\n const end = Math.min(page * limit, total);\n return `${formatInteger(start)}
|
|
1
|
+
{"version":3,"file":"use-pagination-navigation.js","names":[],"sources":["../../../src/components/tables/use-pagination-navigation.ts"],"sourcesContent":["import type { ComputedRef, MaybeRefOrGetter, Ref, WritableComputedRef } from 'vue';\nimport type { TableOptions } from '@/composables/defaults/table';\nimport { formatInteger } from '@/utils/helpers';\n\ninterface LimitEntry { limit: number }\n\ninterface PageRange { page: number; text: string }\n\nexport interface TablePaginationData {\n page: number;\n total: number;\n limit: number;\n limits?: number[];\n}\n\nexport interface UsePaginationNavigationReturn {\n limits: ComputedRef<LimitEntry[]>;\n currentLimit: WritableComputedRef<number>;\n pages: ComputedRef<number>;\n ranges: ComputedRef<PageRange[]>;\n indicatorText: ComputedRef<string>;\n currentRange: WritableComputedRef<number>;\n useInputJump: ComputedRef<boolean>;\n hasPrev: ComputedRef<boolean>;\n hasNext: ComputedRef<boolean>;\n onPrev: () => void;\n onNext: () => void;\n onFirst: () => void;\n onLast: () => void;\n}\n\nexport function usePaginationNavigation(\n modelValue: Ref<TablePaginationData>,\n tableDefaults: TableOptions,\n rangesThreshold: MaybeRefOrGetter<number> = 500,\n): UsePaginationNavigationReturn {\n const limits = computed<LimitEntry[]>(() =>\n (get(modelValue).limits ?? get(tableDefaults.limits)).map(limit => ({ limit })),\n );\n\n const currentLimit = computed<number>({\n get: () => get(modelValue).limit,\n set: limit =>\n set(modelValue, {\n ...get(modelValue),\n limit,\n page: 1,\n }),\n });\n\n const pages = computed<number>(() => {\n const { limit, total } = get(modelValue);\n if (!total)\n return 0;\n\n return Math.ceil(total / limit);\n });\n\n function pageRangeText(page: number): string {\n const { limit, total } = get(modelValue);\n const start = (page - 1) * limit + 1;\n const end = Math.min(page * limit, total);\n return `${formatInteger(start)}–${formatInteger(end)}`;\n }\n\n const useInputJump = computed<boolean>(() => {\n const threshold = toValue(rangesThreshold);\n return threshold > 0 && get(pages) > threshold;\n });\n\n const ranges = computed<PageRange[]>(() => {\n if (get(useInputJump))\n return [];\n\n return Array.from({ length: get(pages) }, (_, i) => {\n const page = i + 1;\n return { page, text: pageRangeText(page) };\n });\n });\n\n const indicatorText = computed<string>(() => {\n const { total } = get(modelValue);\n if (get(useInputJump))\n return `of ${formatInteger(get(pages))}`;\n\n return total ? `of ${formatInteger(total)}` : `0 of 0`;\n });\n\n const currentRange = computed<number>({\n get: () => get(modelValue).page,\n set: page =>\n set(modelValue, {\n ...get(modelValue),\n page,\n }),\n });\n\n const hasPrev = computed<boolean>(() => get(modelValue).page > 1);\n const hasNext = computed<boolean>(() => get(pages) > get(modelValue).page);\n\n function goToPage(page: number): void {\n set(currentRange, page);\n }\n\n function onPrev(): void {\n if (get(hasPrev))\n goToPage(get(modelValue).page - 1);\n }\n\n function onNext(): void {\n if (get(hasNext))\n goToPage(get(modelValue).page + 1);\n }\n\n function onFirst(): void {\n if (get(hasPrev))\n goToPage(1);\n }\n\n function onLast(): void {\n if (get(hasNext))\n goToPage(get(pages));\n }\n\n return {\n limits,\n currentLimit,\n pages,\n ranges,\n indicatorText,\n currentRange,\n useInput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EvC,OAAO,QAAQ,MAAM,cAAc,KAAK,MAAM;CAChD,CAAC;CAED,MAAM,eAAe,SAAiB;EACpC,WAAW,IAAI,UAAU,CAAC,CAAC;EAC3B,MAAK,SACH,IAAI,YAAY;GACd,GAAG,IAAI,UAAU;GACjB;EACF,CAAC;CACL,CAAC;CAED,MAAM,UAAU,eAAwB,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CAChE,MAAM,UAAU,eAAwB,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,CAAC,IAAI;CAEzE,SAAS,SAAS,MAAoB;EACpC,IAAI,cAAc,IAAI;CACxB;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CACrC;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,UAAU,CAAC,CAAC,OAAO,CAAC;CACrC;CAEA,SAAS,UAAgB;EACvB,IAAI,IAAI,OAAO,GACb,SAAS,CAAC;CACd;CAEA,SAAS,SAAe;EACtB,IAAI,IAAI,OAAO,GACb,SAAS,IAAI,KAAK,CAAC;CACvB;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/index.js
CHANGED
|
@@ -59,11 +59,11 @@ import RuiNotification_default from "./components/overlays/notification/RuiNotif
|
|
|
59
59
|
import RuiFooterStepper_default from "./components/steppers/RuiFooterStepper.js";
|
|
60
60
|
import RuiStepper_default from "./components/steppers/RuiStepper.js";
|
|
61
61
|
import RuiTableEmptyState_default from "./components/tables/RuiTableEmptyState.js";
|
|
62
|
+
import RuiTableErrorState_default from "./components/tables/RuiTableErrorState.js";
|
|
62
63
|
import RuiExpandButton_default from "./components/tables/RuiExpandButton.js";
|
|
63
64
|
import RuiTableLoadingState_default from "./components/tables/RuiTableLoadingState.js";
|
|
64
65
|
import RuiTablePagination_default from "./components/tables/RuiTablePagination.js";
|
|
65
66
|
import RuiDataTable_default from "./components/tables/RuiDataTable.js";
|
|
66
|
-
import RuiTableErrorState_default from "./components/tables/RuiTableErrorState.js";
|
|
67
67
|
import RuiTable_default from "./components/tables/RuiTable.js";
|
|
68
68
|
import RuiTabItem_default from "./components/tabs/tab-item/RuiTabItem.js";
|
|
69
69
|
import RuiTabItems_default from "./components/tabs/tab-items/RuiTabItems.js";
|