angular-toolbox 1.4.1 → 1.4.2

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.
@@ -586,8 +586,8 @@ class AbstractVersionManager {
586
586
  const ATX_VERSION_CONFIG = {
587
587
  major: 1,
588
588
  minor: 4,
589
- patch: 1,
590
- buildTimestamp: 1727868693957
589
+ patch: 2,
590
+ buildTimestamp: 1728546812271
591
591
  };
592
592
  /**
593
593
  * The public service that exposes the current version of the Angular Toolbox library.
@@ -8789,11 +8789,11 @@ class BorderLayoutContainer {
8789
8789
  this.resizable = true;
8790
8790
  }
8791
8791
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: BorderLayoutContainer, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
8792
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.3", type: BorderLayoutContainer, isStandalone: true, selector: "atx-border-layout-container", inputs: { constraints: "constraints" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<ng-content></ng-content>\n@if (resizable) {\n <div class=\"atx-handle\" [class.atx-handle-selected]=\"selected\" (mousedown)=\"resizetart()\"></div>\n}\n", styles: [":host{box-sizing:border-box;padding:0;margin:0}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }); }
8792
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.3", type: BorderLayoutContainer, isStandalone: true, selector: "atx-border-layout-container", inputs: { constraints: "constraints" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<ng-content></ng-content>\n@if (resizable) {\n <div class=\"atx-handle\" [class.atx-handle-selected]=\"selected\" (mousedown)=\"resizetart()\"></div>\n}\n", styles: [":host{box-sizing:border-box;padding:0;margin:0}:host.north{position:absolute;z-index:10;top:0;left:0;right:0}:host.north>.atx-handle{left:0;right:0;bottom:0;height:4px;cursor:ns-resize}:host.west{position:absolute;z-index:5;left:0;height:unset!important}:host.west>.atx-handle{right:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host.east{position:absolute;z-index:5;right:0;height:unset!important}:host.east>.atx-handle{left:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host.south{position:absolute;z-index:10;bottom:0;left:0;right:0}:host.south>.atx-handle{left:0;right:0;top:0;height:4px;cursor:ns-resize}:host.center{position:absolute}.atx-handle{position:absolute}.atx-handle:hover,.atx-handle.atx-handle-selected{background-color:var(--atx-handle-color, #469afa)}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }); }
8793
8793
  }
8794
8794
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: BorderLayoutContainer, decorators: [{
8795
8795
  type: Component,
8796
- args: [{ selector: 'atx-border-layout-container', standalone: true, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<ng-content></ng-content>\n@if (resizable) {\n <div class=\"atx-handle\" [class.atx-handle-selected]=\"selected\" (mousedown)=\"resizetart()\"></div>\n}\n", styles: [":host{box-sizing:border-box;padding:0;margin:0}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }]
8796
+ args: [{ selector: 'atx-border-layout-container', standalone: true, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<ng-content></ng-content>\n@if (resizable) {\n <div class=\"atx-handle\" [class.atx-handle-selected]=\"selected\" (mousedown)=\"resizetart()\"></div>\n}\n", styles: [":host{box-sizing:border-box;padding:0;margin:0}:host.north{position:absolute;z-index:10;top:0;left:0;right:0}:host.north>.atx-handle{left:0;right:0;bottom:0;height:4px;cursor:ns-resize}:host.west{position:absolute;z-index:5;left:0;height:unset!important}:host.west>.atx-handle{right:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host.east{position:absolute;z-index:5;right:0;height:unset!important}:host.east>.atx-handle{left:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host.south{position:absolute;z-index:10;bottom:0;left:0;right:0}:host.south>.atx-handle{left:0;right:0;top:0;height:4px;cursor:ns-resize}:host.center{position:absolute}.atx-handle{position:absolute}.atx-handle:hover,.atx-handle.atx-handle-selected{background-color:var(--atx-handle-color, #469afa)}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }]
8797
8797
  }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { class: [{
8798
8798
  type: HostBinding,
8799
8799
  args: ['class']
@@ -9042,17 +9042,26 @@ class BorderLayoutRenderer extends IdentifiableComponent {
9042
9042
  /**
9043
9043
  * @private
9044
9044
  */
9045
- constructor(subscribeSvc) {
9045
+ constructor(subscribeSvc, document) {
9046
9046
  super();
9047
9047
  this.subscribeSvc = subscribeSvc;
9048
+ this.document = document;
9048
9049
  /**
9049
9050
  * Emits events each time the user starts, or stops dragging handle.
9050
9051
  */
9051
- this.userAction = new EventEmitter(false);
9052
+ this.userAction = new EventEmitter();
9052
9053
  /**
9053
9054
  * @private
9054
9055
  */
9055
9056
  this.containerList = [];
9057
+ /**
9058
+ * @private
9059
+ */
9060
+ this.storedStopHandler = null;
9061
+ /**
9062
+ * @private
9063
+ */
9064
+ this.storedMoveHandler = null;
9056
9065
  this.boundsManager = new BorderLayoutBoundsManager();
9057
9066
  }
9058
9067
  /**
@@ -9099,12 +9108,17 @@ class BorderLayoutRenderer extends IdentifiableComponent {
9099
9108
  * Makes this object elligible for garbage collection.
9100
9109
  */
9101
9110
  destroy() {
9111
+ if (this.storedStopHandler) {
9112
+ this.document.removeEventListener(MOUSEMOVE, this.storedMoveHandler);
9113
+ this.document.removeEventListener(MOUSEUP, this.storedStopHandler);
9114
+ this.deleteStoredHandlers();
9115
+ }
9102
9116
  this.subscribeSvc.clearAll(this);
9103
- this.containerList.length = 0;
9104
- this.containerList = null;
9105
9117
  this.lytContainerElm = null;
9106
9118
  this.boundsManager.destroy();
9107
9119
  this.boundsManager = null;
9120
+ this.containerList.length = 0;
9121
+ this.containerList = null;
9108
9122
  }
9109
9123
  /**
9110
9124
  * Forces the layout of all `BorderLayoutContainer` objects associated with the main container.
@@ -9147,32 +9161,36 @@ class BorderLayoutRenderer extends IdentifiableComponent {
9147
9161
  const region = constraints.region;
9148
9162
  const minSize = constraints.minSize;
9149
9163
  const maxSize = constraints.maxSize;
9164
+ const doc = this.document;
9150
9165
  let size = 0;
9151
9166
  this.boundsManager.setOrigin(bounds.x, bounds.y);
9152
9167
  let resizeMethod = this.boundsManager.getResizeMethod(region);
9153
9168
  container.selected = true;
9154
9169
  const onMoveHandler = (event) => {
9155
- event.preventDefault();
9156
9170
  event.stopPropagation();
9171
+ event.preventDefault();
9157
9172
  size = resizeMethod(event, width, height, minSize, maxSize);
9158
9173
  container.setSize(size);
9159
9174
  this.render(width);
9160
9175
  this.fireEvent(container, LayoutDragEventType.DRAGGING);
9161
9176
  };
9162
9177
  const onStopHandler = (event) => {
9163
- event.preventDefault();
9164
9178
  event.stopPropagation();
9165
- lytNativeElm.removeEventListener(MOUSEMOVE, onMoveHandler);
9166
- lytNativeElm.removeEventListener(MOUSEUP, onStopHandler);
9179
+ event.preventDefault();
9180
+ doc.removeEventListener(MOUSEMOVE, onMoveHandler);
9181
+ doc.removeEventListener(MOUSEUP, onStopHandler);
9182
+ this.deleteStoredHandlers();
9167
9183
  container.selected = false;
9168
9184
  size = resizeMethod(event, width, height, minSize, maxSize);
9169
9185
  container.setSize(size);
9170
9186
  this.render(width);
9171
9187
  this.fireEvent(container, LayoutDragEventType.DRAG_STOP);
9172
9188
  };
9173
- lytNativeElm.addEventListener(MOUSEMOVE, onMoveHandler);
9174
- lytNativeElm.addEventListener(MOUSEUP, onStopHandler);
9189
+ this.storedMoveHandler = onMoveHandler;
9190
+ this.storedStopHandler = onStopHandler;
9175
9191
  this.fireEvent(container, LayoutDragEventType.DRAG_START);
9192
+ doc.addEventListener(MOUSEMOVE, onMoveHandler);
9193
+ doc.addEventListener(MOUSEUP, onStopHandler);
9176
9194
  }
9177
9195
  /**
9178
9196
  * @private
@@ -9190,32 +9208,47 @@ class BorderLayoutRenderer extends IdentifiableComponent {
9190
9208
  const bottom = bounds.bottom;
9191
9209
  const left = bounds.left;
9192
9210
  const right = bounds.right;
9193
- this.containerList.forEach((cont) => {
9211
+ const cList = this.containerList;
9212
+ let cursor = cList.length - 1;
9213
+ while (cursor >= 0) {
9214
+ const cont = cList[cursor];
9194
9215
  const r = cont.constraints.region;
9216
+ cursor--;
9195
9217
  if (r === LayoutRegion.WEST) {
9196
9218
  cont.setTopPos(top);
9197
9219
  cont.setRightPos(width - left);
9198
9220
  cont.setBottomPos(bottom - top);
9199
- return;
9221
+ continue;
9200
9222
  }
9201
9223
  if (r === LayoutRegion.CENTER) {
9202
9224
  cont.setTopPos(top);
9203
9225
  cont.setLeftPos(left);
9204
9226
  cont.setRightPos(right - left);
9205
9227
  cont.setBottomPos(bottom - top);
9206
- return;
9228
+ continue;
9207
9229
  }
9208
9230
  if (r === LayoutRegion.EAST) {
9209
9231
  cont.setTopPos(top);
9210
9232
  cont.setLeftPos(width - (right - left));
9211
9233
  cont.setBottomPos(bottom - top);
9234
+ continue;
9212
9235
  }
9213
- });
9236
+ }
9237
+ ;
9214
9238
  }
9239
+ /**
9240
+ * @private
9241
+ */
9215
9242
  checkLytContainer() {
9216
9243
  if (!this.lytContainerElm)
9217
9244
  throw new ReferenceError(LAYOUT_ERR_MSG);
9218
9245
  }
9246
+ /**
9247
+ * @private
9248
+ */
9249
+ deleteStoredHandlers() {
9250
+ this.storedMoveHandler = this.storedStopHandler = null;
9251
+ }
9219
9252
  }
9220
9253
 
9221
9254
  /**
@@ -9247,22 +9280,22 @@ class BorderLayout extends IdentifiableComponent {
9247
9280
  /**
9248
9281
  * @private
9249
9282
  */
9250
- constructor(subscribeSvc) {
9283
+ constructor(subscribeSvc, document) {
9251
9284
  super();
9252
9285
  this.subscribeSvc = subscribeSvc;
9253
9286
  /**
9254
9287
  * Emits events each time the user starts dragging a region handle.
9255
9288
  */
9256
- this.dragStart = new EventEmitter(false);
9289
+ this.dragStart = new EventEmitter();
9257
9290
  /**
9258
9291
  * Emits events each time the user stops dragging a region handle.
9259
9292
  */
9260
- this.dragStop = new EventEmitter(false);
9293
+ this.dragStop = new EventEmitter();
9261
9294
  /**
9262
9295
  * Emits events each time the user is dragging a region handle.
9263
9296
  */
9264
- this.dragging = new EventEmitter(false);
9265
- this.renderer = new BorderLayoutRenderer(subscribeSvc);
9297
+ this.dragging = new EventEmitter();
9298
+ this.renderer = new BorderLayoutRenderer(subscribeSvc, document);
9266
9299
  subscribeSvc.register(this, this.renderer.userAction.subscribe((event) => {
9267
9300
  event.layout = this;
9268
9301
  if (event.type === LayoutDragEventType.DRAGGING) {
@@ -9314,13 +9347,16 @@ class BorderLayout extends IdentifiableComponent {
9314
9347
  resizeRegion(region, size) {
9315
9348
  this.renderer.resizeRegion(region, size);
9316
9349
  }
9317
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: BorderLayout, deps: [{ token: SubscriptionService }], target: i0.ɵɵFactoryTarget.Component }); }
9318
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: BorderLayout, isStandalone: true, selector: "atx-border-layout", outputs: { dragStart: "dragStart", dragStop: "dragStop", dragging: "dragging" }, host: { listeners: { "window:resize": "onResize()" } }, queries: [{ propertyName: "__containers__", predicate: BorderLayoutContainer }], viewQueries: [{ propertyName: "layoutContainer", first: true, predicate: ["atxLayoutContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<div #atxLayoutContainer class=\"atx-border-layout\">\n <ng-content></ng-content>\n</div>", styles: [".atx-border-layout{position:relative;height:100%;width:100%;-webkit-user-select:none;user-select:none;overflow:hidden}.atx-border-layout,.atx-border-layout *{box-sizing:border-box}.atx-border-layout .content{height:100%;width:100%;overflow:auto}.atx-border-layout .drag{position:absolute;border:2px solid black}:host ::ng-deep .atx-handle{position:absolute}:host ::ng-deep .atx-handle:hover,:host ::ng-deep .atx-handle.atx-handle-selected{background-color:var(--atx-handle-color, #469afa)}:host ::ng-deep .north{position:absolute;z-index:10;top:0;left:0;right:0}:host ::ng-deep .north .atx-handle{left:0;right:0;bottom:0;height:4px;cursor:ns-resize}:host ::ng-deep .west{position:absolute;z-index:5;left:0;height:unset!important}:host ::ng-deep .west .atx-handle{right:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host ::ng-deep .east{position:absolute;z-index:5;right:0;height:unset!important}:host ::ng-deep .east .atx-handle{left:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host ::ng-deep .south{position:absolute;z-index:10;bottom:0;left:0;right:0}:host ::ng-deep .south .atx-handle{left:0;right:0;top:0;height:4px;cursor:ns-resize}:host ::ng-deep .center{position:absolute}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }); }
9350
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: BorderLayout, deps: [{ token: SubscriptionService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
9351
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: BorderLayout, isStandalone: true, selector: "atx-border-layout", outputs: { dragStart: "dragStart", dragStop: "dragStop", dragging: "dragging" }, host: { listeners: { "window:resize": "onResize()" } }, queries: [{ propertyName: "__containers__", predicate: BorderLayoutContainer }], viewQueries: [{ propertyName: "layoutContainer", first: true, predicate: ["atxLayoutContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<div #atxLayoutContainer class=\"atx-border-layout\">\n <ng-content></ng-content>\n</div>", styles: [".atx-border-layout{position:relative;height:100%;width:100%;-webkit-user-select:none;user-select:none;overflow:hidden}.atx-border-layout{box-sizing:border-box}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }); }
9319
9352
  }
9320
9353
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: BorderLayout, decorators: [{
9321
9354
  type: Component,
9322
- args: [{ selector: 'atx-border-layout', standalone: true, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<div #atxLayoutContainer class=\"atx-border-layout\">\n <ng-content></ng-content>\n</div>", styles: [".atx-border-layout{position:relative;height:100%;width:100%;-webkit-user-select:none;user-select:none;overflow:hidden}.atx-border-layout,.atx-border-layout *{box-sizing:border-box}.atx-border-layout .content{height:100%;width:100%;overflow:auto}.atx-border-layout .drag{position:absolute;border:2px solid black}:host ::ng-deep .atx-handle{position:absolute}:host ::ng-deep .atx-handle:hover,:host ::ng-deep .atx-handle.atx-handle-selected{background-color:var(--atx-handle-color, #469afa)}:host ::ng-deep .north{position:absolute;z-index:10;top:0;left:0;right:0}:host ::ng-deep .north .atx-handle{left:0;right:0;bottom:0;height:4px;cursor:ns-resize}:host ::ng-deep .west{position:absolute;z-index:5;left:0;height:unset!important}:host ::ng-deep .west .atx-handle{right:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host ::ng-deep .east{position:absolute;z-index:5;right:0;height:unset!important}:host ::ng-deep .east .atx-handle{left:0;bottom:0;top:0;width:4px;cursor:ew-resize}:host ::ng-deep .south{position:absolute;z-index:10;bottom:0;left:0;right:0}:host ::ng-deep .south .atx-handle{left:0;right:0;top:0;height:4px;cursor:ns-resize}:host ::ng-deep .center{position:absolute}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }]
9323
- }], ctorParameters: () => [{ type: SubscriptionService }], propDecorators: { dragStart: [{
9355
+ args: [{ selector: 'atx-border-layout', standalone: true, template: "<!--\n * LICENSE\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n-->\n\n<div #atxLayoutContainer class=\"atx-border-layout\">\n <ng-content></ng-content>\n</div>", styles: [".atx-border-layout{position:relative;height:100%;width:100%;-webkit-user-select:none;user-select:none;overflow:hidden}.atx-border-layout{box-sizing:border-box}\n/**\n * @license\n * Copyright Pascal ECHEMANN. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be found in\n * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license\n */\n"] }]
9356
+ }], ctorParameters: () => [{ type: SubscriptionService }, { type: Document, decorators: [{
9357
+ type: Inject,
9358
+ args: [DOCUMENT]
9359
+ }] }], propDecorators: { dragStart: [{
9324
9360
  type: Output
9325
9361
  }], dragStop: [{
9326
9362
  type: Output