@coolon/angular-ui-powerups 16.1.0-alpha.312 → 16.1.0-alpha.314

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.
@@ -6938,8 +6938,11 @@ class TableBodyComponent extends ResizeAwareComponent {
6938
6938
  * themed with a shorter header scrolls correctly; 48 when the variable can't be read.
6939
6939
  */
6940
6940
  headerHeight$ = new MutableValueModel(48);
6941
- // TODO: take the row height from --aup-table-row-height too. Not a drop-in: table.scss sets it to
6942
- // 40px while virtual rows have always been 44, so following it would shrink every virtual row.
6941
+ /**
6942
+ * A row's height, which the virtual scroller gives every row. Taken from --aup-table-row-height at init
6943
+ * (table.scss sets 44px), so a table themed with taller rows scrolls correctly; 44 when the variable
6944
+ * can't be read.
6945
+ */
6943
6946
  rowHeight$ = new MutableValueModel(44);
6944
6947
  baseCssClass = "aup-table-component";
6945
6948
  get animationsDisabledClass() { return this.animationsDisabled$.value; }
@@ -6975,8 +6978,9 @@ class TableBodyComponent extends ResizeAwareComponent {
6975
6978
  // scrolling stops.
6976
6979
  // A body inside projected content (a loading container, a card) is initialised before it is in the
6977
6980
  // document, where no theme variable resolves. Its first reported size is the moment it is, so take
6978
- // the header height again then; the report arrives outside change detection, so this is safe.
6979
- when(this.bounds$).changes(() => this.takeHeaderHeightFromTheme());
6981
+ // the heights again then; the report arrives outside change detection, so this is safe. A change of
6982
+ // layout that themes other heights (a phone's taller rows) resizes the body too, so it is taken then.
6983
+ when(this.bounds$).changes(() => this.takeHeightsFromTheme());
6980
6984
  const delayedData$ = chain(this.data$).postponeWhile(this.virtualScrollActive$);
6981
6985
  when(delayedData$).changes(delatedData => {
6982
6986
  this.animationsDisabled$.value = true;
@@ -6996,9 +7000,9 @@ class TableBodyComponent extends ResizeAwareComponent {
6996
7000
  this.resetAnimationsAfterFrame();
6997
7001
  }, { initialValue: "evaluate" });
6998
7002
  this.onInit(() => {
6999
- // On init, not after the view: the header height is bound in this view and in a host binding,
7000
- // and changing it after they are checked would trip ExpressionChangedAfterItHasBeenChecked.
7001
- this.takeHeaderHeightFromTheme();
7003
+ // On init, not after the view: the heights are bound in this view and in host bindings, and
7004
+ // changing them after they are checked would trip ExpressionChangedAfterItHasBeenChecked.
7005
+ this.takeHeightsFromTheme();
7002
7006
  this.columns$ = chain(this.tableModel.visibleColumns$);
7003
7007
  this.columnIds$ = chain(this.columns$).pluck("columnId");
7004
7008
  this.columnsById$ = chain(this.columns$).indexBy('columnId');
@@ -7072,13 +7076,21 @@ class TableBodyComponent extends ResizeAwareComponent {
7072
7076
  }
7073
7077
  return classes;
7074
7078
  }
7075
- /** Sets [headerHeight$] from --aup-table-header-row-height, keeping the current value when it can't be read. */
7076
- takeHeaderHeightFromTheme() {
7077
- this.headerHeight$.value = this.readCssPixels("--aup-table-header-row-height") ?? this.headerHeight$.value;
7078
- }
7079
- /** A length custom property as resolved on this element, in px; undefined when unset or not a length. */
7080
- readCssPixels(property) {
7081
- const pixels = parseFloat(getComputedStyle(this.elementRef.nativeElement).getPropertyValue(property));
7079
+ /**
7080
+ * Sets [headerHeight$] from --aup-table-header-row-height and [rowHeight$] from --aup-table-row-height,
7081
+ * keeping a current value when its variable can't be read.
7082
+ */
7083
+ takeHeightsFromTheme() {
7084
+ const body = this.elementRef.nativeElement;
7085
+ this.headerHeight$.value = this.readCssPixels(body, "--aup-table-header-row-height") ?? this.headerHeight$.value;
7086
+ // The row height's host binding writes --aup-table-row-height onto this element, so read here it would
7087
+ // return this body's own value once rendered. The theme's value is the one the parent passes down.
7088
+ const parent = body.parentElement;
7089
+ this.rowHeight$.value = (parent && this.readCssPixels(parent, "--aup-table-row-height")) ?? this.rowHeight$.value;
7090
+ }
7091
+ /** A length custom property as resolved on an element, in px; undefined when unset or not a length. */
7092
+ readCssPixels(element, property) {
7093
+ const pixels = parseFloat(getComputedStyle(element).getPropertyValue(property));
7082
7094
  return Number.isFinite(pixels) && pixels > 0 ? pixels : undefined;
7083
7095
  }
7084
7096
  scheduleTableHeightCheck(waitMillis = 50) {
@@ -15031,7 +15043,8 @@ let nextInstanceId = 0;
15031
15043
  *
15032
15044
  * The rail collapses to an icon strip from the Menu row, and expands over the content when the
15033
15045
  * pointer rests on it. A touch has no hover, so on touch a tap on a collapsed group expands the rail
15034
- * over the content instead of navigating, with that group open; tapping a page, the backdrop, the
15046
+ * over the content instead of navigating, showing that group's children alone, whatever
15047
+ * {@link groupsStartOpen} says, so they open beside the finger; tapping a page, the backdrop, the
15035
15048
  * Menu row or Esc closes it again. The pinned state is kept in localStorage under {@link persistKey}.
15036
15049
  *
15037
15050
  * {@link currentPath$} names where the user is the way the rail does, for a breadcrumb.
@@ -15128,6 +15141,8 @@ class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
15128
15141
  * stays until the user goes somewhere or dismisses it: a touch never leaves, as a pointer does.
15129
15142
  */
15130
15143
  tapOpen$ = new MutableValueModel(false);
15144
+ /** The one group a tap expansion shows, if any. Kept apart from the groups the user has opened. */
15145
+ tappedGroup$ = new MutableValueModel(undefined);
15131
15146
  /** Labels and children are shown: pinned expanded, or expanded over the content. */
15132
15147
  open$;
15133
15148
  /** Expanded over the content, by hover or a tap, as opposed to pinned expanded beside it. */
@@ -15187,12 +15202,16 @@ class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
15187
15202
  const isGroup = ({ place, children }) => place.navDepth > 1 && children.length > 1;
15188
15203
  this.navItems$ = chain(entries$).mapAll(entries => {
15189
15204
  const railOpen = this.open$.value;
15205
+ // A tap expansion shows the tapped group alone: every other open group, the current one
15206
+ // included, would push its children away from the finger.
15207
+ const tapped = this.tapOpen$.value ? this.tappedGroup$.value : null;
15190
15208
  const openGroups = this.openGroups$.value;
15191
15209
  const closedGroups = this.closedGroups$.value;
15192
15210
  const groupOpen = (place) => this.groupsStartOpen$.value ? !closedGroups.has(place) : openGroups.has(place);
15193
15211
  return entries.map(({ place, current, children, currentChild }) => {
15194
15212
  const group = isGroup({ place, children });
15195
- const showChildren = group && railOpen && (current || groupOpen(place));
15213
+ const showChildren = group && railOpen &&
15214
+ (tapped !== null ? place === tapped : current || groupOpen(place));
15196
15215
  return {
15197
15216
  place,
15198
15217
  face: this.getNavigationFace(place),
@@ -15209,7 +15228,8 @@ class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
15209
15228
  };
15210
15229
  });
15211
15230
  }, {
15212
- dependsOn: [this.openGroups$, this.closedGroups$, this.groupsStartOpen$, this.open$]
15231
+ dependsOn: [this.openGroups$, this.closedGroups$, this.groupsStartOpen$, this.open$, this.tapOpen$,
15232
+ this.tappedGroup$]
15213
15233
  });
15214
15234
  // From the entries rather than navItems$: the path doesn't change as the rail opens and closes.
15215
15235
  this.currentPath$ = chain(entries$).mapAll(entries => {
@@ -15252,18 +15272,21 @@ class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
15252
15272
  this.viewStateDependsOn(this.navItems$, this.open$, this.overlay$, this.expanded$, this.tapOpen$);
15253
15273
  }
15254
15274
  /**
15255
- * A group header toggles while the rail is open, and a touch on a collapsed one opens the rail
15256
- * with it; anything else navigates.
15275
+ * A group header toggles while the rail is open, one group at a time while a tap expanded it, and
15276
+ * a touch on a collapsed one opens the rail with it; anything else navigates.
15257
15277
  */
15258
15278
  activate(item) {
15259
15279
  const touch = this.pressedWith === 'touch';
15260
15280
  this.pressedWith = undefined;
15261
- if (item.group && this.open$.value) {
15281
+ if (item.group && this.tapOpen$.value) {
15282
+ this.tappedGroup$.value = this.tappedGroup$.value === item.place ? undefined : item.place;
15283
+ }
15284
+ else if (item.group && this.open$.value) {
15262
15285
  this.toggleGroup(item);
15263
15286
  }
15264
15287
  else if (item.group && touch) {
15265
15288
  // Navigating would land on one child with no way to reach its siblings.
15266
- this.openGroup(item.place);
15289
+ this.tappedGroup$.value = item.place;
15267
15290
  this.tapOpen$.value = true;
15268
15291
  }
15269
15292
  else {