@strands.gg/accui 2.10.6 → 2.10.8
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/accui.css +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +23 -9
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -30753,7 +30753,8 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
30753
30753
|
rows = rows.filter((row) => {
|
|
30754
30754
|
return Object.entries(filters.value).every(([key, filterValue]) => {
|
|
30755
30755
|
if (!filterValue || filterValue === "") return true;
|
|
30756
|
-
const
|
|
30756
|
+
const column = props.columns.find((col) => col.key === key);
|
|
30757
|
+
const cellValue = getCellValue(row, key, column);
|
|
30757
30758
|
const cellStr = String(cellValue || "").toLowerCase();
|
|
30758
30759
|
if (Array.isArray(filterValue)) {
|
|
30759
30760
|
return filterValue.some((val) => cellStr.includes(String(val).toLowerCase()));
|
|
@@ -30763,17 +30764,19 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
30763
30764
|
});
|
|
30764
30765
|
}
|
|
30765
30766
|
if (sortKey.value && (props.sortable || props.columns.find((col) => col.key === sortKey.value)?.sortable)) {
|
|
30767
|
+
const sortColumn = props.columns.find((col) => col.key === sortKey.value);
|
|
30766
30768
|
rows.sort((a, b) => {
|
|
30767
|
-
const aVal = getCellValue(a, sortKey.value);
|
|
30768
|
-
const bVal = getCellValue(b, sortKey.value);
|
|
30769
|
+
const aVal = getCellValue(a, sortKey.value, sortColumn);
|
|
30770
|
+
const bVal = getCellValue(b, sortKey.value, sortColumn);
|
|
30769
30771
|
if (aVal < bVal) return sortOrder.value === "asc" ? -1 : 1;
|
|
30770
30772
|
if (aVal > bVal) return sortOrder.value === "asc" ? 1 : -1;
|
|
30771
30773
|
return 0;
|
|
30772
30774
|
});
|
|
30773
30775
|
}
|
|
30774
30776
|
if (groupBy.value && props.groupable) {
|
|
30777
|
+
const groupColumn = props.columns.find((col) => col.key === groupBy.value);
|
|
30775
30778
|
const grouped = rows.reduce((groups, row) => {
|
|
30776
|
-
const groupValue = getCellValue(row, groupBy.value);
|
|
30779
|
+
const groupValue = getCellValue(row, groupBy.value, groupColumn);
|
|
30777
30780
|
const key = String(groupValue || "Ungrouped");
|
|
30778
30781
|
if (!groups[key]) groups[key] = [];
|
|
30779
30782
|
groups[key].push(row);
|
|
@@ -30786,12 +30789,23 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
30786
30789
|
}
|
|
30787
30790
|
return rows;
|
|
30788
30791
|
});
|
|
30789
|
-
const getCellValue = (row, key) => {
|
|
30792
|
+
const getCellValue = (row, key, column) => {
|
|
30793
|
+
if (!key) return void 0;
|
|
30790
30794
|
const keys2 = key.split(".");
|
|
30791
30795
|
let value = row;
|
|
30792
30796
|
for (const k of keys2) {
|
|
30793
30797
|
value = value?.[k];
|
|
30794
30798
|
}
|
|
30799
|
+
if (column?.formatters && Array.isArray(column.formatters)) {
|
|
30800
|
+
value = column.formatters.reduce((acc, formatter) => {
|
|
30801
|
+
try {
|
|
30802
|
+
return formatter(acc);
|
|
30803
|
+
} catch (error) {
|
|
30804
|
+
console.warn(`Formatter error for column ${column.key}:`, error);
|
|
30805
|
+
return acc;
|
|
30806
|
+
}
|
|
30807
|
+
}, value);
|
|
30808
|
+
}
|
|
30795
30809
|
return value;
|
|
30796
30810
|
};
|
|
30797
30811
|
const handleSort = (key) => {
|
|
@@ -30817,7 +30831,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
30817
30831
|
if (column.filterOptions) return column.filterOptions;
|
|
30818
30832
|
const uniqueValues = /* @__PURE__ */ new Set();
|
|
30819
30833
|
props.data.forEach((row) => {
|
|
30820
|
-
const value = getCellValue(row, column.key);
|
|
30834
|
+
const value = getCellValue(row, column.key, column);
|
|
30821
30835
|
if (value != null) uniqueValues.add(String(value));
|
|
30822
30836
|
});
|
|
30823
30837
|
return Array.from(uniqueValues).sort();
|
|
@@ -31086,13 +31100,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
31086
31100
|
colIndex
|
|
31087
31101
|
}, void 0, true) : renderSlot(_ctx.$slots, `cell-${column.key}`, {
|
|
31088
31102
|
key: 1,
|
|
31089
|
-
value: getCellValue(row, column.key),
|
|
31103
|
+
value: getCellValue(row, column.key, column),
|
|
31090
31104
|
row,
|
|
31091
31105
|
column,
|
|
31092
31106
|
rowIndex,
|
|
31093
31107
|
colIndex
|
|
31094
31108
|
}, () => [
|
|
31095
|
-
createTextVNode(toDisplayString(getCellValue(row, column.key)), 1)
|
|
31109
|
+
createTextVNode(toDisplayString(getCellValue(row, column.key, column)), 1)
|
|
31096
31110
|
], true)
|
|
31097
31111
|
], 14, _hoisted_21$8);
|
|
31098
31112
|
}), 128))
|
|
@@ -31150,7 +31164,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
31150
31164
|
};
|
|
31151
31165
|
}
|
|
31152
31166
|
});
|
|
31153
|
-
const UiTable = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
31167
|
+
const UiTable = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-7910ac1d"]]);
|
|
31154
31168
|
const _hoisted_1$u = { class: "ui-hero-content" };
|
|
31155
31169
|
const _hoisted_2$q = {
|
|
31156
31170
|
key: 0,
|