@elderbyte/ngx-starter 20.12.0-beta.4 → 20.12.0-beta.5

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.
@@ -38132,7 +38132,10 @@ class ElderDraggablePaneDirective {
38132
38132
  * *
38133
38133
  **************************************************************************/
38134
38134
  this.constrainedWidth = computed(() => {
38135
- const width = this.widthInPercent() ?? 0;
38135
+ const width = this.widthInPercent();
38136
+ if (width === null) {
38137
+ return null;
38138
+ }
38136
38139
  return Math.max(this.minWidth(), Math.min(this.maxWidth(), width));
38137
38140
  }, ...(ngDevMode ? [{ debugName: "constrainedWidth" }] : []));
38138
38141
  /***************************************************************************
@@ -38144,7 +38147,7 @@ class ElderDraggablePaneDirective {
38144
38147
  this.mouseMove$ = fromEvent(document, 'mousemove');
38145
38148
  this.mouseUp$ = fromEvent(document, 'mouseup');
38146
38149
  this.drag$ = this.mouseDown$.pipe(tap$1((event) => {
38147
- this.initializeIfNecessary();
38150
+ this.initComputedWidthModeIfNecessary();
38148
38151
  this.processDragStart(event);
38149
38152
  }), switchMap((event) => this.mouseMove$.pipe(finalize(() => {
38150
38153
  this.processDragEnd();
@@ -38168,13 +38171,14 @@ class ElderDraggablePaneDirective {
38168
38171
  this.drag$.pipe(takeUntilDestroyed()).subscribe((event) => {
38169
38172
  this.handleMouseMove(event);
38170
38173
  });
38174
+ /**
38175
+ * Effect syncs the width style with the constrained width.
38176
+ */
38171
38177
  effect(() => {
38172
38178
  const constrainedWidth = this.constrainedWidth();
38173
- const isInComputedWidthMode = this.isInComputedWidthMode();
38174
38179
  untracked(() => {
38175
- if (isInComputedWidthMode && constrainedWidth !== null) {
38176
- this.removeExternalWidthStyles();
38177
- this.setWidthStyle(constrainedWidth);
38180
+ if (constrainedWidth !== null) {
38181
+ this.setWidthStyle(this.constrainedWidth());
38178
38182
  }
38179
38183
  });
38180
38184
  });
@@ -38219,10 +38223,13 @@ class ElderDraggablePaneDirective {
38219
38223
  processDragEnd() {
38220
38224
  this.isDragging.set(false);
38221
38225
  }
38222
- initializeIfNecessary() {
38226
+ initComputedWidthModeIfNecessary() {
38223
38227
  if (!this.isInComputedWidthMode()) {
38224
38228
  this.isInComputedWidthMode.set(true);
38225
38229
  this.setWidthInPercentFromElementWidth();
38230
+ this.removeExternalWidthStyles();
38231
+ // manually set width style after removal of initial styles
38232
+ this.setWidthStyle(this.constrainedWidth());
38226
38233
  }
38227
38234
  }
38228
38235
  setWidthInPercentFromElementWidth() {