bootstrap-vue-next 0.45.2 → 0.45.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BOffcanvas-DaKJOICF.mjs → BOffcanvas-CwH0DqSG.mjs} +17 -1
- package/dist/BOffcanvas-CwH0DqSG.mjs.map +1 -0
- package/dist/{BOffcanvas-mlOkh8T1.js → BOffcanvas-DdiP19Xz.js} +17 -1
- package/dist/BOffcanvas-DdiP19Xz.js.map +1 -0
- package/dist/{BTable-DYS8Lftg.mjs → BTable-Bt75vbNu.mjs} +82 -15
- package/dist/BTable-Bt75vbNu.mjs.map +1 -0
- package/dist/{BTable-G-Pjvx68.js → BTable-CXxJl2ps.js} +81 -14
- package/dist/BTable-CXxJl2ps.js.map +1 -0
- package/dist/bootstrap-vue-next.mjs +2 -2
- package/dist/bootstrap-vue-next.umd.js +2 -2
- package/dist/components/BPagination/BPagination.vue.d.mts +1 -1
- package/dist/components/BPagination/BPagination.vue.d.ts +1 -1
- package/dist/components/BTable/BTable.vue.d.mts +4 -3
- package/dist/components/BTable/BTable.vue.d.ts +4 -3
- package/dist/composables/useTableHelpers.d.mts +1 -0
- package/dist/composables/useTableHelpers.d.ts +1 -0
- package/dist/directives/utils.d.mts +2 -2
- package/dist/directives/utils.d.ts +2 -2
- package/dist/src/components/BOffcanvas/index.mjs +1 -1
- package/dist/src/components/BOffcanvas/index.umd.js +1 -1
- package/dist/src/components/BTable/index.mjs +1 -1
- package/dist/src/components/BTable/index.umd.js +1 -1
- package/dist/src/components/index.mjs +2 -2
- package/dist/src/components/index.umd.js +2 -2
- package/dist/src/directives/BPopover/index.mjs +1 -1
- package/dist/src/directives/BPopover/index.umd.js +1 -1
- package/dist/src/directives/BScrollspy/index.mjs +1 -1
- package/dist/src/directives/BScrollspy/index.umd.js +1 -1
- package/dist/src/directives/BToggle/index.mjs +2 -2
- package/dist/src/directives/BToggle/index.mjs.map +1 -1
- package/dist/src/directives/BToggle/index.umd.js +2 -2
- package/dist/src/directives/BToggle/index.umd.js.map +1 -1
- package/dist/src/directives/BTooltip/index.mjs +1 -1
- package/dist/src/directives/BTooltip/index.umd.js +1 -1
- package/dist/types/ComponentEmits.d.mts +2 -1
- package/dist/types/ComponentEmits.d.ts +2 -1
- package/dist/types/ComponentProps.d.mts +5 -0
- package/dist/types/ComponentProps.d.ts +5 -0
- package/dist/{utils-Dgz9Trtl.mjs → utils-BbYwYPyP.mjs} +5 -5
- package/dist/utils-BbYwYPyP.mjs.map +1 -0
- package/dist/{utils-BTPjS0XS.js → utils-ePxMJ7rd.js} +5 -5
- package/dist/utils-ePxMJ7rd.js.map +1 -0
- package/package.json +1 -1
- package/dist/BOffcanvas-DaKJOICF.mjs.map +0 -1
- package/dist/BOffcanvas-mlOkh8T1.js.map +0 -1
- package/dist/BTable-DYS8Lftg.mjs.map +0 -1
- package/dist/BTable-G-Pjvx68.js.map +0 -1
- package/dist/utils-BTPjS0XS.js.map +0 -1
- package/dist/utils-Dgz9Trtl.mjs.map +0 -1
|
@@ -375,8 +375,16 @@ var useItemExpansion = ({ allItems, primaryKey, expandedItems }) => {
|
|
|
375
375
|
};
|
|
376
376
|
var useTableKeyboardNavigation = ({ items, id }, events) => {
|
|
377
377
|
const keyboardNavigation = (0, vue.inject)(require_keys.tableKeyboardNavigationKey, null);
|
|
378
|
-
const
|
|
379
|
-
const
|
|
378
|
+
const instance = (0, vue.getCurrentInstance)();
|
|
379
|
+
const hasEventHandler = (eventName) => {
|
|
380
|
+
const props = instance?.vnode.props;
|
|
381
|
+
if (!props) return false;
|
|
382
|
+
return !!(props[`on${eventName}`] || props[`on${eventName}Once`]);
|
|
383
|
+
};
|
|
384
|
+
const hasHeadClickedHandler = (0, vue.computed)(() => hasEventHandler("HeadClicked"));
|
|
385
|
+
const hasRowClickedHandler = (0, vue.computed)(() => hasEventHandler("RowClicked"));
|
|
386
|
+
const shouldHeaderBeFocusable = (field) => keyboardNavigation ? !!(keyboardNavigation.headerNavigation.value && field.sortable === true) : hasHeadClickedHandler.value;
|
|
387
|
+
const shouldRowBeFocusable = (0, vue.computed)(() => keyboardNavigation ? !!(keyboardNavigation.rowNavigation.value && (0, vue.toValue)(items).length > 0) : !!(hasRowClickedHandler.value && (0, vue.toValue)(items).length > 0));
|
|
380
388
|
const headerClicked = (field, event, isFooter = false) => {
|
|
381
389
|
events.onHeadClicked({
|
|
382
390
|
key: field.key,
|
|
@@ -446,7 +454,7 @@ var _hoisted_2$1 = {
|
|
|
446
454
|
key: 0,
|
|
447
455
|
class: "b-table-stacked-label"
|
|
448
456
|
};
|
|
449
|
-
var _hoisted_3 = { class: "d-inline-flex flex-nowrap align-items-center gap-1" };
|
|
457
|
+
var _hoisted_3$1 = { class: "d-inline-flex flex-nowrap align-items-center gap-1" };
|
|
450
458
|
var _hoisted_4 = { key: 3 };
|
|
451
459
|
//#endregion
|
|
452
460
|
//#region src/components/BTable/BTableLite.vue
|
|
@@ -787,7 +795,10 @@ var BTableLite_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
787
795
|
key: field.key,
|
|
788
796
|
variant: ((0, vue.unref)(isTableItem)(item) ? item._cellVariants?.[field.key] : false) ? null : field.variant,
|
|
789
797
|
class: getFieldRowClasses(field, item)
|
|
790
|
-
}, { ref_for: true },
|
|
798
|
+
}, { ref_for: true }, {
|
|
799
|
+
...field.isRowHeader ? { scope: "row" } : void 0,
|
|
800
|
+
...itemAttributes(item, field)
|
|
801
|
+
}), {
|
|
791
802
|
default: (0, vue.withCtx)(() => [(0, vue.unref)(props).stacked && (0, vue.unref)(props).labelStacked ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", _hoisted_2$1, (0, vue.toDisplayString)((0, vue.unref)(getTableFieldHeadLabel)(field)), 1)) : (0, vue.createCommentVNode)("", true), (0, vue.renderSlot)(_ctx.$slots, slots[`cell(${field.key})`] ? `cell(${field.key})` : "cell()", {
|
|
792
803
|
value: (0, vue.unref)(formatItem)(item, field),
|
|
793
804
|
unformatted: (0, vue.unref)(getByFieldKey)(item, field),
|
|
@@ -869,7 +880,7 @@ var BTableLite_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
869
880
|
onClick: ($event) => (0, vue.unref)(keyboardController).headerClicked(field, $event, true),
|
|
870
881
|
onKeydown: ($event) => (0, vue.unref)(keyboardController).handleHeaderKeydown(field, $event, true)
|
|
871
882
|
}), {
|
|
872
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createElementVNode)("div", null, [(0, vue.renderSlot)(_ctx.$slots, calculatedFooterSlot(field.key), {
|
|
883
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_3$1, [(0, vue.createElementVNode)("div", null, [(0, vue.renderSlot)(_ctx.$slots, calculatedFooterSlot(field.key), {
|
|
873
884
|
label: field.label,
|
|
874
885
|
column: field.key,
|
|
875
886
|
field,
|
|
@@ -937,6 +948,7 @@ var useTableMapper = ({ fields, items, stackedProps, provider, events, paginatio
|
|
|
937
948
|
};
|
|
938
949
|
}));
|
|
939
950
|
const getFormatter = (value) => typeof value.sortByFormatted === "function" ? value.sortByFormatted : value.formatter;
|
|
951
|
+
const getFilterFormatter = (value) => typeof value.filterByFormatted === "function" ? value.filterByFormatted : value.formatter;
|
|
940
952
|
const getStringValue = (ob, key) => {
|
|
941
953
|
if (!isTableItem(ob)) return String(ob);
|
|
942
954
|
const sortField = computedFields.value.find((el) => {
|
|
@@ -983,7 +995,7 @@ var useTableMapper = ({ fields, items, stackedProps, provider, events, paginatio
|
|
|
983
995
|
return false;
|
|
984
996
|
});
|
|
985
997
|
if (isTableField(filterField) && !!filterField.filterByFormatted) {
|
|
986
|
-
const formatter =
|
|
998
|
+
const formatter = getFilterFormatter(filterField);
|
|
987
999
|
if (formatter) return String(formatter({
|
|
988
1000
|
value: val,
|
|
989
1001
|
key: String(filterField.key),
|
|
@@ -1003,12 +1015,25 @@ var useTableMapper = ({ fields, items, stackedProps, provider, events, paginatio
|
|
|
1003
1015
|
}, []);
|
|
1004
1016
|
if (sortByItems?.length && (isSortableResolved.value === true && !usesProviderResolved.value && !(0, vue.toValue)(pagination.sort.noLocalSorting) || isSortableResolved.value === true && usesProviderResolved.value && (0, vue.toValue)(provider.noProviderSorting))) {
|
|
1005
1017
|
const sortCompareValue = (0, vue.unref)(pagination.sort.sortCompare);
|
|
1018
|
+
const sortNullLastValue = (0, vue.toValue)(pagination.sort.sortNullLast);
|
|
1006
1019
|
return mappedItems.sort((a, b) => {
|
|
1007
1020
|
for (let i = 0; i < sortByItems.length; i++) {
|
|
1008
1021
|
const value = sortByItems[i];
|
|
1009
1022
|
if (value === void 0) continue;
|
|
1010
1023
|
const { key, order } = value;
|
|
1011
|
-
const
|
|
1024
|
+
const field = fieldByKey.value.get(key);
|
|
1025
|
+
const comparer = field?.sortCompare || sortCompareValue;
|
|
1026
|
+
if (sortNullLastValue && !comparer) {
|
|
1027
|
+
const getItemVal = (item) => {
|
|
1028
|
+
if (!isTableItem(item)) return void 0;
|
|
1029
|
+
return isTableField(field) && field.accessor ? getWithGetter(item, field.accessor) : getWithGetter(item, key);
|
|
1030
|
+
};
|
|
1031
|
+
const aIsNull = getItemVal(a) == null;
|
|
1032
|
+
const bIsNull = getItemVal(b) == null;
|
|
1033
|
+
if (aIsNull && bIsNull) continue;
|
|
1034
|
+
if (aIsNull) return 1;
|
|
1035
|
+
if (bIsNull) return -1;
|
|
1036
|
+
}
|
|
1012
1037
|
const comparison = comparer ? comparer(a, b, key) : getStringValue(a, key).localeCompare(getStringValue(b, key), void 0, { numeric: true });
|
|
1013
1038
|
if (comparison !== 0) return order === "asc" ? comparison : -comparison;
|
|
1014
1039
|
}
|
|
@@ -1263,10 +1288,14 @@ var useTableSort = ({ fields, sortBy, initialSortDirection, multisort, mustSort,
|
|
|
1263
1288
|
//#endregion
|
|
1264
1289
|
//#region src/components/BTable/BTable.vue?vue&type=script&setup=true&lang.ts
|
|
1265
1290
|
var _hoisted_1 = {
|
|
1291
|
+
key: 0,
|
|
1292
|
+
class: "visually-hidden"
|
|
1293
|
+
};
|
|
1294
|
+
var _hoisted_2 = {
|
|
1266
1295
|
role: "alert",
|
|
1267
1296
|
"aria-live": "polite"
|
|
1268
1297
|
};
|
|
1269
|
-
var
|
|
1298
|
+
var _hoisted_3 = { class: "text-center my-2" };
|
|
1270
1299
|
//#endregion
|
|
1271
1300
|
//#region src/components/BTable/BTable.vue
|
|
1272
1301
|
var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
@@ -1323,6 +1352,13 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1323
1352
|
default: void 0
|
|
1324
1353
|
},
|
|
1325
1354
|
filterable: { default: void 0 },
|
|
1355
|
+
labelSortAsc: { default: "Click to sort ascending" },
|
|
1356
|
+
labelSortClear: { default: "Click to clear sorting" },
|
|
1357
|
+
labelSortDesc: { default: "Click to sort descending" },
|
|
1358
|
+
noFooterSorting: {
|
|
1359
|
+
type: Boolean,
|
|
1360
|
+
default: false
|
|
1361
|
+
},
|
|
1326
1362
|
noLocalSorting: {
|
|
1327
1363
|
type: Boolean,
|
|
1328
1364
|
default: false
|
|
@@ -1331,6 +1367,10 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1331
1367
|
type: Boolean,
|
|
1332
1368
|
default: false
|
|
1333
1369
|
},
|
|
1370
|
+
sortNullLast: {
|
|
1371
|
+
type: Boolean,
|
|
1372
|
+
default: false
|
|
1373
|
+
},
|
|
1334
1374
|
noSortableIcon: {
|
|
1335
1375
|
type: Boolean,
|
|
1336
1376
|
default: false
|
|
@@ -1480,6 +1520,7 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1480
1520
|
"row-unselected",
|
|
1481
1521
|
"sorted",
|
|
1482
1522
|
"change",
|
|
1523
|
+
"context-changed",
|
|
1483
1524
|
"head-clicked",
|
|
1484
1525
|
"row-clicked",
|
|
1485
1526
|
"row-dblclicked",
|
|
@@ -1578,7 +1619,8 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1578
1619
|
isSortable: sortController.isSortable,
|
|
1579
1620
|
noLocalSorting: () => props.noLocalSorting,
|
|
1580
1621
|
by: sortByModel,
|
|
1581
|
-
sortCompare: (0, vue.toRef)(() => props.sortCompare)
|
|
1622
|
+
sortCompare: (0, vue.toRef)(() => props.sortCompare),
|
|
1623
|
+
sortNullLast: () => props.sortNullLast
|
|
1582
1624
|
}
|
|
1583
1625
|
},
|
|
1584
1626
|
stackedProps: {
|
|
@@ -1625,7 +1667,7 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1625
1667
|
event,
|
|
1626
1668
|
isFooter
|
|
1627
1669
|
});
|
|
1628
|
-
sortController.handleFieldSorting(field);
|
|
1670
|
+
if (!isFooter || !props.noFooterSorting) sortController.handleFieldSorting(field);
|
|
1629
1671
|
},
|
|
1630
1672
|
onRowClicked: ({ item, index, event }) => {
|
|
1631
1673
|
if (!props.noSelectOnClick) selectedItemsController.handleRowSelection({
|
|
@@ -1649,7 +1691,10 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1649
1691
|
};
|
|
1650
1692
|
const computedLiteProps = (0, vue.computed)(() => ({
|
|
1651
1693
|
...require_object.pick(props, [...bTableLiteProps, ...bTableSimpleProps]),
|
|
1652
|
-
tableAttrs: {
|
|
1694
|
+
tableAttrs: {
|
|
1695
|
+
ariaBusy: busyModel.value,
|
|
1696
|
+
"aria-multiselectable": props.selectable && props.selectMode !== "single" ? true : void 0
|
|
1697
|
+
},
|
|
1653
1698
|
items: computedDisplayItems.value,
|
|
1654
1699
|
fields: computedFields.value,
|
|
1655
1700
|
tableClass: tableClasses.value,
|
|
@@ -1665,6 +1710,28 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1665
1710
|
items: computedItems.value
|
|
1666
1711
|
}));
|
|
1667
1712
|
const showEmptyFiltered = (0, vue.computed)(() => isFilterableTable.value && props.filter !== void 0 && props.filter !== "");
|
|
1713
|
+
const getSortLabel = (field) => {
|
|
1714
|
+
if (!sortController.isSortable.value || !field.sortable) return "";
|
|
1715
|
+
const currentSort = sortByModel.value?.find((s) => s.key === field.key);
|
|
1716
|
+
if (!currentSort || currentSort.order === void 0) return props.labelSortAsc;
|
|
1717
|
+
if (currentSort.order === "asc") return props.labelSortDesc;
|
|
1718
|
+
const mustSortValue = props.mustSort;
|
|
1719
|
+
if (mustSortValue === true || Array.isArray(mustSortValue) && mustSortValue.includes(field.key)) return props.labelSortAsc;
|
|
1720
|
+
return props.labelSortClear;
|
|
1721
|
+
};
|
|
1722
|
+
(0, vue.watch)([
|
|
1723
|
+
() => props.filter,
|
|
1724
|
+
sortByModel,
|
|
1725
|
+
writableCurrentPageNumber,
|
|
1726
|
+
perPageNumber
|
|
1727
|
+
], ([filter, sortBy, currentPage, perPage]) => {
|
|
1728
|
+
emit("context-changed", {
|
|
1729
|
+
filter,
|
|
1730
|
+
sortBy,
|
|
1731
|
+
currentPage,
|
|
1732
|
+
perPage
|
|
1733
|
+
});
|
|
1734
|
+
}, { deep: true });
|
|
1668
1735
|
__expose({
|
|
1669
1736
|
expansion: {
|
|
1670
1737
|
...expandedItemsController,
|
|
@@ -1698,7 +1765,7 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1698
1765
|
class: "b-table-empty-row"
|
|
1699
1766
|
}, {
|
|
1700
1767
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(BTd_default, { colspan: (0, vue.unref)(computedFields).length }, {
|
|
1701
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div",
|
|
1768
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_2, [(0, vue.createElementVNode)("div", _hoisted_3, [showEmptyFiltered.value ? (0, vue.renderSlot)(_ctx.$slots, "empty-filtered", (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 0 }, emptySlotScope.value)), () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(props).emptyFilteredText), 1)]) : (0, vue.renderSlot)(_ctx.$slots, "empty", (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 1 }, emptySlotScope.value)), () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(props).emptyText), 1)])])])]),
|
|
1702
1769
|
_: 3
|
|
1703
1770
|
}, 8, ["colspan"])]),
|
|
1704
1771
|
_: 3
|
|
@@ -1779,7 +1846,7 @@ var BTable_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
1779
1846
|
fn: (0, vue.withCtx)((scope) => [(0, vue.renderSlot)(_ctx.$slots, slots[`head(${String(field.key)})`] ? `head(${String(field.key)})` : "head()", (0, vue.mergeProps)(scope, {
|
|
1780
1847
|
selectAllRows: (0, vue.unref)(selectedItemsController).setAll,
|
|
1781
1848
|
clearSelected: (0, vue.unref)(selectedItemsController).clear
|
|
1782
|
-
}), () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(getTableFieldHeadLabel)(field)), 1)])])
|
|
1849
|
+
}), () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(getTableFieldHeadLabel)(field)) + " ", 1), (0, vue.unref)(sortController).isSortable.value && field.sortable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1, (0, vue.toDisplayString)(getSortLabel(field)), 1)) : (0, vue.createCommentVNode)("", true)])])
|
|
1783
1850
|
};
|
|
1784
1851
|
})
|
|
1785
1852
|
]), 1040, ["expanded-items"]);
|
|
@@ -1836,4 +1903,4 @@ Object.defineProperty(exports, "BTr_default", {
|
|
|
1836
1903
|
}
|
|
1837
1904
|
});
|
|
1838
1905
|
|
|
1839
|
-
//# sourceMappingURL=BTable-
|
|
1906
|
+
//# sourceMappingURL=BTable-CXxJl2ps.js.map
|