@datarailsshared/datarailsshared 1.4.123 → 1.4.125

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.
@@ -933,6 +933,7 @@
933
933
  var DrTagComponent = /** @class */ (function () {
934
934
  function DrTagComponent() {
935
935
  this.dynamicTagValues = {};
936
+ this.connectedTags = [];
936
937
  this.tagChange = new i0.EventEmitter(); // Not emit value for dynamic tag
937
938
  this.dynamicTagChange = new i0.EventEmitter();
938
939
  this.dynamicTagAdd = new i0.EventEmitter();
@@ -1008,6 +1009,10 @@
1008
1009
  this.connectedTags = _.map(this.connectedTags, function (tag) {
1009
1010
  if (tag.id === connectedDateTagConfig.id) {
1010
1011
  tag.value = event.value;
1012
+ tag.locked = event.locked;
1013
+ if (connectedDateTagConfig.type === exports.TagTypes.DATE) {
1014
+ tag.label = event.label;
1015
+ }
1011
1016
  }
1012
1017
  return tag;
1013
1018
  });
@@ -1041,7 +1046,7 @@
1041
1046
  _this.dateTag = {
1042
1047
  type: tagConfig.type,
1043
1048
  sub_type: tagConfig.options.sub_type,
1044
- value: _.find(_this.connectedTags, { id: tagConfig.id }).value,
1049
+ value: (_.find(_this.connectedTags, { id: tagConfig.id }) || {}).value,
1045
1050
  };
1046
1051
  }
1047
1052
  if (tagConfig.type === exports.TagTypes.LIST) {
@@ -1052,6 +1057,13 @@
1052
1057
  value: (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.default_value,
1053
1058
  };
1054
1059
  }
1060
+ if (!_.find(_this.connectedTags, { id: tagConfig.id })) {
1061
+ _this.connectedTags.push({
1062
+ id: tagConfig.id,
1063
+ name: tagConfig.name,
1064
+ value: undefined,
1065
+ });
1066
+ }
1055
1067
  });
1056
1068
  };
1057
1069
  return DrTagComponent;
@@ -2660,6 +2672,7 @@
2660
2672
  this.viewContainerRef = viewContainerRef;
2661
2673
  this.elementRef = elementRef;
2662
2674
  this.popoverRef = popoverRef;
2675
+ this.popoverOpened = new i0.EventEmitter();
2663
2676
  this.class = '';
2664
2677
  this.isContentTemplate = false;
2665
2678
  this.popover = true;
@@ -2689,8 +2702,35 @@
2689
2702
  if (this.alignment === 'host') {
2690
2703
  this[getAlignmentDimension(this.position)] = '100%';
2691
2704
  }
2705
+ this.popoverOpened.emit();
2706
+ this.repositionToNewContainerAndFreeze();
2692
2707
  this.cdr.detectChanges();
2693
2708
  };
2709
+ /**
2710
+ * Removing popover element from cdk-overlay and attach to provided container after element is positioned
2711
+ * is required for specific case of preserving popover at same position on document while scroll (not fixed)
2712
+ *
2713
+ * TODO: implement more neat, transparent and Angular way solution: i.e. create another service (or extend existiong one)
2714
+ * without attaching component to cdk Overlay and instead positioning it to element passed in directive input parameter
2715
+ */
2716
+ DrPopoverComponent.prototype.repositionToNewContainerAndFreeze = function () {
2717
+ var _this = this;
2718
+ var newContainer = !!this.freezeToContainerSelector && document.querySelector(this.freezeToContainerSelector);
2719
+ if (newContainer) {
2720
+ // waiting until element is positioned on overlay
2721
+ setTimeout(function () {
2722
+ var element = _this.elementRef.nativeElement;
2723
+ if (!element.closest('.cdk-overlay-container'))
2724
+ return;
2725
+ var position = element.getBoundingClientRect();
2726
+ var newContainerPosition = newContainer.getBoundingClientRect();
2727
+ element.style.position = 'absolute';
2728
+ element.style.top = newContainer.scrollTop + position.top - newContainerPosition.top + "px";
2729
+ element.style.left = newContainerPosition.left + position.left + "px";
2730
+ newContainer.appendChild(element);
2731
+ });
2732
+ }
2733
+ };
2694
2734
  return DrPopoverComponent;
2695
2735
  }());
2696
2736
  DrPopoverComponent.decorators = [
@@ -2712,6 +2752,7 @@
2712
2752
  { type: DrPopoverRef }
2713
2753
  ]; };
2714
2754
  DrPopoverComponent.propDecorators = {
2755
+ popoverOpened: [{ type: i0.Output }],
2715
2756
  content: [{ type: i0.Input }],
2716
2757
  contentContext: [{ type: i0.Input }],
2717
2758
  class: [{ type: i0.Input }],
@@ -2719,6 +2760,7 @@
2719
2760
  manualClosing: [{ type: i0.Input }],
2720
2761
  alignment: [{ type: i0.Input }],
2721
2762
  position: [{ type: i0.Input }],
2763
+ freezeToContainerSelector: [{ type: i0.Input }],
2722
2764
  popoverContainer: [{ type: i0.ViewChild, args: ['popoverContainer', { read: i0.ElementRef, static: true },] }],
2723
2765
  width: [{ type: i0.HostBinding, args: ['style.width',] }],
2724
2766
  height: [{ type: i0.HostBinding, args: ['style.height',] }],
@@ -2743,7 +2785,7 @@
2743
2785
  return popoverRef;
2744
2786
  };
2745
2787
  DrPopoverService.prototype.attachOverlayContainer = function (content, _a, overlayRef, popoverRef) {
2746
- var contentContext = _a.contentContext, position = _a.position, elementClass = _a.class, manualClosing = _a.manualClosing, hostRef = _a.hostRef, alignment = _a.alignment;
2788
+ var contentContext = _a.contentContext, position = _a.position, elementClass = _a.class, manualClosing = _a.manualClosing, hostRef = _a.hostRef, alignment = _a.alignment, freezeToContainerSelector = _a.freezeToContainerSelector;
2747
2789
  var componentPortal = new portal.ComponentPortal(DrPopoverComponent, null, this.createInjector(popoverRef));
2748
2790
  var contentRef = overlayRef.attach(componentPortal);
2749
2791
  popoverRef.componentRef = contentRef;
@@ -2754,6 +2796,7 @@
2754
2796
  contentRef.instance.hostRef = hostRef;
2755
2797
  contentRef.instance.alignment = alignment;
2756
2798
  contentRef.instance.position = position;
2799
+ contentRef.instance.freezeToContainerSelector = freezeToContainerSelector;
2757
2800
  };
2758
2801
  DrPopoverService.prototype.createOverlay = function (popoverModel) {
2759
2802
  var overlayConfig = this.getOverlayConfig(popoverModel);
@@ -2837,6 +2880,7 @@
2837
2880
  this.manualClosing = { enabled: false };
2838
2881
  // eslint-disable-next-line
2839
2882
  this.popoverClose = new i0.EventEmitter();
2883
+ this.popoverOpened = new i0.EventEmitter();
2840
2884
  // eslint-disable-next-line
2841
2885
  this.showStateChange = new i0.EventEmitter();
2842
2886
  }
@@ -2867,12 +2911,16 @@
2867
2911
  position: this.position,
2868
2912
  contentContext: this.contentContext,
2869
2913
  alignment: this.alignment,
2914
+ freezeToContainerSelector: this.freezeToContainerSelector
2870
2915
  });
2871
2916
  popoverRef.onClose.pipe(operators.first()).subscribe(function (res) {
2872
2917
  _this.closePopover();
2873
2918
  _this.popoverClose.emit(res);
2874
2919
  _this.showStateChange.emit({ isShown: !!_this.popoverRef });
2875
2920
  });
2921
+ popoverRef.componentRef.instance.popoverOpened.pipe(operators.first()).subscribe(function () {
2922
+ _this.popoverOpened.emit();
2923
+ });
2876
2924
  };
2877
2925
  DrPopoverDirective.prototype.ngOnDestroy = function () {
2878
2926
  this.closePopover();
@@ -2897,7 +2945,9 @@
2897
2945
  manualClosing: [{ type: i0.Input, args: ['drPopoverManualClosing',] }],
2898
2946
  alignment: [{ type: i0.Input, args: ['drPopoverAlignment',] }],
2899
2947
  disabled: [{ type: i0.Input, args: ['drPopoverDisabled',] }],
2948
+ freezeToContainerSelector: [{ type: i0.Input, args: ['drPopoverFreezeToContainerSelector',] }],
2900
2949
  popoverClose: [{ type: i0.Output, args: ['drPopoverClose',] }],
2950
+ popoverOpened: [{ type: i0.Output, args: ['drPopoverOpened',] }],
2901
2951
  showStateChange: [{ type: i0.Output, args: ['drPopoverShowStateChange',] }],
2902
2952
  togglePopover: [{ type: i0.HostListener, args: ['click',] }]
2903
2953
  };
@@ -3282,6 +3332,7 @@
3282
3332
  DrTabComponent.propDecorators = {
3283
3333
  label: [{ type: i0.Input }],
3284
3334
  disabled: [{ type: i0.Input }],
3335
+ tooltip: [{ type: i0.Input }],
3285
3336
  contentTemplate: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
3286
3337
  };
3287
3338
 
@@ -3301,8 +3352,8 @@
3301
3352
  DrTabsComponent.decorators = [
3302
3353
  { type: i0.Component, args: [{
3303
3354
  selector: 'dr-tabs',
3304
- template: "<mat-tab-group disableRipple [selectedIndex]=\"selectedTab\"\n (selectedIndexChange)=\"selectedIndexChange($event)\"\n [class.with-radio]=\"withRadio\"\n [class.vertical]=\"vertical\"\n [class.no-tab-labels-padding]=\"noTabLabelsPadding\"\n [class.no-body-padding]=\"noBodyPadding\"\n [animationDuration]=\" vertical ? '0ms' : '500ms'\">\n <mat-tab *ngFor=\"let tab of tabsContentList; let index = index\" label=\"{{tab.label}}\" [disabled]=\"tab.disabled\">\n <ng-container *ngIf=\"withRadio\">\n <ng-template mat-tab-label>\n <dr-radio-button [value]=\"index\"\n [(ngModel)]=\"selectedTab\">\n </dr-radio-button>\n {{tab.label}}\n </ng-template>\n </ng-container>\n\n <ng-container *ngTemplateOutlet=\"tab.contentTemplate\"></ng-container>\n </mat-tab>\n</mat-tab-group>\n",
3305
- styles: [":host{width:100%}:host ::ng-deep .mat-tab-group,:host ::ng-deep .mat-tab-body-wrapper{height:100%}:host ::ng-deep .mat-tab-group{font-family:\"Poppins\",sans-serif}:host ::ng-deep .mat-tab-nav-bar,:host ::ng-deep .mat-tab-header{border-bottom:1px solid #d5dae5}:host ::ng-deep .mat-tab-labels{padding:0 17px}:host ::ng-deep .mat-tab-label{padding:0 8px;min-width:0;height:38px;opacity:1}:host ::ng-deep .mat-tab-label:not(:last-child){margin-right:21px}:host ::ng-deep .mat-tab-label-active .mat-tab-label-content{color:#4646ce;font-weight:700}:host ::ng-deep .mat-tab-label-content{font-weight:400;font-size:14px;line-height:22px;color:#51566f;font-family:\"Poppins\",sans-serif}:host ::ng-deep .mat-ink-bar{height:3px;border-radius:5px;background-color:#4646ce!important}:host ::ng-deep .with-radio .mat-tab-labels{padding:0;margin-bottom:8px}:host ::ng-deep .with-radio .mat-tab-label{padding:8px 16px;min-width:0;flex-grow:1;justify-content:start;height:38px;opacity:1}:host ::ng-deep .with-radio .mat-tab-label:not(:last-child){margin-right:8px}:host ::ng-deep .with-radio .mat-tab-label-active{background:#f6f7f8;border-radius:3px}:host ::ng-deep .with-radio .mat-tab-label-active .mat-tab-label-content{color:#0c142b;font-weight:600}:host ::ng-deep .with-radio .mat-ink-bar{display:none!important}:host ::ng-deep .vertical.mat-tab-group{flex-direction:row}:host ::ng-deep .vertical .mat-tab-header{border-bottom:none}:host ::ng-deep .vertical .mat-tab-label-container{border-right:1px solid #d5dae5}:host ::ng-deep .vertical .mat-tab-label-container .mat-tab-labels{flex-direction:column;padding:0}:host ::ng-deep .vertical .mat-ink-bar{display:none!important}:host ::ng-deep .vertical .mat-tab-label{border-bottom:1px solid #d5dae5;margin:0!important;justify-content:flex-start;padding:1rem 2rem;height:40px}:host ::ng-deep .vertical .mat-tab-label:before{content:\"\";width:2px;height:100%;display:flex;position:absolute;top:0;left:0}:host ::ng-deep .vertical .mat-tab-label-active{background-color:#f3f7ff}:host ::ng-deep .vertical .mat-tab-label-active:before{background-color:#151a41}:host ::ng-deep .vertical .mat-tab-label-active .mat-tab-label-content{font-weight:normal;color:#151a41}:host ::ng-deep .vertical .mat-tab-body-wrapper{width:100%;padding:16px}:host ::ng-deep mat-tab-group.no-body-padding .mat-tab-body-wrapper{padding:0}:host ::ng-deep mat-tab-group.no-tab-labels-padding .mat-tab-labels{padding:0}\n"]
3355
+ template: "<mat-tab-group disableRipple [selectedIndex]=\"selectedTab\"\n (selectedIndexChange)=\"selectedIndexChange($event)\"\n [class.with-radio]=\"withRadio\"\n [class.vertical]=\"vertical\"\n [class.no-tab-labels-padding]=\"noTabLabelsPadding\"\n [class.no-body-padding]=\"noBodyPadding\"\n [animationDuration]=\" vertical ? '0ms' : '500ms'\">\n <mat-tab *ngFor=\"let tab of tabsContentList; let index = index\" label=\"{{ tab.label }}\" [disabled]=\"tab.disabled\">\n <ng-container *ngIf=\"withRadio\">\n <ng-template mat-tab-label>\n <dr-radio-button [value]=\"index\"\n [(ngModel)]=\"selectedTab\">\n </dr-radio-button>\n {{ tab.label }}\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"tab.tooltip && !withRadio\">\n <ng-template mat-tab-label>\n <label class=\"cursor-pointer\" [drTooltip]=\"tab.tooltip\">{{ tab.label }}</label>\n </ng-template>\n </ng-container>\n <ng-container *ngTemplateOutlet=\"tab.contentTemplate\"></ng-container>\n </mat-tab>\n</mat-tab-group>\n",
3356
+ styles: [":host{width:100%}:host .cursor-pointer{cursor:pointer}:host ::ng-deep .mat-tab-group,:host ::ng-deep .mat-tab-body-wrapper{height:100%}:host ::ng-deep .mat-tab-group{font-family:\"Poppins\",sans-serif}:host ::ng-deep .mat-tab-nav-bar,:host ::ng-deep .mat-tab-header{border-bottom:1px solid #d5dae5}:host ::ng-deep .mat-tab-labels{padding:0 17px}:host ::ng-deep .mat-tab-label{padding:0 8px;min-width:0;height:38px;opacity:1}:host ::ng-deep .mat-tab-label:not(:last-child){margin-right:21px}:host ::ng-deep .mat-tab-label-active .mat-tab-label-content{color:#4646ce;font-weight:700}:host ::ng-deep .mat-tab-label-content{font-weight:400;font-size:14px;line-height:22px;color:#51566f;font-family:\"Poppins\",sans-serif}:host ::ng-deep .mat-ink-bar{height:3px;border-radius:5px;background-color:#4646ce!important}:host ::ng-deep .with-radio .mat-tab-labels{padding:0;margin-bottom:8px}:host ::ng-deep .with-radio .mat-tab-label{padding:8px 16px;min-width:0;flex-grow:1;justify-content:start;height:38px;opacity:1}:host ::ng-deep .with-radio .mat-tab-label:not(:last-child){margin-right:8px}:host ::ng-deep .with-radio .mat-tab-label-active{background:#f6f7f8;border-radius:3px}:host ::ng-deep .with-radio .mat-tab-label-active .mat-tab-label-content{color:#0c142b;font-weight:600}:host ::ng-deep .with-radio .mat-ink-bar{display:none!important}:host ::ng-deep .vertical.mat-tab-group{flex-direction:row}:host ::ng-deep .vertical .mat-tab-header{border-bottom:none}:host ::ng-deep .vertical .mat-tab-label-container{border-right:1px solid #d5dae5}:host ::ng-deep .vertical .mat-tab-label-container .mat-tab-labels{flex-direction:column;padding:0}:host ::ng-deep .vertical .mat-ink-bar{display:none!important}:host ::ng-deep .vertical .mat-tab-label{border-bottom:1px solid #d5dae5;margin:0!important;justify-content:flex-start;padding:1rem 2rem;height:40px}:host ::ng-deep .vertical .mat-tab-label:before{content:\"\";width:2px;height:100%;display:flex;position:absolute;top:0;left:0}:host ::ng-deep .vertical .mat-tab-label-active{background-color:#f3f7ff}:host ::ng-deep .vertical .mat-tab-label-active:before{background-color:#151a41}:host ::ng-deep .vertical .mat-tab-label-active .mat-tab-label-content{font-weight:normal;color:#151a41}:host ::ng-deep .vertical .mat-tab-body-wrapper{width:100%;padding:16px}:host ::ng-deep mat-tab-group.no-body-padding .mat-tab-body-wrapper{padding:0}:host ::ng-deep mat-tab-group.no-tab-labels-padding .mat-tab-labels{padding:0}\n"]
3306
3357
  },] }
3307
3358
  ];
3308
3359
  DrTabsComponent.ctorParameters = function () { return []; };
@@ -5471,7 +5522,8 @@
5471
5522
  tabs.MatTabsModule,
5472
5523
  forms.FormsModule,
5473
5524
  forms.ReactiveFormsModule,
5474
- DrInputsModule
5525
+ DrInputsModule,
5526
+ DrTooltipModule
5475
5527
  ],
5476
5528
  exports: [
5477
5529
  DrTabsComponent,