bootstrap-vue-next 0.26.21 → 0.26.23

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.
@@ -1 +1 @@
1
- {"version":3,"file":"BTable.vue_vue_type_script_setup_true_lang-BO8_v2Zs.js","sources":["../src/utils/formatItem.ts","../src/types/TableTypes.ts","../src/components/BTable/BTbody.vue","../src/components/BTable/BTd.vue","../src/components/BTable/BTfoot.vue","../src/components/BTable/BTh.vue","../src/components/BTable/BThead.vue","../src/components/BTable/BTr.vue","../src/utils/tableUtils.ts","../src/utils/filterEvent.ts","../src/components/BTable/BTableLite.vue","../src/components/BTable/BTable.vue"],"sourcesContent":["import type {TableFieldFormatter} from '../types/TableTypes'\nimport {get} from './object'\n\nexport const formatItem = <T>(\n item: T,\n // Weakly type fieldKey because it can be a nested string, such as 'foo.bar.baz'\n fieldKey: string,\n formatter?: TableFieldFormatter<T>\n) => {\n const val = get(item, fieldKey)\n return formatter && typeof formatter === 'function' ? formatter(val, fieldKey, item) : val\n}\n","import type {StyleValue} from 'vue'\nimport type {ColorVariant} from './ColorTypes'\nimport type {MaybePromise} from './MaybePromise'\nimport type {LiteralUnion} from './LiteralUnion'\nimport type {AttrsValue, ClassValue} from './AnyValuedAttributes'\n\nexport type TableRowEvent<T> = [item: T, index: number, event: MouseEvent]\n\nexport type TableItem<T = Record<string, unknown>> = T & {\n _rowVariant?: ColorVariant | null\n _cellVariants?: Partial<Record<keyof T, ColorVariant>>\n _showDetails?: boolean\n}\n\nexport const isTableItem = (value: unknown): value is TableItem =>\n typeof value === 'object' && value !== null\n\n// undefined means no sorting\nexport type BTableSortByOrder = 'desc' | 'asc' | undefined\n\nexport type BTableSortBy = {\n order: BTableSortByOrder\n key: string\n comparer?: (a: string, b: string) => number\n}\n\nexport type BTableProviderContext = {\n sortBy: BTableSortBy[] | undefined\n filter: string | undefined\n currentPage: number\n perPage: number\n}\n\nexport type BTableProvider<T> = (\n context: Readonly<BTableProviderContext>\n) => MaybePromise<T[] | undefined>\n\nexport type TableFieldFormatter<T> = (value: unknown, key: string, item: T) => string\n\nexport type TableRowType = 'row' | 'row-details' | 'row-top' | 'row-bottom' | 'table-busy'\nexport type TableRowThead = 'top' | 'bottom'\n\nexport type TableStrictClassValue = string | unknown[] | Record<string, boolean>\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TableField<T = any> = {\n key: LiteralUnion<keyof T>\n label?: string\n headerTitle?: string\n headerAbbr?: string\n class?: ClassValue\n formatter?: TableFieldFormatter<T>\n sortable?: boolean\n sortDirection?: string\n sortByFormatted?: boolean | TableFieldFormatter<T>\n filterByFormatted?: boolean | TableFieldFormatter<T>\n tdClass?:\n | TableStrictClassValue\n | ((value: unknown, key: string, item: T) => TableStrictClassValue)\n thClass?: ClassValue\n thStyle?: StyleValue\n variant?: ColorVariant | null\n tdAttr?: AttrsValue | ((value: unknown, key: string, item: T) => AttrsValue)\n thAttr?:\n | AttrsValue\n | ((value: unknown, key: string, item: T | null, type: TableRowThead) => AttrsValue)\n isRowHeader?: boolean\n stickyColumn?: boolean\n}\n\nexport type TableFieldRaw<T = unknown> = T extends object\n ? LiteralUnion<keyof T> | TableField<T>\n : string | TableField\n\nexport const isTableField = <T>(value: unknown): value is TableField<T> =>\n typeof value === 'object' && value !== null && 'key' in value\n\nexport const isTableFieldRaw = <T>(value: unknown): value is TableFieldRaw<T> =>\n typeof value === 'string' || isTableField(value)\n\nexport type NoProviderTypes = 'paging' | 'sorting' | 'filtering'\n","<template>\n <tbody :class=\"computedClasses\">\n <slot />\n </tbody>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTbodyProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTbodyProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTbody')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`thead-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <td\n :scope=\"scope\"\n :class=\"computedClasses\"\n :colspan=\"props.colspan\"\n :rowspan=\"props.rowspan\"\n :data-label=\"props.stackedHeading\"\n >\n <div v-if=\"props.stackedHeading\">\n <slot />\n </div>\n <slot v-else />\n </td>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTdProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTdProps>(), {\n colspan: undefined,\n rowspan: undefined,\n stackedHeading: undefined,\n stickyColumn: false,\n variant: null,\n})\nconst props = useDefaults(_props, 'BTd')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n 'b-table-sticky-column': props.stickyColumn,\n 'table-b-table-default': props.stickyColumn && props.variant === null,\n}))\n\nconst scope = computed(() => (props.colspan ? 'colspan' : props.rowspan ? 'rowspan' : 'col'))\n</script>\n","<template>\n <tfoot :class=\"computedClasses\">\n <slot />\n </tfoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTfootProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTfootProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTfoot')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <th\n :scope=\"scope\"\n :class=\"computedClasses\"\n :colspan=\"props.colspan\"\n :rowspan=\"props.rowspan\"\n :data-label=\"props.stackedHeading\"\n >\n <div v-if=\"props.stackedHeading !== undefined\">\n <slot />\n </div>\n <slot v-else />\n </th>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BThProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BThProps>(), {\n colspan: undefined,\n rowspan: undefined,\n stackedHeading: undefined,\n stickyColumn: false,\n variant: null,\n})\nconst props = useDefaults(_props, 'BTh')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n 'b-table-sticky-column': props.stickyColumn,\n 'table-b-table-default': props.stickyColumn && props.variant === null,\n}))\n\nconst scope = computed(() => (props.colspan ? 'colspan' : props.rowspan ? 'rowspan' : 'col'))\n</script>\n","<template>\n <thead :class=\"computedClasses\">\n <slot />\n </thead>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTheadProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTheadProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BThead')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <tr :class=\"computedClasses\">\n <slot />\n </tr>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTrProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTrProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTr')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","import {titleCase} from './stringUtils'\nimport type {TableFieldRaw} from '../types/TableTypes'\nimport type {BTableLiteProps, BTableSimpleProps} from '../types'\n\nexport const getTableFieldHeadLabel = (field: Readonly<TableFieldRaw<unknown>>) =>\n typeof field === 'string'\n ? titleCase(field)\n : field.label !== undefined\n ? field.label\n : typeof field.key === 'string'\n ? titleCase(field.key)\n : field.key\n\nexport const btableSimpleProps = Object.freeze(\n Object.keys({\n bordered: 0,\n borderless: 0,\n borderVariant: 0,\n captionTop: 0,\n dark: 0,\n fixed: 0,\n hover: 0,\n id: 0,\n noBorderCollapse: 0,\n outlined: 0,\n responsive: 0,\n small: 0,\n stacked: 0,\n stickyHeader: 0,\n striped: 0,\n stripedColumns: 0,\n variant: 0,\n tableAttrs: 0,\n tableClass: 0,\n } satisfies Record<keyof BTableSimpleProps, 0>)\n) as readonly (keyof BTableSimpleProps)[]\n\nexport const btableLiteProps = Object.freeze(\n Object.keys({\n align: 0,\n caption: 0,\n detailsTdClass: 0,\n fieldColumnClass: 0,\n fields: 0,\n footClone: 0,\n footRowVariant: 0,\n footVariant: 0,\n headRowVariant: 0,\n headVariant: 0,\n items: 0,\n labelStacked: 0,\n modelValue: 0,\n primaryKey: 0,\n tbodyClass: 0,\n tbodyTrAttrs: 0,\n tbodyTrClass: 0,\n tfootClass: 0,\n tfootTrClass: 0,\n theadClass: 0,\n theadTrClass: 0,\n } satisfies Record<keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>, 0>)\n) as readonly (keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>)[]\n","const TABLE_TAG_NAMES = ['TD', 'TH', 'TR']\n\n// Filter CSS selector for click/dblclick/etc. events\n// If any of these selectors match the clicked element, we ignore the event\nconst eventFilter = [\n 'a',\n 'a *', // Include content inside links\n 'button',\n 'button *', // Include content inside buttons\n 'input:not(.disabled):not([disabled])',\n 'select:not(.disabled):not([disabled])',\n 'textarea:not(.disabled):not([disabled])',\n '[role=\"link\"]',\n '[role=\"link\"] *',\n '[role=\"button\"]',\n '[role=\"button\"] *',\n '[tabindex]:not(.disabled):not([disabled])',\n].join(',')\n\n// Returns `true` if we should ignore the click/double-click/keypress event\n// Avoids having the user need to use `@click.stop` on the form control\nexport const filterEvent = (event: Readonly<Event>) => {\n // Exit early when we don't have a target element\n if (!event || !event.target) {\n return false\n }\n const el = event.target as HTMLElement\n // Exit early when element is disabled or a table element\n if (('disabled' in el && el.disabled) || TABLE_TAG_NAMES.indexOf(el.tagName) !== -1) {\n return false\n }\n // Ignore the click when it was inside a dropdown menu\n if (el.closest('.dropdown-menu')) return true\n\n const label = el.tagName === 'LABEL' ? el : el.closest('label')\n // If the label's form control is not disabled then we don't propagate event\n // Modern browsers have `label.control` that references the associated input, but IE 11\n // does not have this property on the label element, so we resort to DOM lookups\n if (label) {\n const labelFor = label.getAttribute('for')\n const input = labelFor\n ? document.getElementById(labelFor)\n : label.querySelector('input, select, textarea')\n if (input && !(input as HTMLInputElement).disabled) {\n return true\n }\n }\n // Otherwise check if the event target matches one of the selectors in the\n // event filter (i.e. anchors, non disabled inputs, etc.)\n // Return `true` if we should ignore the event\n return el.matches(eventFilter)\n}\n","<template>\n <BTableSimple v-bind=\"computedSimpleProps\">\n <BThead v-show=\"showComputedHeaders\" :variant=\"props.headVariant\" :class=\"props.theadClass\">\n <slot name=\"thead-top\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n <BTr :variant=\"props.headRowVariant\" :class=\"props.theadTrClass\">\n <BTh\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :class=\"getFieldColumnClasses(field)\"\n :title=\"field.headerTitle\"\n :variant=\"field.variant\"\n :abbr=\"field.headerAbbr\"\n :style=\"field.thStyle\"\n v-bind=\"callThAttr(null, field, 'top')\"\n @click=\"headerClicked(field, $event)\"\n >\n <!-- eslint-disable prettier/prettier -->\n <slot\n :name=\"\n slots[`head(${String(field.key)})`]\n ? (`head(${String(field.key)})` as 'head()')\n : 'head()'\n \"\n :label=\"field.label\"\n :column=\"field.key as LiteralUnion<keyof Items>\"\n :field\n :is-foot=\"false\"\n >\n <!-- eslint-enable prettier/prettier -->\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n </BTh>\n </BTr>\n <BTr v-if=\"slots['thead-sub']\">\n <BTd\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :variant=\"field.variant\"\n :class=\"[field.class, field.thClass]\"\n >\n <slot name=\"thead-sub\" :items=\"props.items\" :fields=\"computedFields\" :field>\n {{ field.label }}\n </slot>\n </BTd>\n </BTr>\n </BThead>\n <BTbody :class=\"props.tbodyClass\">\n <slot\n name=\"custom-body\"\n :fields=\"computedFields\"\n :items=\"props.items\"\n :columns=\"computedFieldsTotal\"\n >\n <BTr\n v-if=\"!props.stacked && slots['top-row']\"\n :class=\"getRowClasses(null, 'row-top')\"\n v-bind=\"callTbodyTrAttrs(null, 'row-top')\"\n >\n <slot name=\"top-row\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n </BTr>\n\n <template\n v-for=\"(item, itemIndex) in props.items\"\n :key=\"\n props.primaryKey && get(item, props.primaryKey)\n ? get(item, props.primaryKey)\n : itemIndex\n \"\n >\n <BTr\n :id=\"\n props.primaryKey && get(item, props.primaryKey)\n ? generateTableRowId(get(item, props.primaryKey))\n : undefined\n \"\n :class=\"getRowClasses(item, 'row')\"\n :variant=\"isTableItem(item) ? item._rowVariant : undefined\"\n v-bind=\"callTbodyTrAttrs(item, 'row')\"\n @click=\"!filterEvent($event) && emit('row-clicked', item, itemIndex, $event)\"\n @dblclick=\"!filterEvent($event) && emit('row-dblclicked', item, itemIndex, $event)\"\n @contextmenu=\"!filterEvent($event) && emit('row-contextmenu', item, itemIndex, $event)\"\n @mouseenter=\"!filterEvent($event) && emit('row-hovered', item, itemIndex, $event)\"\n @mouseleave=\"!filterEvent($event) && emit('row-unhovered', item, itemIndex, $event)\"\n @mousedown=\"handleMiddleClick(item, itemIndex, $event)\"\n >\n <BTd\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n :variant=\"\n (isTableItem(item) ? item._cellVariants?.[field.key as string] : false)\n ? null\n : field.variant\n \"\n :class=\"getFieldRowClasses(field, item)\"\n v-bind=\"itemAttributes(item, String(field.key), field.tdAttr)\"\n >\n <label v-if=\"props.stacked && props.labelStacked\" class=\"b-table-stacked-label\">\n {{ getTableFieldHeadLabel(field) }}\n </label>\n <slot\n :name=\"\n slots[`cell(${String(field.key)})`]\n ? (`cell(${String(field.key)})` as 'cell()')\n : 'cell()'\n \"\n :value=\"formatItem(item, String(field.key), field.formatter)\"\n :unformatted=\"get(item, String(field.key))\"\n :index=\"itemIndex\"\n :item=\"item\"\n :field=\"field\"\n :items=\"items\"\n :toggle-details=\"() => toggleRowDetails(item)\"\n :details-showing=\"isTableItem(item) ? (detailsMap.get(item) ?? false) : false\"\n >\n <template v-if=\"!slots[`cell(${String(field.key)})`] && !slots['cell()']\">\n {{ formatItem(item, String(field.key), field.formatter) }}\n </template>\n </slot>\n </BTd>\n </BTr>\n\n <template\n v-if=\"isTableItem(item) && detailsMap.get(item) === true && slots['row-details']\"\n >\n <BTr aria-hidden=\"true\" role=\"presentation\" class=\"d-none\" />\n <BTr\n :class=\"getRowClasses(item, 'row-details')\"\n :variant=\"item._rowVariant\"\n v-bind=\"callTbodyTrAttrs(item, 'row-details')\"\n >\n <BTd :colspan=\"computedFieldsTotal\" :class=\"detailsTdClass\">\n <slot\n name=\"row-details\"\n :item=\"item\"\n :toggle-details=\"() => toggleRowDetails(item)\"\n :fields=\"computedFields\"\n :index=\"itemIndex\"\n />\n </BTd>\n </BTr>\n </template>\n </template>\n <!-- This class is for specific targetting of this slot element -->\n <BTr\n v-if=\"!props.stacked && slots['bottom-row']\"\n class=\"bottom-row\"\n :class=\"getRowClasses(null, 'row-bottom')\"\n v-bind=\"callTbodyTrAttrs(null, 'row-bottom')\"\n >\n <slot name=\"bottom-row\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n </BTr>\n </slot>\n </BTbody>\n <BTfoot v-if=\"props.footClone\" v-bind=\"footerProps\">\n <BTr :variant=\"props.footRowVariant\" :class=\"props.tfootTrClass\">\n <BTh\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :class=\"getFieldColumnClasses(field)\"\n :title=\"field.headerTitle\"\n :abbr=\"field.headerAbbr\"\n :style=\"field.thStyle\"\n :variant=\"field.variant\"\n v-bind=\"callThAttr(null, field, 'bottom')\"\n @click=\"headerClicked(field, $event, true)\"\n >\n <div class=\"d-inline-flex flex-nowrap align-items-center gap-1\">\n <div>\n <!-- eslint-disable prettier/prettier -->\n <slot\n :name=\"\n slots[`foot(${String(field.key)})`]\n ? (`foot(${String(field.key)})` as 'foot()')\n : 'foot()'\n \"\n :label=\"field.label\"\n :column=\"field.key as LiteralUnion<keyof Items>\"\n :field=\"field\"\n :is-foot=\"true\"\n >\n <!-- eslint-enable prettier/prettier -->\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n </div>\n </div>\n </BTh>\n </BTr>\n </BTfoot>\n <BTfoot v-else-if=\"slots['custom-foot']\" v-bind=\"footerProps\">\n <slot\n name=\"custom-foot\"\n :fields=\"computedFields\"\n :items=\"props.items\"\n :columns=\"computedFieldsTotal\"\n />\n </BTfoot>\n <caption v-if=\"slots['table-caption'] || props.caption\">\n <slot name=\"table-caption\">\n {{ props.caption }}\n </slot>\n </caption>\n </BTableSimple>\n</template>\n\n<script setup lang=\"ts\" generic=\"Items\">\nimport {computed, ref, watch} from 'vue'\nimport type {BTableLiteProps} from '../../types/ComponentProps'\nimport {\n isTableField,\n isTableItem,\n type TableField,\n type TableItem,\n type TableRowEvent,\n type TableRowThead,\n type TableRowType,\n} from '../../types/TableTypes'\nimport BTableSimple from './BTableSimple.vue'\nimport BTbody from './BTbody.vue'\nimport BTd from './BTd.vue'\nimport BTfoot from './BTfoot.vue'\nimport BTh from './BTh.vue'\nimport BThead from './BThead.vue'\nimport BTr from './BTr.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {get, pick} from '../../utils/object'\nimport {btableSimpleProps, getTableFieldHeadLabel} from '../../utils/tableUtils'\nimport {formatItem} from '../../utils/formatItem'\nimport {filterEvent} from '../../utils/filterEvent'\nimport {startCase} from '../../utils/stringUtils'\nimport type {LiteralUnion} from '../../types/LiteralUnion'\nimport {useId} from '../../composables/useId'\n\nconst _props = withDefaults(defineProps<BTableLiteProps<Items>>(), {\n caption: undefined,\n align: undefined,\n fields: () => [],\n footClone: false,\n items: () => [],\n labelStacked: false,\n fieldColumnClass: undefined,\n tbodyTrClass: undefined,\n detailsTdClass: undefined,\n headVariant: undefined,\n headRowVariant: undefined,\n footRowVariant: undefined,\n footVariant: undefined,\n modelValue: undefined,\n primaryKey: undefined,\n tbodyClass: undefined,\n tbodyTrAttrs: undefined,\n tfootClass: undefined,\n tfootTrClass: undefined,\n theadClass: undefined,\n theadTrClass: undefined,\n // BTableSimpleProps props\n borderVariant: undefined,\n tableClass: undefined,\n variant: undefined,\n bordered: undefined,\n borderless: undefined,\n captionTop: undefined,\n dark: undefined,\n hover: undefined,\n id: undefined,\n noBorderCollapse: undefined,\n outlined: undefined,\n fixed: undefined,\n responsive: undefined,\n stacked: undefined,\n striped: undefined,\n stripedColumns: undefined,\n small: undefined,\n stickyHeader: undefined,\n // End BTableSimpleProps props\n})\nconst props = useDefaults(_props, 'BTableLite')\n\nconst emit = defineEmits<{\n 'head-clicked': [\n key: string,\n field: (typeof computedFields.value)[0],\n event: MouseEvent,\n isFooter: boolean,\n ]\n 'row-clicked': TableRowEvent<Items>\n 'row-dblclicked': TableRowEvent<Items>\n 'row-contextmenu': TableRowEvent<Items>\n 'row-hovered': TableRowEvent<Items>\n 'row-unhovered': TableRowEvent<Items>\n 'row-middle-clicked': TableRowEvent<Items>\n}>()\n\nconst slots = defineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'thead-top'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `head(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'thead-sub'?: (\n props: {\n items: readonly Items[]\n fields: typeof computedFields.value\n field: (typeof computedFields.value)[0]\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => any\n 'custom-body'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'top-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `cell(${string})`]: (props: {\n value: unknown\n unformatted: unknown\n index: number\n item: Items\n field: (typeof computedFields.value)[0]\n items: readonly Items[]\n toggleDetails: () => void\n detailsShowing: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'row-details'?: (props: {\n item: Items\n toggleDetails: () => void\n fields: typeof computedFields.value\n index: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'bottom-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `foot(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: true\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'custom-foot'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-caption'?: (props: Record<string, never>) => any\n}>()\n\nconst computedId = useId(() => props.id)\n\nconst generateDetailsItem = (item: TableItem): [object, boolean | undefined] => [\n item,\n item._showDetails,\n]\nconst detailsMap = ref(new WeakMap<object, boolean | undefined>())\nwatch(\n () => props.items,\n (items) => {\n items.forEach((item) => {\n if (!isTableItem(item)) return\n detailsMap.value.set(...generateDetailsItem(item))\n })\n },\n {deep: true, immediate: true}\n)\n\nconst computedTableClasses = computed(() => [\n props.tableClass,\n {\n [`align-${props.align}`]: props.align !== undefined,\n },\n])\n\nconst computedFields = computed<(TableField<Items> & {_noHeader?: true})[]>(() => {\n if (!props.fields.length && props.items.length) {\n const [firstItem] = props.items\n if (isTableItem(firstItem) || Array.isArray(firstItem)) {\n return Object.keys(firstItem).map((k) => {\n const label = startCase(k)\n return {\n key: k,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n })\n }\n // The items are primitives, so we just return a single empty field\n // No header will be shown, as we don't know what to show\n return [{key: '', _noHeader: true}]\n }\n\n return props.fields.map((f) => {\n if (isTableField(f)) {\n return {\n ...(f as TableField<Items>),\n tdAttr:\n props.stacked === true\n ? {'data-label': startCase(f.key as string), ...f.tdAttr}\n : f.tdAttr,\n }\n }\n const label = startCase(f as string)\n return {\n key: f as string,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n })\n})\nconst computedFieldsTotal = computed(() => computedFields.value.length)\nconst showComputedHeaders = computed(() => {\n // We only hide the header if all fields have _noHeader set to true. Which would be our doing\n // This usually happens under a circumstance of displaying an array of primitives\n // Under any other circumstance, I'm not sure how this would apply\n if (computedFieldsTotal.value > 0 && computedFields.value.every((el) => el._noHeader === true))\n return false\n return true\n})\n\nconst footerProps = computed(() => ({\n variant: props.footVariant,\n class: props.tfootClass,\n}))\n\nconst itemAttributes = (item: Items, fieldKey: string, attr?: unknown) => {\n const val = get(item, fieldKey)\n return attr && typeof attr === 'function' ? attr(val, fieldKey, item) : attr\n}\n\nconst callThAttr = (item: Items | null, field: TableField<Items>, type: TableRowThead) => {\n const fieldKey = String(field.key)\n const val = get(item, fieldKey)\n return field.thAttr && typeof field.thAttr === 'function'\n ? field.thAttr(val, fieldKey, item, type)\n : field.thAttr\n}\n\nconst headerClicked = (field: TableField<Items>, event: Readonly<MouseEvent>, isFooter = false) => {\n emit('head-clicked', field.key as string, field, event, isFooter)\n}\n\nconst toggleRowDetails = (tr: Items) => {\n if (isTableItem(tr)) {\n const prevValue = detailsMap.value.get(tr)\n detailsMap.value.set(tr, !prevValue)\n tr._showDetails = !prevValue\n }\n}\n\nconst getFieldColumnClasses = (field: TableField) => [\n field.class,\n field.thClass,\n {\n 'b-table-sticky-column': field.stickyColumn,\n },\n props.fieldColumnClass\n ? typeof props.fieldColumnClass === 'function'\n ? props.fieldColumnClass(field)\n : props.fieldColumnClass\n : null,\n]\n\nconst getFieldRowClasses = (field: Readonly<TableField>, tr: Items) => {\n const val = get(tr, String(field.key))\n return [\n field.class,\n typeof field.tdClass === 'function' ? field.tdClass(val, String(field.key), tr) : field.tdClass,\n (isTableItem(tr) ? tr._cellVariants?.[field.key as string] : false)\n ? `table-${(tr as TableItem)._cellVariants?.[field.key as string]}`\n : null,\n {\n 'b-table-sticky-column': field.stickyColumn,\n },\n ]\n}\n\nconst handleMiddleClick = (item: Items, itemIndex: number, event: MouseEvent) => {\n if (event.button === 1 && !filterEvent(event)) {\n emit('row-middle-clicked', item, itemIndex, event)\n }\n}\nconst callTbodyTrAttrs = (item: Items | null, type: TableRowType) =>\n props.tbodyTrAttrs\n ? typeof props.tbodyTrAttrs === 'function'\n ? props.tbodyTrAttrs(item, type)\n : props.tbodyTrAttrs\n : null\n\nconst getRowClasses = (item: Items | null, type: TableRowType) =>\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(item, type)\n : props.tbodyTrClass\n : null\n\nconst generateTableRowId = (primaryKeyValue: string) =>\n `${computedId.value}__row_${primaryKeyValue}`\n\nconst computedSimpleProps = computed(() => ({\n ...pick(props, btableSimpleProps),\n tableClass: computedTableClasses.value,\n id: computedId.value,\n}))\n</script>\n","<template>\n <!-- eslint-disable prettier/prettier -->\n <BTableLite\n v-bind=\"computedLiteProps\"\n @head-clicked=\"onFieldHeadClick\"\n @row-clicked=\"onRowClick\"\n @row-dblclicked=\"\n (row, index, e) => {\n emit('row-dblclicked', row, index, e)\n }\n \"\n @row-contextmenu=\"\n (row, index, e) => {\n emit('row-contextmenu', row, index, e)\n }\n \"\n @row-hovered=\"\n (row, index, e) => {\n emit('row-hovered', row, index, e)\n }\n \"\n @row-unhovered=\"\n (row, index, e) => {\n emit('row-unhovered', row, index, e)\n }\n \"\n @row-middle-clicked=\"\n (row, index, e) => {\n emit('row-middle-clicked', row, index, e)\n }\n \"\n >\n <!-- eslint-enable prettier/prettier -->\n <template v-if=\"slots['thead-top']\" #thead-top=\"scope\">\n <slot\n name=\"thead-top\"\n v-bind=\"scope\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :fields=\"computedFields\"\n />\n </template>\n <template v-if=\"slots['thead-sub']\" #thead-sub=\"scope\">\n <slot name=\"thead-sub\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['top-row']\" #top-row=\"scope\">\n <slot name=\"top-row\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['row-details']\" #row-details=\"scope\">\n <slot\n name=\"row-details\"\n v-bind=\"scope\"\n :fields=\"computedFields\"\n :select-row=\"(index = scope.index) => exposedSelectableUtilities.selectRow(index)\"\n :unselect-row=\"(index = scope.index) => exposedSelectableUtilities.unselectRow(index)\"\n :row-selected=\"exposedSelectableUtilities.isRowSelected(scope.index)\"\n />\n </template>\n <template v-if=\"slots['bottom-row']\" #bottom-row=\"scope\">\n <slot name=\"bottom-row\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['custom-foot']\" #custom-foot=\"scope\">\n <slot name=\"custom-foot\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['table-caption']\" #table-caption>\n <slot name=\"table-caption\" />\n </template>\n <template v-for=\"name in dynamicCellSlots\" #[name]=\"scope\">\n <slot\n :name\n v-bind=\"scope\"\n :select-row=\"(index = scope.index) => exposedSelectableUtilities.selectRow(index)\"\n :unselect-row=\"(index = scope.index) => exposedSelectableUtilities.unselectRow(index)\"\n :row-selected=\"exposedSelectableUtilities.isRowSelected(scope.index)\"\n />\n </template>\n <template v-for=\"name in dynamicFootSlots\" #[name]=\"scope\">\n <slot\n :name\n v-bind=\"scope\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n />\n </template>\n\n <template\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n #[`head(${String(field.key)})`]=\"scope\"\n >\n <slot\n :name=\"\n slots[`head(${String(field.key)})`]\n ? (`head(${String(field.key)})` as 'head()')\n : 'head()'\n \"\n v-bind=\"scope\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n >\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n <template v-if=\"isSortable && !!scope.field.sortable && props.noSortableIcon === false\">\n <slot\n v-if=\"sortByModel?.find((el) => el.key === scope.field.key)?.order === 'asc'\"\n v-bind=\"scope\"\n :name=\"\n slots[`sortAsc(${String(scope.field.key)})`]\n ? (`sortAsc(${String(scope.field.key)})` as 'sortAsc()')\n : 'sortAsc()'\n \"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-up-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n />\n </svg>\n </slot>\n <slot\n v-else-if=\"sortByModel?.find((el) => el.key === scope.field.key)?.order === 'desc'\"\n v-bind=\"scope\"\n :name=\"\n slots[`sortDesc(${String(scope.field.key)})`]\n ? (`sortDesc(${String(scope.field.key)})` as 'sortDesc()')\n : 'sortDesc()'\n \"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-down-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 4a.5.5 0 0 1 .5.5v5.793l2.146-2.147a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L7.5 10.293V4.5A.5.5 0 0 1 8 4z\"\n />\n </svg>\n </slot>\n <slot\n v-else\n v-bind=\"scope\"\n :name=\"\n slots[`sortDefault(${String(scope.field.key)})`]\n ? (`sortDefault(${String(scope.field.key)})` as 'sortDefault()')\n : 'sortDefault()'\n \"\n >\n <svg\n :style=\"{opacity: 0.4}\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-up-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n />\n </svg>\n </slot>\n </template>\n </template>\n <template #custom-body=\"scope\">\n <BTr\n v-if=\"busyModel && slots['table-busy']\"\n class=\"b-table-busy-slot\"\n :class=\"getBusyRowClasses\"\n >\n <BTd :colspan=\"scope.fields.length\">\n <slot name=\"table-busy\" />\n </BTd>\n </BTr>\n\n <BTr\n v-else-if=\"props.showEmpty === true && computedItems.length === 0\"\n class=\"b-table-empty-row\"\n >\n <BTd :colspan=\"computedFields.length\">\n <div role=\"alert\" aria-live=\"polite\">\n <div class=\"text-center my-2\">\n <slot v-if=\"isFilterableTable\" name=\"empty-filtered\" v-bind=\"emptySlotScope\">\n {{ props.emptyFilteredText }}\n </slot>\n <slot v-else name=\"empty\" v-bind=\"emptySlotScope\">\n {{ props.emptyText }}\n </slot>\n </div>\n </div>\n </BTd>\n </BTr>\n </template>\n </BTableLite>\n</template>\n\n<script setup lang=\"ts\" generic=\"Items\">\nimport {useToNumber} from '@vueuse/core'\nimport {computed, onMounted, type Ref, ref, watch} from 'vue'\nimport {formatItem} from '../../utils/formatItem'\nimport BTableLite from './BTableLite.vue'\nimport BTd from './BTd.vue'\nimport BTr from './BTr.vue'\nimport {\n type BTableSortBy,\n type BTableSortByOrder,\n isTableField,\n isTableItem,\n type NoProviderTypes,\n type TableField,\n type TableFieldFormatter,\n type TableFieldRaw,\n type TableItem,\n type TableRowEvent,\n type TableRowType,\n type TableStrictClassValue,\n} from '../../types/TableTypes'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTableProps} from '../../types/ComponentProps'\nimport {get, pick, set} from '../../utils/object'\nimport {startCase} from '../../utils/stringUtils'\nimport type {LiteralUnion} from '../../types/LiteralUnion'\nimport {btableLiteProps, btableSimpleProps, getTableFieldHeadLabel} from '../../utils/tableUtils'\nimport {useId} from '../../composables/useId'\n\nconst _props = withDefaults(\n defineProps<Omit<BTableProps<Items>, 'sortBy' | 'busy' | 'selectedItems'>>(),\n {\n noSortableIcon: false,\n perPage: Number.POSITIVE_INFINITY,\n filter: undefined,\n filterFunction: undefined,\n mustSort: false,\n filterable: undefined,\n provider: undefined,\n noProvider: undefined,\n noProviderPaging: false,\n noProviderSorting: false,\n multisort: false,\n noProviderFiltering: false,\n noLocalSorting: false,\n noSelectOnClick: false,\n selectable: false,\n stickySelect: false,\n selectHead: true,\n selectMode: 'multi',\n selectionVariant: 'primary',\n busyLoadingText: 'Loading...',\n currentPage: 1,\n // BTableLite props\n items: () => [],\n fields: () => [],\n // All others use defaults\n caption: undefined,\n align: undefined,\n footClone: undefined,\n labelStacked: undefined,\n showEmpty: false,\n emptyText: 'There are no records to show',\n emptyFilteredText: 'There are no records matching your request',\n fieldColumnClass: undefined,\n tbodyTrClass: undefined,\n detailsTdClass: undefined,\n headVariant: undefined,\n headRowVariant: undefined,\n footRowVariant: undefined,\n footVariant: undefined,\n modelValue: undefined,\n primaryKey: undefined,\n tbodyClass: undefined,\n tfootClass: undefined,\n tfootTrClass: undefined,\n theadClass: undefined,\n theadTrClass: undefined,\n // End BTableLite props\n // BTableSimple props\n borderVariant: undefined,\n variant: undefined,\n bordered: undefined,\n borderless: undefined,\n captionTop: undefined,\n dark: undefined,\n hover: undefined,\n id: undefined,\n noBorderCollapse: undefined,\n outlined: undefined,\n fixed: undefined,\n responsive: undefined,\n stacked: undefined,\n striped: undefined,\n stripedColumns: undefined,\n small: undefined,\n stickyHeader: undefined,\n // End BTableSimple props\n }\n)\nconst props = useDefaults(_props, 'BTable')\n\nconst emit = defineEmits<{\n 'filtered': [value: Items[]]\n 'head-clicked': [\n key: string,\n field: (typeof computedFields.value)[0],\n event: MouseEvent,\n isFooter: boolean,\n ]\n 'row-clicked': TableRowEvent<Items>\n 'row-dblclicked': TableRowEvent<Items>\n 'row-contextmenu': TableRowEvent<Items>\n 'row-hovered': TableRowEvent<Items>\n 'row-unhovered': TableRowEvent<Items>\n 'row-middle-clicked': TableRowEvent<Items>\n 'row-selected': [value: Items]\n 'row-unselected': [value: Items]\n 'sorted': [value: BTableSortBy]\n 'change': [value: Items[]]\n}>()\n\ntype SortSlotScope = {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n}\n\nconst slots = defineSlots<{\n // BTableLite\n 'thead-top'?: (props: {\n columns: number\n fields: typeof computedFields.value\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n [key: `head(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'thead-sub'?: (\n props: {\n items: readonly Items[]\n fields: typeof computedFields.value\n field: (typeof computedFields.value)[0]\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'top-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `cell(${string})`]: (props: {\n value: unknown\n unformatted: unknown\n index: number\n item: Items\n field: (typeof computedFields.value)[0]\n items: readonly Items[]\n toggleDetails: () => void\n detailsShowing: boolean\n rowSelected: boolean\n selectRow: (index?: number) => void\n unselectRow: (index?: number) => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'row-details'?: (props: {\n item: Items\n toggleDetails: () => void\n fields: typeof computedFields.value\n index: number\n rowSelected: boolean\n selectRow: (index?: number) => void\n unselectRow: (index?: number) => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'bottom-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n\n [key: `foot(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: true\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'custom-foot'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-caption'?: (props: Record<string, never>) => any\n\n // end btable slots\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortAsc(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortDesc(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortDefault(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-busy'?: (props: Record<string, never>) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'empty-filtered'?: (props: typeof emptySlotScope.value) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'empty'?: (props: typeof emptySlotScope.value) => any\n}>()\n\nconst dynamicCellSlots = computed(\n () => Object.keys(slots).filter((key) => key.startsWith('cell(')) as 'cell()'[]\n)\nconst dynamicFootSlots = computed(\n () => Object.keys(slots).filter((key) => key.startsWith('foot(')) as 'foot()'[]\n)\n\nconst sortByModel = defineModel<BTableProps<Items>['sortBy']>('sortBy', {\n default: undefined,\n})\nconst busyModel = defineModel<Exclude<BTableProps<Items>['busy'], undefined>>('busy', {\n default: false,\n})\nconst selectedItemsModel = defineModel<Exclude<BTableProps<Items>['selectedItems'], undefined>>(\n 'selectedItems',\n {\n default: () => [],\n }\n)\n\nconst computedId = useId(() => props.id)\n\nconst selectedItemsToSet = computed({\n get: () => new Set([...selectedItemsModel.value]),\n set: (val) => {\n selectedItemsModel.value = [...val]\n },\n})\n\nwatch(selectedItemsToSet, (newValue, oldValue) => {\n Array.from(oldValue)\n .filter((item) => !newValue.has(item))\n .forEach((item) => {\n emit('row-unselected', item)\n })\n Array.from(newValue)\n .filter((item) => !oldValue.has(item))\n .forEach((item) => {\n emit('row-selected', item)\n })\n})\n/**\n * This is to avoid the issue of directly mutating the array structure and to properly trigger the computed setter.\n * The utils also conveniently emit the proper events after\n */\nconst selectedItemsSetUtilities = {\n add: (item: Items) => {\n const value = new Set(selectedItemsToSet.value)\n value.add(item)\n selectedItemsToSet.value = value\n },\n clear: () => {\n selectedItemsToSet.value.forEach((item) => {\n selectedItemsSetUtilities.delete(item)\n })\n },\n delete: (item: Items) => {\n const value = new Set(selectedItemsToSet.value)\n if (props.primaryKey) {\n const pkey: string = props.primaryKey\n selectedItemsModel.value.forEach((v, i) => {\n const selectedKey = get(v, pkey)\n const itemKey = get(item, pkey)\n\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) {\n value.delete(selectedItemsModel.value[i])\n }\n })\n } else {\n value.delete(item)\n }\n selectedItemsToSet.value = value\n },\n set: (items: Items[]) => {\n selectedItemsToSet.value = new Set(items)\n },\n has: (item: Items) => {\n if (!props.primaryKey) return selectedItemsToSet.value.has(item)\n\n // Resolver for when we are using primary keys\n const pkey: string = props.primaryKey\n for (const selected of selectedItemsToSet.value) {\n const selectedKey = get(selected, pkey)\n const itemKey = get(item, pkey)\n\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) return true\n }\n return false\n },\n} as const\n\n/**\n * Only stores data that is fetched when using the provider\n */\nconst internalItems: Ref<Items[]> = ref([])\n\nconst perPageNumber = useToNumber(() => props.perPage, {method: 'parseInt'})\nconst currentPageNumber = useToNumber(() => props.currentPage, {method: 'parseInt'})\n\nconst isFilterableTable = computed(() => !!props.filter)\nconst usesProvider = computed(() => props.provider !== undefined)\nconst isSelecting = computed(() => selectedItemsToSet.value.size > 0)\n\nconst isSortable = computed(\n () =>\n sortByModel.value !== undefined ||\n props.fields.some(\n (field) => typeof field === 'object' && field !== null && field.sortable === true\n )\n)\n\nconst computedFields = computed<TableField<Items>[]>(() =>\n props.fields.map((el) => {\n if (!isTableField<Items>(el)) {\n const label = startCase(el as string)\n return {\n key: el as string,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n }\n\n const value = sortByModel.value?.find((sb) => el.key === sb.key)\n const sortValue =\n isSortable.value === false\n ? undefined\n : value === undefined\n ? 'none'\n : value.order === 'desc'\n ? 'descending'\n : value.order === 'asc'\n ? 'ascending'\n : 'none'\n\n return {\n ...(el as TableField<Items>),\n thAttr: {\n 'aria-sort': sortValue,\n ...el.thAttr,\n },\n }\n })\n)\n\nconst tableClasses = computed(() => ({\n 'b-table-busy': busyModel.value,\n 'b-table-selectable': props.selectable,\n 'user-select-none': props.selectable && isSelecting.value,\n}))\n\nconst getBusyRowClasses = computed(() => [\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(null, 'table-busy')\n : props.tbodyTrClass\n : null,\n])\nconst getFieldColumnClasses = (field: TableField) => [\n {\n 'b-table-sortable-column': isSortable.value && field.sortable,\n },\n]\n// TODO this class has issues if the table has a variant already applied\n// Also the row should technically have aria-selected . Both things could probably just use a function with tbodyTrAttrs\n// But functional tbodyTrAttrs are not supported yet\n// Also the stuff for resolving functions could probably be made a util\nconst getRowClasses = (item: Items | null, type: TableRowType): TableStrictClassValue => [\n {\n [`selected table-${props.selectionVariant}`]:\n props.selectable && !!item && selectedItemsSetUtilities.has(item),\n },\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(item, type)\n : props.tbodyTrClass\n : null,\n]\n\nconst getFormatter = (value: TableField<Items>): TableFieldFormatter<Items> | undefined =>\n typeof value.sortByFormatted === 'function' ? value.sortByFormatted : value.formatter\nconst computedItems = computed<Items[]>(() => {\n const sortItems = (items: Items[]) => {\n // \"undefined\" values are set by us, we do this so we dont wipe out the comparer\n const sortByItems = sortByModel.value?.filter((el) => !!el.order)\n\n if (!sortByItems || sortByItems.length === 0) return items\n\n // Multi-sort\n return [...items].sort((a, b) => {\n for (let i = 0; i < (sortByItems.length ?? 0); i++) {\n const sortOption = sortByItems[i]\n const realVal = (ob: Items): string => {\n if (!isTableItem(ob)) return String(ob)\n\n const sortField = computedFields.value.find((el) => {\n if (isTableField<Items>(el)) return el.key === sortOption.key\n\n return false\n })\n const val = get(ob, sortOption.key as keyof TableItem)\n if (isTableField<Items>(sortField) && !!sortField.sortByFormatted) {\n const formatter = getFormatter(sortField)\n if (formatter) {\n return String(formatItem(ob, String(sortField.key), formatter))\n }\n }\n return typeof val === 'object' && val !== null\n ? JSON.stringify(val)\n : (val?.toString() ?? '')\n }\n\n const aValue = realVal(a)\n const bValue = realVal(b)\n const comparison = sortOption.comparer\n ? sortOption.comparer(aValue, bValue)\n : aValue.localeCompare(bValue, undefined, {numeric: true})\n\n if (comparison !== 0) {\n return sortOption.order === 'asc' ? comparison : -comparison\n }\n }\n return 0 // items are equal\n })\n }\n\n const filterItems = (items: Items[]) =>\n items.filter((item) =>\n isTableItem(item)\n ? Object.entries(item).some(([key, val]) => {\n if (\n val === null ||\n val === undefined ||\n key[0] === '_' ||\n (!props.filterable?.includes(key) && !!props.filterable?.length)\n )\n return false\n\n if (props.filterFunction && typeof props.filterFunction === 'function') {\n return props.filterFunction(item, props.filter)\n }\n\n const realVal = (): string => {\n const filterField = computedFields.value.find((el) => {\n if (isTableField<Items>(el)) return el.key === key\n\n return false\n })\n if (isTableField<Items>(filterField) && !!filterField.filterByFormatted) {\n const formatter = getFormatter(filterField)\n if (formatter) {\n return String(formatter(val, String(filterField.key), item))\n }\n }\n return typeof val === 'object' ? JSON.stringify(Object.values(val)) : val.toString()\n }\n const itemValue: string = realVal()\n return itemValue.toLowerCase().includes(props.filter?.toLowerCase() ?? '')\n })\n : true\n )\n\n let mappedItems = usesProvider.value ? internalItems.value : (props.items as Items[])\n mappedItems = mappedItems.map((item) => {\n if (\n typeof item === 'object' &&\n item !== null &&\n Object.keys(item).some((key) => key.includes('.'))\n ) {\n // We use any here because the TS doesn't isn't certain that \"item\" is the same type as our newItem.\n // But we've determined that it's an object, so we can ignore it since they will always be the same \"object\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let newItem: any = {}\n for (const key in item) {\n if (key.includes('.')) {\n newItem = set(newItem, key, item[key])\n } else {\n newItem[key] = item[key]\n }\n }\n return newItem\n // return\n }\n return item\n })\n\n if (\n (isFilterableTable.value === true && !usesProvider.value) ||\n (isFilterableTable.value === true && usesProvider.value && props.noProviderFiltering)\n ) {\n mappedItems = filterItems(mappedItems)\n }\n\n if (\n (isSortable.value === true && !usesProvider.value && !props.noLocalSorting) ||\n (isSortable.value === true && usesProvider.value && props.noProviderSorting)\n ) {\n mappedItems = sortItems(mappedItems)\n }\n\n return mappedItems\n})\n\nconst emptySlotScope = computed(() => ({\n emptyFilteredText: props.emptyFilteredText,\n emptyText: props.emptyText,\n fields: computedFields.value,\n items: computedItems.value,\n}))\n\nconst computedDisplayItems = computed<Items[]>(() => {\n if (Number.isNaN(perPageNumber.value) || (usesProvider.value && !props.noProviderPaging)) {\n return computedItems.value\n }\n\n return computedItems.value.slice(\n (currentPageNumber.value - 1) * (perPageNumber.value || Number.POSITIVE_INFINITY),\n currentPageNumber.value * (perPageNumber.value || Number.POSITIVE_INFINITY)\n )\n})\n\nwatch(computedDisplayItems, (v) => {\n emit('change', v)\n})\n\nconst handleRowSelection = (\n row: Items,\n index: number,\n shiftClicked = false,\n ctrlClicked = false,\n metaClicked = false\n) => {\n if (!props.selectable) return\n\n if (props.selectMode === 'single' || props.selectMode === 'multi') {\n // Do nothing when these items are held\n if (shiftClicked || ctrlClicked) return\n // Delete if item is in\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row)\n } else {\n if (props.selectMode === 'single') {\n selectedItemsSetUtilities.set([row])\n } else {\n selectedItemsSetUtilities.add(row)\n }\n }\n } else {\n if (ctrlClicked || metaClicked) {\n // Delete if in the object\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row)\n // Otherwise add. Functions similarly to 'multi' at this point\n } else {\n selectedItemsSetUtilities.add(row)\n }\n // This is where range is different, due to the difference in shift\n } else if (shiftClicked) {\n const lastSelectedItem = [...selectedItemsToSet.value].pop()\n const lastSelectedIndex = computedItems.value.findIndex((i) => i === lastSelectedItem)\n const selectStartIndex = Math.min(lastSelectedIndex, index)\n const selectEndIndex = Math.max(lastSelectedIndex, index)\n const items = computedItems.value.slice(selectStartIndex, selectEndIndex + 1)\n selectedItemsSetUtilities.set(items)\n // If nothing is being held, then we just behave like it's single mode\n } else {\n selectedItemsSetUtilities.set([row])\n }\n }\n}\n\nconst onRowClick = (row: Items, index: number, e: MouseEvent) => {\n if (props.noSelectOnClick === false) {\n handleRowSelection(row, index, e.shiftKey, e.ctrlKey, e.metaKey)\n }\n emit('row-clicked', row, index, e)\n}\n\nconst handleFieldSorting = (field: TableField<Items>) => {\n if (!isSortable.value) return\n\n const fieldKey = typeof field === 'object' && field !== null ? field.key : field\n const fieldSortable = typeof field === 'object' && field !== null ? field.sortable : false\n\n if (!(isSortable.value === true && fieldSortable === true)) return\n\n const resolveOrder = (val: BTableSortByOrder): BTableSortByOrder | undefined => {\n if (val === 'asc') return 'desc'\n if (val === undefined) return 'asc'\n if (\n props.mustSort === true ||\n (Array.isArray(props.mustSort) && props.mustSort.includes(fieldKey as string))\n )\n return 'asc'\n return undefined\n }\n\n const index = sortByModel.value?.findIndex((el) => el.key === fieldKey) ?? -1\n const originalValue = sortByModel.value?.[index]\n const updatedValue: BTableSortBy =\n // If value is new, we default to ascending\n // Otherwise we make a temp copy of the value\n index === -1 || !originalValue ? {key: fieldKey as string, order: 'asc'} : {...originalValue}\n\n /**\n * @returns the updated value to emit for sorted\n */\n const handleMultiSort = (): BTableSortBy => {\n let val = updatedValue\n if (index === -1) {\n sortByModel.value = [...(sortByModel.value ?? []), updatedValue]\n } else {\n const order = resolveOrder(updatedValue.order)\n val = {...updatedValue, order}\n sortByModel.value = order\n ? sortByModel.value?.map((el) => (el.key === val.key ? val : el))\n : sortByModel.value?.filter((el) => el.key !== val.key)\n }\n return val\n }\n\n /**\n * @returns the updated value to emit for sorted\n */\n const handleSingleSort = (): BTableSortBy => {\n const val = {\n ...updatedValue,\n order: index === -1 ? updatedValue.order : resolveOrder(updatedValue.order),\n }\n sortByModel.value = [val]\n return val\n }\n\n // Then emit the returned updated value\n emit('sorted', props.multisort === true ? handleMultiSort() : handleSingleSort())\n}\n\nconst onFieldHeadClick = (\n fieldKey: string,\n field: TableField<Items>,\n event: Readonly<MouseEvent>,\n isFooter = false\n) => {\n emit('head-clicked', fieldKey, field, event, isFooter)\n handleFieldSorting(field)\n}\n\nconst callItemsProvider = async () => {\n if (!usesProvider.value || props.provider === undefined || busyModel.value) return\n busyModel.value = true\n const response = props.provider({\n currentPage: currentPageNumber.value,\n filter: props.filter,\n sortBy: sortByModel.value,\n perPage: perPageNumber.value,\n })\n try {\n const items = response instanceof Promise ? await response : response\n\n if (items === undefined) return\n internalItems.value = items\n } finally {\n // Potential race condition could occur if the user explicitly sets the busy value to a different value while the response promise is executing\n // which would have been the users choice.\n // eslint-disable-next-line require-atomic-updates\n busyModel.value = false\n }\n}\n\nconst providerPropsWatch = async (prop: string, val: unknown, oldVal: unknown) => {\n if (val === oldVal) return\n\n //stop provide when paging\n const inNoProvider = (key: NoProviderTypes) => props.noProvider?.includes(key) === true\n const noProvideWhenPaging =\n (prop === 'currentPage' || prop === 'perPage') &&\n (inNoProvider('paging') || props.noProviderPaging === true)\n const noProvideWhenFiltering =\n prop === 'filter' && (inNoProvider('filtering') || props.noProviderFiltering === true)\n const noProvideWhenSorting =\n (prop === 'sortBy' || prop === 'sortDesc') &&\n (inNoProvider('sorting') || props.noProviderSorting === true)\n\n if (noProvideWhenPaging || noProvideWhenFiltering || noProvideWhenSorting) return\n\n if (usesProvider.value === true) {\n await callItemsProvider()\n }\n\n if (!(prop === 'currentPage' || prop === 'perPage')) {\n emit('filtered', [...computedItems.value])\n }\n}\n\nwatch(\n () => props.filter,\n (filter, oldFilter) => {\n providerPropsWatch('filter', filter, oldFilter)\n\n if (filter === oldFilter || usesProvider.value) return\n if (!filter) {\n emit('filtered', [...computedItems.value])\n }\n }\n)\nwatch(currentPageNumber, (val, oldVal) => {\n providerPropsWatch('currentPage', val, oldVal)\n})\nwatch(perPageNumber, (val, oldVal) => {\n providerPropsWatch('perPage', val, oldVal)\n})\nwatch(\n sortByModel,\n (val, oldVal) => {\n providerPropsWatch('sortBy', val, oldVal)\n },\n {deep: true}\n)\n\nwatch(\n () => props.provider,\n (newValue) => {\n // Reset the internal values if the provider stops getting used\n if (newValue === undefined) {\n internalItems.value = []\n return\n }\n // Otherwise we should refresh the table on such a change\n callItemsProvider()\n }\n)\n\nonMounted(callItemsProvider)\n\nconst exposedSelectableUtilities = {\n clearSelected: () => {\n if (!props.selectable) return\n selectedItemsSetUtilities.clear()\n },\n selectAllRows: () => {\n if (!props.selectable || props.selectMode === 'single') return\n selectedItemsToSet.value = new Set([...computedItems.value])\n },\n selectRow: (index: number) => {\n if (!props.selectable) return\n const item = computedItems.value[index]\n if (!item || selectedItemsSetUtilities.has(item)) return\n if (props.selectMode === 'single') {\n selectedItemsSetUtilities.set([item])\n } else {\n selectedItemsSetUtilities.add(item)\n }\n },\n unselectRow: (index: number) => {\n if (!props.selectable) return\n const item = computedItems.value[index]\n if (!item || !selectedItemsSetUtilities.has(item)) return\n selectedItemsSetUtilities.delete(item)\n },\n isRowSelected: (index: number) => {\n if (!props.selectable) return false\n const item = computedItems.value[index]\n return selectedItemsSetUtilities.has(item)\n },\n} as const\n\nconst computedLiteProps = computed(() => ({\n ...pick(props, [...btableLiteProps, ...btableSimpleProps]),\n tableAttrs: {\n ariaBusy: busyModel.value,\n },\n items: computedDisplayItems.value,\n fields: computedFields.value as TableFieldRaw<Items>[],\n tableClass: tableClasses.value,\n tbodyTrClass: getRowClasses,\n fieldColumnClass: getFieldColumnClasses,\n id: computedId.value,\n}))\n\ndefineExpose({\n // The row selection methods are really for compat. Users should probably use the v-model though\n ...exposedSelectableUtilities,\n items: computedItems,\n refresh: callItemsProvider,\n})\n</script>\n"],"names":["formatItem","item","fieldKey","formatter","val","get","isTableItem","value","isTableField","_props","__props","props","useDefaults","computedClasses","computed","variant","stickyColumn","scope","colspan","rowspan","getTableFieldHeadLabel","field","titleCase","label","key","btableSimpleProps","Object","freeze","keys","bordered","borderless","borderVariant","captionTop","dark","fixed","hover","id","noBorderCollapse","outlined","responsive","small","stacked","stickyHeader","striped","stripedColumns","tableAttrs","tableClass","btableLiteProps","align","caption","detailsTdClass","fieldColumnClass","fields","footClone","footRowVariant","footVariant","headRowVariant","headVariant","items","labelStacked","modelValue","primaryKey","tbodyClass","tbodyTrAttrs","tbodyTrClass","tfootClass","tfootTrClass","theadClass","theadTrClass","TABLE_TAG_NAMES","eventFilter","join","filterEvent","event","target","el","disabled","indexOf","tagName","closest","labelFor","getAttribute","input","document","getElementById","querySelector","matches","emit","__emit","slots","_useSlots","computedId","useId","detailsMap","ref","WeakMap","vue","watch","forEach","set","_showDetails","generateDetailsItem","deep","immediate","computedTableClasses","computedFields","length","firstItem","Array","isArray","map","k","startCase","tdAttr","_noHeader","f","computedFieldsTotal","showComputedHeaders","every","footerProps","class","callThAttr","type","String","thAttr","headerClicked","isFooter","toggleRowDetails","tr","prevValue","getFieldColumnClasses","thClass","getFieldRowClasses","tdClass","_a","_cellVariants","_b","callTbodyTrAttrs","getRowClasses","computedSimpleProps","pick","primaryKeyValue","itemIndex","button","attr","dynamicCellSlots","filter","startsWith","dynamicFootSlots","sortByModel","_useModel","busyModel","selectedItemsModel","useModel","selectedItemsToSet","Set","newValue","oldValue","from","has","selectedItemsSetUtilities","add","clear","delete","pkey","v","i","selectedKey","itemKey","selected","internalItems","perPageNumber","useToNumber","perPage","method","currentPageNumber","currentPage","isFilterableTable","usesProvider","provider","isSelecting","size","isSortable","some","sortable","find","sb","sortValue","order","tableClasses","selectable","getBusyRowClasses","selectionVariant","getFormatter","sortByFormatted","computedItems","mappedItems","includes","newItem","noProviderFiltering","entries","filterable","filterFunction","filterField","filterByFormatted","JSON","stringify","values","toString","realVal","toLowerCase","_c","noLocalSorting","noProviderSorting","sortByItems","sort","a","b","sortOption","ob","sortField","aValue","bValue","comparison","comparer","localeCompare","numeric","sortItems","emptySlotScope","emptyFilteredText","emptyText","computedDisplayItems","Number","isNaN","noProviderPaging","slice","POSITIVE_INFINITY","onRowClick","row","index","e","noSelectOnClick","shiftClicked","ctrlClicked","metaClicked","selectMode","lastSelectedItem","pop","lastSelectedIndex","findIndex","selectStartIndex","Math","min","selectEndIndex","max","handleRowSelection","shiftKey","ctrlKey","metaKey","onFieldHeadClick","fieldSortable","resolveOrder","mustSort","originalValue","updatedValue","multisort","handleMultiSort","handleSingleSort","handleFieldSorting","callItemsProvider","async","response","sortBy","Promise","providerPropsWatch","prop","oldVal","inNoProvider","noProvider","noProvideWhenPaging","noProvideWhenFiltering","noProvideWhenSorting","oldFilter","onMounted","exposedSelectableUtilities","clearSelected","selectAllRows","selectRow","unselectRow","isRowSelected","computedLiteProps","ariaBusy","__expose","refresh"],"mappings":"kSAGaA,EAAa,CACxBC,EAEAC,EACAC,KAEM,MAAAC,EAAMC,EAAAA,IAAIJ,EAAMC,GACf,OAAAC,GAAkC,mBAAdA,EAA2BA,EAAUC,EAAKF,EAAUD,GAAQG,CAAA,ECI5EE,EAAeC,GACT,iBAAVA,GAAgC,OAAVA,EA2DlBC,EAAmBD,GACb,iBAAVA,GAAgC,OAAVA,GAAkB,QAASA,+EChE1D,MAAME,EAASC,EAGTC,EAAQC,EAAAA,YAAYH,EAAQ,UAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,2YCFpC,MAAMN,EAASC,EAOTC,EAAQC,EAAAA,YAAYH,EAAQ,OAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,QAClC,wBAAyBJ,EAAMK,aAC/B,wBAAyBL,EAAMK,cAAkC,OAAlBL,EAAMI,YAGjDE,EAAQH,YAAS,IAAOH,EAAMO,QAAU,UAAYP,EAAMQ,QAAU,UAAY,wbC7BtF,MAAMV,EAASC,EAGTC,EAAQC,EAAAA,YAAYH,EAAQ,UAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,2YCFpC,MAAMN,EAASC,EAOTC,EAAQC,EAAAA,YAAYH,EAAQ,OAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,QAClC,wBAAyBJ,EAAMK,aAC/B,wBAAyBL,EAAMK,cAAkC,OAAlBL,EAAMI,YAGjD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AqBhO,MAC5B6C,OAAQqD,EAAelG,MACvBuC,WAAY+I,EAAatL,MACzByD,aAAc0E,EACdvF,iBAAkB+E,EAClB9F,GAAIuD,EAAWpF,iBAGJ6R,EAAA,IAERR,EACHlO,MAAOyI,EACPkG,QAASxB"}
1
+ {"version":3,"file":"BTable.vue_vue_type_script_setup_true_lang-BO8_v2Zs.js","sources":["../src/utils/formatItem.ts","../src/types/TableTypes.ts","../src/components/BTable/BTbody.vue","../src/components/BTable/BTd.vue","../src/components/BTable/BTfoot.vue","../src/components/BTable/BTh.vue","../src/components/BTable/BThead.vue","../src/components/BTable/BTr.vue","../src/utils/tableUtils.ts","../src/utils/filterEvent.ts","../src/components/BTable/BTableLite.vue","../src/components/BTable/BTable.vue"],"sourcesContent":["import type {TableFieldFormatter} from '../types/TableTypes'\nimport {get} from './object'\n\nexport const formatItem = <T>(\n item: T,\n // Weakly type fieldKey because it can be a nested string, such as 'foo.bar.baz'\n fieldKey: string,\n formatter?: TableFieldFormatter<T>\n) => {\n const val = get(item, fieldKey)\n return formatter && typeof formatter === 'function' ? formatter(val, fieldKey, item) : val\n}\n","import type {StyleValue} from 'vue'\nimport type {ColorVariant} from './ColorTypes'\nimport type {MaybePromise} from './MaybePromise'\nimport type {LiteralUnion} from './LiteralUnion'\nimport type {AttrsValue, ClassValue} from './AnyValuedAttributes'\n\nexport type TableRowEvent<T> = [item: T, index: number, event: MouseEvent]\n\nexport type TableItem<T = Record<string, unknown>> = T & {\n _rowVariant?: ColorVariant | null\n _cellVariants?: Partial<Record<keyof T, ColorVariant>>\n _showDetails?: boolean\n}\n\nexport const isTableItem = (value: unknown): value is TableItem =>\n typeof value === 'object' && value !== null\n\n// undefined means no sorting\nexport type BTableSortByOrder = 'desc' | 'asc' | undefined\n\nexport type BTableSortBy = {\n order: BTableSortByOrder\n key: string\n comparer?: (a: string, b: string) => number\n}\n\nexport type BTableProviderContext = {\n sortBy: BTableSortBy[] | undefined\n filter: string | undefined\n currentPage: number\n perPage: number\n}\n\nexport type BTableProvider<T> = (\n context: Readonly<BTableProviderContext>\n) => MaybePromise<T[] | undefined>\n\nexport type TableFieldFormatter<T> = (value: unknown, key: string, item: T) => string\n\nexport type TableRowType = 'row' | 'row-details' | 'row-top' | 'row-bottom' | 'table-busy'\nexport type TableRowThead = 'top' | 'bottom'\n\nexport type TableStrictClassValue = string | unknown[] | Record<string, boolean>\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TableField<T = any> = {\n key: LiteralUnion<keyof T>\n label?: string\n headerTitle?: string\n headerAbbr?: string\n class?: ClassValue\n formatter?: TableFieldFormatter<T>\n sortable?: boolean\n sortDirection?: string\n sortByFormatted?: boolean | TableFieldFormatter<T>\n filterByFormatted?: boolean | TableFieldFormatter<T>\n tdClass?:\n | TableStrictClassValue\n | ((value: unknown, key: string, item: T) => TableStrictClassValue)\n thClass?: ClassValue\n thStyle?: StyleValue\n variant?: ColorVariant | null\n tdAttr?: AttrsValue | ((value: unknown, key: string, item: T) => AttrsValue)\n thAttr?:\n | AttrsValue\n | ((value: unknown, key: string, item: T | null, type: TableRowThead) => AttrsValue)\n isRowHeader?: boolean\n stickyColumn?: boolean\n}\n\nexport type TableFieldRaw<T = unknown> = T extends object\n ? LiteralUnion<keyof T> | TableField<T>\n : string | TableField\n\nexport const isTableField = <T>(value: unknown): value is TableField<T> =>\n typeof value === 'object' && value !== null && 'key' in value\n\nexport const isTableFieldRaw = <T>(value: unknown): value is TableFieldRaw<T> =>\n typeof value === 'string' || isTableField(value)\n\nexport type NoProviderTypes = 'paging' | 'sorting' | 'filtering'\n","<template>\n <tbody :class=\"computedClasses\">\n <slot />\n </tbody>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTbodyProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTbodyProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTbody')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`thead-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <td\n :scope=\"scope\"\n :class=\"computedClasses\"\n :colspan=\"props.colspan\"\n :rowspan=\"props.rowspan\"\n :data-label=\"props.stackedHeading\"\n >\n <div v-if=\"props.stackedHeading\">\n <slot />\n </div>\n <slot v-else />\n </td>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTdProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTdProps>(), {\n colspan: undefined,\n rowspan: undefined,\n stackedHeading: undefined,\n stickyColumn: false,\n variant: null,\n})\nconst props = useDefaults(_props, 'BTd')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n 'b-table-sticky-column': props.stickyColumn,\n 'table-b-table-default': props.stickyColumn && props.variant === null,\n}))\n\nconst scope = computed(() => (props.colspan ? 'colspan' : props.rowspan ? 'rowspan' : 'col'))\n</script>\n","<template>\n <tfoot :class=\"computedClasses\">\n <slot />\n </tfoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTfootProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTfootProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTfoot')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <th\n :scope=\"scope\"\n :class=\"computedClasses\"\n :colspan=\"props.colspan\"\n :rowspan=\"props.rowspan\"\n :data-label=\"props.stackedHeading\"\n >\n <div v-if=\"props.stackedHeading !== undefined\">\n <slot />\n </div>\n <slot v-else />\n </th>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BThProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BThProps>(), {\n colspan: undefined,\n rowspan: undefined,\n stackedHeading: undefined,\n stickyColumn: false,\n variant: null,\n})\nconst props = useDefaults(_props, 'BTh')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n 'b-table-sticky-column': props.stickyColumn,\n 'table-b-table-default': props.stickyColumn && props.variant === null,\n}))\n\nconst scope = computed(() => (props.colspan ? 'colspan' : props.rowspan ? 'rowspan' : 'col'))\n</script>\n","<template>\n <thead :class=\"computedClasses\">\n <slot />\n </thead>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTheadProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTheadProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BThead')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","<template>\n <tr :class=\"computedClasses\">\n <slot />\n </tr>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTrProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\n\nconst _props = withDefaults(defineProps<BTrProps>(), {\n variant: null,\n})\nconst props = useDefaults(_props, 'BTr')\n\ndefineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default?: (props: Record<string, never>) => any\n}>()\n\nconst computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n}))\n</script>\n","import {titleCase} from './stringUtils'\nimport type {TableFieldRaw} from '../types/TableTypes'\nimport type {BTableLiteProps, BTableSimpleProps} from '../types'\n\nexport const getTableFieldHeadLabel = (field: Readonly<TableFieldRaw<unknown>>) =>\n typeof field === 'string'\n ? titleCase(field)\n : field.label !== undefined\n ? field.label\n : typeof field.key === 'string'\n ? titleCase(field.key)\n : field.key\n\nexport const btableSimpleProps = Object.freeze(\n Object.keys({\n bordered: 0,\n borderless: 0,\n borderVariant: 0,\n captionTop: 0,\n dark: 0,\n fixed: 0,\n hover: 0,\n id: 0,\n noBorderCollapse: 0,\n outlined: 0,\n responsive: 0,\n small: 0,\n stacked: 0,\n stickyHeader: 0,\n striped: 0,\n stripedColumns: 0,\n variant: 0,\n tableAttrs: 0,\n tableClass: 0,\n } satisfies Record<keyof BTableSimpleProps, 0>)\n) as readonly (keyof BTableSimpleProps)[]\n\nexport const btableLiteProps = Object.freeze(\n Object.keys({\n align: 0,\n caption: 0,\n detailsTdClass: 0,\n fieldColumnClass: 0,\n fields: 0,\n footClone: 0,\n footRowVariant: 0,\n footVariant: 0,\n headRowVariant: 0,\n headVariant: 0,\n items: 0,\n labelStacked: 0,\n modelValue: 0,\n primaryKey: 0,\n tbodyClass: 0,\n tbodyTrAttrs: 0,\n tbodyTrClass: 0,\n tfootClass: 0,\n tfootTrClass: 0,\n theadClass: 0,\n theadTrClass: 0,\n } satisfies Record<keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>, 0>)\n) as readonly (keyof Omit<BTableLiteProps<unknown>, keyof BTableSimpleProps>)[]\n","const TABLE_TAG_NAMES = ['TD', 'TH', 'TR']\n\n// Filter CSS selector for click/dblclick/etc. events\n// If any of these selectors match the clicked element, we ignore the event\nconst eventFilter = [\n 'a',\n 'a *', // Include content inside links\n 'button',\n 'button *', // Include content inside buttons\n 'input:not(.disabled):not([disabled])',\n 'select:not(.disabled):not([disabled])',\n 'textarea:not(.disabled):not([disabled])',\n '[role=\"link\"]',\n '[role=\"link\"] *',\n '[role=\"button\"]',\n '[role=\"button\"] *',\n '[tabindex]:not(.disabled):not([disabled])',\n].join(',')\n\n// Returns `true` if we should ignore the click/double-click/keypress event\n// Avoids having the user need to use `@click.stop` on the form control\nexport const filterEvent = (event: Readonly<Event>) => {\n // Exit early when we don't have a target element\n if (!event || !event.target) {\n return false\n }\n const el = event.target as HTMLElement\n // Exit early when element is disabled or a table element\n if (('disabled' in el && el.disabled) || TABLE_TAG_NAMES.indexOf(el.tagName) !== -1) {\n return false\n }\n // Ignore the click when it was inside a dropdown menu\n if (el.closest('.dropdown-menu')) return true\n\n const label = el.tagName === 'LABEL' ? el : el.closest('label')\n // If the label's form control is not disabled then we don't propagate event\n // Modern browsers have `label.control` that references the associated input, but IE 11\n // does not have this property on the label element, so we resort to DOM lookups\n if (label) {\n const labelFor = label.getAttribute('for')\n const input = labelFor\n ? document.getElementById(labelFor)\n : label.querySelector('input, select, textarea')\n if (input && !(input as HTMLInputElement).disabled) {\n return true\n }\n }\n // Otherwise check if the event target matches one of the selectors in the\n // event filter (i.e. anchors, non disabled inputs, etc.)\n // Return `true` if we should ignore the event\n return el.matches(eventFilter)\n}\n","<template>\n <BTableSimple v-bind=\"computedSimpleProps\">\n <BThead v-show=\"showComputedHeaders\" :variant=\"props.headVariant\" :class=\"props.theadClass\">\n <slot name=\"thead-top\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n <BTr :variant=\"props.headRowVariant\" :class=\"props.theadTrClass\">\n <BTh\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :class=\"getFieldColumnClasses(field)\"\n :title=\"field.headerTitle\"\n :variant=\"field.variant\"\n :abbr=\"field.headerAbbr\"\n :style=\"field.thStyle\"\n v-bind=\"callThAttr(null, field, 'top')\"\n @click=\"headerClicked(field, $event)\"\n >\n <!-- eslint-disable prettier/prettier -->\n <slot\n :name=\"\n slots[`head(${String(field.key)})`]\n ? (`head(${String(field.key)})` as 'head()')\n : 'head()'\n \"\n :label=\"field.label\"\n :column=\"field.key as LiteralUnion<keyof Items>\"\n :field\n :is-foot=\"false\"\n >\n <!-- eslint-enable prettier/prettier -->\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n </BTh>\n </BTr>\n <BTr v-if=\"slots['thead-sub']\">\n <BTd\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :variant=\"field.variant\"\n :class=\"[field.class, field.thClass]\"\n >\n <slot name=\"thead-sub\" :items=\"props.items\" :fields=\"computedFields\" :field>\n {{ field.label }}\n </slot>\n </BTd>\n </BTr>\n </BThead>\n <BTbody :class=\"props.tbodyClass\">\n <slot\n name=\"custom-body\"\n :fields=\"computedFields\"\n :items=\"props.items\"\n :columns=\"computedFieldsTotal\"\n >\n <BTr\n v-if=\"!props.stacked && slots['top-row']\"\n :class=\"getRowClasses(null, 'row-top')\"\n v-bind=\"callTbodyTrAttrs(null, 'row-top')\"\n >\n <slot name=\"top-row\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n </BTr>\n\n <template\n v-for=\"(item, itemIndex) in props.items\"\n :key=\"\n props.primaryKey && get(item, props.primaryKey)\n ? get(item, props.primaryKey)\n : itemIndex\n \"\n >\n <BTr\n :id=\"\n props.primaryKey && get(item, props.primaryKey)\n ? generateTableRowId(get(item, props.primaryKey))\n : undefined\n \"\n :class=\"getRowClasses(item, 'row')\"\n :variant=\"isTableItem(item) ? item._rowVariant : undefined\"\n v-bind=\"callTbodyTrAttrs(item, 'row')\"\n @click=\"!filterEvent($event) && emit('row-clicked', item, itemIndex, $event)\"\n @dblclick=\"!filterEvent($event) && emit('row-dblclicked', item, itemIndex, $event)\"\n @contextmenu=\"!filterEvent($event) && emit('row-contextmenu', item, itemIndex, $event)\"\n @mouseenter=\"!filterEvent($event) && emit('row-hovered', item, itemIndex, $event)\"\n @mouseleave=\"!filterEvent($event) && emit('row-unhovered', item, itemIndex, $event)\"\n @mousedown=\"handleMiddleClick(item, itemIndex, $event)\"\n >\n <BTd\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n :variant=\"\n (isTableItem(item) ? item._cellVariants?.[field.key as string] : false)\n ? null\n : field.variant\n \"\n :class=\"getFieldRowClasses(field, item)\"\n v-bind=\"itemAttributes(item, String(field.key), field.tdAttr)\"\n >\n <label v-if=\"props.stacked && props.labelStacked\" class=\"b-table-stacked-label\">\n {{ getTableFieldHeadLabel(field) }}\n </label>\n <slot\n :name=\"\n slots[`cell(${String(field.key)})`]\n ? (`cell(${String(field.key)})` as 'cell()')\n : 'cell()'\n \"\n :value=\"formatItem(item, String(field.key), field.formatter)\"\n :unformatted=\"get(item, String(field.key))\"\n :index=\"itemIndex\"\n :item=\"item\"\n :field=\"field\"\n :items=\"items\"\n :toggle-details=\"() => toggleRowDetails(item)\"\n :details-showing=\"isTableItem(item) ? (detailsMap.get(item) ?? false) : false\"\n >\n <template v-if=\"!slots[`cell(${String(field.key)})`] && !slots['cell()']\">\n {{ formatItem(item, String(field.key), field.formatter) }}\n </template>\n </slot>\n </BTd>\n </BTr>\n\n <template\n v-if=\"isTableItem(item) && detailsMap.get(item) === true && slots['row-details']\"\n >\n <BTr aria-hidden=\"true\" role=\"presentation\" class=\"d-none\" />\n <BTr\n :class=\"getRowClasses(item, 'row-details')\"\n :variant=\"item._rowVariant\"\n v-bind=\"callTbodyTrAttrs(item, 'row-details')\"\n >\n <BTd :colspan=\"computedFieldsTotal\" :class=\"detailsTdClass\">\n <slot\n name=\"row-details\"\n :item=\"item\"\n :toggle-details=\"() => toggleRowDetails(item)\"\n :fields=\"computedFields\"\n :index=\"itemIndex\"\n />\n </BTd>\n </BTr>\n </template>\n </template>\n <!-- This class is for specific targetting of this slot element -->\n <BTr\n v-if=\"!props.stacked && slots['bottom-row']\"\n class=\"bottom-row\"\n :class=\"getRowClasses(null, 'row-bottom')\"\n v-bind=\"callTbodyTrAttrs(null, 'row-bottom')\"\n >\n <slot name=\"bottom-row\" :columns=\"computedFieldsTotal\" :fields=\"computedFields\" />\n </BTr>\n </slot>\n </BTbody>\n <BTfoot v-if=\"props.footClone\" v-bind=\"footerProps\">\n <BTr :variant=\"props.footRowVariant\" :class=\"props.tfootTrClass\">\n <BTh\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n scope=\"col\"\n :class=\"getFieldColumnClasses(field)\"\n :title=\"field.headerTitle\"\n :abbr=\"field.headerAbbr\"\n :style=\"field.thStyle\"\n :variant=\"field.variant\"\n v-bind=\"callThAttr(null, field, 'bottom')\"\n @click=\"headerClicked(field, $event, true)\"\n >\n <div class=\"d-inline-flex flex-nowrap align-items-center gap-1\">\n <div>\n <!-- eslint-disable prettier/prettier -->\n <slot\n :name=\"\n slots[`foot(${String(field.key)})`]\n ? (`foot(${String(field.key)})` as 'foot()')\n : 'foot()'\n \"\n :label=\"field.label\"\n :column=\"field.key as LiteralUnion<keyof Items>\"\n :field=\"field\"\n :is-foot=\"true\"\n >\n <!-- eslint-enable prettier/prettier -->\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n </div>\n </div>\n </BTh>\n </BTr>\n </BTfoot>\n <BTfoot v-else-if=\"slots['custom-foot']\" v-bind=\"footerProps\">\n <slot\n name=\"custom-foot\"\n :fields=\"computedFields\"\n :items=\"props.items\"\n :columns=\"computedFieldsTotal\"\n />\n </BTfoot>\n <caption v-if=\"slots['table-caption'] || props.caption\">\n <slot name=\"table-caption\">\n {{ props.caption }}\n </slot>\n </caption>\n </BTableSimple>\n</template>\n\n<script setup lang=\"ts\" generic=\"Items\">\nimport {computed, ref, watch} from 'vue'\nimport type {BTableLiteProps} from '../../types/ComponentProps'\nimport {\n isTableField,\n isTableItem,\n type TableField,\n type TableItem,\n type TableRowEvent,\n type TableRowThead,\n type TableRowType,\n} from '../../types/TableTypes'\nimport BTableSimple from './BTableSimple.vue'\nimport BTbody from './BTbody.vue'\nimport BTd from './BTd.vue'\nimport BTfoot from './BTfoot.vue'\nimport BTh from './BTh.vue'\nimport BThead from './BThead.vue'\nimport BTr from './BTr.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {get, pick} from '../../utils/object'\nimport {btableSimpleProps, getTableFieldHeadLabel} from '../../utils/tableUtils'\nimport {formatItem} from '../../utils/formatItem'\nimport {filterEvent} from '../../utils/filterEvent'\nimport {startCase} from '../../utils/stringUtils'\nimport type {LiteralUnion} from '../../types/LiteralUnion'\nimport {useId} from '../../composables/useId'\n\nconst _props = withDefaults(defineProps<BTableLiteProps<Items>>(), {\n caption: undefined,\n align: undefined,\n fields: () => [],\n footClone: false,\n items: () => [],\n labelStacked: false,\n fieldColumnClass: undefined,\n tbodyTrClass: undefined,\n detailsTdClass: undefined,\n headVariant: undefined,\n headRowVariant: undefined,\n footRowVariant: undefined,\n footVariant: undefined,\n modelValue: undefined,\n primaryKey: undefined,\n tbodyClass: undefined,\n tbodyTrAttrs: undefined,\n tfootClass: undefined,\n tfootTrClass: undefined,\n theadClass: undefined,\n theadTrClass: undefined,\n // BTableSimpleProps props\n borderVariant: undefined,\n tableClass: undefined,\n variant: undefined,\n bordered: undefined,\n borderless: undefined,\n captionTop: undefined,\n dark: undefined,\n hover: undefined,\n id: undefined,\n noBorderCollapse: undefined,\n outlined: undefined,\n fixed: undefined,\n responsive: undefined,\n stacked: undefined,\n striped: undefined,\n stripedColumns: undefined,\n small: undefined,\n stickyHeader: undefined,\n // End BTableSimpleProps props\n})\nconst props = useDefaults(_props, 'BTableLite')\n\nconst emit = defineEmits<{\n 'head-clicked': [\n key: string,\n field: (typeof computedFields.value)[0],\n event: MouseEvent,\n isFooter: boolean,\n ]\n 'row-clicked': TableRowEvent<Items>\n 'row-dblclicked': TableRowEvent<Items>\n 'row-contextmenu': TableRowEvent<Items>\n 'row-hovered': TableRowEvent<Items>\n 'row-unhovered': TableRowEvent<Items>\n 'row-middle-clicked': TableRowEvent<Items>\n}>()\n\nconst slots = defineSlots<{\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'thead-top'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `head(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'thead-sub'?: (\n props: {\n items: readonly Items[]\n fields: typeof computedFields.value\n field: (typeof computedFields.value)[0]\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => any\n 'custom-body'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'top-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `cell(${string})`]: (props: {\n value: unknown\n unformatted: unknown\n index: number\n item: Items\n field: (typeof computedFields.value)[0]\n items: readonly Items[]\n toggleDetails: () => void\n detailsShowing: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'row-details'?: (props: {\n item: Items\n toggleDetails: () => void\n fields: typeof computedFields.value\n index: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'bottom-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `foot(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: true\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'custom-foot'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-caption'?: (props: Record<string, never>) => any\n}>()\n\nconst computedId = useId(() => props.id)\n\nconst generateDetailsItem = (item: TableItem): [object, boolean | undefined] => [\n item,\n item._showDetails,\n]\nconst detailsMap = ref(new WeakMap<object, boolean | undefined>())\nwatch(\n () => props.items,\n (items) => {\n items.forEach((item) => {\n if (!isTableItem(item)) return\n detailsMap.value.set(...generateDetailsItem(item))\n })\n },\n {deep: true, immediate: true}\n)\n\nconst computedTableClasses = computed(() => [\n props.tableClass,\n {\n [`align-${props.align}`]: props.align !== undefined,\n },\n])\n\nconst computedFields = computed<(TableField<Items> & {_noHeader?: true})[]>(() => {\n if (!props.fields.length && props.items.length) {\n const [firstItem] = props.items\n if (isTableItem(firstItem) || Array.isArray(firstItem)) {\n return Object.keys(firstItem).map((k) => {\n const label = startCase(k)\n return {\n key: k,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n })\n }\n // The items are primitives, so we just return a single empty field\n // No header will be shown, as we don't know what to show\n return [{key: '', _noHeader: true}]\n }\n\n return props.fields.map((f) => {\n if (isTableField(f)) {\n return {\n ...(f as TableField<Items>),\n tdAttr:\n props.stacked === true\n ? {'data-label': startCase(f.key as string), ...f.tdAttr}\n : f.tdAttr,\n }\n }\n const label = startCase(f as string)\n return {\n key: f as string,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n })\n})\nconst computedFieldsTotal = computed(() => computedFields.value.length)\nconst showComputedHeaders = computed(() => {\n // We only hide the header if all fields have _noHeader set to true. Which would be our doing\n // This usually happens under a circumstance of displaying an array of primitives\n // Under any other circumstance, I'm not sure how this would apply\n if (computedFieldsTotal.value > 0 && computedFields.value.every((el) => el._noHeader === true))\n return false\n return true\n})\n\nconst footerProps = computed(() => ({\n variant: props.footVariant,\n class: props.tfootClass,\n}))\n\nconst itemAttributes = (item: Items, fieldKey: string, attr?: unknown) => {\n const val = get(item, fieldKey)\n return attr && typeof attr === 'function' ? attr(val, fieldKey, item) : attr\n}\n\nconst callThAttr = (item: Items | null, field: TableField<Items>, type: TableRowThead) => {\n const fieldKey = String(field.key)\n const val = get(item, fieldKey)\n return field.thAttr && typeof field.thAttr === 'function'\n ? field.thAttr(val, fieldKey, item, type)\n : field.thAttr\n}\n\nconst headerClicked = (field: TableField<Items>, event: Readonly<MouseEvent>, isFooter = false) => {\n emit('head-clicked', field.key as string, field, event, isFooter)\n}\n\nconst toggleRowDetails = (tr: Items) => {\n if (isTableItem(tr)) {\n const prevValue = detailsMap.value.get(tr)\n detailsMap.value.set(tr, !prevValue)\n tr._showDetails = !prevValue\n }\n}\n\nconst getFieldColumnClasses = (field: TableField) => [\n field.class,\n field.thClass,\n {\n 'b-table-sticky-column': field.stickyColumn,\n },\n props.fieldColumnClass\n ? typeof props.fieldColumnClass === 'function'\n ? props.fieldColumnClass(field)\n : props.fieldColumnClass\n : null,\n]\n\nconst getFieldRowClasses = (field: Readonly<TableField>, tr: Items) => {\n const val = get(tr, String(field.key))\n return [\n field.class,\n typeof field.tdClass === 'function' ? field.tdClass(val, String(field.key), tr) : field.tdClass,\n (isTableItem(tr) ? tr._cellVariants?.[field.key as string] : false)\n ? `table-${(tr as TableItem)._cellVariants?.[field.key as string]}`\n : null,\n {\n 'b-table-sticky-column': field.stickyColumn,\n },\n ]\n}\n\nconst handleMiddleClick = (item: Items, itemIndex: number, event: MouseEvent) => {\n if (event.button === 1 && !filterEvent(event)) {\n emit('row-middle-clicked', item, itemIndex, event)\n }\n}\nconst callTbodyTrAttrs = (item: Items | null, type: TableRowType) =>\n props.tbodyTrAttrs\n ? typeof props.tbodyTrAttrs === 'function'\n ? props.tbodyTrAttrs(item, type)\n : props.tbodyTrAttrs\n : null\n\nconst getRowClasses = (item: Items | null, type: TableRowType) =>\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(item, type)\n : props.tbodyTrClass\n : null\n\nconst generateTableRowId = (primaryKeyValue: string) =>\n `${computedId.value}__row_${primaryKeyValue}`\n\nconst computedSimpleProps = computed(() => ({\n ...pick(props, btableSimpleProps),\n tableClass: computedTableClasses.value,\n id: computedId.value,\n}))\n</script>\n","<template>\n <!-- eslint-disable prettier/prettier -->\n <BTableLite\n v-bind=\"computedLiteProps\"\n @head-clicked=\"onFieldHeadClick\"\n @row-clicked=\"onRowClick\"\n @row-dblclicked=\"\n (row: Items, index: number, e: MouseEvent) => {\n emit('row-dblclicked', row, index, e)\n }\n \"\n @row-contextmenu=\"\n (row: Items, index: number, e: MouseEvent) => {\n emit('row-contextmenu', row, index, e)\n }\n \"\n @row-hovered=\"\n (row: Items, index: number, e: MouseEvent) => {\n emit('row-hovered', row, index, e)\n }\n \"\n @row-unhovered=\"\n (row: Items, index: number, e: MouseEvent) => {\n emit('row-unhovered', row, index, e)\n }\n \"\n @row-middle-clicked=\"\n (row: Items, index: number, e: MouseEvent) => {\n emit('row-middle-clicked', row, index, e)\n }\n \"\n >\n <!-- eslint-enable prettier/prettier -->\n <template v-if=\"slots['thead-top']\" #thead-top=\"scope\">\n <slot\n name=\"thead-top\"\n v-bind=\"scope\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :fields=\"computedFields\"\n />\n </template>\n <template v-if=\"slots['thead-sub']\" #thead-sub=\"scope\">\n <slot name=\"thead-sub\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['top-row']\" #top-row=\"scope\">\n <slot name=\"top-row\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['row-details']\" #row-details=\"scope\">\n <slot\n name=\"row-details\"\n v-bind=\"scope\"\n :fields=\"computedFields\"\n :select-row=\"(index = scope.index) => exposedSelectableUtilities.selectRow(index)\"\n :unselect-row=\"(index = scope.index) => exposedSelectableUtilities.unselectRow(index)\"\n :row-selected=\"exposedSelectableUtilities.isRowSelected(scope.index)\"\n />\n </template>\n <template v-if=\"slots['bottom-row']\" #bottom-row=\"scope\">\n <slot name=\"bottom-row\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['custom-foot']\" #custom-foot=\"scope\">\n <slot name=\"custom-foot\" v-bind=\"scope\" :fields=\"computedFields\" />\n </template>\n <template v-if=\"slots['table-caption']\" #table-caption>\n <slot name=\"table-caption\" />\n </template>\n <template v-for=\"name in dynamicCellSlots\" #[name]=\"scope\">\n <slot\n :name\n v-bind=\"scope\"\n :select-row=\"(index = scope.index) => exposedSelectableUtilities.selectRow(index)\"\n :unselect-row=\"(index = scope.index) => exposedSelectableUtilities.unselectRow(index)\"\n :row-selected=\"exposedSelectableUtilities.isRowSelected(scope.index)\"\n />\n </template>\n <template v-for=\"name in dynamicFootSlots\" #[name]=\"scope\">\n <slot\n :name\n v-bind=\"scope\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n />\n </template>\n\n <template\n v-for=\"field in computedFields\"\n :key=\"field.key\"\n #[`head(${String(field.key)})`]=\"scope\"\n >\n <slot\n :name=\"\n slots[`head(${String(field.key)})`]\n ? (`head(${String(field.key)})` as 'head()')\n : 'head()'\n \"\n v-bind=\"scope\"\n :select-all-rows=\"exposedSelectableUtilities.selectAllRows\"\n :clear-selected=\"exposedSelectableUtilities.clearSelected\"\n >\n {{ getTableFieldHeadLabel(field) }}\n </slot>\n <template v-if=\"isSortable && !!scope.field.sortable && props.noSortableIcon === false\">\n <slot\n v-if=\"sortByModel?.find((el) => el.key === scope.field.key)?.order === 'asc'\"\n v-bind=\"scope\"\n :name=\"\n slots[`sortAsc(${String(scope.field.key)})`]\n ? (`sortAsc(${String(scope.field.key)})` as 'sortAsc()')\n : 'sortAsc()'\n \"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-up-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n />\n </svg>\n </slot>\n <slot\n v-else-if=\"sortByModel?.find((el) => el.key === scope.field.key)?.order === 'desc'\"\n v-bind=\"scope\"\n :name=\"\n slots[`sortDesc(${String(scope.field.key)})`]\n ? (`sortDesc(${String(scope.field.key)})` as 'sortDesc()')\n : 'sortDesc()'\n \"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-down-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 4a.5.5 0 0 1 .5.5v5.793l2.146-2.147a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L7.5 10.293V4.5A.5.5 0 0 1 8 4z\"\n />\n </svg>\n </slot>\n <slot\n v-else\n v-bind=\"scope\"\n :name=\"\n slots[`sortDefault(${String(scope.field.key)})`]\n ? (`sortDefault(${String(scope.field.key)})` as 'sortDefault()')\n : 'sortDefault()'\n \"\n >\n <svg\n :style=\"{opacity: 0.4}\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n class=\"bi bi-arrow-up-short\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n >\n <path\n fill-rule=\"evenodd\"\n d=\"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n />\n </svg>\n </slot>\n </template>\n </template>\n <template #custom-body=\"scope\">\n <BTr\n v-if=\"busyModel && slots['table-busy']\"\n class=\"b-table-busy-slot\"\n :class=\"getBusyRowClasses\"\n >\n <BTd :colspan=\"scope.fields.length\">\n <slot name=\"table-busy\" />\n </BTd>\n </BTr>\n\n <BTr\n v-else-if=\"props.showEmpty === true && computedItems.length === 0\"\n class=\"b-table-empty-row\"\n >\n <BTd :colspan=\"computedFields.length\">\n <div role=\"alert\" aria-live=\"polite\">\n <div class=\"text-center my-2\">\n <slot v-if=\"isFilterableTable\" name=\"empty-filtered\" v-bind=\"emptySlotScope\">\n {{ props.emptyFilteredText }}\n </slot>\n <slot v-else name=\"empty\" v-bind=\"emptySlotScope\">\n {{ props.emptyText }}\n </slot>\n </div>\n </div>\n </BTd>\n </BTr>\n </template>\n </BTableLite>\n</template>\n\n<script setup lang=\"ts\" generic=\"Items\">\nimport {useToNumber} from '@vueuse/core'\nimport {computed, onMounted, type Ref, ref, watch} from 'vue'\nimport {formatItem} from '../../utils/formatItem'\nimport BTableLite from './BTableLite.vue'\nimport BTd from './BTd.vue'\nimport BTr from './BTr.vue'\nimport {\n type BTableSortBy,\n type BTableSortByOrder,\n isTableField,\n isTableItem,\n type NoProviderTypes,\n type TableField,\n type TableFieldFormatter,\n type TableFieldRaw,\n type TableItem,\n type TableRowEvent,\n type TableRowType,\n type TableStrictClassValue,\n} from '../../types/TableTypes'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BTableProps} from '../../types/ComponentProps'\nimport {get, pick, set} from '../../utils/object'\nimport {startCase} from '../../utils/stringUtils'\nimport type {LiteralUnion} from '../../types/LiteralUnion'\nimport {btableLiteProps, btableSimpleProps, getTableFieldHeadLabel} from '../../utils/tableUtils'\nimport {useId} from '../../composables/useId'\n\nconst _props = withDefaults(\n defineProps<Omit<BTableProps<Items>, 'sortBy' | 'busy' | 'selectedItems'>>(),\n {\n noSortableIcon: false,\n perPage: Number.POSITIVE_INFINITY,\n filter: undefined,\n filterFunction: undefined,\n mustSort: false,\n filterable: undefined,\n provider: undefined,\n noProvider: undefined,\n noProviderPaging: false,\n noProviderSorting: false,\n multisort: false,\n noProviderFiltering: false,\n noLocalSorting: false,\n noSelectOnClick: false,\n selectable: false,\n stickySelect: false,\n selectHead: true,\n selectMode: 'multi',\n selectionVariant: 'primary',\n busyLoadingText: 'Loading...',\n currentPage: 1,\n // BTableLite props\n items: () => [],\n fields: () => [],\n // All others use defaults\n caption: undefined,\n align: undefined,\n footClone: undefined,\n labelStacked: undefined,\n showEmpty: false,\n emptyText: 'There are no records to show',\n emptyFilteredText: 'There are no records matching your request',\n fieldColumnClass: undefined,\n tbodyTrClass: undefined,\n detailsTdClass: undefined,\n headVariant: undefined,\n headRowVariant: undefined,\n footRowVariant: undefined,\n footVariant: undefined,\n modelValue: undefined,\n primaryKey: undefined,\n tbodyClass: undefined,\n tfootClass: undefined,\n tfootTrClass: undefined,\n theadClass: undefined,\n theadTrClass: undefined,\n // End BTableLite props\n // BTableSimple props\n borderVariant: undefined,\n variant: undefined,\n bordered: undefined,\n borderless: undefined,\n captionTop: undefined,\n dark: undefined,\n hover: undefined,\n id: undefined,\n noBorderCollapse: undefined,\n outlined: undefined,\n fixed: undefined,\n responsive: undefined,\n stacked: undefined,\n striped: undefined,\n stripedColumns: undefined,\n small: undefined,\n stickyHeader: undefined,\n // End BTableSimple props\n }\n)\nconst props = useDefaults(_props, 'BTable')\n\nconst emit = defineEmits<{\n 'filtered': [value: Items[]]\n 'head-clicked': [\n key: string,\n field: (typeof computedFields.value)[0],\n event: MouseEvent,\n isFooter: boolean,\n ]\n 'row-clicked': TableRowEvent<Items>\n 'row-dblclicked': TableRowEvent<Items>\n 'row-contextmenu': TableRowEvent<Items>\n 'row-hovered': TableRowEvent<Items>\n 'row-unhovered': TableRowEvent<Items>\n 'row-middle-clicked': TableRowEvent<Items>\n 'row-selected': [value: Items]\n 'row-unselected': [value: Items]\n 'sorted': [value: BTableSortBy]\n 'change': [value: Items[]]\n}>()\n\ntype SortSlotScope = {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n}\n\nconst slots = defineSlots<{\n // BTableLite\n 'thead-top'?: (props: {\n columns: number\n fields: typeof computedFields.value\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n [key: `head(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: false\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'thead-sub'?: (\n props: {\n items: readonly Items[]\n fields: typeof computedFields.value\n field: (typeof computedFields.value)[0]\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'top-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n [key: `cell(${string})`]: (props: {\n value: unknown\n unformatted: unknown\n index: number\n item: Items\n field: (typeof computedFields.value)[0]\n items: readonly Items[]\n toggleDetails: () => void\n detailsShowing: boolean\n rowSelected: boolean\n selectRow: (index?: number) => void\n unselectRow: (index?: number) => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'row-details'?: (props: {\n item: Items\n toggleDetails: () => void\n fields: typeof computedFields.value\n index: number\n rowSelected: boolean\n selectRow: (index?: number) => void\n unselectRow: (index?: number) => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'bottom-row'?: (props: {columns: number; fields: typeof computedFields.value}) => any\n\n [key: `foot(${string})`]: (props: {\n label: string | undefined\n column: LiteralUnion<keyof Items>\n field: (typeof computedFields.value)[0]\n isFoot: true\n selectAllRows: () => void\n clearSelected: () => void\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n 'custom-foot'?: (props: {\n fields: typeof computedFields.value\n items: readonly Items[]\n columns: number\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n }) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-caption'?: (props: Record<string, never>) => any\n\n // end btable slots\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortAsc(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortDesc(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: `sortDefault(${string})`]: (props: SortSlotScope) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'table-busy'?: (props: Record<string, never>) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'empty-filtered'?: (props: typeof emptySlotScope.value) => any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n 'empty'?: (props: typeof emptySlotScope.value) => any\n}>()\n\nconst dynamicCellSlots = computed(\n () => Object.keys(slots).filter((key) => key.startsWith('cell(')) as 'cell()'[]\n)\nconst dynamicFootSlots = computed(\n () => Object.keys(slots).filter((key) => key.startsWith('foot(')) as 'foot()'[]\n)\n\nconst sortByModel = defineModel<BTableProps<Items>['sortBy']>('sortBy', {\n default: undefined,\n})\nconst busyModel = defineModel<Exclude<BTableProps<Items>['busy'], undefined>>('busy', {\n default: false,\n})\nconst selectedItemsModel = defineModel<Exclude<BTableProps<Items>['selectedItems'], undefined>>(\n 'selectedItems',\n {\n default: () => [],\n }\n)\n\nconst computedId = useId(() => props.id)\n\nconst selectedItemsToSet = computed({\n get: () => new Set([...selectedItemsModel.value]),\n set: (val) => {\n selectedItemsModel.value = [...val]\n },\n})\n\nwatch(selectedItemsToSet, (newValue, oldValue) => {\n Array.from(oldValue)\n .filter((item) => !newValue.has(item))\n .forEach((item) => {\n emit('row-unselected', item)\n })\n Array.from(newValue)\n .filter((item) => !oldValue.has(item))\n .forEach((item) => {\n emit('row-selected', item)\n })\n})\n/**\n * This is to avoid the issue of directly mutating the array structure and to properly trigger the computed setter.\n * The utils also conveniently emit the proper events after\n */\nconst selectedItemsSetUtilities = {\n add: (item: Items) => {\n const value = new Set(selectedItemsToSet.value)\n value.add(item)\n selectedItemsToSet.value = value\n },\n clear: () => {\n selectedItemsToSet.value.forEach((item) => {\n selectedItemsSetUtilities.delete(item)\n })\n },\n delete: (item: Items) => {\n const value = new Set(selectedItemsToSet.value)\n if (props.primaryKey) {\n const pkey: string = props.primaryKey\n selectedItemsModel.value.forEach((v, i) => {\n const selectedKey = get(v, pkey)\n const itemKey = get(item, pkey)\n\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) {\n value.delete(selectedItemsModel.value[i])\n }\n })\n } else {\n value.delete(item)\n }\n selectedItemsToSet.value = value\n },\n set: (items: Items[]) => {\n selectedItemsToSet.value = new Set(items)\n },\n has: (item: Items) => {\n if (!props.primaryKey) return selectedItemsToSet.value.has(item)\n\n // Resolver for when we are using primary keys\n const pkey: string = props.primaryKey\n for (const selected of selectedItemsToSet.value) {\n const selectedKey = get(selected, pkey)\n const itemKey = get(item, pkey)\n\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) return true\n }\n return false\n },\n} as const\n\n/**\n * Only stores data that is fetched when using the provider\n */\nconst internalItems: Ref<Items[]> = ref([])\n\nconst perPageNumber = useToNumber(() => props.perPage, {method: 'parseInt'})\nconst currentPageNumber = useToNumber(() => props.currentPage, {method: 'parseInt'})\n\nconst isFilterableTable = computed(() => !!props.filter)\nconst usesProvider = computed(() => props.provider !== undefined)\nconst isSelecting = computed(() => selectedItemsToSet.value.size > 0)\n\nconst isSortable = computed(\n () =>\n sortByModel.value !== undefined ||\n props.fields.some(\n (field) => typeof field === 'object' && field !== null && field.sortable === true\n )\n)\n\nconst computedFields = computed<TableField<Items>[]>(() =>\n props.fields.map((el) => {\n if (!isTableField<Items>(el)) {\n const label = startCase(el as string)\n return {\n key: el as string,\n label,\n tdAttr: props.stacked === true ? {'data-label': label} : undefined,\n }\n }\n\n const value = sortByModel.value?.find((sb) => el.key === sb.key)\n const sortValue =\n isSortable.value === false\n ? undefined\n : value === undefined\n ? 'none'\n : value.order === 'desc'\n ? 'descending'\n : value.order === 'asc'\n ? 'ascending'\n : 'none'\n\n return {\n ...(el as TableField<Items>),\n thAttr: {\n 'aria-sort': sortValue,\n ...el.thAttr,\n },\n }\n })\n)\n\nconst tableClasses = computed(() => ({\n 'b-table-busy': busyModel.value,\n 'b-table-selectable': props.selectable,\n 'user-select-none': props.selectable && isSelecting.value,\n}))\n\nconst getBusyRowClasses = computed(() => [\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(null, 'table-busy')\n : props.tbodyTrClass\n : null,\n])\nconst getFieldColumnClasses = (field: TableField) => [\n {\n 'b-table-sortable-column': isSortable.value && field.sortable,\n },\n]\n// TODO this class has issues if the table has a variant already applied\n// Also the row should technically have aria-selected . Both things could probably just use a function with tbodyTrAttrs\n// But functional tbodyTrAttrs are not supported yet\n// Also the stuff for resolving functions could probably be made a util\nconst getRowClasses = (item: Items | null, type: TableRowType): TableStrictClassValue => [\n {\n [`selected table-${props.selectionVariant}`]:\n props.selectable && !!item && selectedItemsSetUtilities.has(item),\n },\n props.tbodyTrClass\n ? typeof props.tbodyTrClass === 'function'\n ? props.tbodyTrClass(item, type)\n : props.tbodyTrClass\n : null,\n]\n\nconst getFormatter = (value: TableField<Items>): TableFieldFormatter<Items> | undefined =>\n typeof value.sortByFormatted === 'function' ? value.sortByFormatted : value.formatter\nconst computedItems = computed<Items[]>(() => {\n const sortItems = (items: Items[]) => {\n // \"undefined\" values are set by us, we do this so we dont wipe out the comparer\n const sortByItems = sortByModel.value?.filter((el) => !!el.order)\n\n if (!sortByItems || sortByItems.length === 0) return items\n\n // Multi-sort\n return [...items].sort((a, b) => {\n for (let i = 0; i < (sortByItems.length ?? 0); i++) {\n const sortOption = sortByItems[i]\n const realVal = (ob: Items): string => {\n if (!isTableItem(ob)) return String(ob)\n\n const sortField = computedFields.value.find((el) => {\n if (isTableField<Items>(el)) return el.key === sortOption.key\n\n return false\n })\n const val = get(ob, sortOption.key as keyof TableItem)\n if (isTableField<Items>(sortField) && !!sortField.sortByFormatted) {\n const formatter = getFormatter(sortField)\n if (formatter) {\n return String(formatItem(ob, String(sortField.key), formatter))\n }\n }\n return typeof val === 'object' && val !== null\n ? JSON.stringify(val)\n : (val?.toString() ?? '')\n }\n\n const aValue = realVal(a)\n const bValue = realVal(b)\n const comparison = sortOption.comparer\n ? sortOption.comparer(aValue, bValue)\n : aValue.localeCompare(bValue, undefined, {numeric: true})\n\n if (comparison !== 0) {\n return sortOption.order === 'asc' ? comparison : -comparison\n }\n }\n return 0 // items are equal\n })\n }\n\n const filterItems = (items: Items[]) =>\n items.filter((item) =>\n isTableItem(item)\n ? Object.entries(item).some(([key, val]) => {\n if (\n val === null ||\n val === undefined ||\n key[0] === '_' ||\n (!props.filterable?.includes(key) && !!props.filterable?.length)\n )\n return false\n\n if (props.filterFunction && typeof props.filterFunction === 'function') {\n return props.filterFunction(item, props.filter)\n }\n\n const realVal = (): string => {\n const filterField = computedFields.value.find((el) => {\n if (isTableField<Items>(el)) return el.key === key\n\n return false\n })\n if (isTableField<Items>(filterField) && !!filterField.filterByFormatted) {\n const formatter = getFormatter(filterField)\n if (formatter) {\n return String(formatter(val, String(filterField.key), item))\n }\n }\n return typeof val === 'object' ? JSON.stringify(Object.values(val)) : val.toString()\n }\n const itemValue: string = realVal()\n return itemValue.toLowerCase().includes(props.filter?.toLowerCase() ?? '')\n })\n : true\n )\n\n let mappedItems = usesProvider.value ? internalItems.value : (props.items as Items[])\n mappedItems = mappedItems.map((item) => {\n if (\n typeof item === 'object' &&\n item !== null &&\n Object.keys(item).some((key) => key.includes('.'))\n ) {\n // We use any here because the TS doesn't isn't certain that \"item\" is the same type as our newItem.\n // But we've determined that it's an object, so we can ignore it since they will always be the same \"object\"\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let newItem: any = {}\n for (const key in item) {\n if (key.includes('.')) {\n newItem = set(newItem, key, item[key])\n } else {\n newItem[key] = item[key]\n }\n }\n return newItem\n // return\n }\n return item\n })\n\n if (\n (isFilterableTable.value === true && !usesProvider.value) ||\n (isFilterableTable.value === true && usesProvider.value && props.noProviderFiltering)\n ) {\n mappedItems = filterItems(mappedItems)\n }\n\n if (\n (isSortable.value === true && !usesProvider.value && !props.noLocalSorting) ||\n (isSortable.value === true && usesProvider.value && props.noProviderSorting)\n ) {\n mappedItems = sortItems(mappedItems)\n }\n\n return mappedItems\n})\n\nconst emptySlotScope = computed(() => ({\n emptyFilteredText: props.emptyFilteredText,\n emptyText: props.emptyText,\n fields: computedFields.value,\n items: computedItems.value,\n}))\n\nconst computedDisplayItems = computed<Items[]>(() => {\n if (Number.isNaN(perPageNumber.value) || (usesProvider.value && !props.noProviderPaging)) {\n return computedItems.value\n }\n\n return computedItems.value.slice(\n (currentPageNumber.value - 1) * (perPageNumber.value || Number.POSITIVE_INFINITY),\n currentPageNumber.value * (perPageNumber.value || Number.POSITIVE_INFINITY)\n )\n})\n\nwatch(computedDisplayItems, (v) => {\n emit('change', v)\n})\n\nconst handleRowSelection = (\n row: Items,\n index: number,\n shiftClicked = false,\n ctrlClicked = false,\n metaClicked = false\n) => {\n if (!props.selectable) return\n\n if (props.selectMode === 'single' || props.selectMode === 'multi') {\n // Do nothing when these items are held\n if (shiftClicked || ctrlClicked) return\n // Delete if item is in\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row)\n } else {\n if (props.selectMode === 'single') {\n selectedItemsSetUtilities.set([row])\n } else {\n selectedItemsSetUtilities.add(row)\n }\n }\n } else {\n if (ctrlClicked || metaClicked) {\n // Delete if in the object\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row)\n // Otherwise add. Functions similarly to 'multi' at this point\n } else {\n selectedItemsSetUtilities.add(row)\n }\n // This is where range is different, due to the difference in shift\n } else if (shiftClicked) {\n const lastSelectedItem = [...selectedItemsToSet.value].pop()\n const lastSelectedIndex = computedItems.value.findIndex((i) => i === lastSelectedItem)\n const selectStartIndex = Math.min(lastSelectedIndex, index)\n const selectEndIndex = Math.max(lastSelectedIndex, index)\n const items = computedItems.value.slice(selectStartIndex, selectEndIndex + 1)\n selectedItemsSetUtilities.set(items)\n // If nothing is being held, then we just behave like it's single mode\n } else {\n selectedItemsSetUtilities.set([row])\n }\n }\n}\n\nconst onRowClick = (row: Items, index: number, e: MouseEvent) => {\n if (props.noSelectOnClick === false) {\n handleRowSelection(row, index, e.shiftKey, e.ctrlKey, e.metaKey)\n }\n emit('row-clicked', row, index, e)\n}\n\nconst handleFieldSorting = (field: TableField<Items>) => {\n if (!isSortable.value) return\n\n const fieldKey = typeof field === 'object' && field !== null ? field.key : field\n const fieldSortable = typeof field === 'object' && field !== null ? field.sortable : false\n\n if (!(isSortable.value === true && fieldSortable === true)) return\n\n const resolveOrder = (val: BTableSortByOrder): BTableSortByOrder | undefined => {\n if (val === 'asc') return 'desc'\n if (val === undefined) return 'asc'\n if (\n props.mustSort === true ||\n (Array.isArray(props.mustSort) && props.mustSort.includes(fieldKey as string))\n )\n return 'asc'\n return undefined\n }\n\n const index = sortByModel.value?.findIndex((el) => el.key === fieldKey) ?? -1\n const originalValue = sortByModel.value?.[index]\n const updatedValue: BTableSortBy =\n // If value is new, we default to ascending\n // Otherwise we make a temp copy of the value\n index === -1 || !originalValue ? {key: fieldKey as string, order: 'asc'} : {...originalValue}\n\n /**\n * @returns the updated value to emit for sorted\n */\n const handleMultiSort = (): BTableSortBy => {\n let val = updatedValue\n if (index === -1) {\n sortByModel.value = [...(sortByModel.value ?? []), updatedValue]\n } else {\n const order = resolveOrder(updatedValue.order)\n val = {...updatedValue, order}\n sortByModel.value = order\n ? sortByModel.value?.map((el) => (el.key === val.key ? val : el))\n : sortByModel.value?.filter((el) => el.key !== val.key)\n }\n return val\n }\n\n /**\n * @returns the updated value to emit for sorted\n */\n const handleSingleSort = (): BTableSortBy => {\n const val = {\n ...updatedValue,\n order: index === -1 ? updatedValue.order : resolveOrder(updatedValue.order),\n }\n sortByModel.value = [val]\n return val\n }\n\n // Then emit the returned updated value\n emit('sorted', props.multisort === true ? handleMultiSort() : handleSingleSort())\n}\n\nconst onFieldHeadClick = (\n fieldKey: string,\n field: TableField<Items>,\n event: Readonly<MouseEvent>,\n isFooter = false\n) => {\n emit('head-clicked', fieldKey, field, event, isFooter)\n handleFieldSorting(field)\n}\n\nconst callItemsProvider = async () => {\n if (!usesProvider.value || props.provider === undefined || busyModel.value) return\n busyModel.value = true\n const response = props.provider({\n currentPage: currentPageNumber.value,\n filter: props.filter,\n sortBy: sortByModel.value,\n perPage: perPageNumber.value,\n })\n try {\n const items = response instanceof Promise ? await response : response\n\n if (items === undefined) return\n internalItems.value = items\n } finally {\n // Potential race condition could occur if the user explicitly sets the busy value to a different value while the response promise is executing\n // which would have been the users choice.\n // eslint-disable-next-line require-atomic-updates\n busyModel.value = false\n }\n}\n\nconst providerPropsWatch = async (prop: string, val: unknown, oldVal: unknown) => {\n if (val === oldVal) return\n\n //stop provide when paging\n const inNoProvider = (key: NoProviderTypes) => props.noProvider?.includes(key) === true\n const noProvideWhenPaging =\n (prop === 'currentPage' || prop === 'perPage') &&\n (inNoProvider('paging') || props.noProviderPaging === true)\n const noProvideWhenFiltering =\n prop === 'filter' && (inNoProvider('filtering') || props.noProviderFiltering === true)\n const noProvideWhenSorting =\n (prop === 'sortBy' || prop === 'sortDesc') &&\n (inNoProvider('sorting') || props.noProviderSorting === true)\n\n if (noProvideWhenPaging || noProvideWhenFiltering || noProvideWhenSorting) return\n\n if (usesProvider.value === true) {\n await callItemsProvider()\n }\n\n if (!(prop === 'currentPage' || prop === 'perPage')) {\n emit('filtered', [...computedItems.value])\n }\n}\n\nwatch(\n () => props.filter,\n (filter, oldFilter) => {\n providerPropsWatch('filter', filter, oldFilter)\n\n if (filter === oldFilter || usesProvider.value) return\n if (!filter) {\n emit('filtered', [...computedItems.value])\n }\n }\n)\nwatch(currentPageNumber, (val, oldVal) => {\n providerPropsWatch('currentPage', val, oldVal)\n})\nwatch(perPageNumber, (val, oldVal) => {\n providerPropsWatch('perPage', val, oldVal)\n})\nwatch(\n sortByModel,\n (val, oldVal) => {\n providerPropsWatch('sortBy', val, oldVal)\n },\n {deep: true}\n)\n\nwatch(\n () => props.provider,\n (newValue) => {\n // Reset the internal values if the provider stops getting used\n if (newValue === undefined) {\n internalItems.value = []\n return\n }\n // Otherwise we should refresh the table on such a change\n callItemsProvider()\n }\n)\n\nonMounted(callItemsProvider)\n\nconst exposedSelectableUtilities = {\n clearSelected: () => {\n if (!props.selectable) return\n selectedItemsSetUtilities.clear()\n },\n selectAllRows: () => {\n if (!props.selectable || props.selectMode === 'single') return\n selectedItemsToSet.value = new Set([...computedItems.value])\n },\n selectRow: (index: number) => {\n if (!props.selectable) return\n const item = computedItems.value[index]\n if (!item || selectedItemsSetUtilities.has(item)) return\n if (props.selectMode === 'single') {\n selectedItemsSetUtilities.set([item])\n } else {\n selectedItemsSetUtilities.add(item)\n }\n },\n unselectRow: (index: number) => {\n if (!props.selectable) return\n const item = computedItems.value[index]\n if (!item || !selectedItemsSetUtilities.has(item)) return\n selectedItemsSetUtilities.delete(item)\n },\n isRowSelected: (index: number) => {\n if (!props.selectable) return false\n const item = computedItems.value[index]\n return selectedItemsSetUtilities.has(item)\n },\n} as const\n\nconst computedLiteProps = computed(() => ({\n ...pick(props, [...btableLiteProps, ...btableSimpleProps]),\n tableAttrs: {\n ariaBusy: busyModel.value,\n },\n items: computedDisplayItems.value,\n fields: computedFields.value as TableFieldRaw<Items>[],\n tableClass: tableClasses.value,\n tbodyTrClass: getRowClasses,\n fieldColumnClass: getFieldColumnClasses,\n id: computedId.value,\n}))\n\ndefineExpose({\n // The row selection methods are really for compat. Users should probably use the v-model though\n ...exposedSelectableUtilities,\n items: computedItems,\n refresh: callItemsProvider,\n})\n</script>\n"],"names":["formatItem","item","fieldKey","formatter","val","get","isTableItem","value","isTableField","_props","__props","props","useDefaults","computedClasses","computed","variant","stickyColumn","scope","colspan","rowspan","getTableFieldHeadLabel","field","titleCase","label","key","btableSimpleProps","Object","freeze","keys","bordered","borderless","borderVariant","captionTop","dark","fixed","hover","id","noBorderCollapse","outlined","responsive","small","stacked","stickyHeader","striped","stripedColumns","tableAttrs","tableClass","btableLiteProps","align","caption","detailsTdClass","fieldColumnClass","fields","footClone","footRowVariant","footVariant","headRowVariant","headVariant","items","labelStacked","modelValue","primaryKey","tbodyClass","tbodyTrAttrs","tbodyTrClass","tfootClass","tfootTrClass","theadClass","theadTrClass","TABLE_TAG_NAMES","eventFilter","join","filterEvent","event","target","el","disabled","indexOf","tagName","closest","labelFor","getAttribute","input","document","getElementById","querySelector","matches","emit","__emit","slots","_useSlots","computedId","useId","detailsMap","ref","WeakMap","vue","watch","forEach","set","_showDetails","generateDetailsItem","deep","immediate","computedTableClasses","computedFields","length","firstItem","Array","isArray","map","k","startCase","tdAttr","_noHeader","f","computedFieldsTotal","showComputedHeaders","every","footerProps","class","callThAttr","type","String","thAttr","headerClicked","isFooter","toggleRowDetails","tr","prevValue","getFieldColumnClasses","thClass","getFieldRowClasses","tdClass","_a","_cellVariants","_b","callTbodyTrAttrs","getRowClasses","computedSimpleProps","pick","primaryKeyValue","itemIndex","button","attr","dynamicCellSlots","filter","startsWith","dynamicFootSlots","sortByModel","_useModel","busyModel","selectedItemsModel","useModel","selectedItemsToSet","Set","newValue","oldValue","from","has","selectedItemsSetUtilities","add","clear","delete","pkey","v","i","selectedKey","itemKey","selected","internalItems","perPageNumber","useToNumber","perPage","method","currentPageNumber","currentPage","isFilterableTable","usesProvider","provider","isSelecting","size","isSortable","some","sortable","find","sb","sortValue","order","tableClasses","selectable","getBusyRowClasses","selectionVariant","getFormatter","sortByFormatted","computedItems","mappedItems","includes","newItem","noProviderFiltering","entries","filterable","filterFunction","filterField","filterByFormatted","JSON","stringify","values","toString","realVal","toLowerCase","_c","noLocalSorting","noProviderSorting","sortByItems","sort","a","b","sortOption","ob","sortField","aValue","bValue","comparison","comparer","localeCompare","numeric","sortItems","emptySlotScope","emptyFilteredText","emptyText","computedDisplayItems","Number","isNaN","noProviderPaging","slice","POSITIVE_INFINITY","onRowClick","row","index","e","noSelectOnClick","shiftClicked","ctrlClicked","metaClicked","selectMode","lastSelectedItem","pop","lastSelectedIndex","findIndex","selectStartIndex","Math","min","selectEndIndex","max","handleRowSelection","shiftKey","ctrlKey","metaKey","onFieldHeadClick","fieldSortable","resolveOrder","mustSort","originalValue","updatedValue","multisort","handleMultiSort","handleSingleSort","handleFieldSorting","callItemsProvider","async","response","sortBy","Promise","providerPropsWatch","prop","oldVal","inNoProvider","noProvider","noProvideWhenPaging","noProvideWhenFiltering","noProvideWhenSorting","oldFilter","onMounted","exposedSelectableUtilities","clearSelected","selectAllRows","selectRow","unselectRow","isRowSelected","computedLiteProps","ariaBusy","__expose","refresh"],"mappings":"kSAGaA,EAAa,CACxBC,EAEAC,EACAC,KAEM,MAAAC,EAAMC,EAAAA,IAAIJ,EAAMC,GACf,OAAAC,GAAkC,mBAAdA,EAA2BA,EAAUC,EAAKF,EAAUD,GAAQG,CAAA,ECI5EE,EAAeC,GACT,iBAAVA,GAAgC,OAAVA,EA2DlBC,EAAmBD,GACb,iBAAVA,GAAgC,OAAVA,GAAkB,QAASA,+EChE1D,MAAME,EAASC,EAGTC,EAAQC,EAAAA,YAAYH,EAAQ,UAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,2YCFpC,MAAMN,EAASC,EAOTC,EAAQC,EAAAA,YAAYH,EAAQ,OAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,QAClC,wBAAyBJ,EAAMK,aAC/B,wBAAyBL,EAAMK,cAAkC,OAAlBL,EAAMI,YAGjDE,EAAQH,YAAS,IAAOH,EAAMO,QAAU,UAAYP,EAAMQ,QAAU,UAAY,wbC7BtF,MAAMV,EAASC,EAGTC,EAAQC,EAAAA,YAAYH,EAAQ,UAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAAC,SAASH,EAAMI,WAA8B,OAAlBJ,EAAMI,2YCFpC,MAAMN,EAASC,EAOTC,EAAQC,EAAAA,YAAYH,EAAQ,OAO5BI,EAAkBC,EAAAA,UAAS,KAAO,CACtC,CAA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