@mono-lit/helper 0.0.5 → 0.0.6

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.
Files changed (86) hide show
  1. package/dist/{form-control-core-CIdMLXMo.js → form-control-core-rW2WvOcb.js} +1 -1
  2. package/dist/{hydration-flush-DHrl4_KK.js → hydration-flush-9AJE8FRl.js} +398 -1
  3. package/dist/index.js +3 -3
  4. package/dist/{index.node-DzCuvHLg.js → index.node-tTkISFn2.js} +1 -1
  5. package/dist/index.node.js +3 -3
  6. package/dist/{light-slots-DdDdZ6zs.js → light-slots-BnBR29E7.js} +1 -1
  7. package/dist/{light-slots-4ZCjOcBg.js → light-slots-Cb6e-LU3.js} +1 -1
  8. package/dist/{mono-button-CeDB9khW.js → mono-button-Cy5-Y0At.js} +3 -3
  9. package/dist/{mono-button.shadow-D9NdMsmH.js → mono-button.shadow-CIBGisyo.js} +1 -2
  10. package/dist/{mono-element-C7vCschg.js → mono-element-Bc9wElPy.js} +1 -1
  11. package/dist/mono-ui-KOBJcnXk.js +758 -0
  12. package/dist/src/components/table/column-autosize.d.ts +74 -0
  13. package/dist/src/components/table/mono-data-grid.d.ts +10 -0
  14. package/dist/src/components/table/mono-table-th-core.d.ts +3 -0
  15. package/dist/src/components/table/table-types.d.ts +8 -1
  16. package/dist/src/components/tag-input/mono-tag-input.d.ts +12 -0
  17. package/dist/src/components/tag-input/mono-tag-input.shadow.d.ts +9 -1
  18. package/dist/src/components/tag-input/tag-input-core.d.ts +9 -1
  19. package/dist/src/components/tag-input/tag-input-types.d.ts +2 -0
  20. package/dist/src/composables/mono-size-attrs.d.ts +10 -0
  21. package/dist/src/entries/index.d.ts +2 -1
  22. package/dist/src/entries/index.node.d.ts +2 -1
  23. package/dist/ui/accordion.js +3 -3
  24. package/dist/ui/alert.js +2 -2
  25. package/dist/ui/breadcrumb.js +3 -3
  26. package/dist/ui/button-dropdown.js +2 -2
  27. package/dist/ui/button.js +1 -1
  28. package/dist/ui/card.js +3 -3
  29. package/dist/ui/chart.js +2 -3
  30. package/dist/ui/checkbox.js +3 -3
  31. package/dist/ui/chip.js +2 -2
  32. package/dist/ui/date.js +2 -2
  33. package/dist/ui/drawer.js +3 -3
  34. package/dist/ui/dropdown-table.js +3 -4
  35. package/dist/ui/dropdown.js +3 -3
  36. package/dist/ui/file-upload.js +3 -3
  37. package/dist/ui/filter.js +2 -2
  38. package/dist/ui/index.css +1665 -4815
  39. package/dist/ui/input.js +3 -4
  40. package/dist/ui/menu.js +3 -3
  41. package/dist/ui/modal.js +4 -4
  42. package/dist/ui/nav.js +3 -3
  43. package/dist/ui/otp.js +3 -4
  44. package/dist/ui/radio.js +3 -3
  45. package/dist/ui/rich-text-editor.js +3 -4
  46. package/dist/ui/select.js +3 -4
  47. package/dist/ui/shadow/accordion.js +1 -1
  48. package/dist/ui/shadow/alert.js +1 -1
  49. package/dist/ui/shadow/breadcrumb.js +1 -1
  50. package/dist/ui/shadow/button-dropdown.js +2 -2
  51. package/dist/ui/shadow/button.js +1 -1
  52. package/dist/ui/shadow/card.js +1 -2
  53. package/dist/ui/shadow/chart.js +1 -2
  54. package/dist/ui/shadow/checkbox.js +2 -2
  55. package/dist/ui/shadow/chip.js +1 -1
  56. package/dist/ui/shadow/date.js +2 -3
  57. package/dist/ui/shadow/drawer.js +1 -1
  58. package/dist/ui/shadow/dropdown-table.js +2 -3
  59. package/dist/ui/shadow/dropdown.js +1 -1
  60. package/dist/ui/shadow/file-upload.js +2 -2
  61. package/dist/ui/shadow/filter.js +1 -2
  62. package/dist/ui/shadow/input.js +2 -3
  63. package/dist/ui/shadow/menu.js +1 -1
  64. package/dist/ui/shadow/modal.js +2 -2
  65. package/dist/ui/shadow/nav.js +1 -1
  66. package/dist/ui/shadow/otp.js +2 -3
  67. package/dist/ui/shadow/radio.js +2 -2
  68. package/dist/ui/shadow/rich-text-editor.js +2 -3
  69. package/dist/ui/shadow/select.js +3 -4
  70. package/dist/ui/shadow/sidebar.js +1 -1
  71. package/dist/ui/shadow/slider.js +2 -3
  72. package/dist/ui/shadow/switch.js +2 -2
  73. package/dist/ui/shadow/table.js +34 -5
  74. package/dist/ui/shadow/tabs.js +1 -1
  75. package/dist/ui/shadow/tag-input.js +89 -9
  76. package/dist/ui/shadow/textarea.js +2 -3
  77. package/dist/ui/sidebar.js +3 -3
  78. package/dist/ui/slider.js +3 -4
  79. package/dist/ui/switch.js +3 -3
  80. package/dist/ui/table.js +35 -6
  81. package/dist/ui/tabs.js +3 -3
  82. package/dist/ui/tag-input.js +101 -5
  83. package/dist/ui/textarea.js +3 -4
  84. package/package.json +2 -2
  85. package/dist/css-size-DWAPgQdT.js +0 -38
  86. package/dist/mono-ui-BwUc0L6B.js +0 -360
@@ -1,4 +1,4 @@
1
- import { a as __decorate, c as defineHybridPropAlias, l as defineHybridPropAliases, s as booleanStringConverter } from "./hydration-flush-DHrl4_KK.js";
1
+ import { a as __decorate, c as defineHybridPropAlias, l as defineHybridPropAliases, s as booleanStringConverter } from "./hydration-flush-9AJE8FRl.js";
2
2
  import { n as detachEventHandlers, t as applyProps } from "./element-props-xvw0EB7H.js";
3
3
  import { property } from "lit/decorators.js";
4
4
 
@@ -217,6 +217,403 @@ function monoHostChildren(host) {
217
217
  return Array.from(host.children).filter((n) => !isMonoSkeletonWrapper(n));
218
218
  }
219
219
 
220
+ //#endregion
221
+ //#region src/composables/css-size.ts
222
+ /**
223
+ * Normalize a sizing prop to a CSS length string.
224
+ * - `number` (or numeric string) → `${n}px`
225
+ * - any other non-empty string → passed through verbatim (`"12rem"`, `"80%"`, …)
226
+ * - `null` / `undefined` / `''` → `undefined` (treated as "not set")
227
+ */
228
+ function toCssSize(value) {
229
+ if (value === null || value === void 0) return void 0;
230
+ if (typeof value === "number") return Number.isFinite(value) ? `${value}px` : void 0;
231
+ const trimmed = String(value).trim();
232
+ if (trimmed === "") return void 0;
233
+ if (/^-?\d+(\.\d+)?$/.test(trimmed)) return `${trimmed}px`;
234
+ return trimmed;
235
+ }
236
+ /**
237
+ * Build a Lit `styleMap` object from the six sizing props, normalizing each via
238
+ * `toCssSize` and omitting the ones that aren't set.
239
+ */
240
+ function buildSizeStyle(src) {
241
+ const style = {};
242
+ const width = toCssSize(src.width);
243
+ const height = toCssSize(src.height);
244
+ const minWidth = toCssSize(src.minWidth);
245
+ const maxWidth = toCssSize(src.maxWidth);
246
+ const minHeight = toCssSize(src.minHeight);
247
+ const maxHeight = toCssSize(src.maxHeight);
248
+ if (width) style.width = width;
249
+ if (height) style.height = height;
250
+ if (minWidth) style["min-width"] = minWidth;
251
+ if (maxWidth) style["max-width"] = maxWidth;
252
+ if (minHeight) style["min-height"] = minHeight;
253
+ if (maxHeight) style["max-height"] = maxHeight;
254
+ return style;
255
+ }
256
+
257
+ //#endregion
258
+ //#region src/components/table/column-autosize.ts
259
+ /**
260
+ * Content-sized columns — what `mono-table-th`'s `width="auto"` drives.
261
+ *
262
+ * Under `mono-table-fixed` (`table-layout: fixed`) CSS cannot do this: an `auto` column takes
263
+ * the WHOLE surplus instead of fitting its content, and `min-width` / `max-width` on a cell are
264
+ * ignored by the table algorithm. So the column is measured here and handed a concrete px width,
265
+ * clamped to `minWidth` / `maxWidth`, written to its `<col>` (which wins under fixed layout) and
266
+ * to the header cell.
267
+ *
268
+ * Text is measured with a canvas, not read back from the cell: reading the cell's own width would
269
+ * return the width last written, and a column could then never shrink. Measuring text also keeps
270
+ * the pass free of layout reads, so re-running it on every change is cheap.
271
+ *
272
+ * What is measured: the header (caption + its icons), every body cell and every FOOTER cell of
273
+ * the column. The footer matters — a `<mono-table-summary>` total covers the whole set, so a
274
+ * virtual-scroll window that only shows small figures still sizes for the largest one.
275
+ *
276
+ * Cell content is treated as one line (what a money column is). An editor (`<input>`, including
277
+ * the one inside `mono-input`) counts with its value and its own padding / border.
278
+ */
279
+ /** The text measurer — swappable so tests can run where there is no canvas (jsdom). */
280
+ const autosizeEnv = { measure: defaultMeasure };
281
+ let ctx;
282
+ function defaultMeasure(text, font) {
283
+ if (ctx === void 0) ctx = document.createElement("canvas").getContext("2d");
284
+ if (!ctx) return text.length * 8;
285
+ ctx.font = font;
286
+ return ctx.measureText(text).width;
287
+ }
288
+ /**
289
+ * A canvas `font` string for a computed style — always built from the longhands.
290
+ *
291
+ * NOT `style.font`: the shorthand serialises to `''` whenever a longhand it cannot express is set,
292
+ * and `font-variant-numeric: tabular-nums` (every `mono-table-summary`) is one. The old fallback then
293
+ * put `fontVariant` (`tabular-nums`) into the string, canvas rejected it, kept its default
294
+ * `10px sans-serif`, and a footer total measured far too narrow — the largest figure ellipsed.
295
+ * Only `small-caps` is a variant canvas takes; tabular figures are handled in `measureStyled`.
296
+ */
297
+ function fontOf(style) {
298
+ const caps = style.fontVariantCaps === "small-caps" ? "small-caps" : "";
299
+ return [
300
+ style.fontStyle,
301
+ caps,
302
+ style.fontWeight,
303
+ style.fontSize,
304
+ style.fontFamily
305
+ ].filter(Boolean).join(" ");
306
+ }
307
+ const px = (v) => parseFloat(v) || 0;
308
+ /** The widest digit in `font` — a tabular figure's advance, which canvas cannot be asked for. */
309
+ const digitWidths = /* @__PURE__ */ new Map();
310
+ function maxDigit(font) {
311
+ let w = digitWidths.get(font);
312
+ if (w === void 0) {
313
+ w = Math.max(..."0123456789".split("").map((d) => autosizeEnv.measure(d, font)));
314
+ digitWidths.set(font, w);
315
+ }
316
+ return w;
317
+ }
318
+ /**
319
+ * `text` as the element renders it: its `text-transform`, its `letter-spacing` (canvas ignores
320
+ * both) and its `font-variant-numeric: tabular-nums` (every digit at the widest digit's advance —
321
+ * a safe upper bound; tabular figures are wider than the proportional ones canvas measures).
322
+ */
323
+ function measureStyled(text, style) {
324
+ const font = fontOf(style);
325
+ if (style.textTransform === "uppercase") text = text.toUpperCase();
326
+ else if (style.textTransform === "lowercase") text = text.toLowerCase();
327
+ let width;
328
+ if (/tabular-nums/.test(style.fontVariantNumeric ?? "")) {
329
+ const digits = text.replace(/\D/g, "").length;
330
+ width = autosizeEnv.measure(text.replace(/\d/g, ""), font) + digits * maxDigit(font);
331
+ } else width = autosizeEnv.measure(text, font);
332
+ return width + px(style.letterSpacing) * text.length;
333
+ }
334
+ /** Horizontal padding + border of an element's box. */
335
+ function boxX(style) {
336
+ return px(style.paddingLeft) + px(style.paddingRight) + px(style.borderLeftWidth) + px(style.borderRightWidth);
337
+ }
338
+ /**
339
+ * A size prop as px: a number / bare numeric string / `px` → px, `rem` → × the root font size,
340
+ * `em` → × `el`'s font size. Anything else (`%`, `auto`, a var) → `undefined`: not a bound.
341
+ */
342
+ function cssLengthToPx(value, el) {
343
+ if (value == null) return void 0;
344
+ if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
345
+ const m = /^\s*(-?\d+(?:\.\d+)?)\s*(px|rem|em)?\s*$/i.exec(value);
346
+ if (!m) return void 0;
347
+ const n = parseFloat(m[1]);
348
+ const unit = (m[2] ?? "px").toLowerCase();
349
+ if (unit === "px") return n;
350
+ const ref = unit === "rem" ? document.documentElement : el ?? document.documentElement;
351
+ return n * (px(getComputedStyle(ref).fontSize) || 16);
352
+ }
353
+ /** `w` clamped to `[min, max]`; an unset bound does not clamp. `min` wins over a smaller `max`. */
354
+ function clampWidth(w, min, max) {
355
+ if (max != null) w = Math.min(w, max);
356
+ if (min != null) w = Math.max(w, min);
357
+ return w;
358
+ }
359
+ /**
360
+ * The grid column a header cell STARTS at — a walk over its section's rows honouring `rowspan`
361
+ * and `colspan`, so a leaf header under a band row (`<th colspan>` above it) maps to its real
362
+ * column. `cellIndex` alone would count only the cells of its own row.
363
+ */
364
+ function headerColumnIndex(cell) {
365
+ const section = cell.parentElement?.parentElement;
366
+ if (!section) return cell.cellIndex;
367
+ const taken = [];
368
+ const rows = Array.from(section.children).filter((r) => r.tagName === "TR");
369
+ for (let r = 0; r < rows.length; r++) {
370
+ taken[r] ??= [];
371
+ let c = 0;
372
+ for (const cur of Array.from(rows[r].cells)) {
373
+ while (taken[r][c]) c++;
374
+ if (cur === cell) return c;
375
+ for (let dr = 0; dr < Math.max(1, cur.rowSpan); dr++) {
376
+ const row = taken[r + dr] ??= [];
377
+ for (let dc = 0; dc < Math.max(1, cur.colSpan); dc++) row[c + dc] = true;
378
+ }
379
+ c += Math.max(1, cur.colSpan);
380
+ }
381
+ }
382
+ return cell.cellIndex;
383
+ }
384
+ /** The single-column cell of `row` at grid column `col` — a spanning cell (a spacer row) is none. */
385
+ function cellAt(row, col) {
386
+ let c = 0;
387
+ for (const cell of Array.from(row.cells)) {
388
+ const span = Math.max(1, cell.colSpan);
389
+ if (c === col) return span === 1 ? cell : void 0;
390
+ if (c > col) return void 0;
391
+ c += span;
392
+ }
393
+ }
394
+ /** The `<col>` at grid column `col`, honouring `<col span>`. */
395
+ function colAt(table, col) {
396
+ let c = 0;
397
+ for (const group of Array.from(table.children).filter((e) => e.tagName === "COLGROUP")) {
398
+ const cols = Array.from(group.children).filter((e) => e.tagName === "COL");
399
+ for (const el of cols) {
400
+ const span = Math.max(1, el.span || 1);
401
+ if (col < c + span) return span === 1 ? el : void 0;
402
+ c += span;
403
+ }
404
+ }
405
+ }
406
+ /** An element hidden by `v-show` / `hidden` — its text does not show, so it does not count. */
407
+ function isHidden(el) {
408
+ return el.hidden === true || el.style?.display === "none";
409
+ }
410
+ /** The one-line width a cell's content needs, padding included. */
411
+ function contentWidth(cell) {
412
+ let width = 0;
413
+ const walk = (node) => {
414
+ for (const child of Array.from(node.childNodes)) if (child.nodeType === Node.TEXT_NODE) {
415
+ const text = (child.textContent ?? "").replace(/\s+/g, " ");
416
+ if (!text.trim()) continue;
417
+ const parent = child.parentElement ?? node.host ?? cell;
418
+ width += measureStyled(text, getComputedStyle(parent));
419
+ } else if (child.nodeType === Node.ELEMENT_NODE) {
420
+ const el = child;
421
+ if (isHidden(el)) continue;
422
+ if (el.tagName === "INPUT" || el.tagName === "TEXTAREA") {
423
+ const input = el;
424
+ const style = getComputedStyle(input);
425
+ width += measureStyled(input.value || input.placeholder || "", style) + boxX(style);
426
+ continue;
427
+ }
428
+ if (el.tagName === "SVG" || el.tagName === "svg") {
429
+ width += el.getBoundingClientRect?.().width || 0;
430
+ continue;
431
+ }
432
+ walk(el.shadowRoot ?? el);
433
+ }
434
+ };
435
+ walk(cell);
436
+ return width + boxX(getComputedStyle(cell));
437
+ }
438
+ /** The header cell's need: the caption text plus whatever icons sit beside it. */
439
+ function headerWidth(cell, host) {
440
+ const label = host.querySelector("[data-mono-slot=\"label\"]");
441
+ const text = (label?.textContent ?? host.textContent ?? "").replace(/\s+/g, " ").trim();
442
+ let width = text ? measureStyled(text, getComputedStyle(label ?? host)) : 0;
443
+ for (const icon of Array.from(host.querySelectorAll(".mono-th-filter-ind, .mono-table-sort-btn:not(.label-trigger), .mono-th-required"))) {
444
+ const w = icon.getBoundingClientRect?.().width || 0;
445
+ width += w ? w + 4 : 0;
446
+ }
447
+ return width + boxX(getComputedStyle(cell));
448
+ }
449
+ /**
450
+ * One auto-sized column, owned by its `mono-table-th`. `schedule()` coalesces every trigger (a
451
+ * controller notify, a body mutation, typing in an editor) into one measurement per frame.
452
+ */
453
+ var ColumnAutoSize = class {
454
+ constructor(host) {
455
+ this.host = host;
456
+ this._raf = 0;
457
+ this._onInput = (e) => {
458
+ const t = e.target;
459
+ if (t && this._table && !this._table.tHead?.contains(t)) this.schedule();
460
+ };
461
+ this._onFonts = () => {
462
+ digitWidths.clear();
463
+ this.schedule();
464
+ };
465
+ }
466
+ schedule() {
467
+ if (this._raf) return;
468
+ this._raf = requestAnimationFrame(() => {
469
+ this._raf = 0;
470
+ this._run();
471
+ });
472
+ }
473
+ /** Stop watching, and hand the column back to whatever width it is given next. */
474
+ stop(clear = false) {
475
+ if (this._raf) cancelAnimationFrame(this._raf);
476
+ this._raf = 0;
477
+ this._unwatch();
478
+ if (clear && this._wrote) {
479
+ if (this._wrote.col) this._wrote.col.style.width = "";
480
+ this._wrote.cell.style.width = "";
481
+ }
482
+ this._wrote = void 0;
483
+ }
484
+ _watch(table) {
485
+ if (this._table === table) return;
486
+ this._unwatch();
487
+ this._table = table;
488
+ this._observer = new MutationObserver((records) => {
489
+ const head = table.tHead;
490
+ if (records.some((r) => !head?.contains(r.target))) this.schedule();
491
+ });
492
+ this._observer.observe(table, {
493
+ childList: true,
494
+ characterData: true,
495
+ subtree: true
496
+ });
497
+ table.addEventListener("input", this._onInput, true);
498
+ document.fonts?.addEventListener?.("loadingdone", this._onFonts);
499
+ }
500
+ _unwatch() {
501
+ this._observer?.disconnect();
502
+ this._observer = void 0;
503
+ this._table?.removeEventListener("input", this._onInput, true);
504
+ document.fonts?.removeEventListener?.("loadingdone", this._onFonts);
505
+ this._table = void 0;
506
+ }
507
+ _run() {
508
+ const cell = this.host.closest("th, td");
509
+ const table = cell?.closest("table");
510
+ if (!cell || !table || !this.host.isConnected) return;
511
+ this._watch(table);
512
+ const index = headerColumnIndex(cell);
513
+ let width = headerWidth(cell, this.host);
514
+ const sections = [...Array.from(table.tBodies), ...table.tFoot ? [table.tFoot] : []];
515
+ for (const section of sections) for (const row of Array.from(section.rows)) {
516
+ const target = cellAt(row, index);
517
+ if (target) width = Math.max(width, contentWidth(target));
518
+ }
519
+ width = Math.ceil(clampWidth(width + 1, this.min, this.max));
520
+ const value = `${width}px`;
521
+ const col = colAt(table, index);
522
+ if (cell.style.width !== value) cell.style.width = value;
523
+ if (col && col.style.width !== value) col.style.width = value;
524
+ this._wrote = {
525
+ col,
526
+ cell
527
+ };
528
+ }
529
+ };
530
+
531
+ //#endregion
532
+ //#region src/composables/mono-size-attrs.ts
533
+ const ATTRS = [
534
+ "mono-width",
535
+ "mono-min-width",
536
+ "mono-max-width"
537
+ ];
538
+ const SELECTOR = ATTRS.map((a) => `[${a}]`).join(", ");
539
+ /** Auto-sized cells and their sizers — a cell that loses `auto` or the document gets stopped. */
540
+ const sizers = /* @__PURE__ */ new Map();
541
+ let observer = null;
542
+ const isCell = (el) => el.tagName === "TH" || el.tagName === "TD";
543
+ /** Apply the three attributes to one element. Re-run whenever one of them changes. */
544
+ function applyMonoSizeAttributes(el) {
545
+ const width = el.getAttribute("mono-width")?.trim() ?? "";
546
+ const min = el.getAttribute("mono-min-width")?.trim() ?? "";
547
+ const max = el.getAttribute("mono-max-width")?.trim() ?? "";
548
+ const auto = width.toLowerCase() === "auto";
549
+ el.style.minWidth = min ? toCssSize(min) ?? "" : "";
550
+ el.style.maxWidth = max ? toCssSize(max) ?? "" : "";
551
+ if (!isCell(el)) {
552
+ el.style.width = auto ? "fit-content" : width ? toCssSize(width) ?? "" : "";
553
+ return;
554
+ }
555
+ let sizer = sizers.get(el);
556
+ if (!auto) {
557
+ if (sizer) {
558
+ sizer.stop(true);
559
+ sizers.delete(el);
560
+ }
561
+ el.style.width = width ? toCssSize(width) ?? "" : "";
562
+ return;
563
+ }
564
+ if (!sizer) sizers.set(el, sizer = new ColumnAutoSize(el));
565
+ sizer.min = cssLengthToPx(min || null, el);
566
+ sizer.max = cssLengthToPx(max || null, el);
567
+ sizer.schedule();
568
+ }
569
+ /** Stop the sizers of cells that left the document. */
570
+ function sweep() {
571
+ for (const [el, sizer] of sizers) {
572
+ if (el.isConnected) continue;
573
+ sizer.stop();
574
+ sizers.delete(el);
575
+ }
576
+ }
577
+ function scan(root) {
578
+ if (root instanceof HTMLElement && root.matches(SELECTOR)) applyMonoSizeAttributes(root);
579
+ for (const el of Array.from(root.querySelectorAll(SELECTOR))) applyMonoSizeAttributes(el);
580
+ }
581
+ /**
582
+ * Turn the attributes on for the whole document — idempotent, so every caller may call it.
583
+ * Returns a stop function (tests; an app never needs it).
584
+ */
585
+ function startMonoSizeAttributes() {
586
+ if (typeof document === "undefined" || typeof MutationObserver === "undefined") return () => {};
587
+ if (!observer) {
588
+ observer = new MutationObserver((records) => {
589
+ let removed = false;
590
+ for (const r of records) {
591
+ if (r.type === "attributes") {
592
+ applyMonoSizeAttributes(r.target);
593
+ continue;
594
+ }
595
+ for (const node of Array.from(r.addedNodes)) if (node.nodeType === 1) scan(node);
596
+ if (r.removedNodes.length) removed = true;
597
+ }
598
+ if (removed) sweep();
599
+ });
600
+ observer.observe(document.documentElement, {
601
+ subtree: true,
602
+ childList: true,
603
+ attributes: true,
604
+ attributeFilter: [...ATTRS]
605
+ });
606
+ scan(document);
607
+ }
608
+ return stopMonoSizeAttributes;
609
+ }
610
+ function stopMonoSizeAttributes() {
611
+ observer?.disconnect();
612
+ observer = null;
613
+ for (const sizer of sizers.values()) sizer.stop();
614
+ sizers.clear();
615
+ }
616
+
220
617
  //#endregion
221
618
  //#region src/composables/mono-ui.ts
222
619
  const STATE_KEY = Symbol.for("mono-helper.ui");
@@ -1011,4 +1408,4 @@ function flushSsrHydration(el, options = {}) {
1011
1408
  }
1012
1409
 
1013
1410
  //#endregion
1014
- export { monoPendingActive as _, __decorate as a, defineHybridPropAlias as c, optionalNumberConverter as d, customElement as f, monoHostChildren as g, monoHostChildNodes as h, withShadowUtilityStyles as i, defineHybridPropAliases as l, monoApplyPhantomOptions as m, adoptIconStyles as n, arrayHasChanged as o, defineMonoElement as p, toShadowCss as r, booleanStringConverter as s, flushSsrHydration as t, numberStringConverter as u, monoPendingGrace as v, monoPhantomOptions as y };
1411
+ export { monoPendingGrace as C, monoPendingActive as S, buildSizeStyle as _, __decorate as a, monoHostChildNodes as b, defineHybridPropAlias as c, optionalNumberConverter as d, customElement as f, cssLengthToPx as g, ColumnAutoSize as h, withShadowUtilityStyles as i, defineHybridPropAliases as l, startMonoSizeAttributes as m, adoptIconStyles as n, arrayHasChanged as o, defineMonoElement as p, toShadowCss as r, booleanStringConverter as s, flushSsrHydration as t, numberStringConverter as u, toCssSize as v, monoPhantomOptions as w, monoHostChildren as x, monoApplyPhantomOptions as y };
package/dist/index.js CHANGED
@@ -6,13 +6,13 @@ import { t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
6
6
  import { t as monoDataGrid } from "./mono-data-grid-8jmeIXUU.js";
7
7
  import { d as OPERATOR_ARITY, l as treeToArray, m as operatorsFor, n as arrayToTree, s as odataStringToArray, t as arrayToODataString, u as DEFAULT_TEXTS } from "./filter-odata-Bi27XUpQ.js";
8
8
  import { t as monoFilterBuilder } from "./filter-builder-C0T3pMx2.js";
9
- import { a as resetMonoUI, g as resetMonoSkeleton, i as getMonoUIStatus, n as createMonoUI, o as getMonoSkeletonStatus, r as getMonoUI, s as isMonoSsrApp } from "./mono-ui-BwUc0L6B.js";
9
+ import { C as resetMonoSkeleton, a as resetMonoUI, c as stopMonoSizeAttributes, i as getMonoUIStatus, m as isMonoSsrApp, n as createMonoUI, o as applyMonoSizeAttributes, p as getMonoSkeletonStatus, r as getMonoUI, s as startMonoSizeAttributes } from "./mono-ui-KOBJcnXk.js";
10
10
  import { t as monoForm } from "./mono-form-controller-BkMR8g14.js";
11
11
  import { t as monoModal } from "./mono-modal-controller-ClObbHUs.js";
12
12
  import { i as composeApply, n as buildChartApply, r as buildChartOdataRequest, t as monoChart } from "./mono-data-chart-ChkelNT7.js";
13
13
  import { t as monoDataDropdown } from "./mono-data-dropdown-DxpUUk2y.js";
14
14
  import { c as getMonoTooltipGlobal, o as monoTooltip, t as controlMonoTooltip } from "./control-tooltip-C3rA_nSH.js";
15
15
  import { a as resetMonoTooltip, n as createMonoTooltip, r as destroyAllMonoTooltips } from "./tooltip-Drekihf5.js";
16
- import { _ as DEFAULT_FLAVOR, a as flavors, b as themePresets, c as getCurrentFlavor, d as getThemeData, f as isValidFlavor, g as themes, h as resetTheme, i as createThemeClass, l as getCurrentTheme, m as resetFlavor, n as applyTheme, o as getAllFlavors, p as isValidTheme, r as createFlavorClass, s as getAllThemes, t as applyFlavor, u as getFlavorData, v as DEFAULT_THEME, y as flavorPresets } from "./index.node-DzCuvHLg.js";
16
+ import { _ as DEFAULT_FLAVOR, a as flavors, b as themePresets, c as getCurrentFlavor, d as getThemeData, f as isValidFlavor, g as themes, h as resetTheme, i as createThemeClass, l as getCurrentTheme, m as resetFlavor, n as applyTheme, o as getAllFlavors, p as isValidTheme, r as createFlavorClass, s as getAllThemes, t as applyFlavor, u as getFlavorData, v as DEFAULT_THEME, y as flavorPresets } from "./index.node-tTkISFn2.js";
17
17
 
18
- export { DEFAULT_ERROR_MESSAGES, DEFAULT_FLAVOR, DEFAULT_SEARCH_OPERATION, DEFAULT_THEME, OPERATOR_ARITY as MONO_FILTER_OPERATOR_ARITY, DEFAULT_TEXTS as MONO_FILTER_TEXTS, MonoSourceSearch, SEARCH_FIELDS_KEYS, applyFlavor, applyTheme, arrayToODataString, arrayToTree, buildChartApply, buildChartOdataRequest, buildGroups, collectGroupPaths, composeApply, monoChart as controlMonoChart, monoChart, monoDataDropdown as controlMonoDataDropdown, monoDataDropdown, monoFilterBuilder as controlMonoFilterBuilder, monoFilterBuilder, monoForm as controlMonoForm, monoForm, monoModal as controlMonoModal, monoModal, monoDataGrid as controlMonoTable, monoDataGrid, controlMonoTooltip, createFlavorClass, createMonoTooltip, createMonoUI, createThemeClass, describeError, destroyAllMonoTooltips, errorStatus, flattenLeaves, flavorPresets, flavors, getAllFlavors, getAllThemes, getCurrentFlavor, getCurrentTheme, getFieldValue, getFlavorData, getMonoSkeletonStatus, getMonoTooltipGlobal, getMonoUI, getMonoUIStatus, getThemeData, isFoldableSearch, isGroupNode, isMonoSsrApp, isPath, isValidFlavor, isValidTheme, mergePatch, mergeSearchFields, monoArraySource, operatorsFor as monoFilterOperatorsFor, monoTooltip, normalizeError, odataStringToArray, parseFieldPath, parseSearchValue, plainSearchFields, readSearchField, resetFlavor, resetMonoSkeleton, resetMonoTooltip, resetMonoUI, resetTheme, resolveErrorMessages, resolveMaybeReactive, resolveSearchFields, searchRemoteFilter, searchRowPredicate, setErrorMessages, setFieldValue, themePresets, themes, toODataClause, toODataSelector, treeToArray };
18
+ export { DEFAULT_ERROR_MESSAGES, DEFAULT_FLAVOR, DEFAULT_SEARCH_OPERATION, DEFAULT_THEME, OPERATOR_ARITY as MONO_FILTER_OPERATOR_ARITY, DEFAULT_TEXTS as MONO_FILTER_TEXTS, MonoSourceSearch, SEARCH_FIELDS_KEYS, applyFlavor, applyMonoSizeAttributes, applyTheme, arrayToODataString, arrayToTree, buildChartApply, buildChartOdataRequest, buildGroups, collectGroupPaths, composeApply, monoChart as controlMonoChart, monoChart, monoDataDropdown as controlMonoDataDropdown, monoDataDropdown, monoFilterBuilder as controlMonoFilterBuilder, monoFilterBuilder, monoForm as controlMonoForm, monoForm, monoModal as controlMonoModal, monoModal, monoDataGrid as controlMonoTable, monoDataGrid, controlMonoTooltip, createFlavorClass, createMonoTooltip, createMonoUI, createThemeClass, describeError, destroyAllMonoTooltips, errorStatus, flattenLeaves, flavorPresets, flavors, getAllFlavors, getAllThemes, getCurrentFlavor, getCurrentTheme, getFieldValue, getFlavorData, getMonoSkeletonStatus, getMonoTooltipGlobal, getMonoUI, getMonoUIStatus, getThemeData, isFoldableSearch, isGroupNode, isMonoSsrApp, isPath, isValidFlavor, isValidTheme, mergePatch, mergeSearchFields, monoArraySource, operatorsFor as monoFilterOperatorsFor, monoTooltip, normalizeError, odataStringToArray, parseFieldPath, parseSearchValue, plainSearchFields, readSearchField, resetFlavor, resetMonoSkeleton, resetMonoTooltip, resetMonoUI, resetTheme, resolveErrorMessages, resolveMaybeReactive, resolveSearchFields, searchRemoteFilter, searchRowPredicate, setErrorMessages, setFieldValue, startMonoSizeAttributes, stopMonoSizeAttributes, themePresets, themes, toODataClause, toODataSelector, treeToArray };
@@ -1,6 +1,6 @@
1
1
  import "./normalize-error-D93O4q8g.js";
2
2
  import "./mono-data-grid-8jmeIXUU.js";
3
- import "./mono-ui-BwUc0L6B.js";
3
+ import "./mono-ui-KOBJcnXk.js";
4
4
  import "./mono-data-chart-ChkelNT7.js";
5
5
  import "./mono-data-dropdown-DxpUUk2y.js";
6
6
  import "./tooltip-Drekihf5.js";
@@ -6,13 +6,13 @@ import { t as resolveMaybeReactive } from "./reactive-Dtd-esHO.js";
6
6
  import { t as monoDataGrid } from "./mono-data-grid-8jmeIXUU.js";
7
7
  import { d as OPERATOR_ARITY, l as treeToArray, m as operatorsFor, n as arrayToTree, s as odataStringToArray, t as arrayToODataString, u as DEFAULT_TEXTS } from "./filter-odata-Bi27XUpQ.js";
8
8
  import { t as monoFilterBuilder } from "./filter-builder-C0T3pMx2.js";
9
- import { a as resetMonoUI, g as resetMonoSkeleton, i as getMonoUIStatus, n as createMonoUI, o as getMonoSkeletonStatus, r as getMonoUI, s as isMonoSsrApp } from "./mono-ui-BwUc0L6B.js";
9
+ import { C as resetMonoSkeleton, a as resetMonoUI, c as stopMonoSizeAttributes, i as getMonoUIStatus, m as isMonoSsrApp, n as createMonoUI, o as applyMonoSizeAttributes, p as getMonoSkeletonStatus, r as getMonoUI, s as startMonoSizeAttributes } from "./mono-ui-KOBJcnXk.js";
10
10
  import { t as monoForm } from "./mono-form-controller-BkMR8g14.js";
11
11
  import { t as monoModal } from "./mono-modal-controller-ClObbHUs.js";
12
12
  import { i as composeApply, n as buildChartApply, r as buildChartOdataRequest, t as monoChart } from "./mono-data-chart-ChkelNT7.js";
13
13
  import { t as monoDataDropdown } from "./mono-data-dropdown-DxpUUk2y.js";
14
14
  import { c as getMonoTooltipGlobal, o as monoTooltip, t as controlMonoTooltip } from "./control-tooltip-C3rA_nSH.js";
15
15
  import { a as resetMonoTooltip, n as createMonoTooltip, r as destroyAllMonoTooltips } from "./tooltip-Drekihf5.js";
16
- import { _ as DEFAULT_FLAVOR, a as flavors, b as themePresets, c as getCurrentFlavor, d as getThemeData, f as isValidFlavor, g as themes, h as resetTheme, i as createThemeClass, l as getCurrentTheme, m as resetFlavor, n as applyTheme, o as getAllFlavors, p as isValidTheme, r as createFlavorClass, s as getAllThemes, t as applyFlavor, u as getFlavorData, v as DEFAULT_THEME, y as flavorPresets } from "./index.node-DzCuvHLg.js";
16
+ import { _ as DEFAULT_FLAVOR, a as flavors, b as themePresets, c as getCurrentFlavor, d as getThemeData, f as isValidFlavor, g as themes, h as resetTheme, i as createThemeClass, l as getCurrentTheme, m as resetFlavor, n as applyTheme, o as getAllFlavors, p as isValidTheme, r as createFlavorClass, s as getAllThemes, t as applyFlavor, u as getFlavorData, v as DEFAULT_THEME, y as flavorPresets } from "./index.node-tTkISFn2.js";
17
17
 
18
- export { DEFAULT_ERROR_MESSAGES, DEFAULT_FLAVOR, DEFAULT_SEARCH_OPERATION, DEFAULT_THEME, OPERATOR_ARITY as MONO_FILTER_OPERATOR_ARITY, DEFAULT_TEXTS as MONO_FILTER_TEXTS, MonoSourceSearch, SEARCH_FIELDS_KEYS, applyFlavor, applyTheme, arrayToODataString, arrayToTree, buildChartApply, buildChartOdataRequest, buildGroups, collectGroupPaths, composeApply, monoChart as controlMonoChart, monoChart, monoDataDropdown as controlMonoDataDropdown, monoDataDropdown, monoFilterBuilder as controlMonoFilterBuilder, monoFilterBuilder, monoForm as controlMonoForm, monoForm, monoModal as controlMonoModal, monoModal, monoDataGrid as controlMonoTable, monoDataGrid, controlMonoTooltip, createFlavorClass, createMonoTooltip, createMonoUI, createThemeClass, describeError, destroyAllMonoTooltips, errorStatus, flattenLeaves, flavorPresets, flavors, getAllFlavors, getAllThemes, getCurrentFlavor, getCurrentTheme, getFieldValue, getFlavorData, getMonoSkeletonStatus, getMonoTooltipGlobal, getMonoUI, getMonoUIStatus, getThemeData, isFoldableSearch, isGroupNode, isMonoSsrApp, isPath, isValidFlavor, isValidTheme, mergePatch, mergeSearchFields, monoArraySource, operatorsFor as monoFilterOperatorsFor, monoTooltip, normalizeError, odataStringToArray, parseFieldPath, parseSearchValue, plainSearchFields, readSearchField, resetFlavor, resetMonoSkeleton, resetMonoTooltip, resetMonoUI, resetTheme, resolveErrorMessages, resolveMaybeReactive, resolveSearchFields, searchRemoteFilter, searchRowPredicate, setErrorMessages, setFieldValue, themePresets, themes, toODataClause, toODataSelector, treeToArray };
18
+ export { DEFAULT_ERROR_MESSAGES, DEFAULT_FLAVOR, DEFAULT_SEARCH_OPERATION, DEFAULT_THEME, OPERATOR_ARITY as MONO_FILTER_OPERATOR_ARITY, DEFAULT_TEXTS as MONO_FILTER_TEXTS, MonoSourceSearch, SEARCH_FIELDS_KEYS, applyFlavor, applyMonoSizeAttributes, applyTheme, arrayToODataString, arrayToTree, buildChartApply, buildChartOdataRequest, buildGroups, collectGroupPaths, composeApply, monoChart as controlMonoChart, monoChart, monoDataDropdown as controlMonoDataDropdown, monoDataDropdown, monoFilterBuilder as controlMonoFilterBuilder, monoFilterBuilder, monoForm as controlMonoForm, monoForm, monoModal as controlMonoModal, monoModal, monoDataGrid as controlMonoTable, monoDataGrid, controlMonoTooltip, createFlavorClass, createMonoTooltip, createMonoUI, createThemeClass, describeError, destroyAllMonoTooltips, errorStatus, flattenLeaves, flavorPresets, flavors, getAllFlavors, getAllThemes, getCurrentFlavor, getCurrentTheme, getFieldValue, getFlavorData, getMonoSkeletonStatus, getMonoTooltipGlobal, getMonoUI, getMonoUIStatus, getThemeData, isFoldableSearch, isGroupNode, isMonoSsrApp, isPath, isValidFlavor, isValidTheme, mergePatch, mergeSearchFields, monoArraySource, operatorsFor as monoFilterOperatorsFor, monoTooltip, normalizeError, odataStringToArray, parseFieldPath, parseSearchValue, plainSearchFields, readSearchField, resetFlavor, resetMonoSkeleton, resetMonoTooltip, resetMonoUI, resetTheme, resolveErrorMessages, resolveMaybeReactive, resolveSearchFields, searchRemoteFilter, searchRowPredicate, setErrorMessages, setFieldValue, startMonoSizeAttributes, stopMonoSizeAttributes, themePresets, themes, toODataClause, toODataSelector, treeToArray };
@@ -1,4 +1,4 @@
1
- import { l as monoHostChildNodes, u as monoHostChildren } from "./mono-ui-BwUc0L6B.js";
1
+ import { _ as monoHostChildren, g as monoHostChildNodes } from "./mono-ui-KOBJcnXk.js";
2
2
 
3
3
  //#region src/composables/light-slots.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { g as monoHostChildren, h as monoHostChildNodes } from "./hydration-flush-DHrl4_KK.js";
1
+ import { b as monoHostChildNodes, x as monoHostChildren } from "./hydration-flush-9AJE8FRl.js";
2
2
 
3
3
  //#region src/composables/light-slots.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
- import { t as customElement } from "./mono-element-C7vCschg.js";
1
+ import { d as buildSizeStyle } from "./mono-ui-KOBJcnXk.js";
2
+ import { t as customElement } from "./mono-element-Bc9wElPy.js";
2
3
  import { a as defineHybridPropAliases, r as booleanStringConverter, t as __decorate } from "./decorate-DbYFpi8R.js";
3
4
  import { t as dispatchMonoEvent } from "./mono-event-BPku9HpS.js";
4
- import { n as bucketHasContent, r as captureLightSlots, s as placeSlotNode, t as LateSlotWatcher } from "./light-slots-DdDdZ6zs.js";
5
- import { t as buildSizeStyle } from "./css-size-DWAPgQdT.js";
5
+ import { n as bucketHasContent, r as captureLightSlots, s as placeSlotNode, t as LateSlotWatcher } from "./light-slots-BnBR29E7.js";
6
6
  import { a as rateLimitHasChanged, i as rateLimitConverter, n as normalizeDebounce, r as normalizeThrottle, t as createRateLimiter } from "./rate-limit-e9Jlpl5l.js";
7
7
  import { LitElement, html, nothing, unsafeCSS } from "lit";
8
8
  import { property, query, state } from "lit/decorators.js";
@@ -1,6 +1,5 @@
1
- import { a as __decorate, f as customElement, i as withShadowUtilityStyles, l as defineHybridPropAliases, r as toShadowCss, s as booleanStringConverter, t as flushSsrHydration } from "./hydration-flush-DHrl4_KK.js";
1
+ import { _ as buildSizeStyle, a as __decorate, f as customElement, i as withShadowUtilityStyles, l as defineHybridPropAliases, r as toShadowCss, s as booleanStringConverter, t as flushSsrHydration } from "./hydration-flush-9AJE8FRl.js";
2
2
  import { t as dispatchMonoEvent } from "./mono-event-BPku9HpS.js";
3
- import { t as buildSizeStyle } from "./css-size-DWAPgQdT.js";
4
3
  import { a as rateLimitHasChanged, i as rateLimitConverter, n as normalizeDebounce, r as normalizeThrottle, t as createRateLimiter } from "./rate-limit-e9Jlpl5l.js";
5
4
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
6
5
  import { property, query, state } from "lit/decorators.js";
@@ -1,4 +1,4 @@
1
- import { _ as watchSkeletonActivation, c as monoApplyPhantomOptions, d as monoPendingActive, h as registerPendingProperty, m as monoSkeletonInternals, s as isMonoSsrApp, t as applyMonoUIDefaults } from "./mono-ui-BwUc0L6B.js";
1
+ import { S as registerPendingProperty, h as monoApplyPhantomOptions, m as isMonoSsrApp, t as applyMonoUIDefaults, v as monoPendingActive, w as watchSkeletonActivation, x as monoSkeletonInternals } from "./mono-ui-KOBJcnXk.js";
2
2
  import { html } from "lit";
3
3
 
4
4
  //#region src/composables/mono-pending.ts