@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
package/dist/ui/table.js CHANGED
@@ -3,14 +3,13 @@ import { a as buildGroups, c as isGroupNode, o as collectGroupPaths, s as flatte
3
3
  import { A as resolveSearchEntries, D as isWildcardPattern, O as normalizeSearchExpr, c as resolveErrorMessages, h as mergeSearchFields, k as plainSearchColumns, l as setErrorMessages, n as describeError, r as errorStatus, s as normalizeError, t as DEFAULT_ERROR_MESSAGES, w as expandWildcard } from "../normalize-error-D93O4q8g.js";
4
4
  import { h as monoArraySource } from "../data-source-options-QjuI73g8.js";
5
5
  import { a as seedFromRanges, i as minimize, n as buildDateTree, o as setAllChecked, r as checkState, s as setChecked, t as monoDataGrid } from "../mono-data-grid-8jmeIXUU.js";
6
- import { c as monoApplyPhantomOptions, d as monoPendingActive, f as monoPendingGrace, p as monoPhantomOptions, u as monoHostChildren } from "../mono-ui-BwUc0L6B.js";
6
+ import { _ as monoHostChildren, b as monoPhantomOptions, d as buildSizeStyle, h as monoApplyPhantomOptions, l as ColumnAutoSize, s as startMonoSizeAttributes, u as cssLengthToPx, v as monoPendingActive, y as monoPendingGrace } from "../mono-ui-KOBJcnXk.js";
7
7
  import { n as detachEventHandlers, t as applyProps } from "../element-props-xvw0EB7H.js";
8
- import { t as customElement } from "../mono-element-C7vCschg.js";
8
+ import { t as customElement } from "../mono-element-Bc9wElPy.js";
9
9
  import { a as defineHybridPropAliases, i as defineHybridPropAlias, o as numberStringConverter, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
10
10
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
11
11
  import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
12
- import { n as bucketHasContent, o as placeLightSlots, r as captureLightSlots, s as placeSlotNode } from "../light-slots-DdDdZ6zs.js";
13
- import { t as buildSizeStyle } from "../css-size-DWAPgQdT.js";
12
+ import { n as bucketHasContent, o as placeLightSlots, r as captureLightSlots, s as placeSlotNode } from "../light-slots-BnBR29E7.js";
14
13
  import { t as PopupPortalController } from "../popup-portal-C8ttHDRX.js";
15
14
  import { n as cssPart } from "../css-class-B6Tc_MAx.js";
16
15
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
@@ -2254,7 +2253,11 @@ const MonoTableThCore = (superClass) => {
2254
2253
  this._valuesError = false;
2255
2254
  this._search = "";
2256
2255
  this._fromIcon = false;
2257
- defineHybridPropAliases(this, ["editableTrigger"]);
2256
+ defineHybridPropAliases(this, [
2257
+ "editableTrigger",
2258
+ "minWidth",
2259
+ "maxWidth"
2260
+ ]);
2258
2261
  }
2259
2262
  /** The sort config as an object: `true` → `{}`, `false` → `undefined`. */
2260
2263
  get _sortObj() {
@@ -2266,9 +2269,11 @@ const MonoTableThCore = (superClass) => {
2266
2269
  connectedCallback() {
2267
2270
  super.connectedCallback();
2268
2271
  this._register();
2272
+ if (!isServer) startMonoSizeAttributes();
2269
2273
  }
2270
2274
  disconnectedCallback() {
2271
2275
  this.dataGrid?.unregisterColumn(this);
2276
+ this._autoSize?.stop();
2272
2277
  super.disconnectedCallback();
2273
2278
  }
2274
2279
  willUpdate(changed) {
@@ -2280,6 +2285,28 @@ const MonoTableThCore = (superClass) => {
2280
2285
  this.dataGrid.registerColumn(this);
2281
2286
  this._seedSort();
2282
2287
  }
2288
+ /**
2289
+ * `width="auto"` → hand the column to the auto-sizer (re-run on every update: each controller
2290
+ * notify lands here). A fixed width → written as before, and an auto-sizer left over from an
2291
+ * earlier `'auto'` is stopped with its px cleared. The bounds go onto the cell either way —
2292
+ * the auto-sizer clamps with them, an auto-layout table honours them.
2293
+ */
2294
+ _syncWidth(cell) {
2295
+ if (String(this.width ?? "").trim().toLowerCase() === "auto") {
2296
+ const sizer = this._autoSize ??= new ColumnAutoSize(this);
2297
+ sizer.min = cssLengthToPx(this.minWidth ?? null, cell);
2298
+ sizer.max = cssLengthToPx(this.maxWidth ?? null, cell);
2299
+ sizer.schedule();
2300
+ } else {
2301
+ if (this._autoSize) {
2302
+ this._autoSize.stop(true);
2303
+ this._autoSize = void 0;
2304
+ }
2305
+ if (this.width != null && this.width !== "") cell.style.width = toCssSize(this.width);
2306
+ }
2307
+ cell.style.minWidth = this.minWidth != null && this.minWidth !== "" ? toCssSize(this.minWidth) : "";
2308
+ cell.style.maxWidth = this.maxWidth != null && this.maxWidth !== "" ? toCssSize(this.maxWidth) : "";
2309
+ }
2283
2310
  /** Apply `sort.order` once, unless THIS column is already sorted (don't fight a user sort). */
2284
2311
  _seedSort() {
2285
2312
  if (this._seededSort) return;
@@ -2296,7 +2323,7 @@ const MonoTableThCore = (superClass) => {
2296
2323
  const cell = this.closest("th, td");
2297
2324
  if (cell) {
2298
2325
  cell.setAttribute("aria-sort", ariaSort(this._current));
2299
- if (this.width != null && this.width !== "") cell.style.width = toCssSize(this.width);
2326
+ this._syncWidth(cell);
2300
2327
  if (this.height != null && this.height !== "") cell.style.height = toCssSize(this.height);
2301
2328
  cell.style.textAlign = this.align ?? "";
2302
2329
  }
@@ -2936,6 +2963,8 @@ const MonoTableThCore = (superClass) => {
2936
2963
  __decorate([state()], MonoTableThCoreClass.prototype, "_tree", void 0);
2937
2964
  __decorate([state()], MonoTableThCoreClass.prototype, "_expanded", void 0);
2938
2965
  __decorate([property()], MonoTableThCoreClass.prototype, "width", void 0);
2966
+ __decorate([property({ attribute: "min-width" })], MonoTableThCoreClass.prototype, "minWidth", void 0);
2967
+ __decorate([property({ attribute: "max-width" })], MonoTableThCoreClass.prototype, "maxWidth", void 0);
2939
2968
  __decorate([property({ reflect: true })], MonoTableThCoreClass.prototype, "align", void 0);
2940
2969
  __decorate([property()], MonoTableThCoreClass.prototype, "height", void 0);
2941
2970
  __decorate([state()], MonoTableThCoreClass.prototype, "_filterOpen", void 0);
package/dist/ui/tabs.js CHANGED
@@ -1,8 +1,8 @@
1
- import { l as monoHostChildNodes } from "../mono-ui-BwUc0L6B.js";
2
- import { t as customElement } from "../mono-element-C7vCschg.js";
1
+ import { g as monoHostChildNodes } from "../mono-ui-KOBJcnXk.js";
2
+ import { t as customElement } from "../mono-element-Bc9wElPy.js";
3
3
  import { a as defineHybridPropAliases, n as arrayHasChanged, r as booleanStringConverter, t as __decorate } from "../decorate-DbYFpi8R.js";
4
4
  import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
5
- import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-DdDdZ6zs.js";
5
+ import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-BnBR29E7.js";
6
6
  import { LitElement, html, nothing, unsafeCSS } from "lit";
7
7
  import { ref } from "lit/directives/ref.js";
8
8
  import { property, state } from "lit/decorators.js";