@taiga-ui/addon-table 3.5.0 → 3.6.0

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('@angular/common'), require('@taiga-ui/core'), require('rxjs/operators'), require('@taiga-ui/addon-table/utils'), require('@ng-web-apis/intersection-observer'), require('@taiga-ui/kit'), require('rxjs'), require('@tinkoff/ng-polymorpheus'), require('@angular/forms')) :
3
- typeof define === 'function' && define.amd ? define('@taiga-ui/addon-table/components/table', ['exports', '@angular/core', '@taiga-ui/cdk', '@angular/common', '@taiga-ui/core', 'rxjs/operators', '@taiga-ui/addon-table/utils', '@ng-web-apis/intersection-observer', '@taiga-ui/kit', 'rxjs', '@tinkoff/ng-polymorpheus', '@angular/forms'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-table"] = global["taiga-ui"]["addon-table"] || {}, global["taiga-ui"]["addon-table"].components = global["taiga-ui"]["addon-table"].components || {}, global["taiga-ui"]["addon-table"].components.table = {}), global.ng.core, global.i4, global.ng.common, global.i1, global.rxjs.operators, global["taiga-ui"]["addon-table"].utils, global.intersectionObserver, global.kit, global.rxjs, global.i3, global.ng.forms));
5
- })(this, (function (exports, i0, i4, i2, i1, operators, utils, intersectionObserver, kit, i1$1, i3, forms) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('rxjs/operators'), require('@ng-web-apis/intersection-observer'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('rxjs'), require('@angular/common'), require('@taiga-ui/addon-table/utils'), require('@tinkoff/ng-polymorpheus'), require('@angular/forms')) :
3
+ typeof define === 'function' && define.amd ? define('@taiga-ui/addon-table/components/table', ['exports', '@angular/core', '@taiga-ui/cdk', 'rxjs/operators', '@ng-web-apis/intersection-observer', '@taiga-ui/core', '@taiga-ui/kit', 'rxjs', '@angular/common', '@taiga-ui/addon-table/utils', '@tinkoff/ng-polymorpheus', '@angular/forms'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-table"] = global["taiga-ui"]["addon-table"] || {}, global["taiga-ui"]["addon-table"].components = global["taiga-ui"]["addon-table"].components || {}, global["taiga-ui"]["addon-table"].components.table = {}), global.ng.core, global.i4, global.rxjs.operators, global.intersectionObserver, global.i1, global.kit, global.rxjs, global.ng.common, global["taiga-ui"]["addon-table"].utils, global.i3, global.ng.forms));
5
+ })(this, (function (exports, i0, i4, operators, intersectionObserver, i1, kit, i1$1, i2, utils, i3, forms) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -24,9 +24,9 @@
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
26
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
27
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
28
27
  var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1);
29
28
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1$1);
29
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
30
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
31
31
 
32
32
  /******************************************************************************
@@ -382,95 +382,6 @@
382
382
  type: i0.Input
383
383
  }] } });
384
384
 
385
- var TuiHeadDirective = /** @class */ (function () {
386
- function TuiHeadDirective(template) {
387
- this.template = template;
388
- }
389
- return TuiHeadDirective;
390
- }());
391
- TuiHeadDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiHeadDirective, deps: [{ token: i0.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
392
- TuiHeadDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiHeadDirective, selector: "[tuiHead]", inputs: { tuiHead: "tuiHead" }, ngImport: i0__namespace });
393
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiHeadDirective, decorators: [{
394
- type: i0.Directive,
395
- args: [{
396
- selector: "[tuiHead]",
397
- }]
398
- }], ctorParameters: function () {
399
- return [{ type: i0__namespace.TemplateRef, decorators: [{
400
- type: i0.Inject,
401
- args: [i0.TemplateRef]
402
- }] }];
403
- }, propDecorators: { tuiHead: [{
404
- type: i0.Input
405
- }] } });
406
-
407
- var TuiResizedDirective = /** @class */ (function () {
408
- function TuiResizedDirective(documentRef, elementRef, parentRef) {
409
- var _this = this;
410
- this.documentRef = documentRef;
411
- this.elementRef = elementRef;
412
- this.parentRef = parentRef;
413
- this.tuiResized = i4.tuiTypedFromEvent(this.elementRef.nativeElement, "mousedown").pipe(i4.tuiPreventDefault(), operators.switchMap(function () {
414
- var _a = _this.parentRef.nativeElement.getBoundingClientRect(), width = _a.width, right = _a.right;
415
- return i4.tuiTypedFromEvent(_this.documentRef, "mousemove").pipe(operators.distinctUntilChanged(), operators.map(function (_a) {
416
- var clientX = _a.clientX;
417
- return width + clientX - right;
418
- }), operators.takeUntil(i4.tuiTypedFromEvent(_this.documentRef, "mouseup")));
419
- }));
420
- }
421
- return TuiResizedDirective;
422
- }());
423
- TuiResizedDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiResizedDirective, deps: [{ token: i2.DOCUMENT }, { token: i0.ElementRef }, { token: i1.TUI_ELEMENT_REF }], target: i0__namespace.ɵɵFactoryTarget.Directive });
424
- TuiResizedDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiResizedDirective, selector: "[tuiResized]", outputs: { tuiResized: "tuiResized" }, ngImport: i0__namespace });
425
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiResizedDirective, decorators: [{
426
- type: i0.Directive,
427
- args: [{
428
- selector: "[tuiResized]",
429
- }]
430
- }], ctorParameters: function () {
431
- return [{ type: Document, decorators: [{
432
- type: i0.Inject,
433
- args: [i2.DOCUMENT]
434
- }] }, { type: i0__namespace.ElementRef, decorators: [{
435
- type: i0.Inject,
436
- args: [i0.ElementRef]
437
- }] }, { type: i0__namespace.ElementRef, decorators: [{
438
- type: i0.Inject,
439
- args: [i1.TUI_ELEMENT_REF]
440
- }] }];
441
- }, propDecorators: { tuiResized: [{
442
- type: i0.Output
443
- }] } });
444
-
445
- var TuiRowDirective = /** @class */ (function () {
446
- function TuiRowDirective(template) {
447
- this.template = template;
448
- this.tuiRowOf = [];
449
- }
450
- TuiRowDirective.ngTemplateContextGuard = function (_dir, _ctx) {
451
- return true;
452
- };
453
- return TuiRowDirective;
454
- }());
455
- TuiRowDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiRowDirective, deps: [{ token: i0.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
456
- TuiRowDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiRowDirective, selector: "ng-template[tuiRow]", inputs: { tuiRowOf: "tuiRowOf" }, ngImport: i0__namespace });
457
- __decorate([
458
- i4.tuiDefaultProp()
459
- ], TuiRowDirective.prototype, "tuiRowOf", void 0);
460
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiRowDirective, decorators: [{
461
- type: i0.Directive,
462
- args: [{
463
- selector: "ng-template[tuiRow]",
464
- }]
465
- }], ctorParameters: function () {
466
- return [{ type: i0__namespace.TemplateRef, decorators: [{
467
- type: i0.Inject,
468
- args: [i0.TemplateRef]
469
- }] }];
470
- }, propDecorators: { tuiRowOf: [{
471
- type: i0.Input
472
- }] } });
473
-
474
385
  var TUI_STUCK = new i0.InjectionToken("[TUI_STUCK]: Stream of sticky stuck events");
475
386
  var TUI_STUCK_PROVIDER = {
476
387
  provide: TUI_STUCK,
@@ -609,6 +520,127 @@
609
520
  type: i0.Input
610
521
  }] } });
611
522
 
523
+ var TuiDirectionOrderDirective = /** @class */ (function () {
524
+ function TuiDirectionOrderDirective(table) {
525
+ this.table = table;
526
+ this.directionOrderChange = this.table.directionChange.pipe(operators.map(function (dir) { return (dir === 1 ? "asc" : "desc"); }));
527
+ }
528
+ Object.defineProperty(TuiDirectionOrderDirective.prototype, "directionOrder", {
529
+ set: function (order) {
530
+ this.table.direction = order === "asc" ? 1 : -1;
531
+ },
532
+ enumerable: false,
533
+ configurable: true
534
+ });
535
+ return TuiDirectionOrderDirective;
536
+ }());
537
+ TuiDirectionOrderDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiDirectionOrderDirective, deps: [{ token: TuiTableDirective }], target: i0__namespace.ɵɵFactoryTarget.Directive });
538
+ TuiDirectionOrderDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDirectionOrderDirective, selector: "table[tuiTable][tuiDirectionOrder]", inputs: { directionOrder: "directionOrder" }, outputs: { directionOrderChange: "directionOrderChange" }, ngImport: i0__namespace });
539
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiDirectionOrderDirective, decorators: [{
540
+ type: i0.Directive,
541
+ args: [{
542
+ selector: "table[tuiTable][tuiDirectionOrder]",
543
+ }]
544
+ }], ctorParameters: function () {
545
+ return [{ type: TuiTableDirective, decorators: [{
546
+ type: i0.Inject,
547
+ args: [TuiTableDirective]
548
+ }] }];
549
+ }, propDecorators: { directionOrder: [{
550
+ type: i0.Input
551
+ }], directionOrderChange: [{
552
+ type: i0.Output
553
+ }] } });
554
+
555
+ var TuiHeadDirective = /** @class */ (function () {
556
+ function TuiHeadDirective(template) {
557
+ this.template = template;
558
+ }
559
+ return TuiHeadDirective;
560
+ }());
561
+ TuiHeadDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiHeadDirective, deps: [{ token: i0.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
562
+ TuiHeadDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiHeadDirective, selector: "[tuiHead]", inputs: { tuiHead: "tuiHead" }, ngImport: i0__namespace });
563
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiHeadDirective, decorators: [{
564
+ type: i0.Directive,
565
+ args: [{
566
+ selector: "[tuiHead]",
567
+ }]
568
+ }], ctorParameters: function () {
569
+ return [{ type: i0__namespace.TemplateRef, decorators: [{
570
+ type: i0.Inject,
571
+ args: [i0.TemplateRef]
572
+ }] }];
573
+ }, propDecorators: { tuiHead: [{
574
+ type: i0.Input
575
+ }] } });
576
+
577
+ var TuiResizedDirective = /** @class */ (function () {
578
+ function TuiResizedDirective(documentRef, elementRef, parentRef) {
579
+ var _this = this;
580
+ this.documentRef = documentRef;
581
+ this.elementRef = elementRef;
582
+ this.parentRef = parentRef;
583
+ this.tuiResized = i4.tuiTypedFromEvent(this.elementRef.nativeElement, "mousedown").pipe(i4.tuiPreventDefault(), operators.switchMap(function () {
584
+ var _a = _this.parentRef.nativeElement.getBoundingClientRect(), width = _a.width, right = _a.right;
585
+ return i4.tuiTypedFromEvent(_this.documentRef, "mousemove").pipe(operators.distinctUntilChanged(), operators.map(function (_a) {
586
+ var clientX = _a.clientX;
587
+ return width + clientX - right;
588
+ }), operators.takeUntil(i4.tuiTypedFromEvent(_this.documentRef, "mouseup")));
589
+ }));
590
+ }
591
+ return TuiResizedDirective;
592
+ }());
593
+ TuiResizedDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiResizedDirective, deps: [{ token: i2.DOCUMENT }, { token: i0.ElementRef }, { token: i1.TUI_ELEMENT_REF }], target: i0__namespace.ɵɵFactoryTarget.Directive });
594
+ TuiResizedDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiResizedDirective, selector: "[tuiResized]", outputs: { tuiResized: "tuiResized" }, ngImport: i0__namespace });
595
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiResizedDirective, decorators: [{
596
+ type: i0.Directive,
597
+ args: [{
598
+ selector: "[tuiResized]",
599
+ }]
600
+ }], ctorParameters: function () {
601
+ return [{ type: Document, decorators: [{
602
+ type: i0.Inject,
603
+ args: [i2.DOCUMENT]
604
+ }] }, { type: i0__namespace.ElementRef, decorators: [{
605
+ type: i0.Inject,
606
+ args: [i0.ElementRef]
607
+ }] }, { type: i0__namespace.ElementRef, decorators: [{
608
+ type: i0.Inject,
609
+ args: [i1.TUI_ELEMENT_REF]
610
+ }] }];
611
+ }, propDecorators: { tuiResized: [{
612
+ type: i0.Output
613
+ }] } });
614
+
615
+ var TuiRowDirective = /** @class */ (function () {
616
+ function TuiRowDirective(template) {
617
+ this.template = template;
618
+ this.tuiRowOf = [];
619
+ }
620
+ TuiRowDirective.ngTemplateContextGuard = function (_dir, _ctx) {
621
+ return true;
622
+ };
623
+ return TuiRowDirective;
624
+ }());
625
+ TuiRowDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiRowDirective, deps: [{ token: i0.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
626
+ TuiRowDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiRowDirective, selector: "ng-template[tuiRow]", inputs: { tuiRowOf: "tuiRowOf" }, ngImport: i0__namespace });
627
+ __decorate([
628
+ i4.tuiDefaultProp()
629
+ ], TuiRowDirective.prototype, "tuiRowOf", void 0);
630
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiRowDirective, decorators: [{
631
+ type: i0.Directive,
632
+ args: [{
633
+ selector: "ng-template[tuiRow]",
634
+ }]
635
+ }], ctorParameters: function () {
636
+ return [{ type: i0__namespace.TemplateRef, decorators: [{
637
+ type: i0.Inject,
638
+ args: [i0.TemplateRef]
639
+ }] }];
640
+ }, propDecorators: { tuiRowOf: [{
641
+ type: i0.Input
642
+ }] } });
643
+
612
644
  var TuiThComponent = /** @class */ (function () {
613
645
  function TuiThComponent(head, table) {
614
646
  var _this = this;
@@ -1059,7 +1091,8 @@
1059
1091
  TuiSortableDirective,
1060
1092
  TuiTheadDirective,
1061
1093
  TuiResizedDirective,
1062
- TuiTableSortPipe], imports: [i2.CommonModule, i3.PolymorpheusModule, i4.TuiMapperPipeModule, i1.TuiSvgModule], exports: [TuiTableDirective,
1094
+ TuiTableSortPipe,
1095
+ TuiDirectionOrderDirective], imports: [i2.CommonModule, i3.PolymorpheusModule, i4.TuiMapperPipeModule, i1.TuiSvgModule], exports: [TuiTableDirective,
1063
1096
  TuiTbodyComponent,
1064
1097
  TuiThGroupComponent,
1065
1098
  TuiThComponent,
@@ -1071,7 +1104,8 @@
1071
1104
  TuiSortByDirective,
1072
1105
  TuiSortableDirective,
1073
1106
  TuiTheadDirective,
1074
- TuiTableSortPipe] });
1107
+ TuiTableSortPipe,
1108
+ TuiDirectionOrderDirective] });
1075
1109
  TuiTableModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiTableModule, imports: [[i2.CommonModule, i3.PolymorpheusModule, i4.TuiMapperPipeModule, i1.TuiSvgModule]] });
1076
1110
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: TuiTableModule, decorators: [{
1077
1111
  type: i0.NgModule,
@@ -1092,6 +1126,7 @@
1092
1126
  TuiTheadDirective,
1093
1127
  TuiResizedDirective,
1094
1128
  TuiTableSortPipe,
1129
+ TuiDirectionOrderDirective,
1095
1130
  ],
1096
1131
  exports: [
1097
1132
  TuiTableDirective,
@@ -1107,6 +1142,7 @@
1107
1142
  TuiSortableDirective,
1108
1143
  TuiTheadDirective,
1109
1144
  TuiTableSortPipe,
1145
+ TuiDirectionOrderDirective,
1110
1146
  ],
1111
1147
  }]
1112
1148
  }] });
@@ -1120,6 +1156,7 @@
1120
1156
  exports.TUI_TABLE_PROVIDER = TUI_TABLE_PROVIDER;
1121
1157
  exports.TUI_TABLE_PROVIDERS = TUI_TABLE_PROVIDERS;
1122
1158
  exports.TuiCellDirective = TuiCellDirective;
1159
+ exports.TuiDirectionOrderDirective = TuiDirectionOrderDirective;
1123
1160
  exports.TuiHeadDirective = TuiHeadDirective;
1124
1161
  exports.TuiResizedDirective = TuiResizedDirective;
1125
1162
  exports.TuiRowDirective = TuiRowDirective;