@mono-lit/helper 0.0.6 → 0.0.8

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 (162) hide show
  1. package/dist/{control-tooltip-C3rA_nSH.js → control-tooltip-CoPD37_h.js} +20 -11
  2. package/dist/{data-source-options-Cz9fVLK8.js → data-source-options-BM4r4PRw.js} +26 -9
  3. package/dist/{data-source-options-QjuI73g8.js → data-source-options-fxT5QIX4.js} +26 -9
  4. package/dist/{data-source-read-FxqzQkk2.js → data-source-read-BL266IW0.js} +25 -3
  5. package/dist/{data-source-read-i6CYSUEl.js → data-source-read-HyBCRg1t.js} +25 -3
  6. package/dist/{excel-BPdDt06G.js → excel-DtRpxmxs.js} +1 -1
  7. package/dist/{export-DgomqI_3.js → export-ixRdCS2y.js} +1 -1
  8. package/dist/export.js +3 -3
  9. package/dist/{field-tooltip-FyMi9vNM.js → field-tooltip-Csk4s2ve.js} +2 -3
  10. package/dist/field-tooltip-addon-B32dizW_.js +22 -0
  11. package/dist/{control-tooltip-7vegYmq3.js → field-tooltip-addon-CWCp19mJ.js} +36 -12
  12. package/dist/{field-tooltip.css_raw-DEctHXKm.js → field-tooltip.css_raw-U5UeTa2d.js} +3 -4
  13. package/dist/{field-validation-CHHQi1zl.js → field-validation-CFmUmuDx.js} +1 -1
  14. package/dist/field-validation.css_raw-Cx6SGrfP.js +178 -0
  15. package/dist/{form-control-core-rW2WvOcb.js → form-control-core-BbiACMtL.js} +1 -1
  16. package/dist/{hydration-flush-9AJE8FRl.js → hydration-flush-BaE9gN3C.js} +67 -17
  17. package/dist/index.js +10 -10
  18. package/dist/{index.node-tTkISFn2.js → index.node-CLqE8F8P.js} +5 -5
  19. package/dist/index.node.js +10 -10
  20. package/dist/input.css_raw-Br-T8RWv.js +5 -0
  21. package/dist/{light-slots-BnBR29E7.js → light-slots-B5Ck0t_E.js} +1 -1
  22. package/dist/{light-slots-Cb6e-LU3.js → light-slots-_no0r2Z-.js} +1 -1
  23. package/dist/mono-button-CLkHg3WW.js +871 -0
  24. package/dist/{mono-button.shadow-CIBGisyo.js → mono-button.shadow-DqZMpcqY.js} +1 -1
  25. package/dist/{mono-data-chart-ChkelNT7.js → mono-data-chart-NKPdAgVq.js} +2 -2
  26. package/dist/{mono-data-dropdown-DxpUUk2y.js → mono-data-dropdown-DUXo_jxd.js} +72 -6
  27. package/dist/{mono-data-grid-8jmeIXUU.js → mono-data-grid-Bb00QM72.js} +129 -18
  28. package/dist/{mono-data-grid-KDpu4d4_.js → mono-data-grid-Bkr-e1-i.js} +130 -19
  29. package/dist/{mono-element-Bc9wElPy.js → mono-element-CKcT0rwv.js} +1 -1
  30. package/dist/{mono-form-controller-BkMR8g14.js → mono-form-controller-BrA10erm.js} +12 -1
  31. package/dist/{mono-ui-KOBJcnXk.js → mono-ui-kvLVIf1V.js} +43 -15
  32. package/dist/{popup-portal-C8ttHDRX.js → popup-portal-CINuVjNY.js} +53 -6
  33. package/dist/src/components/accordion/mono-accordion.d.ts +0 -1
  34. package/dist/src/components/alert/mono-alert.d.ts +0 -1
  35. package/dist/src/components/breadcrumb/mono-breadcrumb-list.d.ts +0 -1
  36. package/dist/src/components/breadcrumb/mono-breadcrumb.d.ts +0 -1
  37. package/dist/src/components/button/mono-button-dropdown.d.ts +0 -1
  38. package/dist/src/components/button/mono-button.d.ts +0 -1
  39. package/dist/src/components/card/mono-card.d.ts +0 -1
  40. package/dist/src/components/chart/mono-chart-presets.d.ts +0 -4
  41. package/dist/src/components/chart/mono-chart.d.ts +0 -1
  42. package/dist/src/components/checkbox/mono-checkbox.d.ts +0 -1
  43. package/dist/src/components/chip/mono-chip.d.ts +0 -1
  44. package/dist/src/components/date/mono-date.d.ts +0 -1
  45. package/dist/src/components/drawer/mono-drawer.d.ts +0 -1
  46. package/dist/src/components/dropdown/mono-dropdown.d.ts +0 -1
  47. package/dist/src/components/dropdown-table/mono-dropdown-table.d.ts +0 -1
  48. package/dist/src/components/file-upload/mono-file-upload.d.ts +0 -1
  49. package/dist/src/components/filter/mono-filter-builder.d.ts +0 -1
  50. package/dist/src/components/input/mono-input.d.ts +0 -1
  51. package/dist/src/components/menu/mono-menu.d.ts +0 -1
  52. package/dist/src/components/modal/mono-modal.d.ts +0 -1
  53. package/dist/src/components/nav/mono-nav.d.ts +0 -1
  54. package/dist/src/components/otp/mono-otp.d.ts +0 -1
  55. package/dist/src/components/radio/mono-radio.d.ts +0 -1
  56. package/dist/src/components/rich-text-editor/mono-rich-text-editor.d.ts +0 -1
  57. package/dist/src/components/select/mono-select.d.ts +0 -1
  58. package/dist/src/components/sidebar/mono-sidebar.d.ts +0 -1
  59. package/dist/src/components/slider/mono-slider.d.ts +0 -1
  60. package/dist/src/components/switch/mono-switch.d.ts +0 -1
  61. package/dist/src/components/table/column-autosize.d.ts +23 -1
  62. package/dist/src/components/table/mono-data-grid.d.ts +6 -0
  63. package/dist/src/components/table/mono-table-checkbox.d.ts +0 -1
  64. package/dist/src/components/table/mono-table-detail.d.ts +0 -1
  65. package/dist/src/components/table/mono-table-empty.d.ts +0 -1
  66. package/dist/src/components/table/mono-table-error.d.ts +0 -1
  67. package/dist/src/components/table/mono-table-info.d.ts +0 -1
  68. package/dist/src/components/table/mono-table-loading.d.ts +0 -1
  69. package/dist/src/components/table/mono-table-page-size.d.ts +0 -1
  70. package/dist/src/components/table/mono-table-paging-group.d.ts +0 -1
  71. package/dist/src/components/table/mono-table-paging.d.ts +0 -1
  72. package/dist/src/components/table/mono-table-search.d.ts +0 -1
  73. package/dist/src/components/table/mono-table-sort.d.ts +0 -1
  74. package/dist/src/components/table/mono-table-summary.d.ts +0 -1
  75. package/dist/src/components/table/mono-table-th.d.ts +0 -1
  76. package/dist/src/components/table/table-controller-core.d.ts +2 -0
  77. package/dist/src/components/tabs/mono-tabs.d.ts +0 -1
  78. package/dist/src/components/tag-input/mono-tag-input.d.ts +0 -1
  79. package/dist/src/components/textarea/mono-textarea.d.ts +0 -1
  80. package/dist/src/components/tooltip/field-tooltip-addon.d.ts +5 -0
  81. package/dist/src/composables/popup-portal.d.ts +24 -1
  82. package/dist/src/utils/data-source-read.d.ts +10 -1
  83. package/dist/{styles-BODNpZV1.js → styles-D-ergrfR.js} +1 -1
  84. package/dist/{tooltip-Drekihf5.js → tooltip-Cu5IrDS9.js} +1 -2
  85. package/dist/tooltip.js +2 -3
  86. package/dist/ui/accordion.js +4 -11
  87. package/dist/ui/alert.js +3 -10
  88. package/dist/ui/breadcrumb.js +4 -14
  89. package/dist/ui/button-dropdown.js +22 -15
  90. package/dist/ui/button.js +1 -1
  91. package/dist/ui/card.js +4 -11
  92. package/dist/ui/chart.js +4 -23
  93. package/dist/ui/checkbox.js +4 -11
  94. package/dist/ui/chip.js +6 -9
  95. package/dist/ui/date.js +5 -12
  96. package/dist/ui/drawer.js +5 -12
  97. package/dist/ui/dropdown-table.js +89 -37
  98. package/dist/ui/dropdown.js +34 -21
  99. package/dist/ui/file-upload.js +4 -11
  100. package/dist/ui/filter.js +3 -10
  101. package/dist/ui/form.js +1 -1
  102. package/dist/ui/index.css +3840 -3840
  103. package/dist/ui/input.js +6 -13
  104. package/dist/ui/menu.js +4 -11
  105. package/dist/ui/modal.js +6 -13
  106. package/dist/ui/nav.js +4 -11
  107. package/dist/ui/otp.js +6 -13
  108. package/dist/ui/radio.js +4 -11
  109. package/dist/ui/rich-text-editor.js +4 -11
  110. package/dist/ui/select.js +12 -14
  111. package/dist/ui/shadow/accordion.js +1 -1
  112. package/dist/ui/shadow/alert.js +1 -1
  113. package/dist/ui/shadow/breadcrumb.js +1 -1
  114. package/dist/ui/shadow/button-dropdown.js +21 -7
  115. package/dist/ui/shadow/button.js +1 -1
  116. package/dist/ui/shadow/card.js +1 -1
  117. package/dist/ui/shadow/chart.js +3 -3
  118. package/dist/ui/shadow/checkbox.js +2 -2
  119. package/dist/ui/shadow/chip.js +1 -1
  120. package/dist/ui/shadow/date.js +4 -4
  121. package/dist/ui/shadow/drawer.js +2 -2
  122. package/dist/ui/shadow/dropdown-table.js +159 -34
  123. package/dist/ui/shadow/dropdown.js +31 -11
  124. package/dist/ui/shadow/file-upload.js +2 -2
  125. package/dist/ui/shadow/filter.js +1 -1
  126. package/dist/ui/shadow/input.js +5 -5
  127. package/dist/ui/shadow/menu.js +1 -1
  128. package/dist/ui/shadow/modal.js +3 -3
  129. package/dist/ui/shadow/nav.js +1 -1
  130. package/dist/ui/shadow/otp.js +5 -5
  131. package/dist/ui/shadow/radio.js +2 -2
  132. package/dist/ui/shadow/rich-text-editor.js +2 -2
  133. package/dist/ui/shadow/select.js +11 -6
  134. package/dist/ui/shadow/sidebar.js +2 -2
  135. package/dist/ui/shadow/slider.js +4 -4
  136. package/dist/ui/shadow/switch.js +2 -2
  137. package/dist/ui/shadow/table.js +84 -20
  138. package/dist/ui/shadow/tabs.js +1 -1
  139. package/dist/ui/shadow/tag-input.js +117 -21
  140. package/dist/ui/shadow/textarea.js +4 -4
  141. package/dist/ui/sidebar.js +4 -11
  142. package/dist/ui/slider.js +5 -12
  143. package/dist/ui/switch.js +4 -11
  144. package/dist/ui/table.js +85 -64
  145. package/dist/ui/tabs.js +4 -11
  146. package/dist/ui/tag-input.js +118 -29
  147. package/dist/ui/textarea.js +6 -13
  148. package/dist/ui/theme/luma.css +495 -495
  149. package/dist/ui/theme/lyra.css +495 -495
  150. package/dist/ui/theme/maia.css +495 -495
  151. package/dist/ui/theme/mira.css +495 -495
  152. package/dist/ui/theme/nova.css +495 -495
  153. package/dist/ui/theme/one.css +742 -742
  154. package/dist/ui/theme/rhea.css +495 -495
  155. package/dist/ui/theme/sera.css +495 -495
  156. package/dist/ui/theme/vega.css +495 -495
  157. package/package.json +2 -2
  158. package/dist/field-validation.css_raw-B3Iu33rS.js +0 -178
  159. package/dist/input.css_raw-CQu2fAsU.js +0 -5
  160. package/dist/mono-button-Cy5-Y0At.js +0 -878
  161. package/dist/tooltip-loader-3U9FTOXj.js +0 -20
  162. package/dist/tooltip-loader-Dcp9AUZn.js +0 -23
@@ -1,8 +1,8 @@
1
1
  import { t as createNotifier } from "./notifier-BIrqUzRh.js";
2
2
  import { a as parseFieldPath, c as toODataClause, l as toODataSelector, n as isPath, o as projectFields, r as mergePatch, s as setFieldValue, t as getFieldValue } from "./field-path-BabiMrrA.js";
3
3
  import { C as resolveSearchEntries, D as compileFilterPredicate, E as andPredicates, O as joinFilters, S as plainSearchColumns, T as andFilters, f as mergeSearchFields, g as customRemoteClause, h as customPredicate, n as describeError, o as isCanceled, u as DEFAULT_SEARCH_FIELDS, v as hasCustomSearch, w as searchEntryFor, y as hasWildcardSearch } from "./normalize-error-BmLbgANw.js";
4
- import { a as buildGroups, c as isGroupNode, i as searchFilterOf, o as collectGroupPaths, r as readAllRows, s as flattenLeaves } from "./data-source-read-i6CYSUEl.js";
5
- import { a as resolveDataSourceOptions, c as composeSummaryApply, d as createApplyGate, f as isRolledUp, h as monoArraySource, i as normalizeSortList, l as summaryAliases, m as storeRows, n as extraLoadOptions, o as toList, p as loadApply, s as buildSummaryApply, t as dataSourceOptionsKey, u as summaryFilterOf } from "./data-source-options-Cz9fVLK8.js";
4
+ import { a as buildGroups, c as isGroupNode, i as searchFilterOf, o as collectGroupPaths, r as readAllRows, s as flattenLeaves } from "./data-source-read-HyBCRg1t.js";
5
+ import { a as resolveDataSourceOptions, c as composeSummaryApply, d as createApplyGate, f as isRolledUp, h as monoArraySource, i as normalizeSortList, l as summaryAliases, m as storeRows, n as extraLoadOptions, o as toList, p as loadApply, s as buildSummaryApply, t as dataSourceOptionsKey, u as summaryFilterOf } from "./data-source-options-BM4r4PRw.js";
6
6
  import { n as unwrapReactive } from "./reactive-Dtd-esHO.js";
7
7
  import { t as arrayToODataString } from "./filter-odata-Bi27XUpQ.js";
8
8
  import { t as monoFilterBuilder } from "./filter-builder-B6Y2mmbM.js";
@@ -1004,6 +1004,16 @@ function monoDataGrid(ds = null, opts = {}) {
1004
1004
  const checkedRows = /* @__PURE__ */ new Map();
1005
1005
  let checkConfig = {};
1006
1006
  let checkPending = false;
1007
+ /**
1008
+ * Bumped on every selection notify (a rejected toggle included — its subscribers repaint the
1009
+ * revert), so a listener can tell a selection change from the grid's other notifies without
1010
+ * diffing the store. See `MonoCheckHandle.version`.
1011
+ */
1012
+ let checkVersion = 0;
1013
+ function checkChanged() {
1014
+ checkVersion += 1;
1015
+ notify();
1016
+ }
1007
1017
  /** `keyValue` as a list (empty = project nothing, i.e. keep the whole row). */
1008
1018
  function checkKeys() {
1009
1019
  const k = checkConfig.keyValue;
@@ -1126,26 +1136,26 @@ function monoDataGrid(ds = null, opts = {}) {
1126
1136
  if (next) checkedRows.set(key, item);
1127
1137
  else checkedRows.delete(key);
1128
1138
  }
1129
- notify();
1139
+ checkChanged();
1130
1140
  },
1131
1141
  selectPage() {
1132
1142
  addChecked(ctrl.items);
1133
- notify();
1143
+ checkChanged();
1134
1144
  },
1135
1145
  replace(rows) {
1136
1146
  checkedRows.clear();
1137
1147
  addChecked(rows, false);
1138
- notify();
1148
+ checkChanged();
1139
1149
  },
1140
1150
  async selectAll() {
1141
1151
  if (checkPending) return;
1142
1152
  if (drainIsReusable()) {
1143
1153
  addChecked(drainedRows);
1144
- notify();
1154
+ checkChanged();
1145
1155
  return;
1146
1156
  }
1147
1157
  checkPending = true;
1148
- notify();
1158
+ checkChanged();
1149
1159
  try {
1150
1160
  const select = checkSelect();
1151
1161
  const rows = await readAllRows(bound, {
@@ -1161,7 +1171,7 @@ function monoDataGrid(ds = null, opts = {}) {
1161
1171
  throw err;
1162
1172
  } finally {
1163
1173
  checkPending = false;
1164
- notify();
1174
+ checkChanged();
1165
1175
  }
1166
1176
  },
1167
1177
  clear() {
@@ -1169,14 +1179,14 @@ function monoDataGrid(ds = null, opts = {}) {
1169
1179
  const min = checkLimits().min ?? 0;
1170
1180
  if (min > 0) {
1171
1181
  if (checkedRows.size <= min) {
1172
- notify();
1182
+ checkChanged();
1173
1183
  return;
1174
1184
  }
1175
1185
  const keep = [...checkedRows.entries()].slice(0, min);
1176
1186
  checkedRows.clear();
1177
1187
  for (const [key, row] of keep) checkedRows.set(key, row);
1178
1188
  } else checkedRows.clear();
1179
- notify();
1189
+ checkChanged();
1180
1190
  },
1181
1191
  limits: checkLimits,
1182
1192
  get atMax() {
@@ -1187,6 +1197,9 @@ function monoDataGrid(ds = null, opts = {}) {
1187
1197
  const min = checkLimits().min;
1188
1198
  return min !== void 0 && checkedRows.size <= min;
1189
1199
  },
1200
+ get version() {
1201
+ return checkVersion;
1202
+ },
1190
1203
  get pending() {
1191
1204
  return checkPending;
1192
1205
  },
@@ -1278,8 +1291,53 @@ function monoDataGrid(ds = null, opts = {}) {
1278
1291
  function columns() {
1279
1292
  return columnsHandle;
1280
1293
  }
1294
+ /**
1295
+ * Row → index and row key → index over `ctrl.items`, built lazily per items ARRAY.
1296
+ *
1297
+ * `rowKey()` / `indexOfRowKey()` were linear scans, and they are per-row calls: every
1298
+ * `<mono-table-checkbox>` asks `check.isChecked(row)` on every notify, so a tick on a grid
1299
+ * holding N rows (infinity scroll and page-size "all" hold the whole set) cost O(N²).
1300
+ *
1301
+ * A HIT is always verified against the live array, and a MISS falls back to the scan
1302
+ * (rebuilding when the scan finds the row) — so an in-place mutation of `ctrl.items`, or a
1303
+ * key that moved, costs one rebuild and is never answered wrong.
1304
+ */
1305
+ let indexFor = null;
1306
+ let indexByRow = /* @__PURE__ */ new Map();
1307
+ let keyIndexFor = null;
1308
+ let indexByKey = /* @__PURE__ */ new Map();
1309
+ function rebuildRowIndex(items) {
1310
+ indexFor = items;
1311
+ indexByRow = /* @__PURE__ */ new Map();
1312
+ items.forEach((row, i) => {
1313
+ if (!indexByRow.has(row)) indexByRow.set(row, i);
1314
+ });
1315
+ }
1316
+ function indexOfRow(raw) {
1317
+ const items = ctrl.items;
1318
+ if (indexFor !== items) rebuildRowIndex(items);
1319
+ const hit = indexByRow.get(raw);
1320
+ if (hit !== void 0 && items[hit] === raw) return hit;
1321
+ const i = items.indexOf(raw);
1322
+ if (i >= 0) rebuildRowIndex(items);
1323
+ return i;
1324
+ }
1325
+ function rebuildKeyIndex(items) {
1326
+ keyIndexFor = items;
1327
+ indexByKey = /* @__PURE__ */ new Map();
1328
+ items.forEach((row, i) => {
1329
+ const k = rowKeyOf(row, i);
1330
+ if (!indexByKey.has(k)) indexByKey.set(k, i);
1331
+ });
1332
+ }
1281
1333
  function indexOfRowKey(rowKey) {
1282
- return ctrl.items.findIndex((row, i) => rowKeyOf(row, i) === rowKey);
1334
+ const items = ctrl.items;
1335
+ if (keyIndexFor !== items) rebuildKeyIndex(items);
1336
+ const hit = indexByKey.get(rowKey);
1337
+ if (hit !== void 0 && hit < items.length && rowKeyOf(items[hit], hit) === rowKey) return hit;
1338
+ const i = items.findIndex((row, j) => rowKeyOf(row, j) === rowKey);
1339
+ if (i >= 0) rebuildKeyIndex(items);
1340
+ return i;
1283
1341
  }
1284
1342
  function rowByKey(rowKey) {
1285
1343
  const i = indexOfRowKey(rowKey);
@@ -1394,7 +1452,12 @@ function monoDataGrid(ds = null, opts = {}) {
1394
1452
  return !!row && row._Type === EDITABLE_MARK;
1395
1453
  }
1396
1454
  function isEditingCell(rowKeyStr, field) {
1397
- if (!registeredColumns().some((c) => c.field === field && !!c.editable)) return false;
1455
+ let editableCol = false;
1456
+ for (const el of columnEls) if (el.field === field && el.editable) {
1457
+ editableCol = true;
1458
+ break;
1459
+ }
1460
+ if (!editableCol) return false;
1398
1461
  return ctrl.editingKey === rowKeyStr || isEditableRow(rowByKey(rowKeyStr));
1399
1462
  }
1400
1463
  function commitCell(rowKey, field, value) {
@@ -2166,7 +2229,7 @@ function monoDataGrid(ds = null, opts = {}) {
2166
2229
  */
2167
2230
  function rowKey(row) {
2168
2231
  const raw = unwrapReactive(row);
2169
- const i = ctrl.items.indexOf(raw);
2232
+ const i = indexOfRow(raw);
2170
2233
  if (i >= 0) return rowKeyOf(raw, i);
2171
2234
  const direct = rowKeyOf(raw, NaN);
2172
2235
  if (direct !== "NaN") return direct;
@@ -2213,26 +2276,50 @@ function monoDataGrid(ds = null, opts = {}) {
2213
2276
  if (cols.length && out && typeof out === "object") for (const c of cols) out[c.field] = c.map(row?.[c.field], row, index);
2214
2277
  return out;
2215
2278
  }
2216
- /** Recompute `ctrl.mapped` from `ctrl.items`. Cheap no-op without a map. */
2279
+ /** What `ctrl.mapped` was last built from — see `syncMapped`. */
2280
+ let mappedFrom = [];
2281
+ /**
2282
+ * Recompute `ctrl.mapped` from `ctrl.items`. Cheap no-op without a map.
2283
+ *
2284
+ * Skipped when nothing it reads has moved: the same `items` array (same length), the same
2285
+ * row set (`rowSetVersion`) and the same map config. It runs on EVERY notifier flush, so a
2286
+ * checkbox tick or a loading flip re-mapped every row — every accumulated row under infinity
2287
+ * scroll or page-size "all" — and handed out new `mapped` identities each time.
2288
+ *
2289
+ * Never skipped while a row can be edited IN PLACE (an inline edit, a `showForm` row, form
2290
+ * ops): those write straight into the row objects, which no identity check can see.
2291
+ */
2217
2292
  function syncMapped() {
2218
2293
  if (!hasMap()) {
2219
2294
  ctrl.mapped = ctrl.items;
2295
+ mappedFrom = [];
2220
2296
  return;
2221
2297
  }
2298
+ const from = [
2299
+ ctrl.items,
2300
+ ctrl.items.length,
2301
+ rowSetVersion,
2302
+ elementProps.th,
2303
+ opts.map
2304
+ ];
2305
+ if (!(formHandle != null || formOps.length > 0 || ctrl.editingKey != null) && from.length === mappedFrom.length && from.every((v, i) => Object.is(v, mappedFrom[i]))) return;
2222
2306
  const cols = mapColumns();
2223
2307
  ctrl.mapped = ctrl.items.map((row, i) => mapRow(row, i, cols));
2308
+ mappedFrom = from;
2224
2309
  }
2225
2310
  /** Flatten `ctrl.items` into the ready-to-render, keyed `displayRows` list. */
2226
2311
  function buildDisplayRows() {
2227
2312
  const out = [];
2228
2313
  const cols = mapColumns();
2229
2314
  if (!isGrouped()) {
2315
+ syncMapped();
2316
+ const mapped = ctrl.mapped;
2230
2317
  ctrl.items.forEach((row, i) => out.push({
2231
2318
  key: `r:${rowKeyOf(row, i)}`,
2232
2319
  kind: "row",
2233
2320
  level: 0,
2234
2321
  row,
2235
- mapped: mapRow(row, i, cols)
2322
+ mapped: mapped[i]
2236
2323
  }));
2237
2324
  return out;
2238
2325
  }
@@ -2275,9 +2362,29 @@ function monoDataGrid(ds = null, opts = {}) {
2275
2362
  }
2276
2363
  /** Build the full group tree from every matched row the source holds. */
2277
2364
  function fullGroups() {
2278
- const raw = bound ? [...bound.items?.() ?? []] : [];
2279
- return buildGroups(flattenLeaves(raw), groupFields, collapsed);
2365
+ const src = bound ? bound.items?.() ?? [] : [];
2366
+ const from = [
2367
+ src,
2368
+ src.length,
2369
+ groupFields.join("\0"),
2370
+ rowSetVersion
2371
+ ];
2372
+ if (!(!(formHandle != null || formOps.length > 0 || ctrl.editingKey != null) && from.length === groupTreeFrom.length && from.every((v, i) => Object.is(v, groupTreeFrom[i])))) {
2373
+ groupTree = buildGroups(flattenLeaves([...src]), groupFields, collapsed);
2374
+ groupTreeFrom = from;
2375
+ return groupTree;
2376
+ }
2377
+ const stamp = (nodes) => {
2378
+ for (const node of nodes) {
2379
+ node.collapsed = collapsed.has(node.path);
2380
+ if (node.items.length && isGroupNode(node.items[0])) stamp(node.items);
2381
+ }
2382
+ };
2383
+ stamp(groupTree);
2384
+ return groupTree;
2280
2385
  }
2386
+ let groupTreeFrom = [];
2387
+ let groupTree = [];
2281
2388
  /** Index every group node by path (full, unsliced) for `groupPageInfo`. */
2282
2389
  function indexPaths(nodes) {
2283
2390
  for (const node of nodes) {
@@ -3869,12 +3976,16 @@ function monoDataGrid(ds = null, opts = {}) {
3869
3976
  async function getData() {
3870
3977
  const s = bound;
3871
3978
  if (!s) return [];
3979
+ const loadOptions = {};
3980
+ if (resolvedOpts.expand !== void 0) loadOptions.expand = resolvedOpts.expand;
3981
+ if (resolvedOpts.customQueryParams !== void 0) loadOptions.customQueryParams = resolvedOpts.customQueryParams;
3872
3982
  suppressSync = true;
3873
3983
  try {
3874
3984
  return await readAllRows(s, {
3875
3985
  chunkSize,
3876
3986
  select: opts.select ?? toList(resolvedOpts.select),
3877
- sort: mergedSort()
3987
+ sort: mergedSort(),
3988
+ ...Object.keys(loadOptions).length ? { loadOptions } : {}
3878
3989
  });
3879
3990
  } finally {
3880
3991
  suppressSync = false;
@@ -3908,7 +4019,7 @@ function monoDataGrid(ds = null, opts = {}) {
3908
4019
  });
3909
4020
  }
3910
4021
  async function exportReport(options) {
3911
- const { exportTable } = await import("./export-DgomqI_3.js");
4022
+ const { exportTable } = await import("./export-ixRdCS2y.js");
3912
4023
  return exportTable(options);
3913
4024
  }
3914
4025
  function subscribe(cb) {
@@ -1,4 +1,4 @@
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";
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-kvLVIf1V.js";
2
2
  import { html } from "lit";
3
3
 
4
4
  //#region src/composables/mono-pending.ts
@@ -179,6 +179,9 @@ function monoForm(options) {
179
179
  const state = {};
180
180
  /** Props pushed at runtime by the `setProp()` METHOD (watchers / outside code). */
181
181
  const dynamicProps = {};
182
+ const mergedProps = {};
183
+ /** Keys whose `dynamicProps` moved since their merged props were cached. */
184
+ const propsDirty = /* @__PURE__ */ new Set();
182
185
  const elements = {};
183
186
  for (const key of keys) {
184
187
  const initial = inputs[key].value;
@@ -212,10 +215,14 @@ function monoForm(options) {
212
215
  * it is merged LAST over whatever the `setProp()` method has accumulated.
213
216
  */
214
217
  function propsFor(key) {
218
+ const hit = mergedProps[key];
219
+ if (hit && !propsDirty.has(key)) return hit;
215
220
  const merged = {
216
221
  ...dynamicProps[key] ?? {},
217
222
  ...inputs[key]?.props ?? {}
218
223
  };
224
+ mergedProps[key] = merged;
225
+ propsDirty.delete(key);
219
226
  state[key] && (state[key].props = merged);
220
227
  return merged;
221
228
  }
@@ -320,7 +327,10 @@ function monoForm(options) {
320
327
  bag[p] = v;
321
328
  changed = true;
322
329
  }
323
- if (changed) notify();
330
+ if (changed) {
331
+ propsDirty.add(arg.key);
332
+ notify();
333
+ }
324
334
  }
325
335
  function setValidation(arg) {
326
336
  const item = state[arg?.key];
@@ -352,6 +362,7 @@ function monoForm(options) {
352
362
  };
353
363
  state[key].touched = false;
354
364
  dynamicProps[key] = {};
365
+ propsDirty.add(key);
355
366
  }
356
367
  notify();
357
368
  }
@@ -479,9 +479,11 @@ function headerWidth(cell, host) {
479
479
  * One auto-sized column, owned by its `mono-table-th`. `schedule()` coalesces every trigger (a
480
480
  * controller notify, a body mutation, typing in an editor) into one measurement per frame.
481
481
  */
482
- var ColumnAutoSize = class {
482
+ var ColumnAutoSize = class ColumnAutoSize {
483
483
  constructor(host) {
484
484
  this.host = host;
485
+ this.growOnly = false;
486
+ this._floor = 0;
485
487
  this._raf = 0;
486
488
  this._onInput = (e) => {
487
489
  const t = e.target;
@@ -492,16 +494,37 @@ var ColumnAutoSize = class {
492
494
  this.schedule();
493
495
  };
494
496
  }
497
+ static {
498
+ this._queued = /* @__PURE__ */ new Set();
499
+ }
500
+ static {
501
+ this._frame = 0;
502
+ }
503
+ static _flush() {
504
+ ColumnAutoSize._frame = 0;
505
+ const batch = [...ColumnAutoSize._queued];
506
+ ColumnAutoSize._queued.clear();
507
+ const writes = batch.map((s) => {
508
+ s._raf = 0;
509
+ return s._measure();
510
+ });
511
+ for (const write of writes) write?.();
512
+ }
495
513
  schedule() {
496
514
  if (this._raf) return;
497
- this._raf = requestAnimationFrame(() => {
498
- this._raf = 0;
499
- this._run();
500
- });
515
+ this._raf = 1;
516
+ ColumnAutoSize._queued.add(this);
517
+ ColumnAutoSize._frame ||= requestAnimationFrame(() => ColumnAutoSize._flush());
518
+ }
519
+ /** Forget the grow-only floor (new rows) and re-measure. */
520
+ resetFloor() {
521
+ if (!this._floor) return;
522
+ this._floor = 0;
523
+ this.schedule();
501
524
  }
502
525
  /** Stop watching, and hand the column back to whatever width it is given next. */
503
526
  stop(clear = false) {
504
- if (this._raf) cancelAnimationFrame(this._raf);
527
+ ColumnAutoSize._queued.delete(this);
505
528
  this._raf = 0;
506
529
  this._unwatch();
507
530
  if (clear && this._wrote) {
@@ -533,10 +556,11 @@ var ColumnAutoSize = class {
533
556
  document.fonts?.removeEventListener?.("loadingdone", this._onFonts);
534
557
  this._table = void 0;
535
558
  }
536
- _run() {
559
+ /** Measure now (reads only); returns the write to apply after every sizer has measured. */
560
+ _measure() {
537
561
  const cell = this.host.closest("th, td");
538
562
  const table = cell?.closest("table");
539
- if (!cell || !table || !this.host.isConnected) return;
563
+ if (!cell || !table || !this.host.isConnected) return null;
540
564
  this._watch(table);
541
565
  const index = headerColumnIndex(cell);
542
566
  let width = headerWidth(cell, this.host);
@@ -546,13 +570,17 @@ var ColumnAutoSize = class {
546
570
  if (target) width = Math.max(width, contentWidth(target));
547
571
  }
548
572
  width = Math.ceil(clampWidth(width + 1, this.min, this.max));
573
+ if (this.growOnly) width = this._floor = Math.max(width, this._floor);
574
+ else this._floor = 0;
549
575
  const value = `${width}px`;
550
576
  const col = colAt(table, index);
551
- if (cell.style.width !== value) cell.style.width = value;
552
- if (col && col.style.width !== value) col.style.width = value;
553
- this._wrote = {
554
- col,
555
- cell
577
+ return () => {
578
+ if (cell.style.width !== value) cell.style.width = value;
579
+ if (col && col.style.width !== value) col.style.width = value;
580
+ this._wrote = {
581
+ col,
582
+ cell
583
+ };
556
584
  };
557
585
  }
558
586
  };
@@ -621,10 +649,10 @@ function startMonoSizeAttributes() {
621
649
  applyMonoSizeAttributes(r.target);
622
650
  continue;
623
651
  }
624
- for (const node of Array.from(r.addedNodes)) if (node.nodeType === 1) scan(node);
652
+ for (const node of Array.from(r.addedNodes)) if (node.nodeType === 1 && node.isConnected) scan(node);
625
653
  if (r.removedNodes.length) removed = true;
626
654
  }
627
- if (removed) sweep();
655
+ if (removed && sizers.size) sweep();
628
656
  });
629
657
  observer.observe(document.documentElement, {
630
658
  subtree: true,
@@ -233,6 +233,8 @@ var PopupPortalController = class {
233
233
  this._classObserver = null;
234
234
  this._viewportBound = false;
235
235
  this._viewportFrame = 0;
236
+ this._wasOpen = false;
237
+ this._sizeObserver = null;
236
238
  this._onViewport = () => {
237
239
  if (!this.opts.isOpen() || this._viewportFrame) return;
238
240
  this._viewportFrame = requestAnimationFrame(() => {
@@ -254,24 +256,65 @@ var PopupPortalController = class {
254
256
  hostDisconnected() {
255
257
  this._unbindViewport();
256
258
  this._leaveStack();
259
+ this._unobserveSize();
260
+ this._wasOpen = false;
257
261
  this._classObserver?.disconnect();
258
262
  this._classObserver = null;
259
263
  if (this._portal?.parentNode) this._portal.parentNode.removeChild(this._portal);
260
264
  this._portal = null;
261
265
  this._adopted = false;
262
266
  }
267
+ /**
268
+ * Position SYNCHRONOUSLY only on the open edge; every later update of an open popup is
269
+ * coalesced into one frame (`scheduleReposition`), and the custom-property carry-over
270
+ * (`_syncPortalVars`, two `getComputedStyle`) runs on the open edge only.
271
+ *
272
+ * `reposition()` is a write-then-read forced layout, and hosts update constantly while open —
273
+ * every keystroke in a search box, every arrow-key cursor move, every controller notify — so
274
+ * running it per update cost one synchronous layout each. A frame callback still runs before
275
+ * that frame paints, so nothing visibly lags; a panel whose content resizes WITHOUT a host
276
+ * update (a consumer re-rendering its rows) is caught by the ResizeObserver instead.
277
+ */
263
278
  hostUpdated() {
264
279
  if (isServer) return;
265
280
  if (this.opts.isOpen()) {
281
+ const opening = !this._wasOpen;
282
+ this._wasOpen = true;
266
283
  this._adopt();
267
284
  this._enterStack();
268
- this._syncPortalClass();
269
- this.reposition();
285
+ if (opening) {
286
+ this._syncPortalClass();
287
+ this.reposition();
288
+ this._observeSize();
289
+ } else {
290
+ this._syncPortalClass(false);
291
+ this.scheduleReposition();
292
+ }
270
293
  } else {
294
+ this._wasOpen = false;
295
+ this._unobserveSize();
271
296
  this._leaveStack();
272
- this._syncPortalClass();
297
+ this._syncPortalClass(false);
273
298
  }
274
299
  }
300
+ /** Reposition when the panel or its anchor changes size while open (content, chips wrapping). */
301
+ _observeSize() {
302
+ if (this._sizeObserver || typeof ResizeObserver === "undefined") return;
303
+ const panel = this._panel ?? this.opts.getPanel();
304
+ const anchor = this.opts.getAnchor();
305
+ if (!panel && !anchor) return;
306
+ this._sizeObserver = new ResizeObserver(() => this.scheduleReposition());
307
+ if (panel) this._sizeObserver.observe(panel);
308
+ if (anchor) this._sizeObserver.observe(anchor);
309
+ }
310
+ _unobserveSize() {
311
+ this._sizeObserver?.disconnect();
312
+ this._sizeObserver = null;
313
+ }
314
+ /** Reposition on the next frame, coalesced with any viewport movement already pending. */
315
+ scheduleReposition() {
316
+ this._onViewport();
317
+ }
275
318
  /**
276
319
  * Only relocate to `<body>` when the host renders into light DOM
277
320
  * (`renderRoot === host`). Shadow hosts keep the panel in their shadow root.
@@ -307,8 +350,12 @@ var PopupPortalController = class {
307
350
  this._panel = panel;
308
351
  this._adopted = true;
309
352
  }
310
- /** Mirror the style-scope element's classes and `mono-*` attributes onto the portal. */
311
- _syncPortalClass() {
353
+ /**
354
+ * Mirror the style-scope element's classes and `mono-*` attributes onto the portal.
355
+ * `withVars` also carries the custom properties across — a computed-style read, so only on
356
+ * the open edge and on a scope attribute change, not on every host update.
357
+ */
358
+ _syncPortalClass(withVars = true) {
312
359
  if (!this._portal) return;
313
360
  const scope = this.opts.getStyleScope();
314
361
  const cls = scope?.getAttribute("class") ?? "";
@@ -320,7 +367,7 @@ var PopupPortalController = class {
320
367
  }
321
368
  for (const a of Array.from(this._portal.attributes)) if (mirrored(a.name) && !wanted.has(a.name)) this._portal.removeAttribute(a.name);
322
369
  for (const [name, value] of wanted) if (this._portal.getAttribute(name) !== value) this._portal.setAttribute(name, value);
323
- this._syncPortalVars(scope);
370
+ if (withVars) this._syncPortalVars(scope);
324
371
  }
325
372
  /**
326
373
  * Carry the component's public custom properties across the portal (see
@@ -15,7 +15,6 @@ declare const MonoAccordion_base: Constructor<MonoAccordionCoreInterface> & type
15
15
  * Both register `mono-accordion`, so a document loads only one.
16
16
  */
17
17
  export declare class MonoAccordion extends MonoAccordion_base {
18
- static styles: import("lit").CSSResult[];
19
18
  protected createRenderRoot(): HTMLElement;
20
19
  private _slotObserver?;
21
20
  private _slotTitle;
@@ -18,7 +18,6 @@ declare const MonoAlert_base: Constructor<MonoAlertCoreInterface> & typeof LitEl
18
18
  * rendered, and their captured nodes are parked (kept parented, invisible).
19
19
  */
20
20
  export declare class MonoAlert extends MonoAlert_base {
21
- static styles: import("lit").CSSResult[];
22
21
  protected createRenderRoot(): HTMLElement;
23
22
  private _slotsCaptured;
24
23
  private _buckets;
@@ -16,7 +16,6 @@ declare const MonoBreadcrumbList_base: Constructor<MonoBreadcrumbListCoreInterfa
16
16
  * (`@mono-lit/helper/ui/shadow/breadcrumb`) supports standalone only.
17
17
  */
18
18
  export declare class MonoBreadcrumbList extends MonoBreadcrumbList_base {
19
- static styles: import("lit").CSSResult[];
20
19
  protected createRenderRoot(): HTMLElement;
21
20
  private _parent;
22
21
  connectedCallback(): void;
@@ -18,7 +18,6 @@ declare const MonoBreadcrumb_base: Constructor<MonoBreadcrumbCoreInterface> & ty
18
18
  * so a document loads only one.
19
19
  */
20
20
  export declare class MonoBreadcrumb extends MonoBreadcrumb_base {
21
- static styles: import("lit").CSSResult[];
22
21
  protected createRenderRoot(): HTMLElement;
23
22
  private _slotsCaptured;
24
23
  private _hasBodySlot;
@@ -17,7 +17,6 @@ declare const MonoButtonDropdown_base: Constructor<MonoButtonDropdownCoreInterfa
17
17
  * build shares it and only swaps the embedded button's tag.
18
18
  */
19
19
  export declare class MonoButtonDropdown extends MonoButtonDropdown_base {
20
- static styles: import("lit").CSSResult[];
21
20
  protected createRenderRoot(): HTMLElement;
22
21
  /**
23
22
  * The panel is a STATIC element here, not something a helper returns.
@@ -22,7 +22,6 @@ declare const MonoButton_base: Constructor<MonoButtonCoreInterface> & typeof Lit
22
22
  * document loads only one.
23
23
  */
24
24
  export declare class MonoButton extends MonoButton_base {
25
- static styles: import("lit").CSSResult[];
26
25
  protected createRenderRoot(): HTMLElement;
27
26
  private _buckets;
28
27
  private _slotsCaptured;
@@ -24,7 +24,6 @@ declare const MonoCard_base: Constructor<MonoCardCoreInterface> & typeof LitElem
24
24
  * same document.
25
25
  */
26
26
  export declare class MonoCard extends MonoCard_base {
27
- static styles: import("lit").CSSResult[];
28
27
  protected createRenderRoot(): HTMLElement;
29
28
  private _slotsCaptured;
30
29
  private _buckets;
@@ -6,7 +6,6 @@ import { LitElement, TemplateResult } from "lit";
6
6
  declare const MonoChartBar_base: Constructor<MonoChartCoreInterface> & typeof LitElement;
7
7
  /** `<mono-chart-bar>` — vertical bars. */
8
8
  export declare class MonoChartBar extends MonoChartBar_base {
9
- static styles: import("lit").CSSResult[];
10
9
  protected _presetType: MonoChartType;
11
10
  protected createRenderRoot(): HTMLElement;
12
11
  protected render(): TemplateResult;
@@ -14,7 +13,6 @@ export declare class MonoChartBar extends MonoChartBar_base {
14
13
  declare const MonoChartLine_base: Constructor<MonoChartCoreInterface> & typeof LitElement;
15
14
  /** `<mono-chart-line>` — a line series. */
16
15
  export declare class MonoChartLine extends MonoChartLine_base {
17
- static styles: import("lit").CSSResult[];
18
16
  protected _presetType: MonoChartType;
19
17
  protected createRenderRoot(): HTMLElement;
20
18
  protected render(): TemplateResult;
@@ -22,7 +20,6 @@ export declare class MonoChartLine extends MonoChartLine_base {
22
20
  declare const MonoChartPie_base: Constructor<MonoChartCoreInterface> & typeof LitElement;
23
21
  /** `<mono-chart-pie>` — pie slices. */
24
22
  export declare class MonoChartPie extends MonoChartPie_base {
25
- static styles: import("lit").CSSResult[];
26
23
  protected _presetType: MonoChartType;
27
24
  protected createRenderRoot(): HTMLElement;
28
25
  protected render(): TemplateResult;
@@ -30,7 +27,6 @@ export declare class MonoChartPie extends MonoChartPie_base {
30
27
  declare const MonoChartDoughnut_base: Constructor<MonoChartCoreInterface> & typeof LitElement;
31
28
  /** `<mono-chart-doughnut>` — a pie with a hole. */
32
29
  export declare class MonoChartDoughnut extends MonoChartDoughnut_base {
33
- static styles: import("lit").CSSResult[];
34
30
  protected _presetType: MonoChartType;
35
31
  protected createRenderRoot(): HTMLElement;
36
32
  protected render(): TemplateResult;
@@ -21,7 +21,6 @@ declare const MonoChart_base: Constructor<MonoChartCoreInterface> & typeof LitEl
21
21
  * ```
22
22
  */
23
23
  export declare class MonoChart extends MonoChart_base {
24
- static styles: import("lit").CSSResult[];
25
24
  protected createRenderRoot(): HTMLElement;
26
25
  protected render(): TemplateResult;
27
26
  }
@@ -17,7 +17,6 @@ declare const MonoCheckbox_base: Constructor<MonoCheckboxCoreInterface> & typeof
17
17
  * document loads only one.
18
18
  */
19
19
  export declare class MonoCheckbox extends MonoCheckbox_base {
20
- static styles: import("lit").CSSResult[];
21
20
  protected createRenderRoot(): HTMLElement;
22
21
  private _slotsCaptured;
23
22
  private _slotIcon;
@@ -21,7 +21,6 @@ declare const MonoChip_base: Constructor<MonoChipCoreInterface> & typeof LitElem
21
21
  * only one.
22
22
  */
23
23
  export declare class MonoChip extends MonoChip_base {
24
- static styles: import("lit").CSSResult[];
25
24
  protected createRenderRoot(): HTMLElement;
26
25
  private _buckets;
27
26
  private _slotsCaptured;
@@ -14,7 +14,6 @@ declare const MonoDate_base: Constructor<MonoDateCoreInterface> & typeof LitElem
14
14
  * `mono-date`, so a document loads one.
15
15
  */
16
16
  export declare class MonoDate extends MonoDate_base {
17
- static styles: import("lit").CSSResult[];
18
17
  protected createRenderRoot(): HTMLElement;
19
18
  }
20
19
  declare global {