@lavalogic/scoria 0.0.43 → 0.0.44
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,3 +1,3 @@
|
|
|
1
1
|
import type { Validity } from '../../../../../Types/Internal/Validity.js';
|
|
2
2
|
import type { ValidityWrapper } from '../../../../../Types/Internal/ValidityWrapper.js';
|
|
3
|
-
export type ValidationFn<T> = (item: T, isSelected: boolean) => Validity | Promise<Validity
|
|
3
|
+
export type ValidationFn<T> = (item: T, isSelected: boolean) => Validity | Promise<Validity | ValidityWrapper> | ValidityWrapper;
|
|
@@ -637,7 +637,13 @@ export class TableContext {
|
|
|
637
637
|
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId) ?? []);
|
|
638
638
|
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId) ?? []);
|
|
639
639
|
const centerVisibleCells = $derived(this.columnDefs
|
|
640
|
-
.filter((it) =>
|
|
640
|
+
.filter((it) => {
|
|
641
|
+
if (this.columnPinning.left && typeof this.columnPinning.left.has == 'function') {
|
|
642
|
+
// eslint-disable-next-line no-debugger
|
|
643
|
+
debugger;
|
|
644
|
+
}
|
|
645
|
+
return !(this.columnPinning.left?.has(it.id) || this.columnPinning.right?.has(it.id));
|
|
646
|
+
})
|
|
641
647
|
.map(makeRow));
|
|
642
648
|
return row;
|
|
643
649
|
});
|
|
@@ -1610,7 +1616,13 @@ export class TableContext {
|
|
|
1610
1616
|
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId) ?? []);
|
|
1611
1617
|
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId) ?? []);
|
|
1612
1618
|
const centerVisibleCells = $derived(this.columnDefs
|
|
1613
|
-
.filter((it) =>
|
|
1619
|
+
.filter((it) => {
|
|
1620
|
+
if (this.columnPinning.left && typeof this.columnPinning.left.has == 'function') {
|
|
1621
|
+
// eslint-disable-next-line no-debugger
|
|
1622
|
+
debugger;
|
|
1623
|
+
}
|
|
1624
|
+
return !(this.columnPinning.left?.has(it.id) || this.columnPinning.right?.has(it.id));
|
|
1625
|
+
})
|
|
1614
1626
|
.map(makeRow));
|
|
1615
1627
|
return row;
|
|
1616
1628
|
}
|
|
@@ -1834,6 +1846,10 @@ export class TableContext {
|
|
|
1834
1846
|
const midDefs = [];
|
|
1835
1847
|
const rightDefs = [];
|
|
1836
1848
|
this.columnDefs.forEach((def) => {
|
|
1849
|
+
if (this.columnPinning.left && typeof this.columnPinning.left.has == 'function') {
|
|
1850
|
+
// eslint-disable-next-line no-debugger
|
|
1851
|
+
debugger;
|
|
1852
|
+
}
|
|
1837
1853
|
if (this.columnPinning.left?.has(def.id)) {
|
|
1838
1854
|
leftDefs.push(def);
|
|
1839
1855
|
}
|
|
@@ -1964,7 +1980,13 @@ export class TableContext {
|
|
|
1964
1980
|
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
1965
1981
|
left: new Map(this.columnPinning.left &&
|
|
1966
1982
|
this.columnDefs
|
|
1967
|
-
.filter((col) =>
|
|
1983
|
+
.filter((col) => {
|
|
1984
|
+
if (this.columnPinning.left && typeof this.columnPinning.left.has == 'function') {
|
|
1985
|
+
// eslint-disable-next-line no-debugger
|
|
1986
|
+
debugger;
|
|
1987
|
+
}
|
|
1988
|
+
this.columnPinning.left?.has(col.id);
|
|
1989
|
+
})
|
|
1968
1990
|
.map((col, index) => [col.id, index])),
|
|
1969
1991
|
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
1970
1992
|
right: new Map(this.columnPinning.right &&
|
|
@@ -2116,7 +2138,18 @@ function generateTableOptions(contextObj) {
|
|
|
2116
2138
|
};
|
|
2117
2139
|
const leftHeaderGroups = $derived.by(() => {
|
|
2118
2140
|
const headers = contextObj.columnDefs
|
|
2119
|
-
.filter((it) =>
|
|
2141
|
+
.filter((it) => {
|
|
2142
|
+
const isVisible = contextObj.columnVisibility[it.id] != false;
|
|
2143
|
+
if (!isVisible) {
|
|
2144
|
+
return false;
|
|
2145
|
+
}
|
|
2146
|
+
if (contextObj.columnPinning.left &&
|
|
2147
|
+
typeof contextObj.columnPinning.left.has != 'function') {
|
|
2148
|
+
// eslint-disable-next-line no-debugger
|
|
2149
|
+
debugger;
|
|
2150
|
+
}
|
|
2151
|
+
return contextObj.columnPinning.left?.has(it.id);
|
|
2152
|
+
})
|
|
2120
2153
|
.map(makeHeader);
|
|
2121
2154
|
return [
|
|
2122
2155
|
{
|
|
@@ -2140,8 +2173,15 @@ function generateTableOptions(contextObj) {
|
|
|
2140
2173
|
});
|
|
2141
2174
|
const centerHeaderGroups = $derived.by(() => {
|
|
2142
2175
|
const headers = contextObj.columnDefs
|
|
2143
|
-
.filter((it) =>
|
|
2144
|
-
|
|
2176
|
+
.filter((it) => {
|
|
2177
|
+
if (contextObj.columnPinning.left &&
|
|
2178
|
+
typeof contextObj.columnPinning.left.has == 'function') {
|
|
2179
|
+
// eslint-disable-next-line no-debugger
|
|
2180
|
+
debugger;
|
|
2181
|
+
}
|
|
2182
|
+
return (contextObj.columnVisibility[it.id] != false &&
|
|
2183
|
+
!(contextObj.columnPinning.left?.has(it.id) || contextObj.columnPinning.right?.has(it.id)));
|
|
2184
|
+
})
|
|
2145
2185
|
.map(makeHeader);
|
|
2146
2186
|
return [
|
|
2147
2187
|
{
|