MOdular
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 8s

This commit is contained in:
2026-05-05 22:44:16 +02:00
parent fb8c5eabd2
commit e7e3def5ed
13 changed files with 178 additions and 156 deletions

66
dist/sigpro-ui.js vendored
View File

@@ -80,7 +80,16 @@ var spui = (() => {
Timeline: () => Timeline,
Toast: () => Toast,
Toggle: () => Toggle,
Tooltip: () => Tooltip
Tooltip: () => Tooltip,
cls: () => cls,
filterBy: () => filterBy,
getBy: () => getBy,
hide: () => hide,
lang: () => lang,
rand: () => rand,
setLocale: () => setLocale,
t: () => t,
val: () => val
});
// src/sigpro.js
@@ -186,7 +195,7 @@ var spui = (() => {
if (hasQueue && !isFlushing && batchDepth === 0) queueMicrotask(flush);
}
};
var $2 = (val2, key = null) => {
var $ = (val2, key = null) => {
const subs = /* @__PURE__ */ new Set();
if (isFunc(val2)) {
let cache;
@@ -461,7 +470,7 @@ var spui = (() => {
};
var router = (routes) => {
const getHash = () => window.location.hash.slice(1) || "/";
const path = $2(getHash());
const path = $(getHash());
const handler = () => path(getHash());
window.addEventListener("hashchange", handler);
onUnmount(() => window.removeEventListener("hashchange", handler));
@@ -487,7 +496,7 @@ var spui = (() => {
});
return hook;
};
router.params = $2({});
router.params = $({});
router.to = (p) => window.location.hash = p.replace(/^#?\/?/, "#/");
router.back = () => window.history.back();
router.path = () => window.location.hash.replace(/^#/, "") || "/";
@@ -506,7 +515,7 @@ var spui = (() => {
});
}
// src/helpers.js
// src/sigpro-ui.js
var val = (val2) => typeof val2 === "function" ? val2() : val2;
var getBy = (item, field = "label") => item && typeof item === "object" ? item[field] : item;
var cls = (...classes) => classes.filter(Boolean).join(" ").trim();
@@ -517,13 +526,6 @@ var spui = (() => {
};
var rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}`;
var hide = () => document.activeElement?.blur();
// src/locale.js
var locale_exports = {};
__export(locale_exports, {
setLocale: () => setLocale,
t: () => t
});
var currentLocale = $("en");
var lang = {
es: { uploadFiles: "Arrastrar y soltar o click para seleccionar..." },
@@ -533,8 +535,6 @@ var spui = (() => {
if (lang[locale]) currentLocale(locale);
};
var t = (t2) => () => lang[currentLocale()][t2] || t2;
// src/sigpro-ui.js
var c1 = (tag, cls2) => (p) => h(tag, { ...p, class: `${cls2} ${p?.class || ""}`.trim() });
var c2 = (tag, cls2) => (p, c) => h(tag, { ...p, class: `${cls2} ${p?.class || ""}`.trim() }, c);
var ct = (tag, cls2, type) => (p) => h(tag, { type, ...p, class: `${cls2} ${p?.class || ""}`.trim() });
@@ -607,8 +607,8 @@ var spui = (() => {
});
};
var Autocomplete = ({ items, value, onselect, placeholder = "...", ...props }) => {
const query = $2(val(value) || "");
const filtered = $2(() => filterBy(items, query()));
const query = $(val(value) || "");
const filtered = $(() => filterBy(items, query()));
const pick = (item) => {
const display = getBy(item);
const actual = typeof item === "string" ? item : item.value;
@@ -629,10 +629,10 @@ var spui = (() => {
]);
};
var Calendar = (p) => {
const internalDate = $2(/* @__PURE__ */ new Date());
const hoverDate = $2(null);
const startHour = $2(0);
const endHour = $2(0);
const internalDate = $(/* @__PURE__ */ new Date());
const hoverDate = $(null);
const startHour = $(0);
const endHour = $(0);
const now = /* @__PURE__ */ new Date();
const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
const fmt = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
@@ -833,7 +833,7 @@ var spui = (() => {
));
};
var Datepicker = (p) => {
const displayValue = $2("");
const displayValue = $("");
const rangeMode = () => val(p.range) === true;
watch(() => {
const v = val(p.value);
@@ -885,9 +885,9 @@ var spui = (() => {
]);
};
var Fileinput = (p) => {
const files = $2([]);
const drag = $2(false);
const error = $2(null);
const files = $([]);
const drag = $(false);
const error = $(null);
const maxBytes = (p.max || 2) * 1024 * 1024;
const process = (fileList) => {
const arr = Array.from(fileList);
@@ -964,7 +964,7 @@ var spui = (() => {
};
var Input = (p) => {
const { label: label2, icon, float, placeholder, value, left, right, rule, hint, content, ...rest } = p;
const showPassword = $2(false);
const showPassword = $(false);
const isPassword = p.type === "password";
const pattern = rule ?? null;
const inputType = () => isPassword ? val(showPassword) ? "text" : "password" : p.type || "search";
@@ -1126,8 +1126,8 @@ var spui = (() => {
container.appendChild(host);
let closeFn, timer, enterTimer;
const ToastComponent = () => {
const visible = $2(false);
const leaving = $2(false);
const visible = $(false);
const leaving = $(false);
closeFn = () => {
if (leaving()) return;
clearTimeout(timer);
@@ -1171,11 +1171,11 @@ var spui = (() => {
const { value, class: extraClass } = p;
let editorRef = null;
let savedRange = null;
const isSource = $2(false);
const source = $2("");
const count = $2(0);
const refreshTick = $2(0);
const showEmojis = $2(false);
const isSource = $(false);
const source = $("");
const count = $(0);
const refreshTick = $(0);
const showEmojis = $(false);
const emojis = ["\u{1F600}", "\u{1F60A}", "\u{1F609}", "\u{1F9D0}", "\u{1F62E}", "\u{1F914}", "\u{1F605}", "\u{1F602}", "\u{1F60D}", "\u{1F618}", "\u{1F970}", "\u{1F44D}", "\u{1F44E}", "\u{1F44C}", "\u{1F91D}", "\u{1F91E}", "\u{1F44B}", "\u{1F44F}", "\u{1F64C}", "\u{1F64F}", "\u{1F4AA}", "\u261D\uFE0F", "\u{1F447}", "\u{1F448}", "\u{1F449}", "\u{1F595}", "\u2705", "\u26A0\uFE0F", "\u{1F680}", "\u{1F4E2}", "\u2709\uFE0F", "\u2764\uFE0F"];
const saveSelection = () => {
const sel = window.getSelection();
@@ -1396,6 +1396,6 @@ var spui = (() => {
// src/build_umd.js
if (typeof window !== "undefined") {
Object.assign(window, sigpro_ui_exports, editor_exports, locale_exports);
Object.assign(window, sigpro_ui_exports, editor_exports);
}
})();