@motifx-community/ui 0.1.0-beta.12 → 0.1.0-beta.13

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 (173) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/components/datagrid/view/ColumnStyles.d.ts +3 -1
  3. package/dist/components/dropdown/drop-down-props.d.ts +5 -2
  4. package/dist/components/listbox/item-template.d.ts +4 -0
  5. package/dist/components/tabdocs/DocumentTab.d.ts +0 -1
  6. package/dist/components/tabdocs/PhoneBar.d.ts +0 -1
  7. package/dist/components/treeview/TreeView.d.ts +8 -4
  8. package/dist/components/treeview/tree-view-item-template.d.ts +4 -0
  9. package/dist/core/show-icon.d.ts +3 -3
  10. package/dist/index.js +99 -176
  11. package/dist/index.js.map +1 -1
  12. package/dist/parts/list/OptionList.d.ts +4 -3
  13. package/dist/parts/list/option-parts.d.ts +1 -1
  14. package/dist/styles.css +43 -24
  15. package/docs/accordion.md +1 -1
  16. package/docs/actionsheet.md +1 -1
  17. package/docs/appbar.md +1 -1
  18. package/docs/appmenu-api.md +1 -1
  19. package/docs/appmenu-programmatic.md +1 -1
  20. package/docs/appmenu-search.md +1 -1
  21. package/docs/appmenu.md +1 -1
  22. package/docs/avatar.md +1 -1
  23. package/docs/badge.md +1 -1
  24. package/docs/bar-gauge-angles.md +1 -1
  25. package/docs/bar-gauge-data.md +1 -1
  26. package/docs/bar-gauge-labels.md +1 -1
  27. package/docs/bar-gauge.md +1 -1
  28. package/docs/barcode.md +1 -1
  29. package/docs/bottomnavigation.md +1 -1
  30. package/docs/bottomsheet.md +1 -1
  31. package/docs/breadcrumb.md +1 -1
  32. package/docs/button.md +1 -1
  33. package/docs/buttongroup.md +1 -1
  34. package/docs/buttons.md +1 -1
  35. package/docs/calendar.md +1 -1
  36. package/docs/card.md +1 -1
  37. package/docs/chart-bars.md +1 -1
  38. package/docs/chart-candles.md +1 -1
  39. package/docs/chart-funnel.md +1 -1
  40. package/docs/chart-heatmap.md +1 -1
  41. package/docs/chart-lines.md +1 -1
  42. package/docs/chart-live.md +1 -1
  43. package/docs/chart-pie.md +1 -1
  44. package/docs/chart-radar.md +1 -1
  45. package/docs/chart-ranges.md +1 -1
  46. package/docs/chart-references.md +1 -1
  47. package/docs/chart-scatter.md +1 -1
  48. package/docs/chart-waterfall.md +1 -1
  49. package/docs/chart-zoom.md +1 -1
  50. package/docs/chart.md +1 -1
  51. package/docs/checkbox.md +1 -1
  52. package/docs/chip.md +1 -1
  53. package/docs/choice.md +1 -1
  54. package/docs/colorbox.md +1 -1
  55. package/docs/combobox.md +2 -1
  56. package/docs/commands.md +1 -1
  57. package/docs/control.md +1 -1
  58. package/docs/data.md +1 -1
  59. package/docs/datagrid-api.md +1 -1
  60. package/docs/datagrid-bands.md +1 -1
  61. package/docs/datagrid-drag-select.md +1 -1
  62. package/docs/datagrid-drag.md +1 -1
  63. package/docs/datagrid-editing.md +1 -1
  64. package/docs/datagrid-filtering.md +1 -1
  65. package/docs/datagrid-forms.md +1 -1
  66. package/docs/datagrid-grouping.md +1 -1
  67. package/docs/datagrid-layout.md +1 -1
  68. package/docs/datagrid-lookups.md +4 -1
  69. package/docs/datagrid-master-detail.md +1 -1
  70. package/docs/datagrid-scrolling.md +1 -1
  71. package/docs/datagrid-selection.md +1 -1
  72. package/docs/datagrid.md +1 -1
  73. package/docs/datebox.md +1 -1
  74. package/docs/daterangebox.md +1 -1
  75. package/docs/display.md +1 -1
  76. package/docs/draggable.md +1 -1
  77. package/docs/drawer.md +1 -1
  78. package/docs/dropdown.md +4 -3
  79. package/docs/editors.md +1 -1
  80. package/docs/feedback.md +1 -1
  81. package/docs/fileuploader.md +1 -1
  82. package/docs/filterbuilder.md +1 -1
  83. package/docs/formlayout.md +1 -1
  84. package/docs/foundations.md +1 -1
  85. package/docs/gallery.md +1 -1
  86. package/docs/gauge-base.md +1 -1
  87. package/docs/gauge-circular.md +1 -1
  88. package/docs/gauge-dashboards.md +1 -1
  89. package/docs/gauge-linear.md +1 -1
  90. package/docs/gauge-markers.md +1 -1
  91. package/docs/gauge-marks.md +1 -1
  92. package/docs/gauge-ranges.md +1 -1
  93. package/docs/gauge-scales.md +1 -1
  94. package/docs/gauge.md +1 -1
  95. package/docs/home.md +1 -1
  96. package/docs/keyboard.md +1 -1
  97. package/docs/language.md +1 -1
  98. package/docs/layout.md +1 -1
  99. package/docs/listbox.md +4 -3
  100. package/docs/loadpanel.md +1 -1
  101. package/docs/lookup.md +1 -1
  102. package/docs/menus-api.md +1 -1
  103. package/docs/menus-context.md +1 -1
  104. package/docs/menus-customization.md +1 -1
  105. package/docs/menus-merging.md +1 -1
  106. package/docs/menus-programmatic.md +1 -1
  107. package/docs/menus.md +1 -1
  108. package/docs/multiview.md +1 -1
  109. package/docs/navigation.md +1 -1
  110. package/docs/numberbox.md +1 -1
  111. package/docs/otpinput.md +1 -1
  112. package/docs/pagination.md +1 -1
  113. package/docs/popover.md +1 -1
  114. package/docs/progress.md +1 -1
  115. package/docs/qrcode.md +1 -1
  116. package/docs/radiogroup.md +1 -1
  117. package/docs/rating.md +1 -1
  118. package/docs/resizable.md +1 -1
  119. package/docs/ribbonmenu-api.md +1 -1
  120. package/docs/ribbonmenu-commands.md +1 -1
  121. package/docs/ribbonmenu-customization.md +1 -1
  122. package/docs/ribbonmenu-display.md +3 -3
  123. package/docs/ribbonmenu-layouts.md +1 -1
  124. package/docs/ribbonmenu-programmatic.md +1 -1
  125. package/docs/ribbonmenu.md +1 -1
  126. package/docs/scheduler-agenda.md +1 -1
  127. package/docs/scheduler-big-data.md +1 -1
  128. package/docs/scheduler-editing.md +1 -1
  129. package/docs/scheduler-form.md +1 -1
  130. package/docs/scheduler-icalendar.md +1 -1
  131. package/docs/scheduler-mobile.md +1 -1
  132. package/docs/scheduler-recurrence.md +1 -1
  133. package/docs/scheduler-resources.md +1 -1
  134. package/docs/scheduler-timeline.md +1 -1
  135. package/docs/scheduler.md +1 -1
  136. package/docs/scrollview.md +1 -1
  137. package/docs/shortcuteditor.md +1 -1
  138. package/docs/showcase-home.md +1 -1
  139. package/docs/showcase.md +1 -1
  140. package/docs/signature.md +1 -1
  141. package/docs/skeleton.md +1 -1
  142. package/docs/slider.md +1 -1
  143. package/docs/sortable.md +1 -1
  144. package/docs/sparkline.md +1 -1
  145. package/docs/speeddial.md +1 -1
  146. package/docs/splitter.md +1 -1
  147. package/docs/stepper.md +1 -1
  148. package/docs/switch.md +1 -1
  149. package/docs/tabdocs-dock.md +1 -1
  150. package/docs/tabdocs-drag.md +1 -1
  151. package/docs/tabdocs-menus.md +1 -1
  152. package/docs/tabdocs-mobile.md +1 -1
  153. package/docs/tabdocs-tabs.md +1 -1
  154. package/docs/tabdocs-windows.md +1 -1
  155. package/docs/tabdocs-workspace.md +1 -1
  156. package/docs/tabdocs.md +1 -1
  157. package/docs/tabs.md +1 -1
  158. package/docs/tagbox.md +4 -3
  159. package/docs/textarea.md +1 -1
  160. package/docs/textbox.md +1 -1
  161. package/docs/tileview.md +1 -1
  162. package/docs/timeline.md +1 -1
  163. package/docs/toast.md +1 -1
  164. package/docs/tokens.md +1 -1
  165. package/docs/toolbar.md +1 -1
  166. package/docs/tooltip.md +1 -1
  167. package/docs/treeview.md +3 -3
  168. package/docs/validationsummary.md +1 -1
  169. package/docs/window.md +1 -1
  170. package/docs/wizard.md +1 -1
  171. package/llms-full.txt +174 -167
  172. package/llms.txt +1 -1
  173. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -6697,12 +6697,11 @@ function givenList(list) {
6697
6697
  //#endregion
6698
6698
  //#region src/core/show-icon.ts
6699
6699
  /**
6700
- * Shows an icon in `into`, a part of the kit: an `<img>` for an address, or the app's component. Returns what takes
6701
- * it away again (removed and disposed).
6700
+ * Shows an icon in `into`, a part of the kit: an `<img>` for an address, or the app's component. It goes with `into`;
6701
+ * `clearParts(into)` takes it out for another one.
6702
6702
  */
6703
6703
  function showIcon(source, into) {
6704
- const icon = iconPart(into, source);
6705
- return () => removePart(icon);
6704
+ iconPart(into, source);
6706
6705
  }
6707
6706
  //#endregion
6708
6707
  //#region src/core/icon-source.ts
@@ -7686,7 +7685,6 @@ var MenuList = class MenuList extends Component {
7686
7685
  let description = null;
7687
7686
  let shortcut = null;
7688
7687
  let arrow = null;
7689
- let release = null;
7690
7688
  let source = null;
7691
7689
  let caption = null;
7692
7690
  const bind = (read, write) => button.bindings.watch(() => {
@@ -7722,8 +7720,8 @@ var MenuList = class MenuList extends Component {
7722
7720
  bind(() => fieldOf(item, "icon", this), (next) => {
7723
7721
  if (Object.is(next, source)) return;
7724
7722
  source = next;
7725
- release?.();
7726
- release = next ? showIcon(next, icon) : null;
7723
+ clearParts(icon);
7724
+ if (next) showIcon(next, icon);
7727
7725
  });
7728
7726
  bind(() => givenField(item, "description") ?? "", (value) => {
7729
7727
  if (!value) {
@@ -7767,7 +7765,6 @@ var MenuList = class MenuList extends Component {
7767
7765
  this.keepSubmenu(entry);
7768
7766
  });
7769
7767
  button.motif.setDisposable(() => {
7770
- release?.();
7771
7768
  if (this.isDisposed || !this.built) return;
7772
7769
  if (this.built.get(item) === entry) this.built.delete(item);
7773
7770
  if (this.hoverEntry === entry) this.cancelHover();
@@ -8050,9 +8047,7 @@ var Button = class extends Control {
8050
8047
  this.listen();
8051
8048
  this.placeChildren();
8052
8049
  this.motif.setDisposable(() => {
8053
- const parts = this.parts;
8054
- parts.releaseIcon();
8055
- parts.stopArrowLabel?.();
8050
+ this.parts.stopArrowLabel?.();
8056
8051
  const content = this.peekProperty("dropDown");
8057
8052
  if (content && !content.isDisposed) content.dispose();
8058
8053
  });
@@ -8248,7 +8243,6 @@ var Button = class extends Control {
8248
8243
  stopArrowLabel: null,
8249
8244
  caption: null,
8250
8245
  icon: null,
8251
- releaseIcon: () => {},
8252
8246
  spinner: null,
8253
8247
  chevron: null,
8254
8248
  popup: null,
@@ -8331,8 +8325,6 @@ var Button = class extends Control {
8331
8325
  renderIcon() {
8332
8326
  const parts = this.parts;
8333
8327
  const icon = this.peekProperty("icon");
8334
- parts.releaseIcon();
8335
- parts.releaseIcon = () => {};
8336
8328
  mark(this, "data-icon", !!icon);
8337
8329
  this.renderIconOnly();
8338
8330
  if (!icon) {
@@ -8346,7 +8338,7 @@ var Button = class extends Control {
8346
8338
  parts.icon.attr.add({ "aria-hidden": "true" });
8347
8339
  }
8348
8340
  clearParts(parts.icon);
8349
- parts.releaseIcon = showIcon(icon, parts.icon);
8341
+ showIcon(icon, parts.icon);
8350
8342
  }
8351
8343
  renderBusy(busy) {
8352
8344
  const parts = this.parts;
@@ -8792,7 +8784,6 @@ var Field = class extends Control {
8792
8784
  parts.stopClearLabel?.();
8793
8785
  parts.leaveGroup?.();
8794
8786
  parts.stopLanding?.();
8795
- parts.releaseIcon();
8796
8787
  parts.valueChanged.dispose();
8797
8788
  parts.validated.dispose();
8798
8789
  });
@@ -9189,7 +9180,6 @@ var Field = class extends Control {
9189
9180
  counterText: "",
9190
9181
  clear: null,
9191
9182
  stopClearLabel: null,
9192
- releaseIcon: () => {},
9193
9183
  buttons: createSignal([]),
9194
9184
  buttonParts: /* @__PURE__ */ new Map(),
9195
9185
  buttonAreas: /* @__PURE__ */ new WeakSet(),
@@ -9319,10 +9309,8 @@ var Field = class extends Control {
9319
9309
  this.renderDescribedBy();
9320
9310
  }
9321
9311
  renderIcon() {
9322
- const parts = this.parts;
9312
+ this.parts;
9323
9313
  const icon = this.peekProperty("icon");
9324
- parts.releaseIcon();
9325
- parts.releaseIcon = () => {};
9326
9314
  mark(this, "data-icon", !!icon);
9327
9315
  if (!icon) {
9328
9316
  this.removeArea("icon");
@@ -9331,7 +9319,7 @@ var Field = class extends Control {
9331
9319
  const area = this.area("icon");
9332
9320
  put(area, "aria-hidden", "true");
9333
9321
  clearParts(area);
9334
- parts.releaseIcon = showIcon(icon, area);
9322
+ showIcon(icon, area);
9335
9323
  }
9336
9324
  /**
9337
9325
  * Gives the places the buttons now. Each place lists its buttons once (`start`, `end`): a field of a button changes
@@ -9373,7 +9361,6 @@ var Field = class extends Control {
9373
9361
  let caption = null;
9374
9362
  let captionText = "";
9375
9363
  let source;
9376
- let release = null;
9377
9364
  const bind = (read, write) => buttonPart.bindings.watch(() => {
9378
9365
  const value = read();
9379
9366
  untracked(() => write(value));
@@ -9393,10 +9380,10 @@ var Field = class extends Control {
9393
9380
  });
9394
9381
  bind(() => givenField(button, "icon"), (next) => {
9395
9382
  kept$1(icon, next !== void 0);
9396
- if (Object.is(next, source) && (release || next === void 0)) return;
9383
+ if (Object.is(next, source)) return;
9397
9384
  source = next;
9398
- release?.();
9399
- release = next !== void 0 ? showIcon(next, icon) : null;
9385
+ clearParts(icon);
9386
+ if (next !== void 0) showIcon(next, icon);
9400
9387
  });
9401
9388
  buttonPart.motif.on("click", (_, event) => givenValue(button, "click")?.({
9402
9389
  button,
@@ -9404,7 +9391,6 @@ var Field = class extends Control {
9404
9391
  event
9405
9392
  }));
9406
9393
  buttonPart.motif.setDisposable(() => {
9407
- release?.();
9408
9394
  if (parts.buttonParts.get(button) === buttonPart) parts.buttonParts.delete(button);
9409
9395
  });
9410
9396
  return buttonPart;
@@ -13197,7 +13183,8 @@ var OptionList = class extends Component {
13197
13183
  this,
13198
13184
  /**
13199
13185
  * Draws an option's content instead of its text, into `host`. `option` holds the option's parts, for an owner that
13200
- * marks the option itself. It can return a cleanup function.
13186
+ * marks the option itself. `host` (`option.text`) is made for each drawing and goes when the option is drawn again
13187
+ * or goes; a cleanup function returned is given to it and runs then.
13201
13188
  */
13202
13189
  "draw",
13203
13190
  null
@@ -13749,7 +13736,7 @@ var OptionList = class extends Component {
13749
13736
  makeOption(entry) {
13750
13737
  const row = loose("div", "mx-list__item");
13751
13738
  row.attr.add({ role: "option" });
13752
- const text = part(row, "span", "mx-list__text");
13739
+ let text = part(row, "span", "mx-list__text");
13753
13740
  const option = {
13754
13741
  row,
13755
13742
  text,
@@ -13759,13 +13746,9 @@ var OptionList = class extends Component {
13759
13746
  let checkHost = null;
13760
13747
  let iconHost = null;
13761
13748
  let iconShown = null;
13762
- let releaseIcon = null;
13763
13749
  let drawnWith;
13764
- let releaseDrawn = null;
13765
13750
  let shownText = null;
13766
13751
  row.motif.setDisposable(() => {
13767
- releaseIcon?.();
13768
- releaseDrawn?.();
13769
13752
  if (this.partsOf?.get(entry) === option) this.partsOf.delete(entry);
13770
13753
  });
13771
13754
  this.bind(row, () => entry.at.value, (index) => {
@@ -13813,28 +13796,28 @@ var OptionList = class extends Component {
13813
13796
  this.bind(row, () => (this.state.value, this.iconOf?.(item) ?? null), (source) => {
13814
13797
  if (source === iconShown) return;
13815
13798
  iconShown = source;
13816
- releaseIcon?.();
13817
- releaseIcon = null;
13818
13799
  removePart(iconHost);
13819
13800
  iconHost = null;
13820
13801
  if (source === null) return;
13821
13802
  iconHost = partBefore(row, text, "span", "mx-list__icon");
13822
13803
  iconHost.attr.add({ "aria-hidden": "true" });
13823
- releaseIcon = showIcon(source, iconHost);
13804
+ showIcon(source, iconHost);
13824
13805
  });
13825
13806
  this.bind(row, () => (this.state.value, {
13826
13807
  draw: this.draw,
13827
13808
  value: this.draw ? null : this.textOf(item)
13828
13809
  }), ({ draw, value }) => {
13829
13810
  if (draw !== drawnWith && (draw || drawnWith)) {
13830
- releaseDrawn?.();
13831
- releaseDrawn = null;
13832
- if (drawnWith) clearParts(text);
13811
+ if (drawnWith) {
13812
+ const drawn = text;
13813
+ text = option.text = partBefore(row, drawn, "span", "mx-list__text");
13814
+ removePart(drawn);
13815
+ }
13833
13816
  drawnWith = draw;
13834
13817
  shownText = null;
13835
13818
  if (draw) {
13836
13819
  const release = draw(item, text, option);
13837
- releaseDrawn = typeof release === "function" ? release : null;
13820
+ if (typeof release === "function") text.motif.setDisposable(release);
13838
13821
  }
13839
13822
  }
13840
13823
  if (value !== null && value !== shownText) {
@@ -13846,16 +13829,11 @@ var OptionList = class extends Component {
13846
13829
  }
13847
13830
  /**
13848
13831
  * Binds an option's text to `read`, read again when the items are given again or refreshed, and written in place.
13849
- * For a `draw` that writes the text itself; the release it gives back stops the binding.
13832
+ * For a `draw` that writes the text itself; the binding goes with the text part it writes.
13850
13833
  */
13851
13834
  bindText(option, read) {
13852
- let live = true;
13853
- this.bind(option.text, () => live ? (this.state.value, read()) : null, (value) => {
13854
- if (value !== null) text$1(option.text, value);
13855
- });
13856
- return () => {
13857
- live = false;
13858
- };
13835
+ const text = option.text;
13836
+ this.bind(text, () => (this.state.value, read()), (value) => text$1(text, value));
13859
13837
  }
13860
13838
  /** The index of the option an event started in, asked of the options drawn; -1 for none. */
13861
13839
  indexOf(e) {
@@ -13951,6 +13929,8 @@ var DropDown = class extends Field {
13951
13929
  if (own.onClosed) this.onClosed(own.onClosed);
13952
13930
  const parts = this.dropParts;
13953
13931
  glyphPart(this.area("actions"), "chevron-down", "mx-drop-down__chevron");
13932
+ this.observeProperty("dataSource", () => this.renderSource());
13933
+ this.observeProperty("valueField", (field) => parts.source.valueField = typeof field === "string" ? field : void 0);
13954
13934
  const stopField = follow$1(this, "field", () => {
13955
13935
  this.getProperty("textField");
13956
13936
  this.getProperty("valueField");
@@ -13964,8 +13944,6 @@ var DropDown = class extends Field {
13964
13944
  template: this.getProperty("fieldTemplate")
13965
13945
  };
13966
13946
  }, ({ tick, items, value, valueText, placeholder, template }) => this.renderField(tick, items, value, valueText, placeholder, template));
13967
- this.observeProperty("dataSource", () => this.renderSource());
13968
- this.observeProperty("valueField", (field) => parts.source.valueField = typeof field === "string" ? field : void 0);
13969
13947
  parts.source.onChanged(() => this.sourceChanged());
13970
13948
  this.listen();
13971
13949
  this.motif.setDisposable(() => {
@@ -13974,7 +13952,6 @@ var DropDown = class extends Field {
13974
13952
  parts.source.dispose();
13975
13953
  parts.stopList?.();
13976
13954
  parts.stopLanguage?.();
13977
- parts.releaseField();
13978
13955
  parts.opened.dispose();
13979
13956
  parts.closed.dispose();
13980
13957
  });
@@ -14191,7 +14168,6 @@ var DropDown = class extends Field {
14191
14168
  valuePart: part(textPart, "span", "mx-drop-down__value"),
14192
14169
  waitPart: null,
14193
14170
  drawnPart: null,
14194
- releaseField: () => {},
14195
14171
  popup: null,
14196
14172
  list: null,
14197
14173
  search: null,
@@ -14529,8 +14505,6 @@ var DropDown = class extends Field {
14529
14505
  const same = parts.fieldShown?.length === shown.length && shown.every((v, i) => Object.is(v, parts.fieldShown[i]));
14530
14506
  parts.fieldShown = shown;
14531
14507
  if (same) return;
14532
- parts.releaseField();
14533
- parts.releaseField = () => {};
14534
14508
  parts.state = state;
14535
14509
  const loading = state === "loading";
14536
14510
  const empty = item === void 0 && !text && !loading;
@@ -14546,12 +14520,12 @@ var DropDown = class extends Field {
14546
14520
  kept$1(parts.waitPart, loading);
14547
14521
  }
14548
14522
  if (loading) this.addSpinner();
14549
- if (drawn && !parts.drawnPart) parts.drawnPart = part(parts.textPart, "span", "mx-drop-down__drawn");
14523
+ const before = parts.drawnPart;
14524
+ parts.drawnPart = drawn ? partBefore(parts.textPart, before, "span", "mx-drop-down__drawn") : null;
14525
+ removePart(before);
14550
14526
  if (parts.drawnPart) {
14551
- clearParts(parts.drawnPart);
14552
- parts.drawnPart.setText("");
14553
- if (drawn) parts.releaseField = template(item, parts.drawnPart) ?? (() => {});
14554
- kept$1(parts.drawnPart, drawn);
14527
+ const release = template(item, parts.drawnPart);
14528
+ if (typeof release === "function") parts.drawnPart.motif.setDisposable(release);
14555
14529
  }
14556
14530
  text$1(parts.valuePart, loading || drawn ? "" : empty ? placeholder : text);
14557
14531
  kept$1(parts.valuePart, !loading && !drawn);
@@ -30462,7 +30436,6 @@ var MxForm = class MxForm extends FocusContainer {
30462
30436
  if (parts.open) this.closeWith(void 0, "owner");
30463
30437
  parts.pending = null;
30464
30438
  for (const resolve of parts.waiters.splice(0)) resolve("cancel");
30465
- parts.releaseIcon();
30466
30439
  parts.stopLabels?.();
30467
30440
  this.removeChip();
30468
30441
  for (const emitter of [
@@ -30783,7 +30756,6 @@ var MxForm = class MxForm extends FocusContainer {
30783
30756
  const self = this;
30784
30757
  return {
30785
30758
  iconPart,
30786
- releaseIcon: () => {},
30787
30759
  titlePart,
30788
30760
  titleId,
30789
30761
  minimize: null,
@@ -30928,11 +30900,9 @@ var MxForm = class MxForm extends FocusContainer {
30928
30900
  renderIcon() {
30929
30901
  const parts = this.parts;
30930
30902
  const icon = this.peekProperty("icon");
30931
- parts.releaseIcon();
30932
- parts.releaseIcon = () => {};
30933
30903
  kept$1(parts.iconPart, !!icon);
30934
30904
  clearParts(parts.iconPart);
30935
- if (icon) parts.releaseIcon = showIcon(icon, parts.iconPart);
30905
+ if (icon) showIcon(icon, parts.iconPart);
30936
30906
  }
30937
30907
  /** The title bar buttons: minimize (modeless only), maximize, close. */
30938
30908
  renderTools() {
@@ -33481,7 +33451,6 @@ var Tab = class extends Control {
33481
33451
  this.observeProperty("key", () => parts.owner?.tabChanged(this));
33482
33452
  this.observeProperty("lazy", () => parts.owner?.tabChanged(this));
33483
33453
  this.motif.setDisposable(() => {
33484
- parts.releaseIcon();
33485
33454
  parts.stopCloseHint?.();
33486
33455
  removePart(parts.headerPart);
33487
33456
  parts.owner?.tabGone(this);
@@ -33680,7 +33649,6 @@ var Tab = class extends Control {
33680
33649
  headerPart,
33681
33650
  label,
33682
33651
  icon: null,
33683
- releaseIcon: () => {},
33684
33652
  badge: null,
33685
33653
  close: null,
33686
33654
  stopCloseHint: null,
@@ -33699,8 +33667,6 @@ var Tab = class extends Control {
33699
33667
  renderIcon() {
33700
33668
  const parts = this.parts;
33701
33669
  const icon = this.peekProperty("icon");
33702
- parts.releaseIcon();
33703
- parts.releaseIcon = () => {};
33704
33670
  if (!icon) {
33705
33671
  removePart(parts.icon);
33706
33672
  parts.icon = null;
@@ -33710,7 +33676,7 @@ var Tab = class extends Control {
33710
33676
  parts.icon.attr.add({ "aria-hidden": "true" });
33711
33677
  }
33712
33678
  clearParts(parts.icon);
33713
- parts.releaseIcon = showIcon(icon, parts.icon);
33679
+ showIcon(icon, parts.icon);
33714
33680
  }
33715
33681
  parts.owner?.tabResized();
33716
33682
  }
@@ -34544,7 +34510,6 @@ var TagBox = class extends Field {
34544
34510
  this.motif.setDisposable(() => {
34545
34511
  stopLocale();
34546
34512
  clearTimeout(parts.timer);
34547
- for (const slot of [...parts.slots.values()].flat()) slot.release?.();
34548
34513
  parts.items.dispose();
34549
34514
  parts.opened.dispose();
34550
34515
  parts.closed.dispose();
@@ -34932,7 +34897,6 @@ var TagBox = class extends Field {
34932
34897
  });
34933
34898
  list.push(slot.tag);
34934
34899
  }
34935
- for (const slot of [...old.values()].flat()) slot.release?.();
34936
34900
  parts.slots = slots;
34937
34901
  parts.more = null;
34938
34902
  if (shown < values.length && !parts.moreTag) {
@@ -34993,7 +34957,8 @@ var TagBox = class extends Field {
34993
34957
  this.freshLabel(slot);
34994
34958
  slot.item = item;
34995
34959
  slot.template = template;
34996
- slot.release = template(item, slot.label) || void 0;
34960
+ const release = template(item, slot.label);
34961
+ if (typeof release === "function") slot.label.motif.setDisposable(release);
34997
34962
  return;
34998
34963
  }
34999
34964
  if (slot.text === null && slot.template) this.freshLabel(slot);
@@ -35004,8 +34969,6 @@ var TagBox = class extends Field {
35004
34969
  }
35005
34970
  /** A new label for a template to draw in, the one drawn before taken out. */
35006
34971
  freshLabel(slot) {
35007
- slot.release?.();
35008
- slot.release = void 0;
35009
34972
  removePart(slot.label);
35010
34973
  slot.label = partBefore(slot.tag, slot.remove, "span", "mx-tag-box__tag-text");
35011
34974
  slot.text = null;
@@ -35082,12 +35045,12 @@ var TagBox = class extends Field {
35082
35045
  drawRow(row, host, option, template) {
35083
35046
  const list = this.tagParts.list;
35084
35047
  if (row === selectAllRow) {
35085
- const release = list.bindText(option, () => uiLocale.strings.selectAll);
35048
+ list.bindText(option, () => uiLocale.strings.selectAll);
35086
35049
  this.keepSelectAllRow(option);
35087
- return release;
35050
+ return;
35088
35051
  }
35089
35052
  if (template) return template(row, host);
35090
- return list.bindText(option, () => this.itemText(row));
35053
+ list.bindText(option, () => this.itemText(row));
35091
35054
  }
35092
35055
  listChanged() {
35093
35056
  const parts = this.tagParts;
@@ -48515,7 +48478,6 @@ var LiveOptions = class {
48515
48478
  };
48516
48479
  //#endregion
48517
48480
  //#region src/components/datagrid/view/action-button.ts
48518
- var releases = /* @__PURE__ */ new WeakMap();
48519
48481
  /** The key each button was drawn for. */
48520
48482
  var keys = /* @__PURE__ */ new WeakMap();
48521
48483
  /** The parts of each button's face: made the first time they are needed, then written in place. */
@@ -48561,14 +48523,13 @@ function fillActionButton(button, a) {
48561
48523
  faces.set(button, face);
48562
48524
  const iconOf = a.hasIcon ? a.action.id : null;
48563
48525
  if (face.iconOf !== iconOf) {
48564
- releases.get(button)?.();
48565
- releases.delete(button);
48526
+ if (face.holder) clearParts(face.holder);
48566
48527
  const icon = iconOf !== null ? readField(a.action, "icon") : null;
48567
48528
  if (icon && !face.holder) {
48568
48529
  face.holder = partBefore(button, face.text, "span", "mx-button__icon");
48569
48530
  face.holder.attr.add({ "aria-hidden": "true" });
48570
48531
  }
48571
- if (icon && face.holder) releases.set(button, showIcon(icon, face.holder));
48532
+ if (icon && face.holder) showIcon(icon, face.holder);
48572
48533
  face.iconOf = iconOf;
48573
48534
  face.icon = !!icon;
48574
48535
  }
@@ -49326,7 +49287,6 @@ var TreeView = class extends Control {
49326
49287
  stopTexts();
49327
49288
  for (const stop of parts.watchers.splice(0)) stop();
49328
49289
  parts.loads.clear();
49329
- this.releaseAll();
49330
49290
  for (const emitter of [
49331
49291
  parts.expanding,
49332
49292
  parts.collapsing,
@@ -49703,7 +49663,6 @@ var TreeView = class extends Control {
49703
49663
  index: /* @__PURE__ */ new Map(),
49704
49664
  elements: /* @__PURE__ */ new Map(),
49705
49665
  spaces: [],
49706
- releases: /* @__PURE__ */ new Map(),
49707
49666
  looks: /* @__PURE__ */ new WeakMap(),
49708
49667
  stashes: /* @__PURE__ */ new Map(),
49709
49668
  expanded: /* @__PURE__ */ new Set(),
@@ -50096,7 +50055,7 @@ var TreeView = class extends Control {
50096
50055
  const windowed = parts.rows.length > this.windowFrom;
50097
50056
  const old = windowed === parts.windowed ? this.takeRows() : null;
50098
50057
  if (!old) {
50099
- this.releaseAll();
50058
+ this.forgetAll();
50100
50059
  clearParts(parts.bodyPart);
50101
50060
  parts.spaces = [];
50102
50061
  }
@@ -50144,37 +50103,31 @@ var TreeView = class extends Control {
50144
50103
  takeRows() {
50145
50104
  const parts = this.parts;
50146
50105
  const old = /* @__PURE__ */ new Map();
50147
- for (const [node, drawn] of parts.elements) old.set(node.key, {
50148
- drawn,
50149
- release: parts.releases.get(node)
50150
- });
50106
+ for (const [node, drawn] of parts.elements) old.set(node.key, drawn);
50151
50107
  parts.elements.clear();
50152
- parts.releases.clear();
50153
50108
  return old;
50154
50109
  }
50155
50110
  /** The row drawn before for `row`'s key, kept for its new node when what it was drawn with stays; null otherwise. */
50156
50111
  keepRow(old, row) {
50157
50112
  const parts = this.parts;
50158
50113
  const node = row.node;
50159
- const entry = old.get(node.key);
50160
- const look = entry && parts.looks.get(entry.drawn);
50161
- if (!entry || !look) return null;
50114
+ const drawn = old.get(node.key);
50115
+ const look = drawn && parts.looks.get(drawn);
50116
+ if (!drawn || !look) return null;
50162
50117
  const item = node.item;
50163
50118
  const template = this.peekProperty("itemTemplate") ?? null;
50164
50119
  if (!(look.parentKey === node.parent?.key && look.checks === !!this.peekProperty("showCheckBoxes") && look.template === template && (!template || look.item === item) && look.icon === this.iconOf(item))) return null;
50165
50120
  old.delete(node.key);
50166
- parts.elements.set(node, entry.drawn);
50167
- if (entry.release) parts.releases.set(node, entry.release);
50121
+ parts.elements.set(node, drawn);
50168
50122
  look.item = item;
50169
50123
  if (!template) text$1(look.text, this.textOf(item));
50170
- css(entry.drawn.item, "--_level", String(node.level));
50171
- return entry.drawn;
50124
+ css(drawn.item, "--_level", String(node.level));
50125
+ return drawn;
50172
50126
  }
50173
- /** Lets go of the rows drawn before that were not kept. */
50127
+ /** Lets go of the rows drawn before that were not kept: each goes with what it holds, its template's cleanup too. */
50174
50128
  dropRows(old) {
50175
50129
  const parts = this.parts;
50176
- for (const { drawn, release } of old.values()) {
50177
- release?.();
50130
+ for (const drawn of old.values()) {
50178
50131
  const stash = parts.stashes.get(drawn);
50179
50132
  if (stash) {
50180
50133
  parts.stashes.delete(drawn);
@@ -50197,21 +50150,17 @@ var TreeView = class extends Control {
50197
50150
  const parts = this.parts;
50198
50151
  const taken = /* @__PURE__ */ new Map();
50199
50152
  if (rows) {
50200
- for (const [key, entry] of rows) {
50201
- if (!isWithin(entry.drawn.item, group)) continue;
50202
- taken.set(key, entry);
50153
+ for (const [key, drawn] of rows) {
50154
+ if (!isWithin(drawn.item, group)) continue;
50155
+ taken.set(key, drawn);
50203
50156
  rows.delete(key);
50204
50157
  }
50205
50158
  return taken;
50206
50159
  }
50207
50160
  for (const [node, drawn] of parts.elements) {
50208
50161
  if (!isWithin(drawn.item, group)) continue;
50209
- taken.set(node.key, {
50210
- drawn,
50211
- release: parts.releases.get(node)
50212
- });
50162
+ taken.set(node.key, drawn);
50213
50163
  parts.elements.delete(node);
50214
- parts.releases.delete(node);
50215
50164
  }
50216
50165
  return taken;
50217
50166
  }
@@ -50338,26 +50287,25 @@ var TreeView = class extends Control {
50338
50287
  const parts = this.parts;
50339
50288
  const row = parts.rows[0];
50340
50289
  if (!row) return 32;
50341
- const releases = [];
50342
- const probe = this.rowParts(row, releases);
50290
+ const probe = this.rowParts(row);
50343
50291
  this.renderItem(probe, row);
50344
50292
  parts.bodyPart.controls.add(probe.item);
50345
50293
  const height = rectOf(probe.item).height;
50346
- for (const release of releases) release();
50347
50294
  removePart(probe.item);
50348
50295
  return height || 32;
50349
50296
  }
50350
50297
  itemPart(row) {
50351
50298
  const parts = this.parts;
50352
- const releases = [];
50353
- const drawn = this.rowParts(row, releases);
50354
- if (releases.length) parts.releases.set(row.node, () => releases.forEach((r) => r()));
50299
+ const drawn = this.rowParts(row);
50355
50300
  parts.elements.set(row.node, drawn);
50356
50301
  this.renderItem(drawn, row);
50357
50302
  return drawn;
50358
50303
  }
50359
- /** The parts of a row, not kept by the tree yet; what takes its icon and template away again goes to `releases`. */
50360
- rowParts(row, releases) {
50304
+ /**
50305
+ * The parts of a row, not kept by the tree yet. The icon and what the template drew go with the row; the template's
50306
+ * cleanup, given to the text part it drew in, runs as the core disposes the row.
50307
+ */
50308
+ rowParts(row) {
50361
50309
  const node = row.node;
50362
50310
  const item = node.item;
50363
50311
  const itemPart = loose("div", "mx-tree-view__item");
@@ -50377,12 +50325,12 @@ var TreeView = class extends Control {
50377
50325
  if (icon !== void 0 && icon !== null) {
50378
50326
  const host = part(line, "span", "mx-tree-view__icon");
50379
50327
  host.attr.add({ "aria-hidden": "true" });
50380
- releases.push(showIcon(icon, host));
50328
+ showIcon(icon, host);
50381
50329
  }
50382
50330
  const text = part(line, "span", "mx-tree-view__text");
50383
50331
  const template = this.peekProperty("itemTemplate");
50384
50332
  const release = template ? template(item, text) : void 0;
50385
- if (release) releases.push(release);
50333
+ if (typeof release === "function") text.motif.setDisposable(release);
50386
50334
  if (!template) text$1(text, this.textOf(item));
50387
50335
  const drawn = {
50388
50336
  item: itemPart,
@@ -50545,19 +50493,14 @@ var TreeView = class extends Control {
50545
50493
  this.controls.insert(this.controls.items.indexOf(parts.bodyPart), search);
50546
50494
  parts.search = search;
50547
50495
  }
50548
- /** Lets go of the row drawn for `node`: what its icon and template hold is released, and the tree keeps it no longer. */
50496
+ /** The tree keeps the row drawn for `node` no longer; the row goes with what it holds when it is taken out. */
50549
50497
  forget(node) {
50550
- const parts = this.parts;
50551
- parts.releases.get(node)?.();
50552
- parts.releases.delete(node);
50553
- parts.elements.delete(node);
50498
+ this.parts.elements.delete(node);
50554
50499
  }
50555
- releaseAll() {
50500
+ /** The tree keeps no row drawn so far, the hidden ones included; they go when the rows are taken out. */
50501
+ forgetAll() {
50556
50502
  const parts = this.parts;
50557
- for (const release of parts.releases.values()) release();
50558
- parts.releases.clear();
50559
50503
  parts.elements.clear();
50560
- for (const stash of parts.stashes.values()) for (const { release } of stash.values()) release?.();
50561
50504
  parts.stashes.clear();
50562
50505
  }
50563
50506
  scrollToRow(at) {
@@ -51140,7 +51083,9 @@ var escapeAttr = (v) => v.replace(/["\\]/g, "\\$&");
51140
51083
  /**
51141
51084
  * Per-column CSS of one grid: columns not shown, alignment and sticky offsets, written as rules keyed
51142
51085
  * by `data-field` (a pinned band's header by `data-band`, at the offset of its columns). Changing a width or pinning a column rewrites this sheet only; no cell gets a
51143
- * binding of its own and no row is touched. A constructable stylesheet adopted by the document (or
51086
+ * binding of its own and no row is touched. A rule finds the rows through the parts that hold them (the head, the body,
51087
+ * the foot, the copy of a dragged row), which carry the grid's id, and goes on by child combinators only: the rows of a
51088
+ * grid inside this one (in a row's details, in a cell) are that grid's. A constructable stylesheet adopted by the document (or
51144
51089
  * shadow root) where there is one, which also works under a strict Content Security Policy; else a
51145
51090
  * `<style>` element inside the grid.
51146
51091
  */
@@ -51164,12 +51109,12 @@ var ColumnStyles = class {
51164
51109
  }
51165
51110
  /** `placed`: every column's cells get their track by number, so a row may leave out the cells of columns not drawn (virtual columns). */
51166
51111
  update(visible, offsets, align, bands = [], placed = false) {
51167
- const scope = `[data-grid-id="${this.gridId}"]`;
51112
+ const rows = `[data-grid-id="${this.gridId}"] > .mx-data-grid__row`;
51168
51113
  const rules = [];
51169
51114
  const shown = new Set(visible);
51170
51115
  const track = new Map(visible.map((f, i) => [f, i + 1]));
51171
51116
  for (const field of this.columns.state.order) {
51172
- const sel = `${scope} .mx-data-grid__row > [data-field="${escapeAttr(field)}"]`;
51117
+ const sel = `${rows} > [data-field="${escapeAttr(field)}"]`;
51173
51118
  if (!shown.has(field)) {
51174
51119
  rules.push(`${sel}{display:none}`);
51175
51120
  continue;
@@ -51178,7 +51123,7 @@ var ColumnStyles = class {
51178
51123
  const a = align.get(field);
51179
51124
  if (a && a !== "start") {
51180
51125
  rules.push(`${sel}.mx-data-grid__cell{text-align:${a}}`);
51181
- rules.push(`${sel} .mx-data-grid__title{text-align:${a}}`);
51126
+ rules.push(`${sel} > .mx-data-grid__title{text-align:${a}}`);
51182
51127
  }
51183
51128
  const sticky = offsets.get(field);
51184
51129
  if (sticky) {
@@ -51192,7 +51137,7 @@ var ColumnStyles = class {
51192
51137
  if (!first || !last) continue;
51193
51138
  const near = first.side === "start" ? first : last;
51194
51139
  const edge = first.side === "start" ? last.edge : first.edge;
51195
- const sel = `${scope} .mx-data-grid__row > [data-band="${escapeAttr(band.id)}"]`;
51140
+ const sel = `${rows} > [data-band="${escapeAttr(band.id)}"]`;
51196
51141
  rules.push(`${sel}{position:sticky;inset-inline-${near.side}:${near.offset}px;z-index:var(--_z-sticky)}`);
51197
51142
  if (edge) rules.push(`${sel}{box-shadow:var(--_sticky-${near.side})}`);
51198
51143
  }
@@ -56242,12 +56187,12 @@ var ListBox = class extends Field {
56242
56187
  parts.template = template;
56243
56188
  list.draw = (row, host, option) => {
56244
56189
  if (row === selectAllRow) {
56245
- const release = list.bindText(option, () => uiLocale.strings.selectAll);
56190
+ list.bindText(option, () => uiLocale.strings.selectAll);
56246
56191
  this.keepSelectAllRow(option);
56247
- return release;
56192
+ return;
56248
56193
  }
56249
56194
  if (template) return template(row, host);
56250
- return list.bindText(option, () => this.itemText(row));
56195
+ list.bindText(option, () => this.itemText(row));
56251
56196
  };
56252
56197
  }
56253
56198
  isMultiple() {
@@ -61563,7 +61508,6 @@ var DataGrid = class extends Control {
61563
61508
  const { model } = this;
61564
61509
  const settings = model.settings;
61565
61510
  this.class.add("mx-data-grid");
61566
- this.attr.add({ "data-grid-id": this.gridId });
61567
61511
  this.drawRoot();
61568
61512
  this.motif.setDisposable(model.notices.before(() => {
61569
61513
  for (const check of this.reactions) safeCall(check, "DataGrid");
@@ -61895,13 +61839,21 @@ var DataGrid = class extends Control {
61895
61839
  else if (settings.get("tooltips")) this.tip.hovered(this.tipFrom(e));
61896
61840
  });
61897
61841
  viewport.motif.on("pointerleave", () => this.tip.hide());
61842
+ const rowsOf = { "data-grid-id": this.gridId };
61898
61843
  const head = div("mx-data-grid__head", viewport);
61899
- head.attr.add({ role: "rowgroup" });
61844
+ head.attr.add({
61845
+ role: "rowgroup",
61846
+ ...rowsOf
61847
+ });
61900
61848
  this.headPart = head;
61901
61849
  head.controls.add(this.header, this.filterRow);
61850
+ this.body.attr.add(rowsOf);
61902
61851
  viewport.controls.add(this.body);
61903
61852
  const foot = div("mx-data-grid__foot", viewport);
61904
- foot.attr.add({ role: "rowgroup" });
61853
+ foot.attr.add({
61854
+ role: "rowgroup",
61855
+ ...rowsOf
61856
+ });
61905
61857
  this.footPart = foot;
61906
61858
  foot.controls.add(this.totalRow);
61907
61859
  const overlay = div("mx-data-grid__overlay", main);
@@ -73403,7 +73355,6 @@ var Toast = class extends Control {
73403
73355
  if (own.onClosed) this.onClosed(own.onClosed);
73404
73356
  this.motif.setDisposable(() => {
73405
73357
  clearTimeout(this.parts.timer);
73406
- this.parts.releaseIcon();
73407
73358
  this.parts.resolve("code");
73408
73359
  this.parts.closedEmitter.dispose();
73409
73360
  });
@@ -73546,7 +73497,6 @@ var Toast = class extends Control {
73546
73497
  const closed = new Promise((r) => resolve = r);
73547
73498
  return {
73548
73499
  icon,
73549
- releaseIcon: () => {},
73550
73500
  body,
73551
73501
  title: null,
73552
73502
  titleId: "",
@@ -73582,8 +73532,6 @@ var Toast = class extends Control {
73582
73532
  const tone = this.peekProperty("tone") ?? "info";
73583
73533
  put(this, "data-tone", tone);
73584
73534
  const icon = this.peekProperty("icon");
73585
- parts.releaseIcon();
73586
- parts.releaseIcon = () => {};
73587
73535
  kept$1(parts.icon, icon !== null);
73588
73536
  clearParts(parts.icon);
73589
73537
  if (icon === null) return;
@@ -73591,7 +73539,7 @@ var Toast = class extends Control {
73591
73539
  glyphPart(parts.icon, GLYPHS[tone] ?? "info", "mx-toast__mark");
73592
73540
  return;
73593
73541
  }
73594
- parts.releaseIcon = showIcon(icon, parts.icon);
73542
+ showIcon(icon, parts.icon);
73595
73543
  }
73596
73544
  renderAction() {
73597
73545
  const parts = this.parts;
@@ -74383,7 +74331,6 @@ var DocumentTab = class {
74383
74331
  _defineProperty(this, "status", void 0);
74384
74332
  _defineProperty(this, "description", null);
74385
74333
  _defineProperty(this, "icon", null);
74386
- _defineProperty(this, "releaseIcon", () => {});
74387
74334
  _defineProperty(this, "badge", null);
74388
74335
  _defineProperty(this, "tooltip", null);
74389
74336
  _defineProperty(this, "tipHolder", null);
@@ -74497,7 +74444,6 @@ var DocumentTab = class {
74497
74444
  }
74498
74445
  dispose() {
74499
74446
  for (const stop of this.stops.splice(0)) stop();
74500
- this.releaseIcon();
74501
74447
  this.attachTooltip(null);
74502
74448
  removePart(this.headerPart);
74503
74449
  if (!this.panel.isDisposed) this.panel.dispose();
@@ -74616,8 +74562,6 @@ var DocumentTab = class {
74616
74562
  this.manager.tabChanged(this);
74617
74563
  }
74618
74564
  renderIcon(icon) {
74619
- this.releaseIcon();
74620
- this.releaseIcon = () => {};
74621
74565
  if (!icon) {
74622
74566
  removePart(this.icon);
74623
74567
  this.icon = null;
@@ -74629,7 +74573,7 @@ var DocumentTab = class {
74629
74573
  this.icon = host;
74630
74574
  }
74631
74575
  clearParts(host);
74632
- this.releaseIcon = showIcon(icon, host);
74576
+ showIcon(icon, host);
74633
74577
  }
74634
74578
  mark(this.headerPart, "data-icon", !!icon);
74635
74579
  this.manager.tabChanged(this);
@@ -79901,7 +79845,7 @@ var AutoHideStrip = class {
79901
79845
  }, (icon) => {
79902
79846
  const holder = loose("span", "mx-tabdocs__icon");
79903
79847
  holder.attr.add({ "aria-hidden": "true" });
79904
- holder.motif.setDisposable(showIcon(icon, holder));
79848
+ showIcon(icon, holder);
79905
79849
  return holder;
79906
79850
  });
79907
79851
  const title = part(button, "span", "mx-tabdocs__autohide-title");
@@ -81609,7 +81553,6 @@ var PhoneBar = class {
81609
81553
  _defineProperty(this, "unsaved", void 0);
81610
81554
  _defineProperty(this, "close", void 0);
81611
81555
  _defineProperty(this, "count", void 0);
81612
- _defineProperty(this, "releaseIcon", () => {});
81613
81556
  _defineProperty(this, "shown", null);
81614
81557
  _defineProperty(this, "swipe", null);
81615
81558
  this.manager = manager;
@@ -81670,7 +81613,6 @@ var PhoneBar = class {
81670
81613
  this.count.readLook();
81671
81614
  }
81672
81615
  dispose() {
81673
- this.releaseIcon();
81674
81616
  if (this.part.parent) this.part.parent.controls.remove(this.part);
81675
81617
  else if (!this.part.isDisposed) this.part.dispose();
81676
81618
  }
@@ -81700,12 +81642,10 @@ var PhoneBar = class {
81700
81642
  focusOn(this.title);
81701
81643
  }
81702
81644
  renderIcon(doc) {
81703
- this.releaseIcon();
81704
- this.releaseIcon = () => {};
81705
81645
  const icon = doc?.icon;
81706
81646
  kept$1(this.icon, !!icon);
81707
81647
  clearParts(this.icon);
81708
- if (icon) this.releaseIcon = showIcon(icon, this.icon);
81648
+ if (icon) showIcon(icon, this.icon);
81709
81649
  }
81710
81650
  touchStart(e) {
81711
81651
  if (e.touches.length !== 1) return;
@@ -81895,7 +81835,6 @@ var PhoneList = class {
81895
81835
  this.endGesture();
81896
81836
  this.dragged?.boxes?.stop();
81897
81837
  this.dragged = null;
81898
- for (const row of this.rows.values()) row.release();
81899
81838
  this.rows.clear();
81900
81839
  if (!this.search.isDisposed) this.search.dispose();
81901
81840
  if (!this.sheet.isDisposed) this.sheet.dispose();
@@ -81930,7 +81869,6 @@ var PhoneList = class {
81930
81869
  }
81931
81870
  for (const [doc, row] of this.rows) {
81932
81871
  if (seen.has(doc)) continue;
81933
- row.release();
81934
81872
  removePart(row.part);
81935
81873
  this.rows.delete(doc);
81936
81874
  }
@@ -81979,13 +81917,12 @@ var PhoneList = class {
81979
81917
  mark(row.part, "data-pinned", doc.pinned);
81980
81918
  mark(row.part, "data-preview", doc.preview);
81981
81919
  if (row.icon !== doc.icon) {
81982
- row.release();
81983
- row.release = () => {};
81920
+ if (row.iconHolder) clearParts(row.iconHolder);
81984
81921
  if (doc.icon && !row.iconHolder) {
81985
81922
  row.iconHolder = partBefore(row.open, row.text, "span", "mx-tabdocs__icon");
81986
81923
  row.iconHolder.attr.add({ "aria-hidden": "true" });
81987
81924
  }
81988
- if (doc.icon && row.iconHolder) row.release = showIcon(doc.icon, row.iconHolder);
81925
+ if (doc.icon && row.iconHolder) showIcon(doc.icon, row.iconHolder);
81989
81926
  row.icon = doc.icon;
81990
81927
  }
81991
81928
  if (row.iconHolder) kept$1(row.iconHolder, !!doc.icon);
@@ -82037,7 +81974,6 @@ var PhoneList = class {
82037
81974
  part: rowPart,
82038
81975
  open: openPart,
82039
81976
  close: closePart,
82040
- release: () => {},
82041
81977
  look: "",
82042
81978
  shown: true,
82043
81979
  text,
@@ -82375,7 +82311,6 @@ var PhoneTools = class {
82375
82311
  put(this.part, "aria-label", m.textOf("tabDocsPhoneTools"));
82376
82312
  for (const [doc, entry] of this.buttons) {
82377
82313
  if (tools.includes(doc)) continue;
82378
- entry.release();
82379
82314
  removePart(entry.button);
82380
82315
  this.buttons.delete(doc);
82381
82316
  }
@@ -82393,7 +82328,6 @@ var PhoneTools = class {
82393
82328
  for (const { button } of this.buttons.values()) put(button, "tabindex", button === stop ? "0" : "-1");
82394
82329
  }
82395
82330
  dispose() {
82396
- for (const entry of this.buttons.values()) entry.release();
82397
82331
  this.buttons.clear();
82398
82332
  removePart(this.part);
82399
82333
  }
@@ -82411,17 +82345,15 @@ var PhoneTools = class {
82411
82345
  button,
82412
82346
  mark,
82413
82347
  label: part(button, "span", "mx-tabdocs__phone-tool-label"),
82414
- release: () => {},
82415
82348
  icon: void 0,
82416
82349
  title: ""
82417
82350
  };
82418
82351
  this.buttons.set(doc, entry);
82419
82352
  } else if (entry.icon === icon && entry.title === title) return entry;
82420
82353
  if (entry.icon !== icon) {
82421
- entry.release();
82422
- entry.release = () => {};
82354
+ clearParts(entry.mark);
82423
82355
  entry.mark.setText("");
82424
- if (icon) entry.release = showIcon(icon, entry.mark);
82356
+ if (icon) showIcon(icon, entry.mark);
82425
82357
  }
82426
82358
  if (!icon && (entry.icon !== icon || entry.title !== title)) entry.mark.setText(Array.from(title.trim())[0]?.toLocaleUpperCase(uiLocale.locale) ?? "");
82427
82359
  text$1(entry.label, title);
@@ -88644,7 +88576,6 @@ var AccordionItem = class extends Control {
88644
88576
  parts.header.motif.on("keydown", (_sender, e) => parts.owner?.headerKeyDown(this, e));
88645
88577
  this.motif.setDisposable(() => {
88646
88578
  clearTimeout(parts.releaseTimer);
88647
- parts.releaseIcon();
88648
88579
  parts.owner?.itemGone(this);
88649
88580
  });
88650
88581
  }
@@ -88788,8 +88719,6 @@ var AccordionItem = class extends Control {
88788
88719
  renderIcon() {
88789
88720
  const parts = this.parts;
88790
88721
  const icon = this.peekProperty("icon");
88791
- parts.releaseIcon();
88792
- parts.releaseIcon = () => {};
88793
88722
  if (!icon) {
88794
88723
  if (parts.icon) removePart(parts.icon);
88795
88724
  parts.icon = null;
@@ -88802,7 +88731,7 @@ var AccordionItem = class extends Control {
88802
88731
  parts.icon = host;
88803
88732
  }
88804
88733
  clearParts(host);
88805
- parts.releaseIcon = showIcon(icon, host);
88734
+ showIcon(icon, host);
88806
88735
  }
88807
88736
  get parts() {
88808
88737
  const self = this;
@@ -88834,7 +88763,6 @@ var AccordionItem = class extends Control {
88834
88763
  headerId,
88835
88764
  label,
88836
88765
  icon: null,
88837
- releaseIcon: () => {},
88838
88766
  region,
88839
88767
  body: loose("div", "mx-accordion__body"),
88840
88768
  owner: null,
@@ -104929,7 +104857,6 @@ var MenuBar = class MenuBar extends Control {
104929
104857
  this.motif.setDisposable(() => {
104930
104858
  parts.stopDrawing?.();
104931
104859
  parts.removeF10?.();
104932
- for (const slot of parts.slots.values()) slot.releaseIcon?.();
104933
104860
  parts.slots.clear();
104934
104861
  parts.itemClick.dispose();
104935
104862
  parts.itemsChanged.dispose();
@@ -105488,7 +105415,6 @@ var MenuBar = class MenuBar extends Control {
105488
105415
  stashed.push(slot);
105489
105416
  continue;
105490
105417
  }
105491
- slot.releaseIcon?.();
105492
105418
  parts.slots.delete(slot.key);
105493
105419
  }
105494
105420
  parts.shownSlots = stashed.length ? [...shownSlots, ...stashed] : shownSlots;
@@ -105510,7 +105436,6 @@ var MenuBar = class MenuBar extends Control {
105510
105436
  if (left.length === parts.shownSlots.length) return;
105511
105437
  for (const slot of parts.shownSlots) {
105512
105438
  if (left.includes(slot)) continue;
105513
- slot.releaseIcon?.();
105514
105439
  parts.slots.delete(slot.key);
105515
105440
  }
105516
105441
  parts.shownSlots = left;
@@ -105533,7 +105458,6 @@ var MenuBar = class MenuBar extends Control {
105533
105458
  label: part(button, "span", "mx-menubar__label"),
105534
105459
  icon: null,
105535
105460
  iconSource: null,
105536
- releaseIcon: null,
105537
105461
  drawnLabel: null,
105538
105462
  token: null,
105539
105463
  entry: null,
@@ -105546,8 +105470,6 @@ var MenuBar = class MenuBar extends Control {
105546
105470
  /** The item's icon, drawn again only when its source changes. */
105547
105471
  drawIcon(slot, source) {
105548
105472
  if (slot.iconSource === source) return;
105549
- slot.releaseIcon?.();
105550
- slot.releaseIcon = null;
105551
105473
  slot.iconSource = source;
105552
105474
  if (!source) {
105553
105475
  removePart(slot.icon);
@@ -105558,7 +105480,8 @@ var MenuBar = class MenuBar extends Control {
105558
105480
  slot.icon = partBefore(slot.button, slot.label, "span", "mx-menubar__icon");
105559
105481
  slot.icon.attr.add({ "aria-hidden": "true" });
105560
105482
  }
105561
- slot.releaseIcon = showIcon(source, slot.icon);
105483
+ clearParts(slot.icon);
105484
+ showIcon(source, slot.icon);
105562
105485
  }
105563
105486
  /** The item Tab reaches: the last one focused, else the first. */
105564
105487
  stop() {