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

41
dist/sigpro-ui.esm.js vendored
View File

@@ -1,7 +1,5 @@
// src/sigpro-ui.js
import { $ as $2, watch, h, mount, when, each, isFunc } from "./sigpro.js";
// src/helpers.js
import { $, watch, h, mount, when, each, isFunc } from "./sigpro.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();
@@ -12,8 +10,6 @@ var filterBy = (items, query, field = "label") => {
};
var rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}`;
var hide = () => document.activeElement?.blur();
// src/locale.js
var currentLocale = $("en");
var lang = {
es: { uploadFiles: "Arrastrar y soltar o click para seleccionar..." },
@@ -24,8 +20,6 @@ var setLocale = (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() });
@@ -98,8 +92,8 @@ var Accordion = (p) => {
});
};
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;
@@ -118,10 +112,10 @@ var Autocomplete = ({ items, value, onselect, placeholder = "...", ...props }) =
]);
};
var Calendar = (p) => {
const internalDate = $2(new Date);
const hoverDate = $2(null);
const startHour = $2(0);
const endHour = $2(0);
const internalDate = $(new Date);
const hoverDate = $(null);
const startHour = $(0);
const endHour = $(0);
const now = 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")}`;
@@ -314,7 +308,7 @@ var ColorPalette = (p) => {
}))));
};
var Datepicker = (p) => {
const displayValue = $2("");
const displayValue = $("");
const rangeMode = () => val(p.range) === true;
watch(() => {
const v = val(p.value);
@@ -369,9 +363,9 @@ var Datepicker = (p) => {
]);
};
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);
@@ -442,7 +436,7 @@ var Fileinput = (p) => {
};
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";
@@ -597,8 +591,8 @@ var Toast = (message, type = "alert-success", duration = 3500) => {
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;
@@ -638,8 +632,15 @@ var Toast = (message, type = "alert-success", duration = 3500) => {
return closeFn;
};
export {
val,
t,
setLocale,
rand,
lang,
hide,
getBy,
filterBy,
cls,
Tooltip,
Toggle,
Toast,