@sumaris-net/ngx-components 1.20.16 → 1.20.17

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.
@@ -20470,6 +20470,104 @@
20470
20470
  autofocus: [{ type: i0.Input }]
20471
20471
  };
20472
20472
 
20473
+ var ResizableDirective = /** @class */ (function () {
20474
+ function ResizableDirective(document, elementRef) {
20475
+ var _this = this;
20476
+ this.document = document;
20477
+ this.elementRef = elementRef;
20478
+ this.resizable = rxjs.fromEvent(this.elementRef.nativeElement, 'mousedown').pipe(operators.tap(function (e) {
20479
+ e.preventDefault();
20480
+ e.stopPropagation();
20481
+ }), operators.switchMap(function () {
20482
+ var _a = _this.elementRef.nativeElement.closest('th').getBoundingClientRect(), width = _a.width, right = _a.right;
20483
+ return rxjs.fromEvent(_this.document, 'mousemove').pipe(operators.map(function (_a) {
20484
+ var clientX = _a.clientX;
20485
+ return width + clientX - right;
20486
+ }), operators.distinctUntilChanged(), operators.takeUntil(rxjs.fromEvent(_this.document, 'mouseup')));
20487
+ }));
20488
+ this.fit = rxjs.fromEvent(this.elementRef.nativeElement, 'click').pipe(operators.bufferWhen(function () { return rxjs.interval(500); }), operators.filter(function (ar) { return ar.length === 2; }));
20489
+ }
20490
+ return ResizableDirective;
20491
+ }());
20492
+ ResizableDirective.decorators = [
20493
+ { type: i0.Directive, args: [{
20494
+ selector: '[resizable]',
20495
+ },] }
20496
+ ];
20497
+ ResizableDirective.ctorParameters = function () { return [
20498
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$4.DOCUMENT,] }] },
20499
+ { type: i0.ElementRef, decorators: [{ type: i0.Inject, args: [i0.ElementRef,] }] }
20500
+ ]; };
20501
+ ResizableDirective.propDecorators = {
20502
+ resizable: [{ type: i0.Output }],
20503
+ fit: [{ type: i0.Output }]
20504
+ };
20505
+
20506
+ var ResizableComponent = /** @class */ (function () {
20507
+ function ResizableComponent(columnDef) {
20508
+ this.columnDef = columnDef;
20509
+ this.sizeChanged = new i0.EventEmitter();
20510
+ this.width = null;
20511
+ this.minWidth = null;
20512
+ this.maxWidth = null;
20513
+ this.debug = false;
20514
+ }
20515
+ ResizableComponent.prototype.onResize = function (width, opts) {
20516
+ if (!this.resizable)
20517
+ return;
20518
+ if (this.debug)
20519
+ console.info("resize:" + width);
20520
+ this.minWidth = width + 'px';
20521
+ this.maxWidth = width + 'px';
20522
+ if (!opts || opts.emitEvent) {
20523
+ this.sizeChanged.emit(width);
20524
+ }
20525
+ };
20526
+ ResizableComponent.prototype.onFit = function (opts) {
20527
+ if (!this.resizable)
20528
+ return;
20529
+ if (this.debug)
20530
+ console.info('fit');
20531
+ this.width = 'auto';
20532
+ this.minWidth = null;
20533
+ this.maxWidth = null;
20534
+ if (!opts || opts.emitEvent) {
20535
+ this.sizeChanged.emit(undefined);
20536
+ }
20537
+ };
20538
+ return ResizableComponent;
20539
+ }());
20540
+ ResizableComponent.decorators = [
20541
+ { type: i0.Component, args: [{
20542
+ // eslint-disable-next-line @angular-eslint/component-selector
20543
+ selector: 'th[resizable]',
20544
+ template: "<div class=\"wrapper\">\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n <div class=\"bar\" [class.cdk-visually-hidden]=\"!resizable\" (resizable)=\"onResize($event)\" (fit)=\"onFit()\"></div>\n</div>\n",
20545
+ styles: [":host:last-child .bar{display:none}.wrapper{display:flex;justify-content:flex-end;align-items:center}.content{flex:1}.bar{height:var(--app-table-header-height,55px);width:10px;justify-self:flex-end;border-left:4px solid transparent;border-right:4px solid transparent;background:var(--ion-color-secondary);background-clip:content-box;cursor:ew-resize;opacity:0;transition:opacity .3s}.bar:active,.bar:hover{opacity:1}:host-context(.mat-table-sticky) .bar{width:12px!important}"]
20546
+ },] }
20547
+ ];
20548
+ ResizableComponent.ctorParameters = function () { return [
20549
+ { type: table.MatColumnDef, decorators: [{ type: i0.Optional }] }
20550
+ ]; };
20551
+ ResizableComponent.propDecorators = {
20552
+ resizable: [{ type: i0.Input }],
20553
+ sizeChanged: [{ type: i0.Output }],
20554
+ width: [{ type: i0.HostBinding, args: ['style.width',] }],
20555
+ minWidth: [{ type: i0.HostBinding, args: ['style.min-width',] }],
20556
+ maxWidth: [{ type: i0.HostBinding, args: ['style.max-width',] }]
20557
+ };
20558
+
20559
+ var ResizableModule = /** @class */ (function () {
20560
+ function ResizableModule() {
20561
+ }
20562
+ return ResizableModule;
20563
+ }());
20564
+ ResizableModule.decorators = [
20565
+ { type: i0.NgModule, args: [{
20566
+ declarations: [ResizableComponent, ResizableDirective],
20567
+ exports: [ResizableComponent, ResizableDirective],
20568
+ },] }
20569
+ ];
20570
+
20473
20571
  function mergeLoadResult(res1, res2) {
20474
20572
  var _c;
20475
20573
  var _a, _b;
@@ -32600,6 +32698,9 @@
32600
32698
  exports.ReferentialUtils = ReferentialUtils;
32601
32699
  exports.ReferentialValidatorService = ReferentialValidatorService;
32602
32700
  exports.RegisterConfirmPage = RegisterConfirmPage;
32701
+ exports.ResizableComponent = ResizableComponent;
32702
+ exports.ResizableDirective = ResizableDirective;
32703
+ exports.ResizableModule = ResizableModule;
32603
32704
  exports.SETTINGS_DISPLAY_COLUMNS = SETTINGS_DISPLAY_COLUMNS;
32604
32705
  exports.SETTINGS_FILTER = SETTINGS_FILTER;
32605
32706
  exports.SETTINGS_PAGE_SIZE = SETTINGS_PAGE_SIZE;