pixelon 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/molecules/chat/StructuredContent/components/CredentialsCard/CredentialsCard.d.ts +24 -0
- package/dist/components/molecules/chat/StructuredContent/components/PhotoPicker/PhotoPicker.d.ts +4 -0
- package/dist/components/molecules/chat/StructuredContent/components/PhotoPicker/types.d.ts +23 -0
- package/dist/components/molecules/chat/StructuredContent/components/ServiceShortcuts/ServiceShortcuts.d.ts +1 -1
- package/dist/components/molecules/chat/StructuredContent/components/UserTools/UserTools.d.ts +2 -0
- package/dist/components/molecules/chat/StructuredContent/components/UserTools/types.d.ts +3 -3
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +306 -100
- package/dist/index.js +307 -99
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/index.scss +3 -0
package/dist/index.esm.js
CHANGED
|
@@ -13174,19 +13174,19 @@ function mapFieldsToFormFields(fields, mode) {
|
|
|
13174
13174
|
}));
|
|
13175
13175
|
}
|
|
13176
13176
|
|
|
13177
|
-
const CLASS$
|
|
13177
|
+
const CLASS$g = `${COMPONENT_PREFIX}field-value`;
|
|
13178
13178
|
const FieldValue = ({
|
|
13179
13179
|
label,
|
|
13180
13180
|
children,
|
|
13181
13181
|
layout = "inline",
|
|
13182
13182
|
className
|
|
13183
|
-
}) => /* @__PURE__ */ jsxs("div", { className: [CLASS$
|
|
13184
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13185
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13183
|
+
}) => /* @__PURE__ */ jsxs("div", { className: [CLASS$g, `${CLASS$g}--${layout}`, className].filter(Boolean).join(" "), children: [
|
|
13184
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$g}__label`, children: label }),
|
|
13185
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$g}__value`, children })
|
|
13186
13186
|
] });
|
|
13187
13187
|
FieldValue.displayName = "FieldValue";
|
|
13188
13188
|
|
|
13189
|
-
const CLASS$
|
|
13189
|
+
const CLASS$f = `${COMPONENT_PREFIX}record-card`;
|
|
13190
13190
|
const RecordCard = ({
|
|
13191
13191
|
title,
|
|
13192
13192
|
summary,
|
|
@@ -13198,20 +13198,20 @@ const RecordCard = ({
|
|
|
13198
13198
|
className
|
|
13199
13199
|
}) => {
|
|
13200
13200
|
const cuerpoId = useId();
|
|
13201
|
-
return /* @__PURE__ */ jsxs("div", { className: [CLASS$
|
|
13201
|
+
return /* @__PURE__ */ jsxs("div", { className: [CLASS$f, open ? `${CLASS$f}--open` : "", className].filter(Boolean).join(" "), children: [
|
|
13202
13202
|
/* @__PURE__ */ jsxs(
|
|
13203
13203
|
"button",
|
|
13204
13204
|
{
|
|
13205
13205
|
type: "button",
|
|
13206
|
-
className: `${CLASS$
|
|
13206
|
+
className: `${CLASS$f}__header`,
|
|
13207
13207
|
"aria-expanded": open,
|
|
13208
13208
|
"aria-controls": cuerpoId,
|
|
13209
13209
|
"aria-label": ariaLabel,
|
|
13210
13210
|
onClick: onToggle,
|
|
13211
13211
|
children: [
|
|
13212
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
13213
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13214
|
-
summary && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13212
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$f}__heading`, children: [
|
|
13213
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$f}__title`, children: title }),
|
|
13214
|
+
summary && /* @__PURE__ */ jsx("span", { className: `${CLASS$f}__summary`, children: summary })
|
|
13215
13215
|
] }),
|
|
13216
13216
|
/* @__PURE__ */ jsx(
|
|
13217
13217
|
Icon,
|
|
@@ -13219,22 +13219,22 @@ const RecordCard = ({
|
|
|
13219
13219
|
type: open ? "chevron-up" : "chevron-down",
|
|
13220
13220
|
width: 18,
|
|
13221
13221
|
height: 18,
|
|
13222
|
-
className: `${CLASS$
|
|
13222
|
+
className: `${CLASS$f}__chevron`,
|
|
13223
13223
|
"aria-hidden": true
|
|
13224
13224
|
}
|
|
13225
13225
|
)
|
|
13226
13226
|
]
|
|
13227
13227
|
}
|
|
13228
13228
|
),
|
|
13229
|
-
open && /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
13229
|
+
open && /* @__PURE__ */ jsxs("div", { className: `${CLASS$f}__body`, id: cuerpoId, children: [
|
|
13230
13230
|
children,
|
|
13231
|
-
actions && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13231
|
+
actions && /* @__PURE__ */ jsx("div", { className: `${CLASS$f}__actions`, children: actions })
|
|
13232
13232
|
] })
|
|
13233
13233
|
] });
|
|
13234
13234
|
};
|
|
13235
13235
|
RecordCard.displayName = "RecordCard";
|
|
13236
13236
|
|
|
13237
|
-
const CLASS$
|
|
13237
|
+
const CLASS$e = `${COMPONENT_PREFIX}crud-cards`;
|
|
13238
13238
|
function summaryFields(fields) {
|
|
13239
13239
|
const visibles = fields.filter((f) => f.showInTable !== false);
|
|
13240
13240
|
const marcados = visibles.filter((f) => f.summary);
|
|
@@ -13253,13 +13253,13 @@ function CardList({
|
|
|
13253
13253
|
const claveResumen = new Set(resumen.map((f) => f.key));
|
|
13254
13254
|
const cuerpo = fields.filter((f) => f.showInTable !== false && !claveResumen.has(f.key));
|
|
13255
13255
|
if (loading && rows.length === 0) {
|
|
13256
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13256
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$e}__estado`, children: "Cargando..." });
|
|
13257
13257
|
}
|
|
13258
13258
|
if (rows.length === 0) {
|
|
13259
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13259
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$e}__estado`, children: emptyText });
|
|
13260
13260
|
}
|
|
13261
13261
|
const [principal, ...secundarios] = resumen;
|
|
13262
|
-
return /* @__PURE__ */ jsx("div", { className: CLASS$
|
|
13262
|
+
return /* @__PURE__ */ jsx("div", { className: CLASS$e, children: rows.map((row) => {
|
|
13263
13263
|
const key = rowKey(row);
|
|
13264
13264
|
const opciones = buildOptions?.(row) ?? [];
|
|
13265
13265
|
const titulo = principal ? renderFieldValue(principal, row) : key;
|
|
@@ -13276,14 +13276,14 @@ function CardList({
|
|
|
13276
13276
|
{
|
|
13277
13277
|
type: "button",
|
|
13278
13278
|
className: [
|
|
13279
|
-
`${CLASS$
|
|
13279
|
+
`${CLASS$e}__accion`,
|
|
13280
13280
|
o.disabled && o.disabledReason ? "is-con-motivo" : ""
|
|
13281
13281
|
].filter(Boolean).join(" "),
|
|
13282
13282
|
disabled: o.disabled,
|
|
13283
13283
|
onClick: () => void o.onClick(),
|
|
13284
13284
|
children: [
|
|
13285
13285
|
/* @__PURE__ */ jsx("span", { children: o.label }),
|
|
13286
|
-
o.disabled && o.disabledReason && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13286
|
+
o.disabled && o.disabledReason && /* @__PURE__ */ jsx("span", { className: `${CLASS$e}__motivo`, children: o.disabledReason })
|
|
13287
13287
|
]
|
|
13288
13288
|
},
|
|
13289
13289
|
o.label
|
|
@@ -13298,7 +13298,7 @@ function CardList({
|
|
|
13298
13298
|
}
|
|
13299
13299
|
CardList.displayName = "CardList";
|
|
13300
13300
|
|
|
13301
|
-
const CLASS$
|
|
13301
|
+
const CLASS$d = `${COMPONENT_PREFIX}crud-scroll-end`;
|
|
13302
13302
|
const MARGEN = 24;
|
|
13303
13303
|
const SELECTOR_CRUD = `.${COMPONENT_PREFIX}table-container, .${COMPONENT_PREFIX}crud-cards`;
|
|
13304
13304
|
const ScrollToEnd = ({
|
|
@@ -13342,7 +13342,7 @@ const ScrollToEnd = ({
|
|
|
13342
13342
|
s.scrollTo({ top: s.scrollHeight, behavior: "smooth" });
|
|
13343
13343
|
}, []);
|
|
13344
13344
|
if (!visible) return null;
|
|
13345
|
-
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$
|
|
13345
|
+
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$d, onClick: alFinal, "aria-label": label, title: label, children: /* @__PURE__ */ jsx(Icon, { type: "chevron-down", width: 18, height: 18, "aria-hidden": true }) });
|
|
13346
13346
|
};
|
|
13347
13347
|
ScrollToEnd.displayName = "ScrollToEnd";
|
|
13348
13348
|
|
|
@@ -14027,7 +14027,7 @@ function Crud({
|
|
|
14027
14027
|
}
|
|
14028
14028
|
Crud.displayName = "Crud";
|
|
14029
14029
|
|
|
14030
|
-
const CLASS$
|
|
14030
|
+
const CLASS$c = "px-chat-reactive-crud__chat-link";
|
|
14031
14031
|
function Burbuja() {
|
|
14032
14032
|
return /* @__PURE__ */ jsx(
|
|
14033
14033
|
"svg",
|
|
@@ -14054,7 +14054,7 @@ const ChatLinkCell = ({
|
|
|
14054
14054
|
if (targets.length === 1) {
|
|
14055
14055
|
const t = targets[0];
|
|
14056
14056
|
const texto = t.label ? `Abrir chat ${t.label}` : "Abrir chat";
|
|
14057
|
-
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$
|
|
14057
|
+
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$c, "aria-label": texto, title: texto, onClick: () => abrir(t.id), children: /* @__PURE__ */ jsx(Burbuja, {}) });
|
|
14058
14058
|
}
|
|
14059
14059
|
return /* @__PURE__ */ jsx(
|
|
14060
14060
|
DropdownMenu,
|
|
@@ -14068,7 +14068,7 @@ const ChatLinkCell = ({
|
|
|
14068
14068
|
"button",
|
|
14069
14069
|
{
|
|
14070
14070
|
type: "button",
|
|
14071
|
-
className: CLASS$
|
|
14071
|
+
className: CLASS$c,
|
|
14072
14072
|
"aria-label": `Abrir chat (${targets.length} conversaciones)`,
|
|
14073
14073
|
title: "Abrir chat",
|
|
14074
14074
|
children: /* @__PURE__ */ jsx(Burbuja, {})
|
|
@@ -14385,7 +14385,7 @@ function uploadViaEventBus(eventBus, file, fileType) {
|
|
|
14385
14385
|
});
|
|
14386
14386
|
}
|
|
14387
14387
|
|
|
14388
|
-
const CLASS$
|
|
14388
|
+
const CLASS$b = `${COMPONENT_PREFIX$1}file-field`;
|
|
14389
14389
|
function iconoPorNombre(nombre) {
|
|
14390
14390
|
const ext = nombre.split(".").pop()?.toLowerCase() ?? "";
|
|
14391
14391
|
if (["png", "jpg", "jpeg", "gif", "webp", "heic", "heif"].includes(ext)) return ICON_TYPES.IMAGE;
|
|
@@ -14416,18 +14416,18 @@ const FileField = ({
|
|
|
14416
14416
|
const elegir = () => {
|
|
14417
14417
|
if (!disabled) inputRef.current?.click();
|
|
14418
14418
|
};
|
|
14419
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
14420
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
14419
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$b}${error ? ` ${CLASS$b}--error` : ""}`, children: [
|
|
14420
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$b}__label`, children: [
|
|
14421
14421
|
label,
|
|
14422
14422
|
required ? " *" : "",
|
|
14423
14423
|
multiple && hechos > 0 ? ` (${hechos})` : ""
|
|
14424
14424
|
] }),
|
|
14425
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
14425
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$b}__box`, children: [
|
|
14426
14426
|
/* @__PURE__ */ jsx(
|
|
14427
14427
|
"input",
|
|
14428
14428
|
{
|
|
14429
14429
|
ref: inputRef,
|
|
14430
|
-
className: `${CLASS$
|
|
14430
|
+
className: `${CLASS$b}__native`,
|
|
14431
14431
|
type: "file",
|
|
14432
14432
|
accept,
|
|
14433
14433
|
multiple,
|
|
@@ -14438,14 +14438,14 @@ const FileField = ({
|
|
|
14438
14438
|
}
|
|
14439
14439
|
}
|
|
14440
14440
|
),
|
|
14441
|
-
/* @__PURE__ */ jsxs("button", { type: "button", className: `${CLASS$
|
|
14441
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: `${CLASS$b}__pick`, onClick: elegir, disabled, children: [
|
|
14442
14442
|
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.UPLOAD, size: "small" }),
|
|
14443
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14443
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__pick-text`, children: entries.length === 0 ? multiple ? "Toca para elegir archivos" : "Toca para elegir un archivo" : multiple ? "A\xF1adir m\xE1s" : "Cambiar archivo" })
|
|
14444
14444
|
] }),
|
|
14445
|
-
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
14446
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14447
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14448
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
14445
|
+
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$b}__list`, children: entries.map((e, i) => /* @__PURE__ */ jsxs("li", { className: `${CLASS$b}__item ${CLASS$b}__item--${e.status}`, children: [
|
|
14446
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__kind`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon$1, { type: iconoPorNombre(e.name), size: "small" }) }),
|
|
14447
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__name`, children: e.name }),
|
|
14448
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$b}__state`, children: [
|
|
14449
14449
|
e.status === "uploading" && "Subiendo\u2026",
|
|
14450
14450
|
e.status === "done" && (pesoLegible(e.size) || "Listo"),
|
|
14451
14451
|
e.status === "error" && "No se pudo subir"
|
|
@@ -14454,7 +14454,7 @@ const FileField = ({
|
|
|
14454
14454
|
"button",
|
|
14455
14455
|
{
|
|
14456
14456
|
type: "button",
|
|
14457
|
-
className: `${CLASS$
|
|
14457
|
+
className: `${CLASS$b}__remove`,
|
|
14458
14458
|
onClick: () => onRemove(i),
|
|
14459
14459
|
"aria-label": `Quitar ${e.name}`,
|
|
14460
14460
|
disabled,
|
|
@@ -14463,8 +14463,8 @@ const FileField = ({
|
|
|
14463
14463
|
)
|
|
14464
14464
|
] }, `${e.name}-${i}`)) })
|
|
14465
14465
|
] }),
|
|
14466
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
14467
|
-
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
14466
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$b}__error`, children: error }),
|
|
14467
|
+
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$b}__hint`, children: "Espera a que terminen de subir." })
|
|
14468
14468
|
] });
|
|
14469
14469
|
};
|
|
14470
14470
|
|
|
@@ -15620,7 +15620,7 @@ function buildMarkerIcon(name, color = "#dc2626", heading = 0) {
|
|
|
15620
15620
|
return `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(svg)}`;
|
|
15621
15621
|
}
|
|
15622
15622
|
|
|
15623
|
-
const CLASS$
|
|
15623
|
+
const CLASS$a = `${COMPONENT_PREFIX$1}map-view`;
|
|
15624
15624
|
const DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
|
|
15625
15625
|
const DEFAULT_ZOOM = 12;
|
|
15626
15626
|
const DEFAULT_HEIGHT$1 = 320;
|
|
@@ -15885,23 +15885,23 @@ const MapView = ({
|
|
|
15885
15885
|
document.body.style.overflow = prev;
|
|
15886
15886
|
};
|
|
15887
15887
|
}, [expanded]);
|
|
15888
|
-
const rootClass = [CLASS$
|
|
15888
|
+
const rootClass = [CLASS$a, fullBleed && `${CLASS$a}--full-bleed`, className].filter(Boolean).join(" ");
|
|
15889
15889
|
if (overQuota) {
|
|
15890
|
-
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15890
|
+
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state ${CLASS$a}__state--error`, children: labels?.quotaText ?? "Se alcanz\xF3 el l\xEDmite diario de uso del mapa. Intenta ma\xF1ana." }) });
|
|
15891
15891
|
}
|
|
15892
15892
|
if (status === "error") {
|
|
15893
|
-
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15893
|
+
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state ${CLASS$a}__state--error`, children: labels?.errorText ?? "No se pudo cargar el mapa." }) });
|
|
15894
15894
|
}
|
|
15895
15895
|
return /* @__PURE__ */ jsxs("div", { className: rootClass, style: fullBleed ? void 0 : { height }, children: [
|
|
15896
|
-
status !== "ready" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15897
|
-
/* @__PURE__ */ jsx("div", { ref: nodeRef, className: `${CLASS$
|
|
15898
|
-
status === "ready" && list.length === 0 && allRoutes.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15899
|
-
status === "ready" && onPointMove && list.length > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15896
|
+
status !== "ready" && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state`, children: labels?.loadingText ?? "Cargando mapa\u2026" }),
|
|
15897
|
+
/* @__PURE__ */ jsx("div", { ref: nodeRef, className: `${CLASS$a}__canvas`, "aria-label": "Mapa", role: "application" }),
|
|
15898
|
+
status === "ready" && list.length === 0 && allRoutes.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__empty`, children: labels?.emptyText ?? "Sin ubicaciones para mostrar" }),
|
|
15899
|
+
status === "ready" && onPointMove && list.length > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__empty`, children: labels?.moveHint ?? "Arrastra el pin o toca el mapa para ajustar" }),
|
|
15900
15900
|
status === "ready" && expandable && !fullBleed && /* @__PURE__ */ jsx(
|
|
15901
15901
|
"button",
|
|
15902
15902
|
{
|
|
15903
15903
|
type: "button",
|
|
15904
|
-
className: `${CLASS$
|
|
15904
|
+
className: `${CLASS$a}__expand`,
|
|
15905
15905
|
"aria-label": labels?.expandAria ?? "Ver el mapa en pantalla completa",
|
|
15906
15906
|
title: labels?.expandAria ?? "Pantalla completa",
|
|
15907
15907
|
onClick: () => setExpanded(true),
|
|
@@ -15909,7 +15909,7 @@ const MapView = ({
|
|
|
15909
15909
|
}
|
|
15910
15910
|
),
|
|
15911
15911
|
expanded && createPortal(
|
|
15912
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
15912
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$a}-fs`, role: "dialog", "aria-modal": "true", "aria-label": "Mapa", children: [
|
|
15913
15913
|
/* @__PURE__ */ jsx(
|
|
15914
15914
|
MapView,
|
|
15915
15915
|
{
|
|
@@ -15923,7 +15923,7 @@ const MapView = ({
|
|
|
15923
15923
|
"button",
|
|
15924
15924
|
{
|
|
15925
15925
|
type: "button",
|
|
15926
|
-
className: `${CLASS$
|
|
15926
|
+
className: `${CLASS$a}-fs__close`,
|
|
15927
15927
|
"aria-label": labels?.closeAria ?? "Cerrar el mapa",
|
|
15928
15928
|
onClick: () => setExpanded(false),
|
|
15929
15929
|
children: /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -16039,7 +16039,7 @@ function reverseGeocode(lat, lng) {
|
|
|
16039
16039
|
});
|
|
16040
16040
|
}
|
|
16041
16041
|
|
|
16042
|
-
const CLASS$
|
|
16042
|
+
const CLASS$9 = `${COMPONENT_PREFIX$1}location-field`;
|
|
16043
16043
|
const GPS_TIMEOUT_MS = 1e4;
|
|
16044
16044
|
const CONFIRM_MAP_HEIGHT = 180;
|
|
16045
16045
|
const LocationField = ({
|
|
@@ -16112,16 +16112,16 @@ const LocationField = ({
|
|
|
16112
16112
|
}
|
|
16113
16113
|
};
|
|
16114
16114
|
const hasPoint = value?.lat != null && value?.lng != null;
|
|
16115
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16116
|
-
label && /* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
16115
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$9}${error ? ` ${CLASS$9}--error` : ""}`, ref: boxRef, children: [
|
|
16116
|
+
label && /* @__PURE__ */ jsxs("span", { className: `${CLASS$9}__label`, children: [
|
|
16117
16117
|
label,
|
|
16118
16118
|
required ? " *" : ""
|
|
16119
16119
|
] }),
|
|
16120
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16120
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$9}__row`, children: [
|
|
16121
16121
|
/* @__PURE__ */ jsx(
|
|
16122
16122
|
"input",
|
|
16123
16123
|
{
|
|
16124
|
-
className: `${CLASS$
|
|
16124
|
+
className: `${CLASS$9}__input`,
|
|
16125
16125
|
type: "text",
|
|
16126
16126
|
value: text,
|
|
16127
16127
|
disabled,
|
|
@@ -16135,7 +16135,7 @@ const LocationField = ({
|
|
|
16135
16135
|
"button",
|
|
16136
16136
|
{
|
|
16137
16137
|
type: "button",
|
|
16138
|
-
className: `${CLASS$
|
|
16138
|
+
className: `${CLASS$9}__gps`,
|
|
16139
16139
|
onClick: useMyLocation,
|
|
16140
16140
|
disabled: disabled || gps === "locating",
|
|
16141
16141
|
title: labels?.useMyLocation ?? "Enviar mi ubicaci\xF3n",
|
|
@@ -16149,11 +16149,11 @@ const LocationField = ({
|
|
|
16149
16149
|
}
|
|
16150
16150
|
)
|
|
16151
16151
|
] }),
|
|
16152
|
-
open && suggestions.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
16153
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16154
|
-
gps === "denied" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16155
|
-
gps === "unavailable" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16156
|
-
hasPoint && /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16152
|
+
open && suggestions.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$9}__suggestions`, children: suggestions.map((s) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void pickSuggestion(s.id, s.description), children: s.description }) }, s.id)) }),
|
|
16153
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__error`, children: error }),
|
|
16154
|
+
gps === "denied" && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint ${CLASS$9}__hint--warn`, children: labels?.permissionDenied ?? "No diste permiso de ubicaci\xF3n. Puedes escribir la direcci\xF3n." }),
|
|
16155
|
+
gps === "unavailable" && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint ${CLASS$9}__hint--warn`, children: labels?.unavailable ?? "No pudimos obtener tu ubicaci\xF3n. Puedes escribir la direcci\xF3n." }),
|
|
16156
|
+
hasPoint && /* @__PURE__ */ jsxs("div", { className: `${CLASS$9}__confirm`, children: [
|
|
16157
16157
|
/* @__PURE__ */ jsx(
|
|
16158
16158
|
MapView,
|
|
16159
16159
|
{
|
|
@@ -16163,7 +16163,7 @@ const LocationField = ({
|
|
|
16163
16163
|
onPointMove: (id, lat, lng) => void movePoint(id, lat, lng)
|
|
16164
16164
|
}
|
|
16165
16165
|
),
|
|
16166
|
-
/* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16166
|
+
/* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint`, children: labels?.confirmHint ?? "Verifica que el punto sea correcto." })
|
|
16167
16167
|
] })
|
|
16168
16168
|
] });
|
|
16169
16169
|
};
|
|
@@ -16786,7 +16786,7 @@ function markFitOutliers(points, radiusKm = FIT_RADIUS_KM) {
|
|
|
16786
16786
|
return { points: marcados, outside };
|
|
16787
16787
|
}
|
|
16788
16788
|
|
|
16789
|
-
const CLASS$
|
|
16789
|
+
const CLASS$8 = `${COMPONENT_PREFIX$1}services-map`;
|
|
16790
16790
|
const DEFAULT_HEIGHT = 340;
|
|
16791
16791
|
function readNumber(row, field) {
|
|
16792
16792
|
if (!field) return void 0;
|
|
@@ -16912,7 +16912,7 @@ const ServicesMap = ({ config, eventBus, apiKey, filter, fill }) => {
|
|
|
16912
16912
|
[livePoints]
|
|
16913
16913
|
);
|
|
16914
16914
|
const nadaQueDibujar = rows !== null && allPoints.length === 0 && route.length === 0;
|
|
16915
|
-
return /* @__PURE__ */ jsx("div", { className: fill ? `${CLASS$
|
|
16915
|
+
return /* @__PURE__ */ jsx("div", { className: fill ? `${CLASS$8} ${CLASS$8}--fill` : CLASS$8, children: rows === null ? /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__state`, children: labels.loadingText ?? "Cargando ubicaciones\u2026" }) : nadaQueDibujar ? /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__state`, children: lineaSinMapa(labels, missing, failed) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16916
16916
|
/* @__PURE__ */ jsx(
|
|
16917
16917
|
MapView,
|
|
16918
16918
|
{
|
|
@@ -16926,20 +16926,20 @@ const ServicesMap = ({ config, eventBus, apiKey, filter, fill }) => {
|
|
|
16926
16926
|
labels: { emptyText: labels.emptyText }
|
|
16927
16927
|
}
|
|
16928
16928
|
),
|
|
16929
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16930
|
-
livePoints.length > 0 && /* @__PURE__ */ jsxs("p", { className: `${CLASS$
|
|
16929
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$8}__notes`, children: [
|
|
16930
|
+
livePoints.length > 0 && /* @__PURE__ */ jsxs("p", { className: `${CLASS$8}__note ${CLASS$8}__note--live`, children: [
|
|
16931
16931
|
(config.live?.labels?.liveText ?? "{n} en movimiento").replace(
|
|
16932
16932
|
"{n}",
|
|
16933
16933
|
String(livePoints.length)
|
|
16934
16934
|
),
|
|
16935
16935
|
simulated > 0 && ` \xB7 ${config.live?.labels?.simulatedText ?? "incluye posiciones simuladas"}`
|
|
16936
16936
|
] }),
|
|
16937
|
-
missing > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16938
|
-
outside > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16937
|
+
missing > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: ((missing === 1 ? labels.missingTextOne : void 0) ?? labels.missingText ?? "{n} sin ubicaci\xF3n registrada").replace("{n}", String(missing)) }),
|
|
16938
|
+
outside > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: (labels.outsideText ?? "{n} fuera de la zona (aleja el mapa para verlos)").replace(
|
|
16939
16939
|
"{n}",
|
|
16940
16940
|
String(outside)
|
|
16941
16941
|
) }),
|
|
16942
|
-
failed && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16942
|
+
failed && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: "No se pudieron cargar las ubicaciones." })
|
|
16943
16943
|
] })
|
|
16944
16944
|
] }) });
|
|
16945
16945
|
};
|
|
@@ -16955,7 +16955,7 @@ function lineaSinMapa(labels, missing, failed) {
|
|
|
16955
16955
|
return labels.emptyText ?? "Sin ubicaciones para mostrar";
|
|
16956
16956
|
}
|
|
16957
16957
|
|
|
16958
|
-
const CLASS$
|
|
16958
|
+
const CLASS$7 = `${COMPONENT_PREFIX$1}service-shortcuts`;
|
|
16959
16959
|
const ICONS = {
|
|
16960
16960
|
// SPEC-126 — quien DESPACHA tambien necesita sus puertas, y una de ellas son las conversaciones
|
|
16961
16961
|
// de sus servicios. Los cinco iconos que habia eran todos de quien PIDE una grua.
|
|
@@ -16985,6 +16985,15 @@ const ICONS = {
|
|
|
16985
16985
|
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
16986
16986
|
/* @__PURE__ */ jsx("line", { x1: "16.5", y1: "16.5", x2: "21", y2: "21" })
|
|
16987
16987
|
] }),
|
|
16988
|
+
// SPEC-139 — una grúa con un «más»: inscribir la mía.
|
|
16989
|
+
enroll: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
16990
|
+
/* @__PURE__ */ jsx("path", { d: "M3 17V8h8l3 4h4v5" }),
|
|
16991
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "17", r: "2" }),
|
|
16992
|
+
/* @__PURE__ */ jsx("circle", { cx: "16", cy: "17", r: "2" }),
|
|
16993
|
+
/* @__PURE__ */ jsx("line", { x1: "9", y1: "17", x2: "14", y2: "17" }),
|
|
16994
|
+
/* @__PURE__ */ jsx("line", { x1: "19", y1: "3", x2: "19", y2: "9" }),
|
|
16995
|
+
/* @__PURE__ */ jsx("line", { x1: "16", y1: "6", x2: "22", y2: "6" })
|
|
16996
|
+
] }),
|
|
16988
16997
|
// SPEC-008 — quien tiene cuenta: operadora, empresa aliada o conductor.
|
|
16989
16998
|
user: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
16990
16999
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "8", r: "4" }),
|
|
@@ -17000,16 +17009,16 @@ const ServiceShortcuts = ({
|
|
|
17000
17009
|
}) => {
|
|
17001
17010
|
if (!options?.length) return null;
|
|
17002
17011
|
const elegido = !!selectedId;
|
|
17003
|
-
return /* @__PURE__ */ jsx("div", { className: [CLASS$
|
|
17012
|
+
return /* @__PURE__ */ jsx("div", { className: [CLASS$7, elegido ? `${CLASS$7}--used` : ""].filter(Boolean).join(" "), children: options.map((o) => {
|
|
17004
17013
|
const esElegido = o.id === selectedId;
|
|
17005
17014
|
return /* @__PURE__ */ jsxs(
|
|
17006
17015
|
"button",
|
|
17007
17016
|
{
|
|
17008
17017
|
type: "button",
|
|
17009
17018
|
className: [
|
|
17010
|
-
`${CLASS$
|
|
17011
|
-
elegido ? `${CLASS$
|
|
17012
|
-
esElegido ? `${CLASS$
|
|
17019
|
+
`${CLASS$7}__item`,
|
|
17020
|
+
elegido ? `${CLASS$7}__item--off` : "",
|
|
17021
|
+
esElegido ? `${CLASS$7}__item--chosen` : ""
|
|
17013
17022
|
].filter(Boolean).join(" "),
|
|
17014
17023
|
disabled: elegido,
|
|
17015
17024
|
"aria-disabled": elegido,
|
|
@@ -17020,12 +17029,12 @@ const ServiceShortcuts = ({
|
|
|
17020
17029
|
else if (o.route) eventBus?.emit(CHAT_EVENT.NAVIGATE, { route: o.route });
|
|
17021
17030
|
},
|
|
17022
17031
|
children: [
|
|
17023
|
-
o.icon && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17024
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
17025
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17026
|
-
o.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17032
|
+
o.icon && /* @__PURE__ */ jsx("span", { className: `${CLASS$7}__icon`, children: ICONS[o.icon] }),
|
|
17033
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$7}__text`, children: [
|
|
17034
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$7}__label`, children: o.label }),
|
|
17035
|
+
o.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$7}__hint`, children: o.hint })
|
|
17027
17036
|
] }),
|
|
17028
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17037
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$7}__arrow`, children: esElegido ? CHECK : elegido ? null : /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) }) })
|
|
17029
17038
|
]
|
|
17030
17039
|
},
|
|
17031
17040
|
o.id
|
|
@@ -17594,25 +17603,44 @@ function ChatNavigatorChat({ component, eventBus }) {
|
|
|
17594
17603
|
] });
|
|
17595
17604
|
}
|
|
17596
17605
|
|
|
17597
|
-
const CLASS$
|
|
17598
|
-
const UserTools = ({ config, onChange, className }) => {
|
|
17606
|
+
const CLASS$6 = `${COMPONENT_PREFIX$1}user-tools`;
|
|
17607
|
+
const UserTools = ({ config, onChange, onAction, className }) => {
|
|
17599
17608
|
const { title, description, items } = config;
|
|
17600
|
-
return /* @__PURE__ */ jsxs("section", { className: [CLASS$
|
|
17601
|
-
title && /* @__PURE__ */ jsx("h2", { className: `${CLASS$
|
|
17602
|
-
description && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
17603
|
-
/* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
17609
|
+
return /* @__PURE__ */ jsxs("section", { className: [CLASS$6, className].filter(Boolean).join(" "), children: [
|
|
17610
|
+
title && /* @__PURE__ */ jsx("h2", { className: `${CLASS$6}__title`, children: title }),
|
|
17611
|
+
description && /* @__PURE__ */ jsx("p", { className: `${CLASS$6}__description`, children: description }),
|
|
17612
|
+
/* @__PURE__ */ jsx("ul", { className: `${CLASS$6}__list`, children: items.map((item) => /* @__PURE__ */ jsx("li", { className: `${CLASS$6}__item`, children: item.kind === "action" ? (
|
|
17613
|
+
// SPEC-139 T9 — un ajuste que se pulsa: mismo renglón (etiqueta y pista), y en vez
|
|
17614
|
+
// de la caja, un botón que dice lo que hace.
|
|
17615
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$6}__action`, children: [
|
|
17616
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$6}__text`, children: [
|
|
17617
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$6}__label`, children: item.label }),
|
|
17618
|
+
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$6}__hint`, children: item.hint })
|
|
17619
|
+
] }),
|
|
17620
|
+
/* @__PURE__ */ jsx(
|
|
17621
|
+
Button,
|
|
17622
|
+
{
|
|
17623
|
+
variant: "secondary",
|
|
17624
|
+
size: "small",
|
|
17625
|
+
disabled: item.disabled,
|
|
17626
|
+
onClick: () => onAction?.(item.id),
|
|
17627
|
+
children: item.label
|
|
17628
|
+
}
|
|
17629
|
+
)
|
|
17630
|
+
] })
|
|
17631
|
+
) : /* @__PURE__ */ jsx(
|
|
17604
17632
|
Checkbox$1,
|
|
17605
17633
|
{
|
|
17606
|
-
checked: item.value,
|
|
17634
|
+
checked: Boolean(item.value),
|
|
17607
17635
|
disabled: item.disabled,
|
|
17608
17636
|
onChange: (checked) => onChange?.(item.id, checked),
|
|
17609
|
-
label: /* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
17610
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17611
|
-
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17637
|
+
label: /* @__PURE__ */ jsxs("span", { className: `${CLASS$6}__text`, children: [
|
|
17638
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$6}__label`, children: item.label }),
|
|
17639
|
+
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$6}__hint`, children: item.hint })
|
|
17612
17640
|
] })
|
|
17613
17641
|
}
|
|
17614
17642
|
) }, item.id)) }),
|
|
17615
|
-
items.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
17643
|
+
items.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$6}__empty`, children: "No hay herramientas disponibles por ahora." })
|
|
17616
17644
|
] });
|
|
17617
17645
|
};
|
|
17618
17646
|
UserTools.displayName = "UserTools";
|
|
@@ -17652,6 +17680,14 @@ function UserToolsChat({ component, eventBus }) {
|
|
|
17652
17680
|
value
|
|
17653
17681
|
});
|
|
17654
17682
|
};
|
|
17683
|
+
const handleAction = (id) => {
|
|
17684
|
+
eventBus?.emit(CHAT_EVENT.COMPONENT_INTERACTION, {
|
|
17685
|
+
type: "user_tools",
|
|
17686
|
+
id,
|
|
17687
|
+
kind: "action",
|
|
17688
|
+
value: true
|
|
17689
|
+
});
|
|
17690
|
+
};
|
|
17655
17691
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17656
17692
|
/* @__PURE__ */ jsxs("button", { type: "button", className: "px-chat-reactive-crud-trigger", onClick: () => setOpen(true), children: [
|
|
17657
17693
|
/* @__PURE__ */ jsx("span", { className: "px-chat-reactive-crud-trigger__icon", children: /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -17676,7 +17712,7 @@ function UserToolsChat({ component, eventBus }) {
|
|
|
17676
17712
|
}
|
|
17677
17713
|
)
|
|
17678
17714
|
] }),
|
|
17679
|
-
/* @__PURE__ */ jsx("div", { className: "px-chat-reactive-crud-fs__body", children: /* @__PURE__ */ jsx(UserTools, { config, onChange: handleChange }) })
|
|
17715
|
+
/* @__PURE__ */ jsx("div", { className: "px-chat-reactive-crud-fs__body", children: /* @__PURE__ */ jsx(UserTools, { config, onChange: handleChange, onAction: handleAction }) })
|
|
17680
17716
|
] }),
|
|
17681
17717
|
document.body
|
|
17682
17718
|
)
|
|
@@ -18214,7 +18250,7 @@ const ChatHeader = ({
|
|
|
18214
18250
|
] });
|
|
18215
18251
|
};
|
|
18216
18252
|
|
|
18217
|
-
const CLASS$
|
|
18253
|
+
const CLASS$5 = `${COMPONENT_PREFIX$1}floating-actions`;
|
|
18218
18254
|
const ICON_VALUES = new Set(Object.values(ICON_TYPES));
|
|
18219
18255
|
function renderIcon(icon) {
|
|
18220
18256
|
if (typeof icon === "string" && ICON_VALUES.has(icon)) {
|
|
@@ -18223,23 +18259,23 @@ function renderIcon(icon) {
|
|
|
18223
18259
|
return icon;
|
|
18224
18260
|
}
|
|
18225
18261
|
function Side({ buttons, align, eventBus }) {
|
|
18226
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18262
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__group ${CLASS$5}__group--${align}`, children: buttons.map((b) => {
|
|
18227
18263
|
const emit = () => {
|
|
18228
18264
|
if (b.disabled) return;
|
|
18229
18265
|
eventBus.emit(b.event, b.payload);
|
|
18230
18266
|
};
|
|
18231
18267
|
if (b.custom) {
|
|
18232
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
18268
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$5}__slot`, children: [
|
|
18233
18269
|
b.custom,
|
|
18234
|
-
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18270
|
+
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__panel ${CLASS$5}__panel--${align}`, children: b.panel })
|
|
18235
18271
|
] }, b.id);
|
|
18236
18272
|
}
|
|
18237
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
18273
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$5}__slot`, children: [
|
|
18238
18274
|
/* @__PURE__ */ jsxs(
|
|
18239
18275
|
"button",
|
|
18240
18276
|
{
|
|
18241
18277
|
type: "button",
|
|
18242
|
-
className: [`${CLASS$
|
|
18278
|
+
className: [`${CLASS$5}__button`, b.active ? `${CLASS$5}__button--active` : ""].filter(Boolean).join(" "),
|
|
18243
18279
|
"aria-label": b.ariaLabel,
|
|
18244
18280
|
title: b.ariaLabel,
|
|
18245
18281
|
"aria-pressed": b.active,
|
|
@@ -18247,16 +18283,16 @@ function Side({ buttons, align, eventBus }) {
|
|
|
18247
18283
|
onClick: emit,
|
|
18248
18284
|
children: [
|
|
18249
18285
|
renderIcon(b.icon),
|
|
18250
|
-
b.badge != null && b.badge !== "" && b.badge !== 0 && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18286
|
+
b.badge != null && b.badge !== "" && b.badge !== 0 && /* @__PURE__ */ jsx("span", { className: `${CLASS$5}__badge`, children: b.badge })
|
|
18251
18287
|
]
|
|
18252
18288
|
}
|
|
18253
18289
|
),
|
|
18254
|
-
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18290
|
+
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__panel ${CLASS$5}__panel--${align}`, children: b.panel })
|
|
18255
18291
|
] }, b.id);
|
|
18256
18292
|
}) });
|
|
18257
18293
|
}
|
|
18258
18294
|
const ChatFloatingActions = ({ eventBus, left = [], right = [], offset = 12, glass = false }) => {
|
|
18259
|
-
const cls = [CLASS$
|
|
18295
|
+
const cls = [CLASS$5, glass ? `${CLASS$5}--glass` : ""].filter(Boolean).join(" ");
|
|
18260
18296
|
return /* @__PURE__ */ jsxs("div", { className: cls, style: { paddingLeft: offset, paddingRight: offset }, children: [
|
|
18261
18297
|
/* @__PURE__ */ jsx(Side, { buttons: left, align: "left", eventBus }),
|
|
18262
18298
|
/* @__PURE__ */ jsx(Side, { buttons: right, align: "right", eventBus })
|
|
@@ -18689,6 +18725,176 @@ const UserMessage = ({
|
|
|
18689
18725
|
] }) });
|
|
18690
18726
|
};
|
|
18691
18727
|
|
|
18728
|
+
const CLASS$4 = `${COMPONENT_PREFIX$1}photo-picker`;
|
|
18729
|
+
const PhotoPicker = ({
|
|
18730
|
+
label,
|
|
18731
|
+
hint,
|
|
18732
|
+
required,
|
|
18733
|
+
max,
|
|
18734
|
+
capture,
|
|
18735
|
+
entries,
|
|
18736
|
+
disabled,
|
|
18737
|
+
error,
|
|
18738
|
+
onFiles,
|
|
18739
|
+
onRemove
|
|
18740
|
+
}) => {
|
|
18741
|
+
const galeriaRef = useRef(null);
|
|
18742
|
+
const camaraRef = useRef(null);
|
|
18743
|
+
const hechas = entries.filter((e) => e.status === "done").length;
|
|
18744
|
+
const subiendo = entries.some((e) => e.status === "uploading");
|
|
18745
|
+
const lleno = max !== void 0 && entries.length >= max;
|
|
18746
|
+
const elegir = (ref) => {
|
|
18747
|
+
if (!disabled && !lleno) ref.current?.click();
|
|
18748
|
+
};
|
|
18749
|
+
const alCambiar = (e) => {
|
|
18750
|
+
void onFiles(e.target.files);
|
|
18751
|
+
e.target.value = "";
|
|
18752
|
+
};
|
|
18753
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$4}${error ? ` ${CLASS$4}--error` : ""}`, children: [
|
|
18754
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$4}__label`, children: [
|
|
18755
|
+
label,
|
|
18756
|
+
required ? " *" : "",
|
|
18757
|
+
hechas > 0 ? ` (${hechas}${max ? `/${max}` : ""})` : ""
|
|
18758
|
+
] }),
|
|
18759
|
+
/* @__PURE__ */ jsx(
|
|
18760
|
+
"input",
|
|
18761
|
+
{
|
|
18762
|
+
ref: galeriaRef,
|
|
18763
|
+
className: `${CLASS$4}__native`,
|
|
18764
|
+
type: "file",
|
|
18765
|
+
accept: "image/*",
|
|
18766
|
+
multiple: max !== 1,
|
|
18767
|
+
disabled,
|
|
18768
|
+
onChange: alCambiar,
|
|
18769
|
+
"data-testid": "photo-picker-gallery"
|
|
18770
|
+
}
|
|
18771
|
+
),
|
|
18772
|
+
capture && /* @__PURE__ */ jsx(
|
|
18773
|
+
"input",
|
|
18774
|
+
{
|
|
18775
|
+
ref: camaraRef,
|
|
18776
|
+
className: `${CLASS$4}__native`,
|
|
18777
|
+
type: "file",
|
|
18778
|
+
accept: "image/*",
|
|
18779
|
+
capture: "environment",
|
|
18780
|
+
disabled,
|
|
18781
|
+
onChange: alCambiar,
|
|
18782
|
+
"data-testid": "photo-picker-camera"
|
|
18783
|
+
}
|
|
18784
|
+
),
|
|
18785
|
+
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$4}__grid`, children: entries.map((e, i) => /* @__PURE__ */ jsxs("li", { className: `${CLASS$4}__thumb ${CLASS$4}__thumb--${e.status}`, children: [
|
|
18786
|
+
e.previewUrl ? /* @__PURE__ */ jsx("img", { className: `${CLASS$4}__img`, src: e.previewUrl, alt: e.name }) : /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__placeholder`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.IMAGE }) }),
|
|
18787
|
+
e.status === "uploading" && /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__state`, children: "Subiendo\u2026" }),
|
|
18788
|
+
e.status === "error" && /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__state ${CLASS$4}__state--error`, children: "No se pudo subir" }),
|
|
18789
|
+
onRemove && e.status !== "uploading" && /* @__PURE__ */ jsx(
|
|
18790
|
+
"button",
|
|
18791
|
+
{
|
|
18792
|
+
type: "button",
|
|
18793
|
+
className: `${CLASS$4}__remove`,
|
|
18794
|
+
onClick: () => onRemove(i),
|
|
18795
|
+
"aria-label": `Quitar ${e.name}`,
|
|
18796
|
+
disabled,
|
|
18797
|
+
children: /* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.CLOSE, size: "small" })
|
|
18798
|
+
}
|
|
18799
|
+
)
|
|
18800
|
+
] }, `${e.name}-${i}`)) }),
|
|
18801
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$4}__actions`, children: [
|
|
18802
|
+
capture && /* @__PURE__ */ jsxs(
|
|
18803
|
+
"button",
|
|
18804
|
+
{
|
|
18805
|
+
type: "button",
|
|
18806
|
+
className: `${CLASS$4}__pick`,
|
|
18807
|
+
onClick: () => elegir(camaraRef),
|
|
18808
|
+
disabled: disabled || lleno,
|
|
18809
|
+
children: [
|
|
18810
|
+
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.IMAGE, size: "small" }),
|
|
18811
|
+
/* @__PURE__ */ jsx("span", { children: "Tomar foto" })
|
|
18812
|
+
]
|
|
18813
|
+
}
|
|
18814
|
+
),
|
|
18815
|
+
/* @__PURE__ */ jsxs(
|
|
18816
|
+
"button",
|
|
18817
|
+
{
|
|
18818
|
+
type: "button",
|
|
18819
|
+
className: `${CLASS$4}__pick ${CLASS$4}__pick--secondary`,
|
|
18820
|
+
onClick: () => elegir(galeriaRef),
|
|
18821
|
+
disabled: disabled || lleno,
|
|
18822
|
+
children: [
|
|
18823
|
+
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.UPLOAD, size: "small" }),
|
|
18824
|
+
/* @__PURE__ */ jsx("span", { children: entries.length === 0 ? "Elegir fotos" : "A\xF1adir m\xE1s" })
|
|
18825
|
+
]
|
|
18826
|
+
}
|
|
18827
|
+
)
|
|
18828
|
+
] }),
|
|
18829
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__error`, children: error }),
|
|
18830
|
+
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__hint`, children: "Espera a que terminen de subir." }),
|
|
18831
|
+
!error && !subiendo && hint && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__hint`, children: hint })
|
|
18832
|
+
] });
|
|
18833
|
+
};
|
|
18834
|
+
|
|
18835
|
+
const CLASS$3 = `${COMPONENT_PREFIX$1}credentials-card`;
|
|
18836
|
+
async function copiar(texto) {
|
|
18837
|
+
try {
|
|
18838
|
+
await navigator.clipboard.writeText(texto);
|
|
18839
|
+
return true;
|
|
18840
|
+
} catch {
|
|
18841
|
+
return false;
|
|
18842
|
+
}
|
|
18843
|
+
}
|
|
18844
|
+
const Fila = ({ row }) => {
|
|
18845
|
+
const [copiado, setCopiado] = useState(false);
|
|
18846
|
+
const [visible, setVisible] = useState(!row.masked);
|
|
18847
|
+
useEffect(() => {
|
|
18848
|
+
if (!copiado) return;
|
|
18849
|
+
const t = setTimeout(() => setCopiado(false), 1800);
|
|
18850
|
+
return () => clearTimeout(t);
|
|
18851
|
+
}, [copiado]);
|
|
18852
|
+
return /* @__PURE__ */ jsxs("li", { className: `${CLASS$3}__row`, children: [
|
|
18853
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$3}__label`, children: row.label }),
|
|
18854
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$3}__value`, "data-testid": `credential-${row.label}`, children: visible ? row.value : "\u2022".repeat(Math.min(row.value.length, 12)) }),
|
|
18855
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$3}__tools`, children: [
|
|
18856
|
+
row.masked && /* @__PURE__ */ jsx(
|
|
18857
|
+
"button",
|
|
18858
|
+
{
|
|
18859
|
+
type: "button",
|
|
18860
|
+
className: `${CLASS$3}__tool`,
|
|
18861
|
+
onClick: () => setVisible((v) => !v),
|
|
18862
|
+
"aria-label": visible ? `Ocultar ${row.label}` : `Ver ${row.label}`,
|
|
18863
|
+
children: visible ? "Ocultar" : "Ver"
|
|
18864
|
+
}
|
|
18865
|
+
),
|
|
18866
|
+
row.copyable !== false && /* @__PURE__ */ jsx(
|
|
18867
|
+
"button",
|
|
18868
|
+
{
|
|
18869
|
+
type: "button",
|
|
18870
|
+
className: `${CLASS$3}__tool`,
|
|
18871
|
+
onClick: async () => setCopiado(await copiar(row.value)),
|
|
18872
|
+
"aria-label": `Copiar ${row.label}`,
|
|
18873
|
+
children: copiado ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18874
|
+
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.CHECK, size: "small" }),
|
|
18875
|
+
/* @__PURE__ */ jsx("span", { children: "Copiado" })
|
|
18876
|
+
] }) : "Copiar"
|
|
18877
|
+
}
|
|
18878
|
+
)
|
|
18879
|
+
] })
|
|
18880
|
+
] });
|
|
18881
|
+
};
|
|
18882
|
+
const CredentialsCard = ({
|
|
18883
|
+
title,
|
|
18884
|
+
intro,
|
|
18885
|
+
rows,
|
|
18886
|
+
note,
|
|
18887
|
+
action,
|
|
18888
|
+
className
|
|
18889
|
+
}) => /* @__PURE__ */ jsxs("section", { className: [CLASS$3, className].filter(Boolean).join(" "), "aria-label": title, children: [
|
|
18890
|
+
/* @__PURE__ */ jsx("h3", { className: `${CLASS$3}__title`, children: title }),
|
|
18891
|
+
intro && /* @__PURE__ */ jsx("p", { className: `${CLASS$3}__intro`, children: intro }),
|
|
18892
|
+
/* @__PURE__ */ jsx("ul", { className: `${CLASS$3}__rows`, children: rows.map((r) => /* @__PURE__ */ jsx(Fila, { row: r }, r.label)) }),
|
|
18893
|
+
note && /* @__PURE__ */ jsx("p", { className: `${CLASS$3}__note`, children: note }),
|
|
18894
|
+
action && /* @__PURE__ */ jsx("div", { className: `${CLASS$3}__action`, children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: action.onClick, disabled: action.disabled, children: action.label }) })
|
|
18895
|
+
] });
|
|
18896
|
+
CredentialsCard.displayName = "CredentialsCard";
|
|
18897
|
+
|
|
18692
18898
|
const FADE_AFTER_MS = 4e3;
|
|
18693
18899
|
const NewMessageDivider = ({
|
|
18694
18900
|
label = "Nuevo mensaje",
|
|
@@ -24917,4 +25123,4 @@ function buildBreadcrumbPath(items, targetKey, currentPath = []) {
|
|
|
24917
25123
|
return [];
|
|
24918
25124
|
}
|
|
24919
25125
|
|
|
24920
|
-
export { ActionFormDrawer, BottomSheet, CHAT_CONFIG_DEFAULTS, CHAT_EVENT, ICON_TYPES as CHAT_ICON_TYPES, Chat, AssistantMessage as ChatAssistantMessage, AssistantThinkingIndicator as ChatAssistantThinkingIndicator, AttachmentPreview as ChatAttachmentPreview, Avatar as ChatAvatar, Button$1 as ChatButton, ChatConfigProvider, DateDivider as ChatDateDivider, FileViewer as ChatFileViewer, ChatFloatingActions, FullscreenViewer as ChatFullscreenViewer, ChatHeader as ChatHeaderComponent, Icon$1 as ChatIcon, Input$2 as ChatInput, ChatInput as ChatInputComponent, Link as ChatLink, Loader$1 as ChatLoader, Logo as ChatLogo, MessageStatus as ChatMessageStatus, Modal as ChatModal, ChatNavigator, Select$2 as ChatSelect, SelectMenu as ChatSelectMenu, StructuredContent as ChatStructuredContent, Text as ChatText, Textarea as ChatTextarea, UserAttachments as ChatUserAttachments, UserMessage as ChatUserMessage, ChatWidget, FileField, BADGE_VARIANTS as LUMI_BADGE_VARIANTS, DEFAULT_TITLES as LUMI_DEFAULT_TITLES, LUMI_ICON_TYPES, LiveIndicator, LocationField, ActionBar as LumiActionBar, Badge as LumiBadge, Base as LumiBase, BaseNavbar as LumiBaseNavbar, BaseWorkspace as LumiBaseWorkspace, Breadcrumb as LumiBreadcrumb, BreadcrumbItem as LumiBreadcrumbItem, BreadcrumbSeparator as LumiBreadcrumbSeparator, Button as LumiButton, Calendar as LumiCalendar, Card as LumiCard, Checkbox$1 as LumiCheckbox, Crud as LumiCrud, CurrencyDisplay as LumiCurrencyDisplay, Dashboard as LumiDashboard, DashboardNavbar as LumiDashboardNavbar, DashboardSidebar as LumiDashboardSidebar, DashboardWorkspace as LumiDashboardWorkspace, DateDisplay as LumiDateDisplay, DateInput$1 as LumiDateInput, Drawer as LumiDrawer, DropdownMenu as LumiDropdownMenu, DynamicForm as LumiDynamicForm, FieldValue as LumiFieldValue, Filter as LumiFilter, FilterRow as LumiFilterRow, Checkbox as LumiFormCheckbox, DateInput as LumiFormDateInput, FormDrawer as LumiFormDrawer, Input as LumiFormInput, Select as LumiFormSelect, TimeInput as LumiFormTimeInput, Icon as LumiIcon, Input$1 as LumiInput, Loader as LumiLoader, Menu as LumiMenu, MenuItem as LumiMenuItem, MenuItemGroup as LumiMenuItemGroup, Notification as LumiNotification, Pagination as LumiPagination, Popover as LumiPopover, QRCode as LumiQRCode, RecordCard as LumiRecordCard, Select$1 as LumiSelect, StepIndicator as LumiStepIndicator, Stepper as LumiStepper, SubMenu as LumiSubMenu, Table as LumiTable, Tabs as LumiTabs, TextArea as LumiTextArea, TimeInput$1 as LumiTimeInput, Tooltip as LumiTooltip, MapView, ReactiveCrud, ServiceShortcuts, ServicesMap, SessionExpiryPrompt, UserTools, chatEventBus, clearChatComponents, createDeepPropertySubscriber, createEventBus, createStore, createStoreMerger, deepMerge, disabledReasonFor, getLastFleetSnapshot, matchesDisabledWhen, matchesDoneWhen, matchesVisibleWhen, registerChatComponents, setLastFleetSnapshot, useChatConfig, useReactiveCrud };
|
|
25126
|
+
export { ActionFormDrawer, BottomSheet, CHAT_CONFIG_DEFAULTS, CHAT_EVENT, ICON_TYPES as CHAT_ICON_TYPES, Chat, AssistantMessage as ChatAssistantMessage, AssistantThinkingIndicator as ChatAssistantThinkingIndicator, AttachmentPreview as ChatAttachmentPreview, Avatar as ChatAvatar, Button$1 as ChatButton, ChatConfigProvider, DateDivider as ChatDateDivider, FileViewer as ChatFileViewer, ChatFloatingActions, FullscreenViewer as ChatFullscreenViewer, ChatHeader as ChatHeaderComponent, Icon$1 as ChatIcon, Input$2 as ChatInput, ChatInput as ChatInputComponent, Link as ChatLink, Loader$1 as ChatLoader, Logo as ChatLogo, MessageStatus as ChatMessageStatus, Modal as ChatModal, ChatNavigator, Select$2 as ChatSelect, SelectMenu as ChatSelectMenu, StructuredContent as ChatStructuredContent, Text as ChatText, Textarea as ChatTextarea, UserAttachments as ChatUserAttachments, UserMessage as ChatUserMessage, ChatWidget, CredentialsCard, FileField, BADGE_VARIANTS as LUMI_BADGE_VARIANTS, DEFAULT_TITLES as LUMI_DEFAULT_TITLES, LUMI_ICON_TYPES, LiveIndicator, LocationField, ActionBar as LumiActionBar, Badge as LumiBadge, Base as LumiBase, BaseNavbar as LumiBaseNavbar, BaseWorkspace as LumiBaseWorkspace, Breadcrumb as LumiBreadcrumb, BreadcrumbItem as LumiBreadcrumbItem, BreadcrumbSeparator as LumiBreadcrumbSeparator, Button as LumiButton, Calendar as LumiCalendar, Card as LumiCard, Checkbox$1 as LumiCheckbox, Crud as LumiCrud, CurrencyDisplay as LumiCurrencyDisplay, Dashboard as LumiDashboard, DashboardNavbar as LumiDashboardNavbar, DashboardSidebar as LumiDashboardSidebar, DashboardWorkspace as LumiDashboardWorkspace, DateDisplay as LumiDateDisplay, DateInput$1 as LumiDateInput, Drawer as LumiDrawer, DropdownMenu as LumiDropdownMenu, DynamicForm as LumiDynamicForm, FieldValue as LumiFieldValue, Filter as LumiFilter, FilterRow as LumiFilterRow, Checkbox as LumiFormCheckbox, DateInput as LumiFormDateInput, FormDrawer as LumiFormDrawer, Input as LumiFormInput, Select as LumiFormSelect, TimeInput as LumiFormTimeInput, Icon as LumiIcon, Input$1 as LumiInput, Loader as LumiLoader, Menu as LumiMenu, MenuItem as LumiMenuItem, MenuItemGroup as LumiMenuItemGroup, Notification as LumiNotification, Pagination as LumiPagination, Popover as LumiPopover, QRCode as LumiQRCode, RecordCard as LumiRecordCard, Select$1 as LumiSelect, StepIndicator as LumiStepIndicator, Stepper as LumiStepper, SubMenu as LumiSubMenu, Table as LumiTable, Tabs as LumiTabs, TextArea as LumiTextArea, TimeInput$1 as LumiTimeInput, Tooltip as LumiTooltip, MapView, PhotoPicker, ReactiveCrud, ServiceShortcuts, ServicesMap, SessionExpiryPrompt, UserTools, chatEventBus, clearChatComponents, createDeepPropertySubscriber, createEventBus, createStore, createStoreMerger, deepMerge, disabledReasonFor, getLastFleetSnapshot, matchesDisabledWhen, matchesDoneWhen, matchesVisibleWhen, registerChatComponents, setLastFleetSnapshot, useChatConfig, useReactiveCrud };
|