Toast tiene el ancho para cada uno
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
This commit is contained in:
9
dist/sigpro-ui.css
vendored
9
dist/sigpro-ui.css
vendored
@@ -4110,6 +4110,9 @@
|
||||
.w-96 {
|
||||
width: calc(var(--spacing) * 96);
|
||||
}
|
||||
.w-auto {
|
||||
width: auto;
|
||||
}
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -4230,6 +4233,9 @@
|
||||
.items-center {
|
||||
align-items: center;
|
||||
}
|
||||
.items-end {
|
||||
align-items: flex-end;
|
||||
}
|
||||
.items-start {
|
||||
align-items: flex-start;
|
||||
}
|
||||
@@ -4682,6 +4688,9 @@
|
||||
.text-balance {
|
||||
text-wrap: balance;
|
||||
}
|
||||
.whitespace-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.alert-error {
|
||||
@layer daisyui.l1.l2 {
|
||||
color: var(--color-error-content);
|
||||
|
||||
17
dist/sigpro-ui.esm.js
vendored
17
dist/sigpro-ui.esm.js
vendored
@@ -100,7 +100,7 @@ var x = false;
|
||||
var A = 0;
|
||||
var C = new Set;
|
||||
var D = new WeakMap;
|
||||
var $2 = Symbol("iter");
|
||||
var $ = Symbol("iter");
|
||||
var B = new WeakMap;
|
||||
var E = (e) => {
|
||||
if (!e || e._disposed)
|
||||
@@ -247,16 +247,16 @@ var I = (e) => {
|
||||
let u = Reflect.has(c, t), a = Reflect.get(c, t, l), f = Reflect.set(c, t, r, l);
|
||||
if (f && !Object.is(a, r)) {
|
||||
if (w(i(t), true), !u)
|
||||
w(i($2), true);
|
||||
w(i($), true);
|
||||
}
|
||||
return f;
|
||||
}, deleteProperty(c, t) {
|
||||
let r = Reflect.deleteProperty(c, t);
|
||||
if (r)
|
||||
w(i(t), true), w(i($2), true);
|
||||
w(i(t), true), w(i($), true);
|
||||
return r;
|
||||
}, ownKeys(c) {
|
||||
return w(i($2)), Reflect.ownKeys(c);
|
||||
return w(i($)), Reflect.ownKeys(c);
|
||||
} });
|
||||
return D.set(e, s), s;
|
||||
};
|
||||
@@ -1110,7 +1110,7 @@ var Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
if (!container) {
|
||||
container = O("div", {
|
||||
id: "sigpro-toast-container",
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col items-end gap-2 pointer-events-none"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
@@ -1138,11 +1138,12 @@ var Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
const msgNode = typeof content === "string" ? O("span", {}, content) : content;
|
||||
return O("div", {
|
||||
class: () => {
|
||||
const base = `alert alert-soft ${type} shadow-lg transition-all duration-300 inline-flex w-auto whitespace-nowrap pointer-events-auto`;
|
||||
if (leaving())
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-full opacity-0 pointer-events-auto`;
|
||||
return `${base} translate-x-full opacity-0`;
|
||||
if (visible())
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-0 opacity-100 pointer-events-auto`;
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`;
|
||||
return `${base} translate-x-0 opacity-100`;
|
||||
return `${base} translate-x-10 opacity-0`;
|
||||
}
|
||||
}, [
|
||||
msgNode,
|
||||
|
||||
4
dist/sigpro-ui.esm.min.js
vendored
4
dist/sigpro-ui.esm.min.js
vendored
File diff suppressed because one or more lines are too long
17
dist/sigpro-ui.js
vendored
17
dist/sigpro-ui.js
vendored
@@ -131,7 +131,7 @@
|
||||
var A = 0;
|
||||
var C = new Set;
|
||||
var D = new WeakMap;
|
||||
var $2 = Symbol("iter");
|
||||
var $ = Symbol("iter");
|
||||
var B = new WeakMap;
|
||||
var E = (e) => {
|
||||
if (!e || e._disposed)
|
||||
@@ -278,16 +278,16 @@
|
||||
let u = Reflect.has(c, t), a = Reflect.get(c, t, l), f = Reflect.set(c, t, r, l);
|
||||
if (f && !Object.is(a, r)) {
|
||||
if (w(i(t), true), !u)
|
||||
w(i($2), true);
|
||||
w(i($), true);
|
||||
}
|
||||
return f;
|
||||
}, deleteProperty(c, t) {
|
||||
let r = Reflect.deleteProperty(c, t);
|
||||
if (r)
|
||||
w(i(t), true), w(i($2), true);
|
||||
w(i(t), true), w(i($), true);
|
||||
return r;
|
||||
}, ownKeys(c) {
|
||||
return w(i($2)), Reflect.ownKeys(c);
|
||||
return w(i($)), Reflect.ownKeys(c);
|
||||
} });
|
||||
return D.set(e, s), s;
|
||||
};
|
||||
@@ -1141,7 +1141,7 @@
|
||||
if (!container) {
|
||||
container = O("div", {
|
||||
id: "sigpro-toast-container",
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col items-end gap-2 pointer-events-none"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
@@ -1169,11 +1169,12 @@
|
||||
const msgNode = typeof content === "string" ? O("span", {}, content) : content;
|
||||
return O("div", {
|
||||
class: () => {
|
||||
const base = `alert alert-soft ${type} shadow-lg transition-all duration-300 inline-flex w-auto whitespace-nowrap pointer-events-auto`;
|
||||
if (leaving())
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-full opacity-0 pointer-events-auto`;
|
||||
return `${base} translate-x-full opacity-0`;
|
||||
if (visible())
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-0 opacity-100 pointer-events-auto`;
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`;
|
||||
return `${base} translate-x-0 opacity-100`;
|
||||
return `${base} translate-x-10 opacity-0`;
|
||||
}
|
||||
}, [
|
||||
msgNode,
|
||||
|
||||
2
dist/sigpro-ui.min.css
vendored
2
dist/sigpro-ui.min.css
vendored
File diff suppressed because one or more lines are too long
4
dist/sigpro-ui.min.js
vendored
4
dist/sigpro-ui.min.js
vendored
File diff suppressed because one or more lines are too long
2
docs/sigpro-ui.min.css
vendored
2
docs/sigpro-ui.min.css
vendored
File diff suppressed because one or more lines are too long
4
docs/sigpro-ui.min.js
vendored
4
docs/sigpro-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -5,46 +5,4 @@ export const cls = (...classes) => classes.filter(Boolean).join(' ').trim();
|
||||
export const isFn = f => typeof f === "function";
|
||||
export const filterBy = (items, query, field = 'label', q = String(query).toLowerCase()) => !query ? get(items) : get(items).filter(item => String(item && typeof item === 'object' ? item[field] : item).toLowerCase().includes(q));
|
||||
export const rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}`
|
||||
export const close = () => document.activeElement?.blur()
|
||||
export const req = ({ url, method = 'GET', headers = {} }) => {
|
||||
const loading = $(false);
|
||||
const error = $(null);
|
||||
const data = $(null);
|
||||
let controller = null;
|
||||
let timeoutId = null;
|
||||
|
||||
const run = async (body = null) => {
|
||||
controller?.abort();
|
||||
clearTimeout(timeoutId);
|
||||
controller = new AbortController();
|
||||
timeoutId = setTimeout(() => controller.abort(), 10000);
|
||||
loading(true);
|
||||
error(null);
|
||||
try {
|
||||
const isFormData = body instanceof FormData;
|
||||
const res = await fetch(url, {
|
||||
method,
|
||||
headers: isFormData ? headers : { 'Content-Type': 'application/json', ...headers },
|
||||
body: isFormData ? body : (body ? JSON.stringify(body) : undefined),
|
||||
signal: controller.signal
|
||||
});
|
||||
const text = await res.text();
|
||||
const json = text ? JSON.parse(text) : null;
|
||||
if (!res.ok) throw new Error(json?.message || res.statusText);
|
||||
data(json);
|
||||
return json;
|
||||
} catch (e) {
|
||||
if (e.name !== 'AbortError') error(e.message);
|
||||
throw e;
|
||||
} finally {
|
||||
loading(false);
|
||||
clearTimeout(timeoutId);
|
||||
controller = null;
|
||||
timeoutId = null;
|
||||
}
|
||||
};
|
||||
|
||||
const abort = () => controller?.abort();
|
||||
|
||||
return { run, abort, loading, error, data };
|
||||
};
|
||||
export const close = () => document.activeElement?.blur()
|
||||
@@ -520,7 +520,7 @@ export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
if (!container) {
|
||||
container = h("div", {
|
||||
id: "sigpro-toast-container",
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"
|
||||
class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col items-end gap-2 pointer-events-none"
|
||||
});
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
@@ -546,9 +546,10 @@ export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
const msgNode = typeof content === 'string' ? h("span", {}, content) : content;
|
||||
return h("div", {
|
||||
class: () => {
|
||||
if (leaving()) return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-full opacity-0 pointer-events-auto`;
|
||||
if (visible()) return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-0 opacity-100 pointer-events-auto`;
|
||||
return `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`;
|
||||
const base = `alert alert-soft ${type} shadow-lg transition-all duration-300 inline-flex w-auto whitespace-nowrap pointer-events-auto`;
|
||||
if (leaving()) return `${base} translate-x-full opacity-0`;
|
||||
if (visible()) return `${base} translate-x-0 opacity-100`;
|
||||
return `${base} translate-x-10 opacity-0`;
|
||||
}
|
||||
}, [
|
||||
msgNode,
|
||||
|
||||
Reference in New Issue
Block a user