chore (maintenance): lint + tscheck

This commit is contained in:
MickaelK 2025-03-21 15:12:15 +11:00
parent 35ed3d64fb
commit a1d1e950e5
5 changed files with 45 additions and 42 deletions

View file

@ -287,7 +287,6 @@ export function $renderInput(options = {}) {
else if ((val || "").substring(0, 20) === "data:application/pdf") $preview.appendChild(createElement(`
<object class="full-width" type="application/pdf" data="${val}" style="height:250px;" />
`));
console.log("DRAW", $preview, (val || "").substring(0, 10))
};
qs($file, "input").onchange = (e) => {
if (e.target.files.length === 0) return;

View file

@ -37,7 +37,7 @@ class ModalComponent extends HTMLElement {
await loadCSS(import.meta.url, "./modal.css");
}
trigger($node, { withButtonsLeft = null, withButtonsRight = null, targetHeight = 0, onQuit = (a) => Promise.resolve(a) }) {
trigger($node, { withButtonsLeft = null, withButtonsRight = null, targetHeight = 0, onQuit = (_a, _b) => Promise.resolve() }) {
const close$ = new rxjs.Subject();
// feature: build the dom

View file

@ -6,7 +6,7 @@ import {
map, mapTo, filter, mergeMap, EMPTY, empty,
switchMapTo, switchMap,
BehaviorSubject, Subject, ReplaySubject,
pipe, share, toArray, distinctUntilChanged, from,
pipe, share, toArray, distinctUntilChanged, from, finalize,
combineLatest, shareReplay, race, repeat, interval, merge,
debounceTime, debounce, delay, concatMap, distinct, scan, throwError,
zip, animationFrames, retry, forkJoin, skip, takeUntil, timer,
@ -42,6 +42,7 @@ declare const rxjs: {
map: typeof map,
mapTo: typeof mapTo,
filter: typeof filter,
finalize: typeof finalize,
mergeMap: typeof mergeMap,
switchMapTo: typeof switchMapTo,
switchMap: typeof switchMap,

View file

@ -1,5 +1,5 @@
export function init(config) {
if (navigator.onLine === false) return Promise.resolve()
if (navigator.onLine === false) return Promise.resolve();
if (!config["enable_chromecast"]) {
return Promise.resolve();
} else if (!("chrome" in window)) {

View file

@ -230,45 +230,48 @@ function componentRight(render, { getSelectionLength$ }) {
effect(getSelectionLength$.pipe(
rxjs.filter((l) => l === 0),
rxjs.mergeMap(() => getState$().pipe(rxjs.first())),
rxjs.map(({ view, sort, search }) => ({ search, $page: render(createFragment(`
<form style="display: inline-block;" onsubmit="event.preventDefault()">
<input class="hidden" placeholder="${t("search")}" name="q" style="
background: transparent;
border: none;
padding-left: 5px;
color: var(--color);
font-size: 0.95rem;"
value="${search || ""}"
</form>
<button data-action="search" title="${t("Search")}">
<img class="component_icon" draggable="false" src="data:image/svg+xml;base64,${ICONS.MAGNIFYING_GLASS}" alt="search" />
</button>
<button data-action="view" title="${t("Layout")}">
${defaultLayout(view)}
</button>
<button data-action="sort" title="${t("Sort")}">
${defaultSort(sort)}
</button>
<div class="component_dropdown view sort" data-target="sort">
<div class="dropdown_container">
<ul>
<li data-target="type">
${t("Sort By Type")}
<img class="component_icon" draggable="false" src="data:image/svg+xml;base64,${ICONS.CHECK}" alt="check" />
</li>
<li data-target="date">
${t("Sort By Date")}
</li>
<li data-target="name">
${t("Sort By Name")}
</li>
<li data-target="size">
${t("Sort By Size")}
</li>
</ul>
rxjs.map(({ view, sort, search }) => ({
search,
$page: render(createFragment(`
<form style="display: inline-block;" onsubmit="event.preventDefault()">
<input class="hidden" placeholder="${t("search")}" name="q" style="
background: transparent;
border: none;
padding-left: 5px;
color: var(--color);
font-size: 0.95rem;"
value="${search || ""}"
</form>
<button data-action="search" title="${t("Search")}">
<img class="component_icon" draggable="false" src="data:image/svg+xml;base64,${ICONS.MAGNIFYING_GLASS}" alt="search" />
</button>
<button data-action="view" title="${t("Layout")}">
${defaultLayout(view)}
</button>
<button data-action="sort" title="${t("Sort")}">
${defaultSort(sort)}
</button>
<div class="component_dropdown view sort" data-target="sort">
<div class="dropdown_container">
<ul>
<li data-target="type">
${t("Sort By Type")}
<img class="component_icon" draggable="false" src="data:image/svg+xml;base64,${ICONS.CHECK}" alt="check" />
</li>
<li data-target="date">
${t("Sort By Date")}
</li>
<li data-target="name">
${t("Sort By Name")}
</li>
<li data-target="size">
${t("Sort By Size")}
</li>
</ul>
</div>
</div>
</div>
`))})),
`))
})),
rxjs.mergeMap(({ $page, search }) => rxjs.merge(
// feature: view button
onClick(qs($page, `[data-action="view"]`)).pipe(rxjs.tap(($button) => {