@motifx-community/ui 0.1.0-beta.6 → 0.1.0-beta.7

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 (151) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/datagrid/grid-lookup.d.ts +3 -3
  3. package/dist/components/datagrid/model/GridModel.d.ts +2 -0
  4. package/dist/components/listbox/list-rows.d.ts +2 -0
  5. package/dist/index.js +72 -11
  6. package/dist/index.js.map +1 -1
  7. package/dist/parts/data/DataItems.d.ts +2 -0
  8. package/dist/parts/data/KeyedItems.d.ts +1 -0
  9. package/dist/parts/list/OptionList.d.ts +6 -0
  10. package/dist/parts/list/item-source.d.ts +4 -0
  11. package/docs/accordion.md +1 -1
  12. package/docs/actionsheet.md +1 -1
  13. package/docs/appbar.md +1 -1
  14. package/docs/avatar.md +1 -1
  15. package/docs/badge.md +1 -1
  16. package/docs/bar-gauge-angles.md +1 -1
  17. package/docs/bar-gauge-data.md +1 -1
  18. package/docs/bar-gauge-labels.md +1 -1
  19. package/docs/bar-gauge.md +1 -1
  20. package/docs/barcode.md +1 -1
  21. package/docs/bottomnavigation.md +1 -1
  22. package/docs/bottomsheet.md +1 -1
  23. package/docs/breadcrumb.md +1 -1
  24. package/docs/button.md +1 -1
  25. package/docs/buttongroup.md +1 -1
  26. package/docs/buttons.md +1 -1
  27. package/docs/calendar.md +1 -1
  28. package/docs/card.md +1 -1
  29. package/docs/chart-bars.md +1 -1
  30. package/docs/chart-candles.md +1 -1
  31. package/docs/chart-funnel.md +1 -1
  32. package/docs/chart-heatmap.md +1 -1
  33. package/docs/chart-lines.md +1 -1
  34. package/docs/chart-live.md +1 -1
  35. package/docs/chart-pie.md +1 -1
  36. package/docs/chart-radar.md +1 -1
  37. package/docs/chart-ranges.md +1 -1
  38. package/docs/chart-references.md +1 -1
  39. package/docs/chart-scatter.md +1 -1
  40. package/docs/chart-waterfall.md +1 -1
  41. package/docs/chart-zoom.md +1 -1
  42. package/docs/chart.md +1 -1
  43. package/docs/checkbox.md +1 -1
  44. package/docs/chip.md +1 -1
  45. package/docs/choice.md +1 -1
  46. package/docs/colorbox.md +1 -1
  47. package/docs/combobox.md +1 -1
  48. package/docs/control.md +1 -1
  49. package/docs/data.md +1 -1
  50. package/docs/datagrid-api.md +1 -1
  51. package/docs/datagrid-bands.md +1 -1
  52. package/docs/datagrid-drag-select.md +1 -1
  53. package/docs/datagrid-drag.md +1 -1
  54. package/docs/datagrid-editing.md +1 -1
  55. package/docs/datagrid-filtering.md +1 -1
  56. package/docs/datagrid-forms.md +1 -1
  57. package/docs/datagrid-grouping.md +1 -1
  58. package/docs/datagrid-layout.md +1 -1
  59. package/docs/datagrid-lookups.md +2 -2
  60. package/docs/datagrid-master-detail.md +1 -1
  61. package/docs/datagrid-scrolling.md +1 -1
  62. package/docs/datagrid-selection.md +1 -1
  63. package/docs/datagrid.md +1 -1
  64. package/docs/datebox.md +1 -1
  65. package/docs/daterangebox.md +1 -1
  66. package/docs/display.md +1 -1
  67. package/docs/draggable.md +1 -1
  68. package/docs/drawer.md +1 -1
  69. package/docs/dropdown.md +1 -1
  70. package/docs/editors.md +1 -1
  71. package/docs/feedback.md +1 -1
  72. package/docs/fileuploader.md +1 -1
  73. package/docs/filterbuilder.md +1 -1
  74. package/docs/formlayout.md +1 -1
  75. package/docs/foundations.md +1 -1
  76. package/docs/gallery.md +1 -1
  77. package/docs/gauge-base.md +1 -1
  78. package/docs/gauge-circular.md +1 -1
  79. package/docs/gauge-dashboards.md +1 -1
  80. package/docs/gauge-linear.md +1 -1
  81. package/docs/gauge-markers.md +1 -1
  82. package/docs/gauge-marks.md +1 -1
  83. package/docs/gauge-ranges.md +1 -1
  84. package/docs/gauge-scales.md +1 -1
  85. package/docs/gauge.md +1 -1
  86. package/docs/home.md +1 -1
  87. package/docs/keyboard.md +1 -1
  88. package/docs/language.md +1 -1
  89. package/docs/layout.md +1 -1
  90. package/docs/listbox.md +1 -1
  91. package/docs/loadpanel.md +1 -1
  92. package/docs/lookup.md +1 -1
  93. package/docs/menus.md +1 -1
  94. package/docs/multiview.md +1 -1
  95. package/docs/navigation.md +1 -1
  96. package/docs/numberbox.md +1 -1
  97. package/docs/otpinput.md +1 -1
  98. package/docs/pagination.md +1 -1
  99. package/docs/popover.md +1 -1
  100. package/docs/progress.md +1 -1
  101. package/docs/qrcode.md +1 -1
  102. package/docs/radiogroup.md +1 -1
  103. package/docs/rating.md +1 -1
  104. package/docs/resizable.md +1 -1
  105. package/docs/scheduler-agenda.md +1 -1
  106. package/docs/scheduler-big-data.md +1 -1
  107. package/docs/scheduler-editing.md +1 -1
  108. package/docs/scheduler-form.md +1 -1
  109. package/docs/scheduler-icalendar.md +1 -1
  110. package/docs/scheduler-mobile.md +1 -1
  111. package/docs/scheduler-recurrence.md +1 -1
  112. package/docs/scheduler-resources.md +1 -1
  113. package/docs/scheduler-timeline.md +1 -1
  114. package/docs/scheduler.md +1 -1
  115. package/docs/scrollview.md +1 -1
  116. package/docs/showcase-home.md +1 -1
  117. package/docs/showcase.md +1 -1
  118. package/docs/signature.md +1 -1
  119. package/docs/skeleton.md +1 -1
  120. package/docs/slider.md +1 -1
  121. package/docs/sortable.md +1 -1
  122. package/docs/sparkline.md +1 -1
  123. package/docs/speeddial.md +1 -1
  124. package/docs/splitter.md +1 -1
  125. package/docs/stepper.md +1 -1
  126. package/docs/switch.md +1 -1
  127. package/docs/tabdocs-dock.md +1 -1
  128. package/docs/tabdocs-drag.md +1 -1
  129. package/docs/tabdocs-menus.md +1 -1
  130. package/docs/tabdocs-mobile.md +1 -1
  131. package/docs/tabdocs-tabs.md +1 -1
  132. package/docs/tabdocs-windows.md +1 -1
  133. package/docs/tabdocs-workspace.md +1 -1
  134. package/docs/tabdocs.md +1 -1
  135. package/docs/tabs.md +1 -1
  136. package/docs/tagbox.md +1 -1
  137. package/docs/textarea.md +1 -1
  138. package/docs/textbox.md +1 -1
  139. package/docs/tileview.md +1 -1
  140. package/docs/timeline.md +1 -1
  141. package/docs/toast.md +1 -1
  142. package/docs/tokens.md +1 -1
  143. package/docs/toolbar.md +1 -1
  144. package/docs/tooltip.md +1 -1
  145. package/docs/treeview.md +1 -1
  146. package/docs/validationsummary.md +1 -1
  147. package/docs/window.md +1 -1
  148. package/docs/wizard.md +1 -1
  149. package/llms-full.txt +140 -140
  150. package/llms.txt +1 -1
  151. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0-beta.7] - 2026-11-08
10
+
11
+ ### Fixed
12
+
13
+ - Lookup texts are asked 20 keys at a time instead of 100 (`lookup.batchSize`), so a request that carries the keys in
14
+ its URL stays within common server limits.
15
+ - A row of a list that failed to load, and a whole list that failed, say that they could not load and load again when
16
+ pressed or with Enter, instead of staying on Loading or showing an empty list. This covers `DropDown`, `ComboBox`,
17
+ `ListBox`, `TagBox` and the header filter of `DataGrid`.
18
+ - `DataGrid`: searching the header filter of a lookup column whose `textFrom` is a field searches that field on the
19
+ server, instead of turning the matching texts into a long list of keys.
20
+ - `DataGrid`: a lookup column grouped by its own field (`calculateGroupValue` naming it, with `textFrom`) shows the text
21
+ of the key in its group rows and in an export, not the key.
22
+
9
23
  ## [0.1.0-beta.6] - 2026-11-07
10
24
 
11
25
  ### New components
@@ -33,7 +33,7 @@ export interface GridLookup<T = any> {
33
33
  * item by key.
34
34
  */
35
35
  resolve?: 'batch' | 'byKey';
36
- /** The keys per request in `'batch'` mode. The default is 100. */
36
+ /** The keys per request in `'batch'` mode. The default is 20, which keeps a request that carries the keys in its URL within common server limits. */
37
37
  batchSize?: number;
38
38
  /**
39
39
  * Sorts in-memory rows by the key (the default, as the service sorts) or by the displayed text (every
@@ -44,11 +44,11 @@ export interface GridLookup<T = any> {
44
44
  editor?: 'dropdown' | 'combobox' | 'lookup';
45
45
  /** The props passed to the editor, such as the `Lookup`'s `columns`. */
46
46
  editorOptions?: Record<string, unknown>;
47
- /** The maximum number of items containing the search panel's text that the search converts to keys. The default is 100. */
47
+ /** The maximum number of items containing the search panel's text that the search converts to keys (not used when `textFrom` is a field: the search reads that field). The default is 100. */
48
48
  searchLimit?: number;
49
49
  /** The items the editor's list loads per request while it scrolls (a data source). The default is 50. */
50
50
  pageSize?: number;
51
- /** The maximum number of items containing the header filter's search text that it converts to keys. The default is 1000. */
51
+ /** The maximum number of items containing the header filter's search text that it converts to keys (not used when `textFrom` is a field: the search reads that field). The default is 1000. */
52
52
  filterSearchLimit?: number;
53
53
  /** With `'byKey'`, the requests at the same time. The default is 6. */
54
54
  parallelRequests?: number;
@@ -436,6 +436,8 @@ export declare class GridModel<T> {
436
436
  * value, "(empty)"; a value of its own (`calculateGroupValue`, `textFrom`) as it is.
437
437
  */
438
438
  groupValue(node: GroupNode, ask?: boolean): LookupCell;
439
+ /** Whether a column's groups hold its own value: no value of their own, or `calculateGroupValue` naming the column's field (a lookup's key, whose text the group row shows). */
440
+ groupsByOwnValue(col: GridColumn<T>): boolean;
439
441
  /** "Title: value" of a group, as its row and an export show it. */
440
442
  groupCaption(node: GroupNode): string;
441
443
  /** Runs a change of the open groups and puts the active row back on the group or row it showed (or the group that hides it now). */
@@ -8,5 +8,7 @@ export declare class ListRows<T> implements ItemSource<T | SelectAllRow> {
8
8
  get count(): number;
9
9
  at(index: number): T | SelectAllRow | undefined;
10
10
  ensure(first: number, end: number): void;
11
+ failedAt(index?: number): boolean;
12
+ retryFailed(): void;
11
13
  private get offset();
12
14
  }
package/dist/index.js CHANGED
@@ -8816,7 +8816,12 @@ var KeyedItems = class KeyedItems {
8816
8816
  "resolve",
8817
8817
  void 0
8818
8818
  );
8819
- _defineProperty(this, "batchSize", 100);
8819
+ _defineProperty(
8820
+ this,
8821
+ /** The keys per request in `'batch'` mode: few enough that a request that carries them in its address stays within common URL limits. */
8822
+ "batchSize",
8823
+ 20
8824
+ );
8820
8825
  _defineProperty(
8821
8826
  this,
8822
8827
  /** With `'byKey'`, the number of simultaneous requests. */
@@ -9187,6 +9192,15 @@ var DataItems = class {
9187
9192
  ensure(first, end) {
9188
9193
  if (this.source?.loadMode === "blocks") this.source.ensure(first, end);
9189
9194
  }
9195
+ failedAt(index) {
9196
+ const source = this.source;
9197
+ if (!source) return false;
9198
+ if (index === void 0) return source.status === "error";
9199
+ return source.loadMode === "blocks" && source.isFailed(index);
9200
+ }
9201
+ retryFailed() {
9202
+ this.source?.retry();
9203
+ }
9190
9204
  /** Every item in memory, or the loaded rows. */
9191
9205
  get loaded() {
9192
9206
  const source = this.source;
@@ -9316,6 +9330,13 @@ var OptionList = class extends Component {
9316
9330
  _defineProperty(this, "size", 0);
9317
9331
  _defineProperty(this, "itemAt", () => void 0);
9318
9332
  _defineProperty(this, "ensure", null);
9333
+ _defineProperty(
9334
+ this,
9335
+ /** Whether a row (or, with no index, the whole list) failed to load; a press on it loads it again. */
9336
+ "failedAt",
9337
+ () => false
9338
+ );
9339
+ _defineProperty(this, "retryFailed", () => {});
9319
9340
  _defineProperty(
9320
9341
  this,
9321
9342
  /** With groups: the headers between the items. Without: one row per item. */
@@ -9354,7 +9375,7 @@ var OptionList = class extends Component {
9354
9375
  cancelAnimationFrame(this.frame);
9355
9376
  this.frame = requestAnimationFrame(() => this.drawWindow());
9356
9377
  });
9357
- const stopEmpty = onLanguage(this, () => this.empty.textContent = this.emptyText?.() ?? uiLocale.strings.noItems);
9378
+ const stopEmpty = onLanguage(this, () => this.writeEmpty());
9358
9379
  const stopLook = onLookChanged(() => {
9359
9380
  this.rowHeight = 0;
9360
9381
  if (this.windowed) this.drawWindow();
@@ -9373,6 +9394,8 @@ var OptionList = class extends Component {
9373
9394
  this.size = items.length;
9374
9395
  this.itemAt = (index) => items[index];
9375
9396
  this.ensure = null;
9397
+ this.failedAt = () => false;
9398
+ this.retryFailed = () => {};
9376
9399
  this.rows = null;
9377
9400
  if (this.groupOf) {
9378
9401
  const rows = [];
@@ -9393,13 +9416,15 @@ var OptionList = class extends Component {
9393
9416
  this.size = source.count;
9394
9417
  this.itemAt = (index) => source.at(index);
9395
9418
  this.ensure = source.ensure ? (first, end) => source.ensure(first, end) : null;
9419
+ this.failedAt = (index) => source.failedAt?.(index) ?? false;
9420
+ this.retryFailed = () => source.retryFailed?.();
9396
9421
  this.rows = null;
9397
9422
  if (this.active >= this.size) this.active = -1;
9398
9423
  this.drawAll();
9399
9424
  }
9400
9425
  /** Redraws the rows in view, such as after some have loaded. */
9401
9426
  redraw() {
9402
- if (this.windowed) {
9427
+ if (this.windowed && this.size) {
9403
9428
  this.drawn = {
9404
9429
  first: 0,
9405
9430
  end: 0
@@ -9494,6 +9519,10 @@ var OptionList = class extends Component {
9494
9519
  break;
9495
9520
  case "Enter": {
9496
9521
  const item = this.activeItem;
9522
+ if (item === void 0 && this.failedAt(this.size ? this.active : void 0)) {
9523
+ this.retryFailed();
9524
+ break;
9525
+ }
9497
9526
  if (item === void 0 || !this.enabledOf(item)) return false;
9498
9527
  this.chosenEmitter.fire({
9499
9528
  item,
@@ -9542,7 +9571,7 @@ var OptionList = class extends Component {
9542
9571
  else this.element.removeAttribute("aria-multiselectable");
9543
9572
  this.element.toggleAttribute("data-empty", !this.size);
9544
9573
  if (!this.size) {
9545
- this.empty.textContent = this.emptyText?.() ?? uiLocale.strings.noItems;
9574
+ this.writeEmpty();
9546
9575
  this.element.append(this.empty);
9547
9576
  return;
9548
9577
  }
@@ -9648,12 +9677,16 @@ var OptionList = class extends Component {
9648
9677
  el.setAttribute("role", "option");
9649
9678
  const item = this.itemAt(index);
9650
9679
  if (item === void 0) {
9651
- el.setAttribute("aria-busy", "true");
9680
+ const failed = this.failedAt(index);
9652
9681
  el.setAttribute("aria-selected", "false");
9653
- el.setAttribute("data-loading", "");
9682
+ if (failed) el.setAttribute("data-failed", "");
9683
+ else {
9684
+ el.setAttribute("aria-busy", "true");
9685
+ el.setAttribute("data-loading", "");
9686
+ }
9654
9687
  const text = el.appendChild(document.createElement("span"));
9655
9688
  text.className = "mx-list__text";
9656
- text.textContent = uiLocale.strings.loading;
9689
+ text.textContent = failed ? this.failedText() : uiLocale.strings.loading;
9657
9690
  return el;
9658
9691
  }
9659
9692
  if (!this.enabledOf(item)) el.setAttribute("aria-disabled", "true");
@@ -9688,9 +9721,22 @@ var OptionList = class extends Component {
9688
9721
  const el = isElement(target) ? target.closest("[role=\"option\"]") : null;
9689
9722
  return el && this.element.contains(el) ? Number(el.dataset.index) : -1;
9690
9723
  }
9724
+ /** "Could not load. Retry": a row or a list that failed, which a press loads again. */
9725
+ failedText() {
9726
+ return `${uiLocale.strings.loadFailed} ${uiLocale.strings.retry}`;
9727
+ }
9728
+ writeEmpty() {
9729
+ const failed = this.failedAt();
9730
+ this.empty.toggleAttribute("data-failed", failed);
9731
+ this.empty.textContent = failed ? this.failedText() : this.emptyText?.() ?? uiLocale.strings.noItems;
9732
+ }
9691
9733
  clicked(e) {
9692
9734
  const index = this.indexOf(e.target);
9693
9735
  const item = index < 0 ? void 0 : this.itemAt(index);
9736
+ if (!this.size && isElement(e.target) && this.empty.contains(e.target) && this.failedAt() || index >= 0 && item === void 0 && this.failedAt(index)) {
9737
+ this.retryFailed();
9738
+ return;
9739
+ }
9694
9740
  if (index < 0 || item === void 0 || !this.enabledOf(item)) return;
9695
9741
  this.setActive(index, false);
9696
9742
  this.chosenEmitter.fire({
@@ -28685,6 +28731,15 @@ var ListRows = class {
28685
28731
  const offset = this.offset;
28686
28732
  this.items.ensure?.(Math.max(0, first - offset), Math.max(0, end - offset));
28687
28733
  }
28734
+ failedAt(index) {
28735
+ if (index === void 0) return this.items.failedAt?.() ?? false;
28736
+ const offset = this.offset;
28737
+ if (offset && index === 0) return false;
28738
+ return this.items.failedAt?.(index - offset) ?? false;
28739
+ }
28740
+ retryFailed() {
28741
+ this.items.retryFailed?.();
28742
+ }
28688
28743
  get offset() {
28689
28744
  return this.withSelectAll && this.items.count > 0 ? 1 : 0;
28690
28745
  }
@@ -34132,8 +34187,8 @@ var GridExport = class {
34132
34187
  /** Lookup cells and groups export their texts: every key of the rows is resolved first. */
34133
34188
  async loadTexts(cols, view, rows) {
34134
34189
  const { model } = this;
34135
- const grouped = view ? model.groups.fields().map((f) => model.columns.get(f)) : [];
34136
- const lookups = [...cols, ...grouped].filter((c, i, all) => c.lookup && !c.textFrom && all.indexOf(c) === i);
34190
+ const grouped = view ? model.groups.fields().map((f) => model.columns.get(f)).filter((c) => model.groupsByOwnValue(c)) : [];
34191
+ const lookups = [...cols.filter((c) => !c.textFrom), ...grouped].filter((c, i, all) => c.lookup && all.indexOf(c) === i);
34137
34192
  if (lookups.length) await model.lookups.load(lookups, rows, (row, col) => model.value(model.rowIdOf(row), row, col));
34138
34193
  }
34139
34194
  /** Saves text as a file through a link the browser downloads. */
@@ -36070,7 +36125,8 @@ var LookupValues = class {
36070
36125
  };
36071
36126
  }
36072
36127
  if (!source.adapter.capabilities.group || !items) return null;
36073
- if (search) {
36128
+ if (search && typeof col.textFrom === "string") filter = data.and(filter, data.where(col.textFrom, "contains", search));
36129
+ else if (search) {
36074
36130
  const { items: matches } = await items.search(search, lookups.search(col), 0, Math.max(1, col.lookup?.filterSearchLimit ?? 1e3));
36075
36131
  if (!matches.length) return {
36076
36132
  values: [],
@@ -41195,7 +41251,7 @@ var GridModel = class {
41195
41251
  text: this.text("gridEmptyOption"),
41196
41252
  state: "none"
41197
41253
  };
41198
- if (col.calculateGroupValue !== void 0 || col.textFrom !== void 0) return {
41254
+ if (!this.groupsByOwnValue(col)) return {
41199
41255
  text: key instanceof Date ? key.toLocaleDateString(this.formatter.locale) : String(key),
41200
41256
  state: "none"
41201
41257
  };
@@ -41205,6 +41261,11 @@ var GridModel = class {
41205
41261
  state: "none"
41206
41262
  };
41207
41263
  }
41264
+ /** Whether a column's groups hold its own value: no value of their own, or `calculateGroupValue` naming the column's field (a lookup's key, whose text the group row shows). */
41265
+ groupsByOwnValue(col) {
41266
+ if (col.calculateGroupValue !== void 0) return col.calculateGroupValue === col.field;
41267
+ return col.textFrom === void 0;
41268
+ }
41208
41269
  /** "Title: value" of a group, as its row and an export show it. */
41209
41270
  groupCaption(node) {
41210
41271
  return this.text("gridGroupText", {