@strands.gg/accui 2.10.7 → 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 +22 -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,13 +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) => {
|
|
30790
30793
|
if (!key) return void 0;
|
|
30791
30794
|
const keys2 = key.split(".");
|
|
30792
30795
|
let value = row;
|
|
30793
30796
|
for (const k of keys2) {
|
|
30794
30797
|
value = value?.[k];
|
|
30795
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
|
+
}
|
|
30796
30809
|
return value;
|
|
30797
30810
|
};
|
|
30798
30811
|
const handleSort = (key) => {
|
|
@@ -30818,7 +30831,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
30818
30831
|
if (column.filterOptions) return column.filterOptions;
|
|
30819
30832
|
const uniqueValues = /* @__PURE__ */ new Set();
|
|
30820
30833
|
props.data.forEach((row) => {
|
|
30821
|
-
const value = getCellValue(row, column.key);
|
|
30834
|
+
const value = getCellValue(row, column.key, column);
|
|
30822
30835
|
if (value != null) uniqueValues.add(String(value));
|
|
30823
30836
|
});
|
|
30824
30837
|
return Array.from(uniqueValues).sort();
|
|
@@ -31087,13 +31100,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
31087
31100
|
colIndex
|
|
31088
31101
|
}, void 0, true) : renderSlot(_ctx.$slots, `cell-${column.key}`, {
|
|
31089
31102
|
key: 1,
|
|
31090
|
-
value: getCellValue(row, column.key),
|
|
31103
|
+
value: getCellValue(row, column.key, column),
|
|
31091
31104
|
row,
|
|
31092
31105
|
column,
|
|
31093
31106
|
rowIndex,
|
|
31094
31107
|
colIndex
|
|
31095
31108
|
}, () => [
|
|
31096
|
-
createTextVNode(toDisplayString(getCellValue(row, column.key)), 1)
|
|
31109
|
+
createTextVNode(toDisplayString(getCellValue(row, column.key, column)), 1)
|
|
31097
31110
|
], true)
|
|
31098
31111
|
], 14, _hoisted_21$8);
|
|
31099
31112
|
}), 128))
|
|
@@ -31151,7 +31164,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
31151
31164
|
};
|
|
31152
31165
|
}
|
|
31153
31166
|
});
|
|
31154
|
-
const UiTable = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
31167
|
+
const UiTable = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-7910ac1d"]]);
|
|
31155
31168
|
const _hoisted_1$u = { class: "ui-hero-content" };
|
|
31156
31169
|
const _hoisted_2$q = {
|
|
31157
31170
|
key: 0,
|