@erplora/outfitkit 0.1.12 → 0.1.14

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.
@@ -39,6 +39,13 @@ export interface DataTableAction {
39
39
  icon?: string;
40
40
  /** Color Ionic del botón (p.ej. 'danger', 'primary'). */
41
41
  color?: string;
42
+ /** (opcional, por fila) Si devuelve `true` para una fila, el botón de esa acción se renderiza
43
+ * deshabilitado (`?disabled` + `aria-disabled="true"`). */
44
+ disabled?: (row: Record<string, unknown>) => boolean;
45
+ /** (opcional, por fila) Si devuelve `true` para una fila, el botón muestra un
46
+ * `<ion-spinner name="dots">` en lugar del icono/label Y queda deshabilitado
47
+ * (una acción en curso no debe ser re-clicable). */
48
+ loading?: (row: Record<string, unknown>) => boolean;
42
49
  }
43
50
  /** Acción primaria de la topbar (botón destacado). Emite el evento `primaryAction`. */
44
51
  export interface DataTablePrimaryAction {
@@ -181,6 +188,11 @@ export declare class OkDataTable extends LitElement {
181
188
  * vistas. La presencia de 'cards' (o 'card') habilita la vista tarjetas. Compatibilidad: el
182
189
  * antiguo valor booleano sigue funcionando. */
183
190
  views: boolean | string[];
191
+ /** (NUEVO) Vista inicial al montar: 'cards' | 'table'. Por defecto 'table' (compatibilidad). Solo
192
+ * aplica una vez, en el primer render; el usuario puede luego conmutar con el toggle. Si pide
193
+ * 'cards' pero la vista tarjetas no está habilitada (`views`), se ignora. Evita el hack de fijar
194
+ * `viewMode` por referencia tras montar (frágil si la tabla monta detrás de un `v-if`/loading). */
195
+ defaultView?: 'table' | 'cards';
184
196
  /** (NUEVO, alias documentado) Habilita import/export CSV (equivalente a `exportable`+`importable`
185
197
  * / `csv`). Mostrar el botón de Exportar. */
186
198
  exportable: boolean;
@@ -250,7 +262,7 @@ export declare class OkDataTable extends LitElement {
250
262
  private onImportFile;
251
263
  private toggle;
252
264
  private cloneFilters;
253
- private toggleFilterValue;
265
+ private setFilterValues;
254
266
  private setFilterRange;
255
267
  private applyFilters;
256
268
  private clearFilters;
@@ -286,6 +298,7 @@ export declare class OkDataTable extends LitElement {
286
298
  private onFilterSelect;
287
299
  private onInlineRange;
288
300
  private openMenu;
301
+ firstUpdated(): void;
289
302
  private setViewMode;
290
303
  private renderFilterControl;
291
304
  private renderInlineFilters;
@@ -149,13 +149,7 @@ class OkDataTable extends LitElement {
149
149
  .fblock { display: flex; flex-direction: column; gap: 0.45rem; }
150
150
  .flabel { font-size: 13px; font-weight: 500; color: var(--color); }
151
151
  .frange { display: flex; gap: 0.5rem; }
152
- /* Filtros cliente: chips multi-select (estilo Hub) + rango de fechas. */
153
- .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
154
- .chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.6rem; border: 1px solid var(--border-color); border-radius: 999px; background: var(--background); color: var(--color-muted); font-size: 12px; cursor: pointer; transition: color 0.12s, background 0.12s, border-color 0.12s; }
155
- .chip:hover { color: var(--color); }
156
- .chip.on { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, transparent); }
157
- .chip ion-icon { font-size: 12px; }
158
- .chip-empty { font-size: 12px; color: var(--color-muted); }
152
+ /* Filtros cliente: multi-select con ion-select (ventana flotante de Ionic) + rango de fechas. */
159
153
  .daterange { display: flex; gap: 0.6rem; }
160
154
  .daterange ion-input { flex: 1; }
161
155
  /* Pie del drawer de filtros: Limpiar / Aplicar. */
@@ -275,33 +269,45 @@ class OkDataTable extends LitElement {
275
269
  .range { display: flex; gap: 0.25rem; }
276
270
 
277
271
  /* ── Vista tarjetas ──────────────────────────────────────────────────────────────────── */
278
- .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; padding: 1rem; }
279
- /* Flat: sin borde ni elevación las tarjetas se delimitan por la superficie (no por sombra). */
280
- .rcard { display: flex; flex-direction: column; border: 0; border-radius: 12px; overflow: hidden; background: var(--header-background); box-shadow: none; transition: background-color var(--ok-transition, 150ms ease), color var(--ok-transition, 150ms ease), box-shadow var(--ok-transition, 150ms ease), transform 120ms ease; }
281
- @media (hover: hover) {
282
- .rcard:hover { background: var(--row-hover); }
283
- }
284
- .rcard:active { transform: scale(0.995); }
272
+ /* Cada tarjeta mide SU contenido (no se estira al alto de la fila ni del contenedor):
273
+ - grid-auto-rows: max-content cada fila implícita = alto de su contenido. CLAVE: sin esto,
274
+ en modo fill (grid de alto fijo + align-content:start) cuando las tarjetas no caben el
275
+ navegador encoge los tracks de fila y las tarjetas se solapan.
276
+ - align-content: start empaqueta las filas arriba (no reparte el hueco sobrante estirando).
277
+ - align-items: start → en una fila multi-columna cada tarjeta mide su propio contenido.
278
+ En modo fill el grid es flex-child con overflow:auto cuando las tarjetas no caben aparece el
279
+ scroll DENTRO de la tabla (no crece hacia fuera). */
280
+ .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; padding: 1rem; grid-auto-rows: max-content; align-content: start; align-items: start; }
281
+ /* Tarjeta = ion-card NATIVO de Ionic: su fondo, radio, elevación y padding son los de Ionic y NO
282
+ se sobrescriben. Aquí solo se ajusta lo que el contexto de rejilla exige (margin) y los huecos
283
+ que Ionic no trae (cabecera en fila, filas clave-valor, barra de acciones, resalte de selección). */
284
+ ion-card.rcard { margin: 0; } /* la rejilla aporta el gap → sin esto el margin por defecto de ion-card lo duplica */
285
+ ion-card.rcard.selected { outline: 2px solid var(--primary); outline-offset: -2px; }
285
286
  @media (prefers-reduced-motion: reduce) {
286
287
  .gh.sortable:hover, .gh.sortable:active,
287
- .grow-data:hover, .grow-data:active,
288
- .rcard:hover, .rcard:active { transform: none; }
288
+ .grow-data:hover, .grow-data:active { transform: none; }
289
289
  }
290
- .rcard.selected { background: color-mix(in srgb, var(--primary) 12%, var(--header-background)); }
291
- .rcard-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border-color); background: var(--header-background); }
290
+ /* Cabecera: ion-card-header en fila (icono + título + checkbox); se conserva su padding Ionic. */
291
+ ion-card-header.rcard-head { display: flex; align-items: center; gap: 0.5rem; }
292
292
  .rcard-head .rc-icon { display: inline-flex; color: var(--primary); }
293
293
  .rcard-head .rc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
294
- .rcard-body { flex: 1; padding: 0.6rem 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }
294
+ /* Cuerpo: ion-card-content (padding Ionic por defecto) con las filas clave-valor apiladas. */
295
+ ion-card-content.rcard-body { display: flex; flex-direction: column; gap: 0.4rem; }
295
296
  .rrow { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 13px; }
296
297
  .rrow .rk { color: var(--color-muted); }
297
- .rrow .rv { font-weight: 500; text-align: right; }
298
- .ractions { display: flex; justify-content: flex-end; gap: 0.25rem; padding: 0.25rem 0.5rem; border-top: 1px solid var(--border-color-soft); background: var(--header-background); }
298
+ .rrow .rv { font-weight: 500; text-align: right; color: var(--color); }
299
+ /* Barra de acciones (Ionic no trae "card actions"): pie alineado a la derecha, fondo transparente. */
300
+ .ractions { display: flex; justify-content: flex-end; gap: 0.25rem; padding: 0 0.5rem 0.5rem; }
299
301
 
300
302
  /* ── Estado vacío ────────────────────────────────────────────────────────────────────── */
301
303
  .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3.5rem 1rem; text-align: center; color: var(--color-muted); }
302
304
  .empty .empty-ic { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 999px; background: var(--header-background); font-size: 26px; }
303
305
 
304
306
  .actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
307
+ /* Spinner de acción en curso (loading): contenido dentro del ion-button small (Ionic lo fija
308
+ * a 28px en el :host, por eso width/height y no font-size). Cubre tabla y tarjetas: los
309
+ * botones de fila siempre van dentro de .actions. */
310
+ .actions ion-spinner { width: 18px; height: 18px; }
305
311
 
306
312
  /* ── Pie: contador + paginación ──────────────────────────────────────────────────────── */
307
313
  .pager { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 1rem; border-top: 1px solid var(--border-color); background: var(--header-background); font-size: 12.5px; color: var(--color-muted); }
@@ -469,12 +475,12 @@ class OkDataTable extends LitElement {
469
475
  }
470
476
  return out;
471
477
  }
472
- toggleFilterValue(key, value) {
478
+ // Fija el conjunto de valores seleccionados de una columna (multi-select del drawer = ion-select).
479
+ setFilterValues(key, values) {
473
480
  const next = this.cloneFilters(this.filterDraft);
474
- const values = new Set(next[key]?.values ?? []);
475
- if (values.has(value)) values.delete(value);
476
- else values.add(value);
477
- next[key] = { ...next[key], values };
481
+ const clean = (values ?? []).filter((v) => v != null && v !== "");
482
+ if (clean.length) next[key] = { ...next[key], values: new Set(clean) };
483
+ else next[key] = { ...next[key], values: void 0 };
478
484
  this.filterDraft = next;
479
485
  }
480
486
  setFilterRange(key, edge, value) {
@@ -669,6 +675,13 @@ class OkDataTable extends LitElement {
669
675
  this.menuEv = ev;
670
676
  this.menuOpen = true;
671
677
  }
678
+ // Aplica la vista inicial declarada (`default-view`) una sola vez, tras el primer render. Es la
679
+ // forma robusta de arrancar en tarjetas sin depender de fijar `viewMode` por referencia (que
680
+ // falla si la tabla monta detrás de un `v-if`/loading y el ref aún es null).
681
+ firstUpdated() {
682
+ if (this.defaultView === "cards" && this.cardViewEnabled) this.viewMode = "cards";
683
+ else if (this.defaultView === "table") this.viewMode = "table";
684
+ }
672
685
  setViewMode(mode) {
673
686
  if (this.viewMode === mode) return;
674
687
  this.viewMode = mode;
@@ -804,16 +817,22 @@ class OkDataTable extends LitElement {
804
817
  return html`
805
818
  <div class="actions">
806
819
  ${this.actions.map(
807
- (a) => html`
820
+ (a) => {
821
+ const loading = a.loading?.(row) === true;
822
+ const disabled = loading || a.disabled?.(row) === true;
823
+ return html`
808
824
  <ion-button
809
825
  size="small"
810
826
  fill="clear"
811
827
  color=${a.color ?? "medium"}
828
+ ?disabled=${disabled}
829
+ aria-disabled=${disabled ? "true" : nothing}
812
830
  @click=${() => this.emit("rowAction", { actionId: a.id, row })}
813
831
  >
814
- ${a.icon ? html`<ion-icon slot="icon-only" name=${a.icon}></ion-icon>` : a.label}
832
+ ${loading ? html`<ion-spinner slot="icon-only" name="dots"></ion-spinner>` : a.icon ? html`<ion-icon slot="icon-only" name=${a.icon}></ion-icon>` : a.label}
815
833
  </ion-button>
816
- `
834
+ `;
835
+ }
817
836
  )}
818
837
  </div>
819
838
  `;
@@ -1024,21 +1043,23 @@ class OkDataTable extends LitElement {
1024
1043
  </div>
1025
1044
  `;
1026
1045
  }
1027
- const distinct = this.distinctValues(col);
1028
- const selected = this.filterDraft[col.key]?.values ?? /* @__PURE__ */ new Set();
1046
+ const opts = col.options ?? this.distinctValues(col).map((v) => ({ value: v, label: v }));
1047
+ const selected = [...this.filterDraft[col.key]?.values ?? /* @__PURE__ */ new Set()];
1029
1048
  return html`
1030
1049
  <div class="fblock">
1031
- <span class="flabel">${label}</span>
1032
- <div class="chips">
1033
- ${distinct.length === 0 ? html`<span class="chip-empty">${this.t.noValues}</span>` : distinct.map((v) => {
1034
- const on = selected.has(v);
1035
- return html`
1036
- <button class=${`chip${on ? " on" : ""}`} @click=${() => this.toggleFilterValue(col.key, v)}>
1037
- ${on ? html`<ion-icon name="checkmark-outline"></ion-icon>` : nothing}${v}
1038
- </button>
1039
- `;
1040
- })}
1041
- </div>
1050
+ <ion-select
1051
+ label=${label}
1052
+ label-placement="stacked"
1053
+ fill="outline"
1054
+ multiple
1055
+ interface="modal"
1056
+ .interfaceOptions=${{ cssClass: "ok-overlay" }}
1057
+ placeholder=${this.t.select}
1058
+ .value=${selected}
1059
+ @ionChange=${(e) => this.setFilterValues(col.key, e.detail.value ?? [])}
1060
+ >
1061
+ ${opts.length === 0 ? html`<ion-select-option .disabled=${true} value="">${this.t.noValues}</ion-select-option>` : opts.map((o) => html`<ion-select-option value=${o.value}>${o.label}</ion-select-option>`)}
1062
+ </ion-select>
1042
1063
  </div>
1043
1064
  `;
1044
1065
  }
@@ -1117,21 +1138,21 @@ class OkDataTable extends LitElement {
1117
1138
  const selected = this.selectable && this.selection.has(key);
1118
1139
  const icon = this.cardIcon?.(row);
1119
1140
  return html`
1120
- <div class=${`rcard${selected ? " selected" : ""}`}>
1141
+ <ion-card class=${`rcard${selected ? " selected" : ""}`}>
1121
1142
  ${hasHead ? html`
1122
- <header class="rcard-head">
1143
+ <ion-card-header class="rcard-head">
1123
1144
  ${icon != null && icon !== "" ? html`<span class="rc-icon">${typeof icon === "string" ? html`<ion-icon name=${icon}></ion-icon>` : icon}</span>` : nothing}
1124
1145
  <span class="rc-title">${this.cardTitle ? this.cardTitle(row) : nothing}</span>
1125
1146
  ${this.selectable ? html`<ion-checkbox .checked=${selected} aria-label=${this.t.select} @ionChange=${() => this.toggleRow(key)}></ion-checkbox>` : nothing}
1126
- </header>
1147
+ </ion-card-header>
1127
1148
  ` : nothing}
1128
- <div class="rcard-body">
1149
+ <ion-card-content class="rcard-body">
1129
1150
  ${this.renderCard ? this.renderCard(row) : this.visibleColumns.map(
1130
1151
  (c) => html`<div class="rrow"><span class="rk">${c.header}</span><span class="rv">${c.render ? c.render(row) : this.cell(c, row)}</span></div>`
1131
1152
  )}
1132
- </div>
1153
+ </ion-card-content>
1133
1154
  ${this.actions.length ? html`<div class="ractions">${this.actionButtons(row)}</div>` : nothing}
1134
- </div>
1155
+ </ion-card>
1135
1156
  `;
1136
1157
  }
1137
1158
  )}
@@ -1211,6 +1232,9 @@ __decorateClass([
1211
1232
  __decorateClass([
1212
1233
  property({ attribute: false })
1213
1234
  ], OkDataTable.prototype, "views");
1235
+ __decorateClass([
1236
+ property({ attribute: "default-view" })
1237
+ ], OkDataTable.prototype, "defaultView");
1214
1238
  __decorateClass([
1215
1239
  property({ type: Boolean })
1216
1240
  ], OkDataTable.prototype, "exportable");
@@ -264,7 +264,7 @@ Yt.elementStyles = [], Yt.shadowRootOptions = { mode: "open" }, Yt[Cr("elementPr
264
264
  */
265
265
  const Wo = globalThis, ya = (n) => n, no = Wo.trustedTypes, ka = no ? no.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Go = "$lit$", xe = `lit$${Math.random().toFixed(9).slice(2)}$`, Qo = "?" + xe, bi = `<${Qo}>`, gt = document, Er = () => gt.createComment(""), Pr = (n) => n === null || typeof n != "object" && typeof n != "function", Zo = Array.isArray, Ra = (n) => Zo(n) || typeof n?.[Symbol.iterator] == "function", Oo = `[
266
266
  \f\r]`, kr = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wa = /-->/g, $a = />/g, mt = RegExp(`>|${Oo}(?:([^\\s"'>=/]+)(${Oo}*=${Oo}*(?:[^
267
- \f\r"'\`<>=]|("|')|))|$)`, "g"), za = /'/g, _a = /"/g, Na = /^(?:script|style|textarea|title)$/i, Jo = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), s = Jo(1), P = Jo(2), Id = Jo(3), ye = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Ca = /* @__PURE__ */ new WeakMap(), ft = gt.createTreeWalker(gt, 129);
267
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), za = /'/g, _a = /"/g, Na = /^(?:script|style|textarea|title)$/i, Jo = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), s = Jo(1), P = Jo(2), Ld = Jo(3), ye = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), Ca = /* @__PURE__ */ new WeakMap(), ft = gt.createTreeWalker(gt, 129);
268
268
  function qa(n, e) {
269
269
  if (!Zo(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
270
270
  return ka !== void 0 ? ka.createHTML(e) : e;
@@ -585,7 +585,7 @@ const Sa = (n, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorat
585
585
  * Copyright 2017 Google LLC
586
586
  * SPDX-License-Identifier: BSD-3-Clause
587
587
  */
588
- function I(n, e) {
588
+ function L(n, e) {
589
589
  return (t, r, o) => {
590
590
  const a = (i) => i.renderRoot?.querySelector(n) ?? null;
591
591
  if (e) {
@@ -976,10 +976,10 @@ const Qa = "important", ji = " !" + Qa, Ma = ra(class extends oa {
976
976
  return ye;
977
977
  }
978
978
  });
979
- var Li = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, C = (n, e, t, r) => {
980
- for (var o = r > 1 ? void 0 : r ? Ii(e, t) : e, a = n.length - 1, i; a >= 0; a--)
979
+ var Ii = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, C = (n, e, t, r) => {
980
+ for (var o = r > 1 ? void 0 : r ? Li(e, t) : e, a = n.length - 1, i; a >= 0; a--)
981
981
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
982
- return r && o && Li(e, t, o), o;
982
+ return r && o && Ii(e, t, o), o;
983
983
  };
984
984
  const Ti = {
985
985
  search: "Search…",
@@ -1074,13 +1074,7 @@ class _ extends g {
1074
1074
  .fblock { display: flex; flex-direction: column; gap: 0.45rem; }
1075
1075
  .flabel { font-size: 13px; font-weight: 500; color: var(--color); }
1076
1076
  .frange { display: flex; gap: 0.5rem; }
1077
- /* Filtros cliente: chips multi-select (estilo Hub) + rango de fechas. */
1078
- .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
1079
- .chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.6rem; border: 1px solid var(--border-color); border-radius: 999px; background: var(--background); color: var(--color-muted); font-size: 12px; cursor: pointer; transition: color 0.12s, background 0.12s, border-color 0.12s; }
1080
- .chip:hover { color: var(--color); }
1081
- .chip.on { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, transparent); }
1082
- .chip ion-icon { font-size: 12px; }
1083
- .chip-empty { font-size: 12px; color: var(--color-muted); }
1077
+ /* Filtros cliente: multi-select con ion-select (ventana flotante de Ionic) + rango de fechas. */
1084
1078
  .daterange { display: flex; gap: 0.6rem; }
1085
1079
  .daterange ion-input { flex: 1; }
1086
1080
  /* Pie del drawer de filtros: Limpiar / Aplicar. */
@@ -1200,33 +1194,45 @@ class _ extends g {
1200
1194
  .range { display: flex; gap: 0.25rem; }
1201
1195
 
1202
1196
  /* ── Vista tarjetas ──────────────────────────────────────────────────────────────────── */
1203
- .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; padding: 1rem; }
1204
- /* Flat: sin borde ni elevación las tarjetas se delimitan por la superficie (no por sombra). */
1205
- .rcard { display: flex; flex-direction: column; border: 0; border-radius: 12px; overflow: hidden; background: var(--header-background); box-shadow: none; transition: background-color var(--ok-transition, 150ms ease), color var(--ok-transition, 150ms ease), box-shadow var(--ok-transition, 150ms ease), transform 120ms ease; }
1206
- @media (hover: hover) {
1207
- .rcard:hover { background: var(--row-hover); }
1208
- }
1209
- .rcard:active { transform: scale(0.995); }
1197
+ /* Cada tarjeta mide SU contenido (no se estira al alto de la fila ni del contenedor):
1198
+ - grid-auto-rows: max-content cada fila implícita = alto de su contenido. CLAVE: sin esto,
1199
+ en modo fill (grid de alto fijo + align-content:start) cuando las tarjetas no caben el
1200
+ navegador encoge los tracks de fila y las tarjetas se solapan.
1201
+ - align-content: start empaqueta las filas arriba (no reparte el hueco sobrante estirando).
1202
+ - align-items: start → en una fila multi-columna cada tarjeta mide su propio contenido.
1203
+ En modo fill el grid es flex-child con overflow:auto cuando las tarjetas no caben aparece el
1204
+ scroll DENTRO de la tabla (no crece hacia fuera). */
1205
+ .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; padding: 1rem; grid-auto-rows: max-content; align-content: start; align-items: start; }
1206
+ /* Tarjeta = ion-card NATIVO de Ionic: su fondo, radio, elevación y padding son los de Ionic y NO
1207
+ se sobrescriben. Aquí solo se ajusta lo que el contexto de rejilla exige (margin) y los huecos
1208
+ que Ionic no trae (cabecera en fila, filas clave-valor, barra de acciones, resalte de selección). */
1209
+ ion-card.rcard { margin: 0; } /* la rejilla aporta el gap → sin esto el margin por defecto de ion-card lo duplica */
1210
+ ion-card.rcard.selected { outline: 2px solid var(--primary); outline-offset: -2px; }
1210
1211
  @media (prefers-reduced-motion: reduce) {
1211
1212
  .gh.sortable:hover, .gh.sortable:active,
1212
- .grow-data:hover, .grow-data:active,
1213
- .rcard:hover, .rcard:active { transform: none; }
1213
+ .grow-data:hover, .grow-data:active { transform: none; }
1214
1214
  }
1215
- .rcard.selected { background: color-mix(in srgb, var(--primary) 12%, var(--header-background)); }
1216
- .rcard-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border-color); background: var(--header-background); }
1215
+ /* Cabecera: ion-card-header en fila (icono + título + checkbox); se conserva su padding Ionic. */
1216
+ ion-card-header.rcard-head { display: flex; align-items: center; gap: 0.5rem; }
1217
1217
  .rcard-head .rc-icon { display: inline-flex; color: var(--primary); }
1218
1218
  .rcard-head .rc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
1219
- .rcard-body { flex: 1; padding: 0.6rem 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; }
1219
+ /* Cuerpo: ion-card-content (padding Ionic por defecto) con las filas clave-valor apiladas. */
1220
+ ion-card-content.rcard-body { display: flex; flex-direction: column; gap: 0.4rem; }
1220
1221
  .rrow { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 13px; }
1221
1222
  .rrow .rk { color: var(--color-muted); }
1222
- .rrow .rv { font-weight: 500; text-align: right; }
1223
- .ractions { display: flex; justify-content: flex-end; gap: 0.25rem; padding: 0.25rem 0.5rem; border-top: 1px solid var(--border-color-soft); background: var(--header-background); }
1223
+ .rrow .rv { font-weight: 500; text-align: right; color: var(--color); }
1224
+ /* Barra de acciones (Ionic no trae "card actions"): pie alineado a la derecha, fondo transparente. */
1225
+ .ractions { display: flex; justify-content: flex-end; gap: 0.25rem; padding: 0 0.5rem 0.5rem; }
1224
1226
 
1225
1227
  /* ── Estado vacío ────────────────────────────────────────────────────────────────────── */
1226
1228
  .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3.5rem 1rem; text-align: center; color: var(--color-muted); }
1227
1229
  .empty .empty-ic { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 999px; background: var(--header-background); font-size: 26px; }
1228
1230
 
1229
1231
  .actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
1232
+ /* Spinner de acción en curso (loading): contenido dentro del ion-button small (Ionic lo fija
1233
+ * a 28px en el :host, por eso width/height y no font-size). Cubre tabla y tarjetas: los
1234
+ * botones de fila siempre van dentro de .actions. */
1235
+ .actions ion-spinner { width: 18px; height: 18px; }
1230
1236
 
1231
1237
  /* ── Pie: contador + paginación ──────────────────────────────────────────────────────── */
1232
1238
  .pager { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 1rem; border-top: 1px solid var(--border-color); background: var(--header-background); font-size: 12.5px; color: var(--color-muted); }
@@ -1342,9 +1348,10 @@ class _ extends g {
1342
1348
  t[r] = { values: o.values ? new Set(o.values) : void 0, from: o.from, to: o.to };
1343
1349
  return t;
1344
1350
  }
1345
- toggleFilterValue(e, t) {
1346
- const r = this.cloneFilters(this.filterDraft), o = new Set(r[e]?.values ?? []);
1347
- o.has(t) ? o.delete(t) : o.add(t), r[e] = { ...r[e], values: o }, this.filterDraft = r;
1351
+ // Fija el conjunto de valores seleccionados de una columna (multi-select del drawer = ion-select).
1352
+ setFilterValues(e, t) {
1353
+ const r = this.cloneFilters(this.filterDraft), o = (t ?? []).filter((a) => a != null && a !== "");
1354
+ o.length ? r[e] = { ...r[e], values: new Set(o) } : r[e] = { ...r[e], values: void 0 }, this.filterDraft = r;
1348
1355
  }
1349
1356
  setFilterRange(e, t, r) {
1350
1357
  const o = this.cloneFilters(this.filterDraft);
@@ -1504,6 +1511,12 @@ class _ extends g {
1504
1511
  openMenu(e) {
1505
1512
  this.menuEv = e, this.menuOpen = !0;
1506
1513
  }
1514
+ // Aplica la vista inicial declarada (`default-view`) una sola vez, tras el primer render. Es la
1515
+ // forma robusta de arrancar en tarjetas sin depender de fijar `viewMode` por referencia (que
1516
+ // falla si la tabla monta detrás de un `v-if`/loading y el ref aún es null).
1517
+ firstUpdated() {
1518
+ this.defaultView === "cards" && this.cardViewEnabled ? this.viewMode = "cards" : this.defaultView === "table" && (this.viewMode = "table");
1519
+ }
1507
1520
  setViewMode(e) {
1508
1521
  this.viewMode !== e && (this.viewMode = e, this.emit("viewChange", e));
1509
1522
  }
@@ -1627,16 +1640,21 @@ class _ extends g {
1627
1640
  return this.actions.length ? s`
1628
1641
  <div class="actions">
1629
1642
  ${this.actions.map(
1630
- (t) => s`
1643
+ (t) => {
1644
+ const r = t.loading?.(e) === !0, o = r || t.disabled?.(e) === !0;
1645
+ return s`
1631
1646
  <ion-button
1632
1647
  size="small"
1633
1648
  fill="clear"
1634
1649
  color=${t.color ?? "medium"}
1650
+ ?disabled=${o}
1651
+ aria-disabled=${o ? "true" : m}
1635
1652
  @click=${() => this.emit("rowAction", { actionId: t.id, row: e })}
1636
1653
  >
1637
- ${t.icon ? s`<ion-icon slot="icon-only" name=${t.icon}></ion-icon>` : t.label}
1654
+ ${r ? s`<ion-spinner slot="icon-only" name="dots"></ion-spinner>` : t.icon ? s`<ion-icon slot="icon-only" name=${t.icon}></ion-icon>` : t.label}
1638
1655
  </ion-button>
1639
- `
1656
+ `;
1657
+ }
1640
1658
  )}
1641
1659
  </div>
1642
1660
  ` : m;
@@ -1823,20 +1841,22 @@ class _ extends g {
1823
1841
  </div>
1824
1842
  `;
1825
1843
  }
1826
- const r = this.distinctValues(e), o = this.filterDraft[e.key]?.values ?? /* @__PURE__ */ new Set();
1844
+ const r = e.options ?? this.distinctValues(e).map((a) => ({ value: a, label: a })), o = [...this.filterDraft[e.key]?.values ?? /* @__PURE__ */ new Set()];
1827
1845
  return s`
1828
1846
  <div class="fblock">
1829
- <span class="flabel">${t}</span>
1830
- <div class="chips">
1831
- ${r.length === 0 ? s`<span class="chip-empty">${this.t.noValues}</span>` : r.map((a) => {
1832
- const i = o.has(a);
1833
- return s`
1834
- <button class=${`chip${i ? " on" : ""}`} @click=${() => this.toggleFilterValue(e.key, a)}>
1835
- ${i ? s`<ion-icon name="checkmark-outline"></ion-icon>` : m}${a}
1836
- </button>
1837
- `;
1838
- })}
1839
- </div>
1847
+ <ion-select
1848
+ label=${t}
1849
+ label-placement="stacked"
1850
+ fill="outline"
1851
+ multiple
1852
+ interface="modal"
1853
+ .interfaceOptions=${{ cssClass: "ok-overlay" }}
1854
+ placeholder=${this.t.select}
1855
+ .value=${o}
1856
+ @ionChange=${(a) => this.setFilterValues(e.key, a.detail.value ?? [])}
1857
+ >
1858
+ ${r.length === 0 ? s`<ion-select-option .disabled=${!0} value="">${this.t.noValues}</ion-select-option>` : r.map((a) => s`<ion-select-option value=${a.value}>${a.label}</ion-select-option>`)}
1859
+ </ion-select>
1840
1860
  </div>
1841
1861
  `;
1842
1862
  }
@@ -1906,21 +1926,21 @@ class _ extends g {
1906
1926
  (r) => {
1907
1927
  const o = this.keyOf(r), a = this.selectable && this.selection.has(o), i = this.cardIcon?.(r);
1908
1928
  return s`
1909
- <div class=${`rcard${a ? " selected" : ""}`}>
1929
+ <ion-card class=${`rcard${a ? " selected" : ""}`}>
1910
1930
  ${t ? s`
1911
- <header class="rcard-head">
1931
+ <ion-card-header class="rcard-head">
1912
1932
  ${i != null && i !== "" ? s`<span class="rc-icon">${typeof i == "string" ? s`<ion-icon name=${i}></ion-icon>` : i}</span>` : m}
1913
1933
  <span class="rc-title">${this.cardTitle ? this.cardTitle(r) : m}</span>
1914
1934
  ${this.selectable ? s`<ion-checkbox .checked=${a} aria-label=${this.t.select} @ionChange=${() => this.toggleRow(o)}></ion-checkbox>` : m}
1915
- </header>
1935
+ </ion-card-header>
1916
1936
  ` : m}
1917
- <div class="rcard-body">
1937
+ <ion-card-content class="rcard-body">
1918
1938
  ${this.renderCard ? this.renderCard(r) : this.visibleColumns.map(
1919
1939
  (c) => s`<div class="rrow"><span class="rk">${c.header}</span><span class="rv">${c.render ? c.render(r) : this.cell(c, r)}</span></div>`
1920
1940
  )}
1921
- </div>
1941
+ </ion-card-content>
1922
1942
  ${this.actions.length ? s`<div class="ractions">${this.actionButtons(r)}</div>` : m}
1923
- </div>
1943
+ </ion-card>
1924
1944
  `;
1925
1945
  }
1926
1946
  )}
@@ -2000,6 +2020,9 @@ C([
2000
2020
  C([
2001
2021
  l({ attribute: !1 })
2002
2022
  ], _.prototype, "views", 2);
2023
+ C([
2024
+ l({ attribute: "default-view" })
2025
+ ], _.prototype, "defaultView", 2);
2003
2026
  C([
2004
2027
  l({ type: Boolean })
2005
2028
  ], _.prototype, "exportable", 2);
@@ -3612,7 +3635,7 @@ sa([
3612
3635
  l({ attribute: !1 })
3613
3636
  ], uo.prototype, "labels", 2);
3614
3637
  y("ok-stepper", uo);
3615
- var rs = Object.defineProperty, os = Object.getOwnPropertyDescriptor, Lr = (n, e, t, r) => {
3638
+ var rs = Object.defineProperty, os = Object.getOwnPropertyDescriptor, Ir = (n, e, t, r) => {
3616
3639
  for (var o = r > 1 ? void 0 : r ? os(e, t) : e, a = n.length - 1, i; a >= 0; a--)
3617
3640
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
3618
3641
  return r && o && rs(e, t, o), o;
@@ -3728,19 +3751,19 @@ class Jt extends g {
3728
3751
  `;
3729
3752
  }
3730
3753
  }
3731
- Lr([
3754
+ Ir([
3732
3755
  l({ attribute: !1 })
3733
3756
  ], Jt.prototype, "steps", 2);
3734
- Lr([
3757
+ Ir([
3735
3758
  l({ type: Number })
3736
3759
  ], Jt.prototype, "current", 2);
3737
- Lr([
3760
+ Ir([
3738
3761
  l()
3739
3762
  ], Jt.prototype, "backLabel", 2);
3740
- Lr([
3763
+ Ir([
3741
3764
  l()
3742
3765
  ], Jt.prototype, "nextLabel", 2);
3743
- Lr([
3766
+ Ir([
3744
3767
  l()
3745
3768
  ], Jt.prototype, "finishLabel", 2);
3746
3769
  y("ok-wizard", Jt);
@@ -5059,7 +5082,7 @@ const xs = {
5059
5082
  empty: "No apps",
5060
5083
  close: "Close"
5061
5084
  };
5062
- class Ir extends g {
5085
+ class Lr extends g {
5063
5086
  constructor() {
5064
5087
  super(...arguments), this.apps = [], this.labels = {}, this.open = !1, this.shown = !1, this.onKeydown = (e) => {
5065
5088
  e.key === "Escape" && this.close();
@@ -5397,17 +5420,17 @@ class Ir extends g {
5397
5420
  }
5398
5421
  mo([
5399
5422
  l({ attribute: !1 })
5400
- ], Ir.prototype, "apps", 2);
5423
+ ], Lr.prototype, "apps", 2);
5401
5424
  mo([
5402
5425
  l({ attribute: !1 })
5403
- ], Ir.prototype, "labels", 2);
5426
+ ], Lr.prototype, "labels", 2);
5404
5427
  mo([
5405
5428
  v()
5406
- ], Ir.prototype, "open", 2);
5429
+ ], Lr.prototype, "open", 2);
5407
5430
  mo([
5408
5431
  v()
5409
- ], Ir.prototype, "shown", 2);
5410
- y("ok-app-launcher", Ir);
5432
+ ], Lr.prototype, "shown", 2);
5433
+ y("ok-app-launcher", Lr);
5411
5434
  var ys = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, er = (n, e, t, r) => {
5412
5435
  for (var o = r > 1 ? void 0 : r ? ks(e, t) : e, a = n.length - 1, i; a >= 0; a--)
5413
5436
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
@@ -6531,13 +6554,13 @@ vo([
6531
6554
  l({ attribute: !1 })
6532
6555
  ], Tr.prototype, "labels", 2);
6533
6556
  vo([
6534
- I("input")
6557
+ L("input")
6535
6558
  ], Tr.prototype, "firstInput", 2);
6536
6559
  y("ok-otp", Tr);
6537
- var Ls = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, Ge = (n, e, t, r) => {
6538
- for (var o = r > 1 ? void 0 : r ? Is(e, t) : e, a = n.length - 1, i; a >= 0; a--)
6560
+ var Is = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, Ge = (n, e, t, r) => {
6561
+ for (var o = r > 1 ? void 0 : r ? Ls(e, t) : e, a = n.length - 1, i; a >= 0; a--)
6539
6562
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
6540
- return r && o && Ls(e, t, o), o;
6563
+ return r && o && Is(e, t, o), o;
6541
6564
  };
6542
6565
  const Ts = {
6543
6566
  keypad: "Number pad",
@@ -7420,7 +7443,7 @@ ze([
7420
7443
  v()
7421
7444
  ], ie.prototype, "error", 2);
7422
7445
  ze([
7423
- I('input[type="file"]')
7446
+ L('input[type="file"]')
7424
7447
  ], ie.prototype, "input", 2);
7425
7448
  y("ok-dropzone", ie);
7426
7449
  var Ys = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, rr = (n, e, t, r) => {
@@ -7819,10 +7842,10 @@ Mt([
7819
7842
  l({ attribute: !1 })
7820
7843
  ], Je.prototype, "labels", 2);
7821
7844
  Mt([
7822
- I(".log")
7845
+ L(".log")
7823
7846
  ], Je.prototype, "logEl", 2);
7824
7847
  Mt([
7825
- I("ion-textarea")
7848
+ L("ion-textarea")
7826
7849
  ], Je.prototype, "textareaEl", 2);
7827
7850
  y("ok-chat", Je);
7828
7851
  var Zs = Object.defineProperty, Js = Object.getOwnPropertyDescriptor, _e = (n, e, t, r) => {
@@ -9144,7 +9167,7 @@ Dt([
9144
9167
  v()
9145
9168
  ], tt.prototype, "slottedCount", 2);
9146
9169
  Dt([
9147
- I(".track")
9170
+ L(".track")
9148
9171
  ], tt.prototype, "trackEl", 2);
9149
9172
  y("ok-carousel", tt);
9150
9173
  var ln = Object.defineProperty, cn = Object.getOwnPropertyDescriptor, At = (n, e, t, r) => {
@@ -9340,7 +9363,7 @@ At([
9340
9363
  l({ attribute: !1 })
9341
9364
  ], rt.prototype, "labels", 2);
9342
9365
  At([
9343
- I("canvas")
9366
+ L("canvas")
9344
9367
  ], rt.prototype, "canvas", 2);
9345
9368
  y("ok-signature", rt);
9346
9369
  var pn = Object.defineProperty, hn = Object.getOwnPropertyDescriptor, or = (n, e, t, r) => {
@@ -10137,7 +10160,7 @@ Se([
10137
10160
  v()
10138
10161
  ], ne.prototype, "muted", 2);
10139
10162
  Se([
10140
- I("audio")
10163
+ L("audio")
10141
10164
  ], ne.prototype, "audioEl", 2);
10142
10165
  y("ok-audio", ne);
10143
10166
  var Mn = Object.defineProperty, Dn = Object.getOwnPropertyDescriptor, le = (n, e, t, r) => {
@@ -10456,18 +10479,18 @@ le([
10456
10479
  v()
10457
10480
  ], G.prototype, "muted", 2);
10458
10481
  le([
10459
- I("video")
10482
+ L("video")
10460
10483
  ], G.prototype, "videoEl", 2);
10461
10484
  le([
10462
- I(".stage")
10485
+ L(".stage")
10463
10486
  ], G.prototype, "stageEl", 2);
10464
10487
  y("ok-video", G);
10465
- var jn = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, bo = (n, e, t, r) => {
10466
- for (var o = r > 1 ? void 0 : r ? Ln(e, t) : e, a = n.length - 1, i; a >= 0; a--)
10488
+ var jn = Object.defineProperty, In = Object.getOwnPropertyDescriptor, bo = (n, e, t, r) => {
10489
+ for (var o = r > 1 ? void 0 : r ? In(e, t) : e, a = n.length - 1, i; a >= 0; a--)
10467
10490
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
10468
10491
  return r && o && jn(e, t, o), o;
10469
10492
  };
10470
- const In = {
10493
+ const Ln = {
10471
10494
  documentTitle: "PDF document",
10472
10495
  open: "Open",
10473
10496
  openAria: "Open or download PDF",
@@ -10557,7 +10580,7 @@ class Br extends g {
10557
10580
  `;
10558
10581
  }
10559
10582
  get t() {
10560
- return { ...In, ...this.labels };
10583
+ return { ...Ln, ...this.labels };
10561
10584
  }
10562
10585
  // Abre el PDF en una pestaña nueva (descarga / vista a pantalla completa del navegador).
10563
10586
  open() {
@@ -11228,7 +11251,7 @@ const Yn = {
11228
11251
  decrement: "Decrease",
11229
11252
  increment: "Increase"
11230
11253
  };
11231
- class Lt extends g {
11254
+ class It extends g {
11232
11255
  constructor() {
11233
11256
  super(...arguments), this.value = 0, this.min = 0, this.step = 1, this.disabled = !1, this.labels = {};
11234
11257
  }
@@ -11385,23 +11408,23 @@ class Lt extends g {
11385
11408
  }
11386
11409
  ar([
11387
11410
  l({ type: Number })
11388
- ], Lt.prototype, "value", 2);
11411
+ ], It.prototype, "value", 2);
11389
11412
  ar([
11390
11413
  l({ type: Number })
11391
- ], Lt.prototype, "min", 2);
11414
+ ], It.prototype, "min", 2);
11392
11415
  ar([
11393
11416
  l({ type: Number })
11394
- ], Lt.prototype, "max", 2);
11417
+ ], It.prototype, "max", 2);
11395
11418
  ar([
11396
11419
  l({ type: Number })
11397
- ], Lt.prototype, "step", 2);
11420
+ ], It.prototype, "step", 2);
11398
11421
  ar([
11399
11422
  l({ type: Boolean, reflect: !0 })
11400
- ], Lt.prototype, "disabled", 2);
11423
+ ], It.prototype, "disabled", 2);
11401
11424
  ar([
11402
11425
  l({ attribute: !1 })
11403
- ], Lt.prototype, "labels", 2);
11404
- y("ok-qty-stepper", Lt);
11426
+ ], It.prototype, "labels", 2);
11427
+ y("ok-qty-stepper", It);
11405
11428
  var Xn = Object.defineProperty, Wn = Object.getOwnPropertyDescriptor, ot = (n, e, t, r) => {
11406
11429
  for (var o = r > 1 ? void 0 : r ? Wn(e, t) : e, a = n.length - 1, i; a >= 0; a--)
11407
11430
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
@@ -11801,7 +11824,7 @@ ot([
11801
11824
  v()
11802
11825
  ], Ee.prototype, "activeIndex", 2);
11803
11826
  ot([
11804
- I(".search input")
11827
+ L(".search input")
11805
11828
  ], Ee.prototype, "searchInput", 2);
11806
11829
  y("ok-command-palette", Ee);
11807
11830
  var Qn = Object.defineProperty, Zn = Object.getOwnPropertyDescriptor, Pe = (n, e, t, r) => {
@@ -11866,7 +11889,7 @@ function oo(n) {
11866
11889
  b: parseInt(e.slice(4, 6), 16)
11867
11890
  } : null;
11868
11891
  }
11869
- function Lo(n) {
11892
+ function Io(n) {
11870
11893
  const e = oo(n);
11871
11894
  return e ? _r(e) : null;
11872
11895
  }
@@ -12171,7 +12194,7 @@ class ce extends g {
12171
12194
  // Maneja la edición del input hex: valida y, si es correcto, deriva el HSV y emite.
12172
12195
  onHexInput(e) {
12173
12196
  this.hexInput = e;
12174
- const t = Lo(e);
12197
+ const t = Io(e);
12175
12198
  if (!t) {
12176
12199
  this.hexInvalid = !0;
12177
12200
  return;
@@ -12183,7 +12206,7 @@ class ce extends g {
12183
12206
  // --- Presets ---
12184
12207
  // Selecciona un swatch preset: deriva HSV/hex y emite.
12185
12208
  selectPreset(e) {
12186
- const t = Lo(e);
12209
+ const t = Io(e);
12187
12210
  if (!t) return;
12188
12211
  const r = oo(t), { h: o, s: a, v: i } = Ao(r.r, r.g, r.b);
12189
12212
  this.h = o, this.s = a, this.v = i, this.value = t, this.hexInput = t, this.hexInvalid = !1, this.emit(t, r);
@@ -12233,7 +12256,7 @@ class ce extends g {
12233
12256
  </div>
12234
12257
  ${this.presets.length ? s`<div class="presets">
12235
12258
  ${this.presets.map((i) => {
12236
- const c = Lo(i), d = c !== null && c === this.value.toLowerCase();
12259
+ const c = Io(i), d = c !== null && c === this.value.toLowerCase();
12237
12260
  return s`<button
12238
12261
  type="button"
12239
12262
  class=${d ? "active" : ""}
@@ -12846,7 +12869,7 @@ Me([
12846
12869
  l({ attribute: !1 })
12847
12870
  ], pe.prototype, "labels", 2);
12848
12871
  Me([
12849
- I(".panel")
12872
+ L(".panel")
12850
12873
  ], pe.prototype, "panel", 2);
12851
12874
  y("ok-drawer", pe);
12852
12875
  var ll = Object.defineProperty, cl = Object.getOwnPropertyDescriptor, at = (n, e, t, r) => {
@@ -13616,7 +13639,7 @@ var kl = Object.defineProperty, wl = Object.getOwnPropertyDescriptor, nr = (n, e
13616
13639
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
13617
13640
  return r && o && kl(e, t, o), o;
13618
13641
  };
13619
- class It extends g {
13642
+ class Lt extends g {
13620
13643
  static {
13621
13644
  this.styles = x`
13622
13645
  :host {
@@ -13760,23 +13783,23 @@ class It extends g {
13760
13783
  }
13761
13784
  nr([
13762
13785
  l()
13763
- ], It.prototype, "icon", 2);
13786
+ ], Lt.prototype, "icon", 2);
13764
13787
  nr([
13765
13788
  l()
13766
- ], It.prototype, "category", 2);
13789
+ ], Lt.prototype, "category", 2);
13767
13790
  nr([
13768
13791
  l()
13769
- ], It.prototype, "name", 2);
13792
+ ], Lt.prototype, "name", 2);
13770
13793
  nr([
13771
13794
  l()
13772
- ], It.prototype, "badge", 2);
13795
+ ], Lt.prototype, "badge", 2);
13773
13796
  nr([
13774
13797
  l()
13775
- ], It.prototype, "price", 2);
13798
+ ], Lt.prototype, "price", 2);
13776
13799
  nr([
13777
13800
  l()
13778
- ], It.prototype, "href", 2);
13779
- y("ok-product-card", It);
13801
+ ], Lt.prototype, "href", 2);
13802
+ y("ok-product-card", Lt);
13780
13803
  var $l = Object.defineProperty, zl = Object.getOwnPropertyDescriptor, oi = (n, e, t, r) => {
13781
13804
  for (var o = r > 1 ? void 0 : r ? zl(e, t) : e, a = n.length - 1, i; a >= 0; a--)
13782
13805
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
@@ -14276,9 +14299,9 @@ var Dl = Object.defineProperty, Al = Object.getOwnPropertyDescriptor, Vr = (n, e
14276
14299
  const jl = {
14277
14300
  menu: "Menu",
14278
14301
  close: "Close"
14279
- }, Ll = "(max-width: 800px)";
14302
+ }, Il = "(max-width: 800px)";
14280
14303
  let ja = !1;
14281
- function Il() {
14304
+ function Ll() {
14282
14305
  if (ja) return;
14283
14306
  ja = !0;
14284
14307
  const n = new CSSStyleSheet();
@@ -14434,7 +14457,7 @@ class cr extends g {
14434
14457
  return { ...jl, ...this.labels };
14435
14458
  }
14436
14459
  connectedCallback() {
14437
- super.connectedCallback(), this.mq = window.matchMedia(Ll), this.isMobile = this.mq.matches, this.mq.addEventListener("change", this.onMqChange);
14460
+ super.connectedCallback(), this.mq = window.matchMedia(Il), this.isMobile = this.mq.matches, this.mq.addEventListener("change", this.onMqChange);
14438
14461
  }
14439
14462
  disconnectedCallback() {
14440
14463
  super.disconnectedCallback(), this.mq?.removeEventListener("change", this.onMqChange), this.mq = null, this.restoreNodes(), this.modal?.remove(), this.modal = null;
@@ -14462,7 +14485,7 @@ class cr extends g {
14462
14485
  }
14463
14486
  async presentPanel() {
14464
14487
  if (this.isMobile) {
14465
- if (Il(), this.modal || (this.modal = this.buildModal()), this.movedNodes.length === 0 && this.linksHost && this.actionsHost)
14488
+ if (Ll(), this.modal || (this.modal = this.buildModal()), this.movedNodes.length === 0 && this.linksHost && this.actionsHost)
14466
14489
  for (const e of Array.from(this.children)) {
14467
14490
  const t = e.getAttribute("slot");
14468
14491
  t !== "brand" && (this.movedNodes.push(e), (t === "actions" ? this.actionsHost : this.linksHost).appendChild(e));
@@ -14615,7 +14638,7 @@ class Bl extends g {
14615
14638
  }
14616
14639
  }
14617
14640
  y("ok-hero", Bl);
14618
- var Fl = Object.defineProperty, Rl = Object.getOwnPropertyDescriptor, Le = (n, e, t, r) => {
14641
+ var Fl = Object.defineProperty, Rl = Object.getOwnPropertyDescriptor, Ie = (n, e, t, r) => {
14619
14642
  for (var o = r > 1 ? void 0 : r ? Rl(e, t) : e, a = n.length - 1, i; a >= 0; a--)
14620
14643
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
14621
14644
  return r && o && Fl(e, t, o), o;
@@ -14897,31 +14920,31 @@ class ue extends g {
14897
14920
  `;
14898
14921
  }
14899
14922
  }
14900
- Le([
14923
+ Ie([
14901
14924
  l({ type: Number })
14902
14925
  ], ue.prototype, "total", 2);
14903
- Le([
14926
+ Ie([
14904
14927
  l({ type: Number })
14905
14928
  ], ue.prototype, "page", 2);
14906
- Le([
14929
+ Ie([
14907
14930
  l({ type: Number, attribute: "page-size" })
14908
14931
  ], ue.prototype, "pageSize", 2);
14909
- Le([
14932
+ Ie([
14910
14933
  l({ type: Number, attribute: "sibling-count" })
14911
14934
  ], ue.prototype, "siblingCount", 2);
14912
- Le([
14935
+ Ie([
14913
14936
  l({ type: Number, attribute: "boundary-count" })
14914
14937
  ], ue.prototype, "boundaryCount", 2);
14915
- Le([
14938
+ Ie([
14916
14939
  l()
14917
14940
  ], ue.prototype, "variant", 2);
14918
- Le([
14941
+ Ie([
14919
14942
  l({ type: Boolean })
14920
14943
  ], ue.prototype, "info", 2);
14921
- Le([
14944
+ Ie([
14922
14945
  l({ type: Array, attribute: "page-size-options" })
14923
14946
  ], ue.prototype, "pageSizeOptions", 2);
14924
- Le([
14947
+ Ie([
14925
14948
  l()
14926
14949
  ], ue.prototype, "label", 2);
14927
14950
  y("ok-pagination", ue);
@@ -14930,7 +14953,7 @@ var Nl = Object.defineProperty, ql = Object.getOwnPropertyDescriptor, st = (n, e
14930
14953
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
14931
14954
  return r && o && Nl(e, t, o), o;
14932
14955
  };
14933
- class Ie extends g {
14956
+ class Le extends g {
14934
14957
  constructor() {
14935
14958
  super(...arguments), this.variant = "text", this.lines = 1, this.preset = "none", this.rows = 5, this.cols = 4;
14936
14959
  }
@@ -15219,29 +15242,29 @@ class Ie extends g {
15219
15242
  }
15220
15243
  st([
15221
15244
  l()
15222
- ], Ie.prototype, "variant", 2);
15245
+ ], Le.prototype, "variant", 2);
15223
15246
  st([
15224
15247
  l({ type: Number })
15225
- ], Ie.prototype, "lines", 2);
15248
+ ], Le.prototype, "lines", 2);
15226
15249
  st([
15227
15250
  l()
15228
- ], Ie.prototype, "width", 2);
15251
+ ], Le.prototype, "width", 2);
15229
15252
  st([
15230
15253
  l()
15231
- ], Ie.prototype, "height", 2);
15254
+ ], Le.prototype, "height", 2);
15232
15255
  st([
15233
15256
  l()
15234
- ], Ie.prototype, "radius", 2);
15257
+ ], Le.prototype, "radius", 2);
15235
15258
  st([
15236
15259
  l()
15237
- ], Ie.prototype, "preset", 2);
15260
+ ], Le.prototype, "preset", 2);
15238
15261
  st([
15239
15262
  l({ type: Number })
15240
- ], Ie.prototype, "rows", 2);
15263
+ ], Le.prototype, "rows", 2);
15241
15264
  st([
15242
15265
  l({ type: Number })
15243
- ], Ie.prototype, "cols", 2);
15244
- y("ok-skeleton", Ie);
15266
+ ], Le.prototype, "cols", 2);
15267
+ y("ok-skeleton", Le);
15245
15268
  var Ul = Object.defineProperty, Vl = Object.getOwnPropertyDescriptor, Q = (n, e, t, r) => {
15246
15269
  for (var o = r > 1 ? void 0 : r ? Vl(e, t) : e, a = n.length - 1, i; a >= 0; a--)
15247
15270
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
@@ -15847,7 +15870,7 @@ var Yl = Object.defineProperty, Xl = Object.getOwnPropertyDescriptor, Tt = (n, e
15847
15870
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
15848
15871
  return r && o && Yl(e, t, o), o;
15849
15872
  };
15850
- const La = [
15873
+ const Ia = [
15851
15874
  "var(--ok-primary, var(--ion-color-primary, #3880ff))",
15852
15875
  "var(--ok-success, var(--ion-color-success, #2dd36f))",
15853
15876
  "var(--ok-warning, var(--ion-color-warning, #ffc409))",
@@ -15957,7 +15980,7 @@ class lt extends g {
15957
15980
  }
15958
15981
  // Color efectivo de un slice (su color o el de la paleta por índice).
15959
15982
  colorAt(e, t) {
15960
- return e.color || La[t % La.length];
15983
+ return e.color || Ia[t % Ia.length];
15961
15984
  }
15962
15985
  // Porcentaje (0–100) de un slice sobre el total.
15963
15986
  pct(e) {
@@ -16085,7 +16108,7 @@ var Wl = Object.defineProperty, Gl = Object.getOwnPropertyDescriptor, dr = (n, e
16085
16108
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
16086
16109
  return r && o && Wl(e, t, o), o;
16087
16110
  };
16088
- const Ia = [
16111
+ const La = [
16089
16112
  "Ene",
16090
16113
  "Feb",
16091
16114
  "Mar",
@@ -16274,8 +16297,8 @@ class Bt extends g {
16274
16297
  }
16275
16298
  return s`<div class="year" role="grid" aria-label="Heatmap anual">
16276
16299
  ${t.map(
16277
- (r, o) => s`<div class="month" role="row" aria-label=${Ia[o]}>
16278
- <div class="month-label">${Ia[o]}</div>
16300
+ (r, o) => s`<div class="month" role="row" aria-label=${La[o]}>
16301
+ <div class="month-label">${La[o]}</div>
16279
16302
  <div class="days">
16280
16303
  ${r.slice().sort((a, i) => a.day - i.day).map((a) => this.renderCell(a.cell))}
16281
16304
  </div>
@@ -17651,7 +17674,7 @@ me([
17651
17674
  v()
17652
17675
  ], Z.prototype, "openSub", 2);
17653
17676
  y("ok-menu", Z);
17654
- var vc = Object.defineProperty, bc = Object.getOwnPropertyDescriptor, L = (n, e, t, r) => {
17677
+ var vc = Object.defineProperty, bc = Object.getOwnPropertyDescriptor, I = (n, e, t, r) => {
17655
17678
  for (var o = r > 1 ? void 0 : r ? bc(e, t) : e, a = n.length - 1, i; a >= 0; a--)
17656
17679
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
17657
17680
  return r && o && vc(e, t, o), o;
@@ -18012,59 +18035,59 @@ class j extends g {
18012
18035
  `;
18013
18036
  }
18014
18037
  }
18015
- L([
18038
+ I([
18016
18039
  l()
18017
18040
  ], j.prototype, "name", 2);
18018
- L([
18041
+ I([
18019
18042
  l()
18020
18043
  ], j.prototype, "badge", 2);
18021
- L([
18044
+ I([
18022
18045
  l()
18023
18046
  ], j.prototype, "handle", 2);
18024
- L([
18047
+ I([
18025
18048
  l()
18026
18049
  ], j.prototype, "avatar", 2);
18027
- L([
18050
+ I([
18028
18051
  l({ attribute: "avatar-src" })
18029
18052
  ], j.prototype, "avatarSrc", 2);
18030
- L([
18053
+ I([
18031
18054
  l()
18032
18055
  ], j.prototype, "body", 2);
18033
- L([
18056
+ I([
18034
18057
  l({ attribute: !1 })
18035
18058
  ], j.prototype, "stats", 2);
18036
- L([
18059
+ I([
18037
18060
  l({ attribute: !1 })
18038
18061
  ], j.prototype, "actions", 2);
18039
- L([
18062
+ I([
18040
18063
  l()
18041
18064
  ], j.prototype, "placement", 2);
18042
- L([
18065
+ I([
18043
18066
  l({ type: Number, attribute: "open-delay" })
18044
18067
  ], j.prototype, "openDelay", 2);
18045
- L([
18068
+ I([
18046
18069
  l({ type: Number, attribute: "close-delay" })
18047
18070
  ], j.prototype, "closeDelay", 2);
18048
- L([
18071
+ I([
18049
18072
  l({ attribute: !1 })
18050
18073
  ], j.prototype, "labels", 2);
18051
- L([
18074
+ I([
18052
18075
  v()
18053
18076
  ], j.prototype, "open", 2);
18054
- L([
18077
+ I([
18055
18078
  v()
18056
18079
  ], j.prototype, "shown", 2);
18057
- L([
18080
+ I([
18058
18081
  v()
18059
18082
  ], j.prototype, "end", 2);
18060
- L([
18083
+ I([
18061
18084
  v()
18062
18085
  ], j.prototype, "above", 2);
18063
- L([
18064
- I(".card")
18086
+ I([
18087
+ L(".card")
18065
18088
  ], j.prototype, "cardEl", 2);
18066
- L([
18067
- I(".trigger")
18089
+ I([
18090
+ L(".trigger")
18068
18091
  ], j.prototype, "triggerEl", 2);
18069
18092
  y("ok-hover-card", j);
18070
18093
  var gc = Object.defineProperty, xc = Object.getOwnPropertyDescriptor, mr = (n, e, t, r) => {
@@ -20074,10 +20097,10 @@ class F extends g {
20074
20097
  );
20075
20098
  }
20076
20099
  prevMonth() {
20077
- this.viewDate = Io(this.viewDate, -1);
20100
+ this.viewDate = Lo(this.viewDate, -1);
20078
20101
  }
20079
20102
  nextMonth() {
20080
- this.viewDate = Io(this.viewDate, 1);
20103
+ this.viewDate = Lo(this.viewDate, 1);
20081
20104
  }
20082
20105
  // ---- Presets -------------------------------------------------------------
20083
20106
  applyPreset(e) {
@@ -20188,7 +20211,7 @@ class F extends g {
20188
20211
  aria-modal="false"
20189
20212
  >
20190
20213
  <div class="months ${this.months === 2 ? "two" : ""}">
20191
- ${t.map((r) => this.renderMonth(Io(this.viewDate, r), r))}
20214
+ ${t.map((r) => this.renderMonth(Lo(this.viewDate, r), r))}
20192
20215
  </div>
20193
20216
  ${this.presets && this.presets.length ? s`<div class="presets" role="group">
20194
20217
  ${this.presets.map(
@@ -20338,7 +20361,7 @@ function Xt(n) {
20338
20361
  function eo(n) {
20339
20362
  return new Date(n.getFullYear(), n.getMonth() + 1, 0);
20340
20363
  }
20341
- function Io(n, e) {
20364
+ function Lo(n, e) {
20342
20365
  return new Date(n.getFullYear(), n.getMonth() + e, 1);
20343
20366
  }
20344
20367
  function Wt(n, e) {
@@ -20357,10 +20380,10 @@ function jc(n) {
20357
20380
  return r;
20358
20381
  }
20359
20382
  y("ok-date-picker", F);
20360
- var Lc = Object.defineProperty, Ic = Object.getOwnPropertyDescriptor, Fe = (n, e, t, r) => {
20361
- for (var o = r > 1 ? void 0 : r ? Ic(e, t) : e, a = n.length - 1, i; a >= 0; a--)
20383
+ var Ic = Object.defineProperty, Lc = Object.getOwnPropertyDescriptor, Fe = (n, e, t, r) => {
20384
+ for (var o = r > 1 ? void 0 : r ? Lc(e, t) : e, a = n.length - 1, i; a >= 0; a--)
20362
20385
  (i = n[a]) && (o = (r ? i(e, t, o) : i(o)) || o);
20363
- return r && o && Lc(e, t, o), o;
20386
+ return r && o && Ic(e, t, o), o;
20364
20387
  };
20365
20388
  function To(n) {
20366
20389
  if (!n) return null;
@@ -21749,7 +21772,7 @@ fe([
21749
21772
  v()
21750
21773
  ], J.prototype, "words", 2);
21751
21774
  fe([
21752
- I(".content")
21775
+ L(".content")
21753
21776
  ], J.prototype, "contentEl", 2);
21754
21777
  let Vc = J;
21755
21778
  y("ok-rich-text", Vc);
@@ -27205,6 +27228,6 @@ N([
27205
27228
  v()
27206
27229
  ], T.prototype, "dragging", 2);
27207
27230
  N([
27208
- I('input[type="file"]')
27231
+ L('input[type="file"]')
27209
27232
  ], T.prototype, "fileInput", 2);
27210
27233
  y("ok-file-manager", T);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erplora/outfitkit",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "OutfitKit — librería de Web Components (Lit) que CONSTRUYE lo que Ionic no tiene (tree, data-table rica, inline-feedback, kpi/stat, stepper/wizard, calendar, kanban…) sobre primitivos de Ionic. Ionic es la base; OutfitKit cubre los huecos. npm + CDN, imports individuales, CSP-safe. Tema vía tokens --ok-* (fallback a --ion-*).",
5
5
  "type": "module",
6
6
  "license": "MIT",