@datarailsshared/datarailsshared 1.5.548 → 1.5.553

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.
@@ -3074,12 +3074,13 @@ function DrToggleButtonComponent_ng_container_1_div_1_Template(rf, ctx) { if (rf
3074
3074
  const item_r1 = i0.ɵɵnextContext().$implicit;
3075
3075
  const ctx_r2 = i0.ɵɵnextContext();
3076
3076
  i0.ɵɵclassProp("selected", item_r1[ctx_r2.bindValue] === ctx_r2.selectedValue || item_r1 === ctx_r2.selectedValue)("disabled", item_r1.disabled);
3077
+ i0.ɵɵattribute("data-analytics", ctx_r2.getDataAnalyticsTag(item_r1));
3077
3078
  i0.ɵɵadvance(1);
3078
3079
  i0.ɵɵtextInterpolate1(" ", item_r1[ctx_r2.bindLabel] || item_r1.name || item_r1, " ");
3079
3080
  } }
3080
3081
  function DrToggleButtonComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
3081
3082
  i0.ɵɵelementContainerStart(0);
3082
- i0.ɵɵtemplate(1, DrToggleButtonComponent_ng_container_1_div_1_Template, 2, 5, "div", 2);
3083
+ i0.ɵɵtemplate(1, DrToggleButtonComponent_ng_container_1_div_1_Template, 2, 6, "div", 2);
3083
3084
  i0.ɵɵelementContainerEnd();
3084
3085
  } if (rf & 2) {
3085
3086
  const item_r1 = ctx.$implicit;
@@ -3125,8 +3126,15 @@ class DrToggleButtonComponent {
3125
3126
  this.onTouched();
3126
3127
  this.cdr.markForCheck();
3127
3128
  }
3129
+ getDataAnalyticsTag(item) {
3130
+ if (!this.dataAnalytics) {
3131
+ return null;
3132
+ }
3133
+ const value = this.bindValue ? item[this.bindValue] : item;
3134
+ return this.dataAnalytics + '_' + String(value).toLowerCase().replace(/ /g, '-');
3135
+ }
3128
3136
  /** @nocollapse */ static { this.ɵfac = function DrToggleButtonComponent_Factory(t) { return new (t || DrToggleButtonComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
3129
- /** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrToggleButtonComponent, selectors: [["dr-toggle-button"]], inputs: { items: "items", bindLabel: "bindLabel", bindValue: "bindValue", bindHidden: "bindHidden", mode: "mode", selectedValue: "selectedValue", disabled: "disabled" }, features: [i0.ɵɵProvidersFeature([{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => DrToggleButtonComponent)), multi: true }])], decls: 2, vars: 4, consts: [[1, "toggle-container"], [4, "ngFor", "ngForOf"], ["class", "toggle-container__item", 3, "selected", "disabled", "click", 4, "ngIf"], [1, "toggle-container__item", 3, "click"]], template: function DrToggleButtonComponent_Template(rf, ctx) { if (rf & 1) {
3137
+ /** @nocollapse */ static { this.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: DrToggleButtonComponent, selectors: [["dr-toggle-button"]], inputs: { items: "items", bindLabel: "bindLabel", bindValue: "bindValue", bindHidden: "bindHidden", mode: "mode", selectedValue: "selectedValue", disabled: "disabled", dataAnalytics: ["data-analytics", "dataAnalytics"] }, features: [i0.ɵɵProvidersFeature([{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => DrToggleButtonComponent)), multi: true }])], decls: 2, vars: 4, consts: [[1, "toggle-container"], [4, "ngFor", "ngForOf"], ["class", "toggle-container__item", 3, "selected", "disabled", "click", 4, "ngIf"], [1, "toggle-container__item", 3, "click"]], template: function DrToggleButtonComponent_Template(rf, ctx) { if (rf & 1) {
3130
3138
  i0.ɵɵelementStart(0, "div", 0);
3131
3139
  i0.ɵɵtemplate(1, DrToggleButtonComponent_ng_container_1_Template, 2, 1, "ng-container", 1);
3132
3140
  i0.ɵɵelementEnd();
@@ -3139,7 +3147,7 @@ class DrToggleButtonComponent {
3139
3147
  }
3140
3148
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrToggleButtonComponent, [{
3141
3149
  type: Component,
3142
- args: [{ selector: 'dr-toggle-button', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => DrToggleButtonComponent)), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"toggle-container\" [class.disabled]=\"_disabled\" [attr.mode]=\"mode\">\n <ng-container *ngFor=\"let item of items\">\n <div\n *ngIf=\"item && !item[bindHidden]\"\n class=\"toggle-container__item\"\n [class.selected]=\"item[bindValue] === selectedValue || item === selectedValue\"\n [class.disabled]=\"item.disabled\"\n (click)=\"setValue(item)\">\n {{ item[bindLabel] || item.name || item }}\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:flex}.toggle-container{display:flex;flex-wrap:nowrap;box-sizing:border-box;border-radius:20px;height:28px;font-family:Poppins,sans-serif}.toggle-container.disabled{pointer-events:none}.toggle-container__item{height:28px;display:flex;align-items:center;justify-content:center;padding:4px 16px;border-radius:20px;margin:-1px;cursor:pointer;font-weight:400;font-size:12px;line-height:20px;white-space:nowrap;color:#4e566c;box-sizing:border-box}.toggle-container__item.selected{background:#f2f2fb!important;border:1px solid #7f7fdd!important;color:#25258c!important}.toggle-container__item.disabled{pointer-events:none;cursor:default;background:#f0f1f4;color:#9ea1aa;border:1px solid #c3c4ce}.toggle-container[mode~=default]{background:#f6f7f8;border:1px solid #c3c4ce}.toggle-container[mode~=dotted] .toggle-container__item{padding:2px 8px;border:1px solid #9ea1aa;border-radius:18px;margin-left:4px;color:#0c142b}.toggle-container[mode~=dotted] .toggle-container__item:hover{background:#f0f1f4}.toggle-container[mode~=dotted] .toggle-container__item:hover .toggle-container[mode~=dotted] .toggle-container__item.selected{background:unset}.toggle-container[mode~=dotted] .toggle-container__item:first-child{margin-left:0}\n"] }]
3150
+ args: [{ selector: 'dr-toggle-button', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef((() => DrToggleButtonComponent)), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"toggle-container\" [class.disabled]=\"_disabled\" [attr.mode]=\"mode\">\n <ng-container *ngFor=\"let item of items\">\n <div\n *ngIf=\"item && !item[bindHidden]\"\n class=\"toggle-container__item\"\n [class.selected]=\"item[bindValue] === selectedValue || item === selectedValue\"\n [class.disabled]=\"item.disabled\"\n (click)=\"setValue(item)\"\n [attr.data-analytics]=\"getDataAnalyticsTag(item)\">\n {{ item[bindLabel] || item.name || item }}\n </div>\n </ng-container>\n</div>\n", styles: [":host{display:flex}.toggle-container{display:flex;flex-wrap:nowrap;box-sizing:border-box;border-radius:20px;height:28px;font-family:Poppins,sans-serif}.toggle-container.disabled{pointer-events:none}.toggle-container__item{height:28px;display:flex;align-items:center;justify-content:center;padding:4px 16px;border-radius:20px;margin:-1px;cursor:pointer;font-weight:400;font-size:12px;line-height:20px;white-space:nowrap;color:#4e566c;box-sizing:border-box}.toggle-container__item.selected{background:#f2f2fb!important;border:1px solid #7f7fdd!important;color:#25258c!important}.toggle-container__item.disabled{pointer-events:none;cursor:default;background:#f0f1f4;color:#9ea1aa;border:1px solid #c3c4ce}.toggle-container[mode~=default]{background:#f6f7f8;border:1px solid #c3c4ce}.toggle-container[mode~=dotted] .toggle-container__item{padding:2px 8px;border:1px solid #9ea1aa;border-radius:18px;margin-left:4px;color:#0c142b}.toggle-container[mode~=dotted] .toggle-container__item:hover{background:#f0f1f4}.toggle-container[mode~=dotted] .toggle-container__item:hover .toggle-container[mode~=dotted] .toggle-container__item.selected{background:unset}.toggle-container[mode~=dotted] .toggle-container__item:first-child{margin-left:0}\n"] }]
3143
3151
  }], function () { return [{ type: i0.ChangeDetectorRef }]; }, { items: [{
3144
3152
  type: Input
3145
3153
  }], bindLabel: [{
@@ -3154,6 +3162,9 @@ class DrToggleButtonComponent {
3154
3162
  type: Input
3155
3163
  }], disabled: [{
3156
3164
  type: Input
3165
+ }], dataAnalytics: [{
3166
+ type: Input,
3167
+ args: [{ alias: 'data-analytics' }]
3157
3168
  }] }); })();
3158
3169
 
3159
3170
  function ListTagComponent_div_1_Template(rf, ctx) { if (rf & 1) {
@@ -12683,9 +12694,9 @@ class BottomPositionStrategy {
12683
12694
 
12684
12695
  const _c0 = ["handleRef"];
12685
12696
  function DrawerContainer_div_0_Template(rf, ctx) { if (rf & 1) {
12686
- i0.ɵɵelement(0, "div", 2, 3);
12697
+ i0.ɵɵelement(0, "div", 3, 4);
12687
12698
  } }
12688
- function DrawerContainer_ng_template_1_Template(rf, ctx) { }
12699
+ function DrawerContainer_ng_template_2_Template(rf, ctx) { }
12689
12700
  /**
12690
12701
  * Internal component that wraps user-provided drawer content.
12691
12702
  * @docs-private
@@ -12807,12 +12818,14 @@ class DrawerContainer extends CdkDialogContainer {
12807
12818
  i0.ɵɵattribute("role", ctx._config.role)("aria-modal", ctx._config.isModal)("aria-label", ctx._config.ariaLabel);
12808
12819
  i0.ɵɵsyntheticHostProperty("@state", ctx._animationState);
12809
12820
  i0.ɵɵclassMap(ctx._drawerPosition);
12810
- } }, standalone: true, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵStandaloneFeature], decls: 2, vars: 1, consts: [["class", "handle", 4, "ngIf"], ["cdkPortalOutlet", ""], [1, "handle"], ["handleRef", ""]], template: function DrawerContainer_Template(rf, ctx) { if (rf & 1) {
12821
+ } }, standalone: true, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵStandaloneFeature], decls: 3, vars: 1, consts: [["class", "handle", 4, "ngIf"], [1, "dr-drawer-container__wrapper"], ["cdkPortalOutlet", ""], [1, "handle"], ["handleRef", ""]], template: function DrawerContainer_Template(rf, ctx) { if (rf & 1) {
12811
12822
  i0.ɵɵtemplate(0, DrawerContainer_div_0_Template, 2, 0, "div", 0);
12812
- i0.ɵɵtemplate(1, DrawerContainer_ng_template_1_Template, 0, 0, "ng-template", 1);
12823
+ i0.ɵɵelementStart(1, "div", 1);
12824
+ i0.ɵɵtemplate(2, DrawerContainer_ng_template_2_Template, 0, 0, "ng-template", 2);
12825
+ i0.ɵɵelementEnd();
12813
12826
  } if (rf & 2) {
12814
12827
  i0.ɵɵproperty("ngIf", ctx._config.position === "bottom");
12815
- } }, dependencies: [PortalModule, i4.CdkPortalOutlet, DialogModule, MatCommonModule, CommonModule, i1.NgIf], styles: [".dr-drawer-container{display:block;width:100%;overflow:auto;outline:0;box-sizing:border-box;background-color:#fff;box-shadow:0 4px 14px #d8d9de80}.cdk-high-contrast-active .dr-drawer-container{outline:1px solid}.handle{position:relative;height:24px;cursor:pointer}.handle:after{content:\"\";position:absolute;top:16px;left:50%;transform:translate(-50%,-50%);background-color:#dfe0e3;height:4px;width:64px;border-radius:16px}.dr-drawer-right{transform:translate(100%);border-top-left-radius:16px;border-bottom-left-radius:16px}.dr-drawer-left{transform:translate(-100%);border-top-right-radius:16px;border-bottom-right-radius:16px}.dr-drawer-bottom{transform:translateY(100%);border-top-left-radius:16px;border-top-right-radius:16px}.dr-drawer-top{transform:translateY(-100%);border-bottom-left-radius:16px;border-bottom-right-radius:16px}\n"], encapsulation: 2, data: { animation: [drDrawerAnimations.drawerState] } }); }
12828
+ } }, dependencies: [PortalModule, i4.CdkPortalOutlet, DialogModule, MatCommonModule, CommonModule, i1.NgIf], styles: [".dr-drawer-container{display:flex;flex-direction:column;width:100%;overflow:auto;outline:0;box-sizing:border-box;background-color:#fff;box-shadow:0 4px 14px #d8d9de80}.dr-drawer-container__wrapper{flex:1;overflow:auto}.cdk-high-contrast-active .dr-drawer-container{outline:1px solid}.handle{position:relative;height:24px;cursor:pointer}.handle:after{content:\"\";position:absolute;top:16px;left:50%;transform:translate(-50%,-50%);background-color:#dfe0e3;height:4px;width:64px;border-radius:16px}.dr-drawer-right{transform:translate(100%);border-top-left-radius:16px;border-bottom-left-radius:16px}.dr-drawer-left{transform:translate(-100%);border-top-right-radius:16px;border-bottom-right-radius:16px}.dr-drawer-bottom{transform:translateY(100%);border-top-left-radius:16px;border-top-right-radius:16px}.dr-drawer-top{transform:translateY(-100%);border-bottom-left-radius:16px;border-bottom-right-radius:16px}\n"], encapsulation: 2, data: { animation: [drDrawerAnimations.drawerState] } }); }
12816
12829
  }
12817
12830
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrawerContainer, [{
12818
12831
  type: Component,
@@ -12827,7 +12840,7 @@ class DrawerContainer extends CdkDialogContainer {
12827
12840
  '[@state]': '_animationState',
12828
12841
  '(@state.start)': '_onAnimationStart($event)',
12829
12842
  '(@state.done)': '_onAnimationDone($event)',
12830
- }, standalone: true, imports: [PortalModule, DialogModule, MatCommonModule, CommonModule], template: "<div *ngIf=\"_config.position === 'bottom'\" #handleRef class=\"handle\"></div>\n<ng-template cdkPortalOutlet></ng-template>\n", styles: [".dr-drawer-container{display:block;width:100%;overflow:auto;outline:0;box-sizing:border-box;background-color:#fff;box-shadow:0 4px 14px #d8d9de80}.cdk-high-contrast-active .dr-drawer-container{outline:1px solid}.handle{position:relative;height:24px;cursor:pointer}.handle:after{content:\"\";position:absolute;top:16px;left:50%;transform:translate(-50%,-50%);background-color:#dfe0e3;height:4px;width:64px;border-radius:16px}.dr-drawer-right{transform:translate(100%);border-top-left-radius:16px;border-bottom-left-radius:16px}.dr-drawer-left{transform:translate(-100%);border-top-right-radius:16px;border-bottom-right-radius:16px}.dr-drawer-bottom{transform:translateY(100%);border-top-left-radius:16px;border-top-right-radius:16px}.dr-drawer-top{transform:translateY(-100%);border-bottom-left-radius:16px;border-bottom-right-radius:16px}\n"] }]
12843
+ }, standalone: true, imports: [PortalModule, DialogModule, MatCommonModule, CommonModule], template: "<div *ngIf=\"_config.position === 'bottom'\" #handleRef class=\"handle\"></div>\n<div class=\"dr-drawer-container__wrapper\">\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n", styles: [".dr-drawer-container{display:flex;flex-direction:column;width:100%;overflow:auto;outline:0;box-sizing:border-box;background-color:#fff;box-shadow:0 4px 14px #d8d9de80}.dr-drawer-container__wrapper{flex:1;overflow:auto}.cdk-high-contrast-active .dr-drawer-container{outline:1px solid}.handle{position:relative;height:24px;cursor:pointer}.handle:after{content:\"\";position:absolute;top:16px;left:50%;transform:translate(-50%,-50%);background-color:#dfe0e3;height:4px;width:64px;border-radius:16px}.dr-drawer-right{transform:translate(100%);border-top-left-radius:16px;border-bottom-left-radius:16px}.dr-drawer-left{transform:translate(-100%);border-top-right-radius:16px;border-bottom-right-radius:16px}.dr-drawer-bottom{transform:translateY(100%);border-top-left-radius:16px;border-top-right-radius:16px}.dr-drawer-top{transform:translateY(-100%);border-bottom-left-radius:16px;border-bottom-right-radius:16px}\n"] }]
12831
12844
  }], function () { return [{ type: i0.ElementRef }, { type: i1$8.FocusTrapFactory }, { type: Document, decorators: [{
12832
12845
  type: Optional
12833
12846
  }, {
@@ -12881,6 +12894,8 @@ class DrawerRef {
12881
12894
  });
12882
12895
  _ref.overlayRef.detachments().subscribe(() => {
12883
12896
  this._ref.close(this._result);
12897
+ this._afterDismissed.next(this._result);
12898
+ this._afterDismissed.complete();
12884
12899
  });
12885
12900
  merge$1(this.backdropClick(), this.keydownEvents().pipe(filter((event) => event.keyCode === ESCAPE))).subscribe((event) => {
12886
12901
  if (!this.disableClose && (event.type !== 'keydown' || !hasModifierKey(event))) {
@@ -12894,6 +12909,8 @@ class DrawerRef {
12894
12909
  * @param result Data to be passed back to the drawer opener.
12895
12910
  */
12896
12911
  dismiss(result) {
12912
+ this._afterDismissed.next(result);
12913
+ this._afterDismissed.complete();
12897
12914
  if (this.containerInstance && !this._afterDismissed.closed) {
12898
12915
  // Transition the backdrop in parallel to the drawer.
12899
12916
  this.containerInstance._animationStateChanged
@@ -12914,8 +12931,12 @@ class DrawerRef {
12914
12931
  this.containerInstance = null;
12915
12932
  }
12916
12933
  }
12917
- /** Gets an observable that is notified when the drawer is finished closing. */
12934
+ /** Gets an observable that is notified when the drawer is dismissed. */
12918
12935
  afterDismissed() {
12936
+ return this._afterDismissed;
12937
+ }
12938
+ /** Gets an observable that is notified when the drawer is finished closing. */
12939
+ afterClosed() {
12919
12940
  return this._ref.closed;
12920
12941
  }
12921
12942
  /** Gets an observable that is notified when the drawer has opened and appeared. */