sort tables by size/rowCount

This commit is contained in:
SPRINX0\prochazka
2025-11-24 08:58:49 +01:00
parent ae9676f744
commit c3baedd93c
3 changed files with 50 additions and 22 deletions

View File

@@ -86,26 +86,26 @@
submenuKey += 1;
return;
}
if (item.switchStore && item.switchValue) {
item.switchStore.update(x => {
const res = {
if (item.switchStore) {
if (item.switchValue) {
item.switchStore.update(x => ({
...x,
[item.switchValue]: !x[item.switchValue],
};
if (item.switchGroupPrefix) {
for (const key of Object.keys(res)) {
if (key.startsWith(item.switchGroupPrefix) && key !== item.switchValue) {
res[key] = false;
}
}
}
return res;
});
}));
}
if (item.switchOption && item.switchOptionValue) {
item.switchStore.update(x => ({
...x,
[item.switchOption]: item.switchOptionValue,
}));
}
switchIndex++;
if (!item.closeOnSwitchClick) {
return;
}
}
dispatchClose();
if (onCloseParent) onCloseParent();
if (item.onClick) item.onClick();
@@ -175,6 +175,16 @@
{/if}
{/key}
{/if}
{#if item.switchOption && item.switchStoreGetter}
{@const optionValue = item.switchStoreGetter()[item.switchOption]}
{#key switchIndex}
{#if optionValue === item.switchOptionValue || (item.switchOptionIsDefault && !optionValue)}
<FontIcon icon="icon check" padRight />
{:else}
<FontIcon icon="icon invisible-box" padRight />
{/if}
{/key}
{/if}
{item.text || item.label}
</span>
{#if item.keyText}