@datarailsshared/datarailsshared 1.4.19-tigers → 1.4.21-tigers

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.
Files changed (38) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +1426 -1300
  2. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  3. package/datarailsshared-datarailsshared-1.4.21-tigers.tgz +0 -0
  4. package/datarailsshared-datarailsshared.d.ts +5 -3
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/datarailsshared-datarailsshared.js +6 -4
  7. package/esm2015/lib/dr-avatar/dr-avatar.component.js +5 -3
  8. package/esm2015/lib/dr-avatar/dr-avatar.pipe.js +3 -2
  9. package/esm2015/lib/dr-inputs/date-pickers/directives/dr-date-picker-format.directive.js +47 -0
  10. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.js +152 -0
  11. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +72 -0
  12. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +128 -0
  13. package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +55 -0
  14. package/esm2015/lib/dr-inputs/dr-inputs.module.js +13 -9
  15. package/esm2015/lib/dr-tooltip/dr-tooltip.component.js +13 -3
  16. package/esm2015/lib/dr-tooltip/dr-tooltip.directive.js +43 -10
  17. package/esm2015/lib/models/datePicker.js +8 -1
  18. package/esm2015/public-api.js +3 -3
  19. package/fesm2015/datarailsshared-datarailsshared.js +630 -526
  20. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  21. package/lib/dr-avatar/dr-avatar.component.d.ts +1 -0
  22. package/lib/dr-inputs/{dr-date-picker → date-pickers/directives}/dr-date-picker-format.directive.d.ts +1 -1
  23. package/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.d.ts +55 -0
  24. package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +26 -0
  25. package/lib/dr-inputs/{dr-date-picker → date-pickers}/dr-date-picker_custom-header/dr-date-picker_custom-header.component.d.ts +4 -4
  26. package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +18 -0
  27. package/lib/dr-tooltip/dr-tooltip.component.d.ts +4 -0
  28. package/lib/dr-tooltip/dr-tooltip.directive.d.ts +4 -0
  29. package/lib/models/datePicker.d.ts +12 -0
  30. package/package.json +1 -1
  31. package/public-api.d.ts +1 -2
  32. package/datarailsshared-datarailsshared-1.4.19-tigers.tgz +0 -0
  33. package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker-format.directive.js +0 -47
  34. package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker.component.js +0 -183
  35. package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker.service.js +0 -41
  36. package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +0 -129
  37. package/lib/dr-inputs/dr-date-picker/dr-date-picker.component.d.ts +0 -54
  38. package/lib/dr-inputs/dr-date-picker/dr-date-picker.service.d.ts +0 -12
@@ -1785,6 +1785,7 @@
1785
1785
  var DrAvatarComponent = /** @class */ (function () {
1786
1786
  function DrAvatarComponent() {
1787
1787
  this.warning = false;
1788
+ this.showUnassigned = false;
1788
1789
  this.userClicked = new i0.EventEmitter();
1789
1790
  this.parsedUsers = [];
1790
1791
  }
@@ -1816,15 +1817,16 @@
1816
1817
  DrAvatarComponent.decorators = [
1817
1818
  { type: i0.Component, args: [{
1818
1819
  selector: 'dr-avatar',
1819
- template: "<div class=\"users-section\">\n <div *ngIf=\"!parsedUsers.length\"\n class=\"users-section__default\">\n </div>\n\n <div *ngFor=\"let user of getFirstUsers()\"\n class=\"users-section__user\"\n [class]=\"'icon-' + user.colorNumber + ' ' + user.status\"\n (click)=\"userClicked.emit()\"\n [matTooltip]=\"user | drAvatar\"\n [matTooltipPosition]=\"'below'\">\n {{user | drAvatar: 'initials'}}\n </div>\n\n <div *ngIf=\"parsedUsers.length > 2\"\n class=\"users-section__user icon-2\"\n [drTooltip]=\"usersTemplate\"\n [drTooltipPosition]=\"'bottom'\">\n {{getLastUsers().length}}\n </div>\n</div>\n\n<ng-template #usersTemplate>\n <div *ngFor=\"let user of getLastUsers()\" class=\"users-popover-item\">\n <div class=\"users-section__user\"\n (click)=\"userClicked.emit()\"\n [class]=\"user.class\">\n {{user | drAvatar: 'initials'}}\n </div>\n <span class=\"username\">\n {{user | drAvatar}}\n </span>\n </div>\n</ng-template>\n",
1820
+ template: "<div class=\"users-section\">\n <div *ngIf=\"!parsedUsers.length\"\n class=\"users-section__default\">\n </div>\n\n <div *ngFor=\"let user of getFirstUsers()\"\n class=\"users-section__user\"\n [class]=\"'icon-' + user.colorNumber + ' ' + user.status\"\n [ngClass]=\"{ 'users-section__default': showUnassigned && !user.email }\"\n (click)=\"userClicked.emit()\"\n [matTooltip]=\"user | drAvatar\"\n [matTooltipPosition]=\"'below'\">\n {{user | drAvatar: 'initials'}}\n </div>\n\n <div *ngIf=\"parsedUsers.length > 2\"\n class=\"users-section__user icon-2\"\n [drTooltip]=\"usersTemplate\"\n [drTooltipPosition]=\"'bottom'\">\n {{getLastUsers().length}}\n </div>\n</div>\n\n<ng-template #usersTemplate>\n <div *ngFor=\"let user of getLastUsers()\" class=\"users-popover-item\">\n <div class=\"users-section__user\"\n (click)=\"userClicked.emit()\"\n [class]=\"user.class\">\n {{user | drAvatar: 'initials'}}\n </div>\n <span class=\"username\">\n {{user | drAvatar}}\n </span>\n </div>\n</ng-template>\n",
1820
1821
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1821
- styles: [":host{width:auto}.users-section{display:flex;height:28px}.users-section__default{display:flex;height:28px;width:28px;border-radius:14px;background:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect width%3D%2224%22 height%3D%2224%22 rx%3D%2212%22 fill%3D%22%23E5E6EA%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M15 9.75C15 11.4069 13.6569 12.75 12 12.75C10.3431 12.75 9 11.4069 9 9.75C9 8.09315 10.3431 6.75 12 6.75C13.6569 6.75 15 8.09315 15 9.75ZM13.875 9.75C13.875 10.7855 13.0355 11.625 12 11.625C10.9645 11.625 10.125 10.7855 10.125 9.75C10.125 8.71447 10.9645 7.875 12 7.875C13.0355 7.875 13.875 8.71447 13.875 9.75Z%22 fill%3D%22%2351566F%22%2F%3E%3Cpath d%3D%22M15.9968 16.7631C15.5425 15.3973 14.0368 14.25 12 14.25C9.9632 14.25 8.45748 15.3973 8.00319 16.7631C7.91242 17.0359 7.67416 17.25 7.38657 17.25C7.04536 17.25 6.77507 16.9539 6.86275 16.6241C7.39546 14.6206 9.49327 13.125 12 13.125C14.5067 13.125 16.6045 14.6206 17.1373 16.6241C17.2249 16.9539 16.9546 17.25 16.6134 17.25C16.3259 17.25 16.0876 17.0359 15.9968 16.7631Z%22 fill%3D%22%2351566F%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:cover}.users-popover-item{display:flex;align-items:center;margin:12px}.users-popover-item .username{color:#51566f;font-size:14px}.users-popover-item .users-section__user{margin-right:8px}.users-section__user{position:relative;display:flex;justify-content:center;align-items:center;height:28px;width:28px;border-radius:14px;background:red;color:#fff;font-size:12px}.users-section__user.icon-0{background-color:#7b61ff}.users-section__user.icon-1{background-color:#21b8f1}.users-section__user.icon-2{background-color:#2969b0}.users-section__user.icon-3{background-color:#51566f}.users-section__user.icon-4{background-color:#0061ff}.users-section__user:hover{cursor:pointer}.users-section__user:not(:first-child){margin-left:4px}.users-section__user.online:after,.users-section__user.offline:after,.users-section__user.warning:after{content:\"\";display:flex;width:8px;height:8px;position:absolute;border-radius:4px;top:-2px;right:0}.users-section__user.online:after{background:#03A678}.users-section__user.offline:after{background:#DE2833}.users-section__user.warning:after{background:#FDA014}\n"]
1822
+ styles: [":host{width:auto}.users-section{display:flex;height:28px}.users-section__default{display:flex;height:28px;width:28px;border-radius:14px;background:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect width%3D%2224%22 height%3D%2224%22 rx%3D%2212%22 fill%3D%22%23E5E6EA%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M15 9.75C15 11.4069 13.6569 12.75 12 12.75C10.3431 12.75 9 11.4069 9 9.75C9 8.09315 10.3431 6.75 12 6.75C13.6569 6.75 15 8.09315 15 9.75ZM13.875 9.75C13.875 10.7855 13.0355 11.625 12 11.625C10.9645 11.625 10.125 10.7855 10.125 9.75C10.125 8.71447 10.9645 7.875 12 7.875C13.0355 7.875 13.875 8.71447 13.875 9.75Z%22 fill%3D%22%2351566F%22%2F%3E%3Cpath d%3D%22M15.9968 16.7631C15.5425 15.3973 14.0368 14.25 12 14.25C9.9632 14.25 8.45748 15.3973 8.00319 16.7631C7.91242 17.0359 7.67416 17.25 7.38657 17.25C7.04536 17.25 6.77507 16.9539 6.86275 16.6241C7.39546 14.6206 9.49327 13.125 12 13.125C14.5067 13.125 16.6045 14.6206 17.1373 16.6241C17.2249 16.9539 16.9546 17.25 16.6134 17.25C16.3259 17.25 16.0876 17.0359 15.9968 16.7631Z%22 fill%3D%22%2351566F%22%2F%3E%3C%2Fsvg%3E\") no-repeat!important;background-size:cover}.users-popover-item{display:flex;align-items:center;margin:12px}.users-popover-item .username{color:#51566f;font-size:14px}.users-popover-item .users-section__user{margin-right:8px}.users-section__user{position:relative;display:flex;justify-content:center;align-items:center;height:28px;width:28px;border-radius:14px;background:red;color:#fff;font-size:12px}.users-section__user.icon-0{background-color:#7b61ff}.users-section__user.icon-1{background-color:#21b8f1}.users-section__user.icon-2{background-color:#2969b0}.users-section__user.icon-3{background-color:#51566f}.users-section__user.icon-4{background-color:#0061ff}.users-section__user:hover{cursor:pointer}.users-section__user:not(:first-child){margin-left:4px}.users-section__user.online:after,.users-section__user.offline:after,.users-section__user.warning:after{content:\"\";display:flex;width:8px;height:8px;position:absolute;border-radius:4px;top:-2px;right:0}.users-section__user.online:after{background:#03A678}.users-section__user.offline:after{background:#DE2833}.users-section__user.warning:after{background:#FDA014}\n"]
1822
1823
  },] }
1823
1824
  ];
1824
1825
  DrAvatarComponent.ctorParameters = function () { return []; };
1825
1826
  DrAvatarComponent.propDecorators = {
1826
1827
  users: [{ type: i0.Input }],
1827
1828
  warning: [{ type: i0.Input }],
1829
+ showUnassigned: [{ type: i0.Input }],
1828
1830
  userClicked: [{ type: i0.Output }]
1829
1831
  };
1830
1832
 
@@ -1834,7 +1836,8 @@
1834
1836
  DrAvatarPipe.prototype.transform = function (item, type) {
1835
1837
  if (type === void 0) { type = 'full'; }
1836
1838
  if (type === 'initials') {
1837
- return (item.first_name && item.last_name ? (item.first_name[0] + item.last_name[0]) : item.email[0]).toUpperCase();
1839
+ var email = item.email ? item.email[0] : '';
1840
+ return (item.first_name && item.last_name ? (item.first_name[0] + item.last_name[0]) : email).toUpperCase();
1838
1841
  }
1839
1842
  return item.first_name && item.last_name ? (item.first_name + ' ' + item.last_name) : item.email;
1840
1843
  };
@@ -1945,10 +1948,17 @@
1945
1948
  var TooltipComponent = /** @class */ (function () {
1946
1949
  function TooltipComponent() {
1947
1950
  this.isContentTemplate = false;
1951
+ this.isMouseOn$ = new rxjs.BehaviorSubject(false);
1948
1952
  }
1949
1953
  TooltipComponent.prototype.ngOnInit = function () {
1950
1954
  this.isContentTemplate = this.content instanceof i0.TemplateRef;
1951
1955
  };
1956
+ TooltipComponent.prototype.setMouseOn = function () {
1957
+ this.isMouseOn$.next(true);
1958
+ };
1959
+ TooltipComponent.prototype.unsetMouseOn = function () {
1960
+ this.isMouseOn$.next(false);
1961
+ };
1952
1962
  return TooltipComponent;
1953
1963
  }());
1954
1964
  TooltipComponent.decorators = [
@@ -1967,7 +1977,9 @@
1967
1977
  contentContext: [{ type: i0.Input }],
1968
1978
  position: [{ type: i0.Input }],
1969
1979
  options: [{ type: i0.Input }],
1970
- class: [{ type: i0.Input }]
1980
+ class: [{ type: i0.Input }],
1981
+ setMouseOn: [{ type: i0.HostListener, args: ['mouseenter',] }],
1982
+ unsetMouseOn: [{ type: i0.HostListener, args: ['mouseleave',] }]
1971
1983
  };
1972
1984
 
1973
1985
  var DrTooltipDirective = /** @class */ (function () {
@@ -1978,6 +1990,8 @@
1978
1990
  this.contentContext = {};
1979
1991
  this.position = 'top';
1980
1992
  this.class = '';
1993
+ // is used for preserve tooltip from being hidden for N milliseconds
1994
+ this.drTooltipMousleaveTimeout = 0;
1981
1995
  }
1982
1996
  Object.defineProperty(DrTooltipDirective.prototype, "drTooltipOptions", {
1983
1997
  set: function (options) {
@@ -2018,16 +2032,37 @@
2018
2032
  if (this.overlayRef) {
2019
2033
  this.overlayRef.dispose();
2020
2034
  }
2035
+ if (this.tooltipMouseOnSubscription) {
2036
+ this.tooltipMouseOnSubscription.unsubscribe();
2037
+ }
2021
2038
  };
2022
2039
  DrTooltipDirective.prototype.show = function () {
2023
- if (this.manualHandling)
2040
+ if (this.manualHandling || this.overlayRef)
2024
2041
  return;
2025
2042
  this.renderTooltip();
2026
2043
  };
2027
2044
  DrTooltipDirective.prototype.hide = function () {
2028
- if (this.manualHandling)
2045
+ var _this = this;
2046
+ var _a;
2047
+ if (this.manualHandling || !this.tooltipRef || ((_a = this.tooltipRef) === null || _a === void 0 ? void 0 : _a.instance.isMouseOn$.getValue()))
2029
2048
  return;
2030
- this.destroyTooltip();
2049
+ // if this timeout value is set - then preserve
2050
+ // tooltip from being hidden N milliseconds and not hiding it
2051
+ // in case mouse is pointed on tooltip
2052
+ if (this.drTooltipMousleaveTimeout) {
2053
+ if (this.mouseleaveTimer) {
2054
+ clearTimeout(this.mouseleaveTimer);
2055
+ }
2056
+ this.mouseleaveTimer = setTimeout(function () {
2057
+ var _a;
2058
+ if (_this.tooltipRef && !((_a = _this.tooltipRef) === null || _a === void 0 ? void 0 : _a.instance.isMouseOn$.getValue())) {
2059
+ _this.destroyTooltip();
2060
+ }
2061
+ }, this.drTooltipMousleaveTimeout);
2062
+ }
2063
+ else {
2064
+ this.destroyTooltip();
2065
+ }
2031
2066
  };
2032
2067
  DrTooltipDirective.prototype.createOverlay = function () {
2033
2068
  var positionStrategy = this.overlayPositionBuilder
@@ -2036,15 +2071,21 @@
2036
2071
  this.overlayRef = this.overlay.create({ positionStrategy: positionStrategy });
2037
2072
  };
2038
2073
  DrTooltipDirective.prototype.renderTooltip = function () {
2074
+ var _this = this;
2039
2075
  var _a;
2040
2076
  this.createOverlay();
2041
2077
  if (!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) && this.content) {
2042
- var tooltipRef = this.overlayRef.attach(new portal.ComponentPortal(TooltipComponent));
2043
- tooltipRef.instance.content = this.content;
2044
- tooltipRef.instance.contentContext = this.contentContext;
2045
- tooltipRef.instance.position = this.position;
2046
- tooltipRef.instance.options = this.options;
2047
- tooltipRef.instance.class = this.class + ' ' + this.position;
2078
+ this.tooltipRef = this.overlayRef.attach(new portal.ComponentPortal(TooltipComponent));
2079
+ this.tooltipRef.instance.content = this.content;
2080
+ this.tooltipRef.instance.contentContext = this.contentContext;
2081
+ this.tooltipRef.instance.position = this.position;
2082
+ this.tooltipRef.instance.options = this.options;
2083
+ this.tooltipRef.instance.class = this.class + ' ' + this.position;
2084
+ this.tooltipMouseOnSubscription = this.tooltipRef.instance.isMouseOn$.pipe(operators.skip(1)).subscribe(function (isMouseOn) {
2085
+ if (!isMouseOn) {
2086
+ _this.destroyTooltip();
2087
+ }
2088
+ });
2048
2089
  }
2049
2090
  };
2050
2091
  DrTooltipDirective.prototype.destroyTooltip = function () {
@@ -2052,6 +2093,10 @@
2052
2093
  this.overlayRef.dispose();
2053
2094
  }
2054
2095
  this.overlayRef = null;
2096
+ this.tooltipRef = null;
2097
+ if (this.tooltipMouseOnSubscription) {
2098
+ this.tooltipMouseOnSubscription.unsubscribe();
2099
+ }
2055
2100
  };
2056
2101
  return DrTooltipDirective;
2057
2102
  }());
@@ -2070,6 +2115,7 @@
2070
2115
  contentContext: [{ type: i0.Input, args: ['drTooltipContext',] }],
2071
2116
  position: [{ type: i0.Input, args: ['drTooltipPosition',] }],
2072
2117
  class: [{ type: i0.Input, args: ['drTooltipClass',] }],
2118
+ drTooltipMousleaveTimeout: [{ type: i0.Input }],
2073
2119
  drTooltipOptions: [{ type: i0.Input }],
2074
2120
  showTooltip: [{ type: i0.Input, args: ['drTooltipShow',] }],
2075
2121
  show: [{ type: i0.HostListener, args: ['mouseenter',] }],
@@ -2387,978 +2433,525 @@
2387
2433
  <dr-button [isDisabled]="false" [theme]="'text-link'">Text Link</dr-button>
2388
2434
  */
2389
2435
 
2390
- var MAT_DEFAULT_DATE_FORMAT = 'MM/DD/yyyy';
2391
- var DATE_INPUT_FORMAT = 'YYYY/MM/DD';
2392
- var YEAR_FORMAT = 'yyyy';
2393
- var MONTH_YEAR_FORMAT = 'MM/yyyy';
2394
- var QUARTER_FORMAT = 'Q/yyyy';
2395
- var CustomDateFormat = /** @class */ (function () {
2396
- function CustomDateFormat() {
2397
- this._parse = {
2398
- dateInput: DATE_INPUT_FORMAT
2399
- };
2400
- this._display = {
2401
- dateInput: DATE_INPUT_FORMAT,
2402
- monthYearLabel: 'MMM YYYY',
2403
- dateA11yLabel: 'LL',
2404
- monthYearA11yLabel: 'MMM YYYY',
2405
- quarterYearLabel: 'Q/YYYY',
2406
- yearLabel: 'YYYY'
2407
- };
2436
+ var DrPopoverRef = /** @class */ (function () {
2437
+ function DrPopoverRef(overlayRef) {
2438
+ this.overlayRef = overlayRef;
2439
+ this.onClose$ = new rxjs.Subject();
2440
+ // FIXME: this decision was made because of the incompatible rxjs version
2441
+ /**
2442
+ * Correct type is @type {Observable<any>}
2443
+ */
2444
+ this.onClose = this.onClose$.asObservable();
2445
+ this.onBackdropClick = this.overlayRef.backdropClick();
2408
2446
  }
2409
- Object.defineProperty(CustomDateFormat.prototype, "parse", {
2410
- get: function () {
2411
- return this._parse;
2412
- },
2413
- set: function (parse) {
2414
- this._parse = Object.assign({}, this._parse, parse);
2415
- },
2416
- enumerable: false,
2417
- configurable: true
2418
- });
2419
- Object.defineProperty(CustomDateFormat.prototype, "display", {
2420
- get: function () {
2421
- return this._display;
2422
- },
2423
- set: function (display) {
2424
- this._display = Object.assign({}, this._display, display);
2425
- },
2426
- enumerable: false,
2427
- configurable: true
2428
- });
2429
- CustomDateFormat.prototype.updateDateFormat = function (parse, display) {
2430
- this.parse = parse;
2431
- if (!display) {
2432
- display = parse;
2433
- }
2434
- this.display = display;
2447
+ DrPopoverRef.prototype.close = function (res) {
2448
+ this.overlayRef.detach();
2449
+ this.overlayRef.dispose();
2450
+ this.onClose$.next(res);
2451
+ this.onClose$.complete();
2435
2452
  };
2436
- return CustomDateFormat;
2453
+ return DrPopoverRef;
2437
2454
  }());
2438
2455
 
2439
- var moment$2 = require('moment');
2440
- var DrDatePickerService = /** @class */ (function () {
2441
- function DrDatePickerService() {
2442
- this.timeframe = 'day';
2443
- this.format = new rxjs.BehaviorSubject(MAT_DEFAULT_DATE_FORMAT);
2444
- this.updatedQuater = new rxjs.Subject();
2456
+ exports.DrPopoverAlignmentDimension = void 0;
2457
+ (function (DrPopoverAlignmentDimension) {
2458
+ DrPopoverAlignmentDimension["Width"] = "width";
2459
+ DrPopoverAlignmentDimension["Height"] = "height";
2460
+ })(exports.DrPopoverAlignmentDimension || (exports.DrPopoverAlignmentDimension = {}));
2461
+ var DEFAULT_CONFIG = {
2462
+ hasBackdrop: false,
2463
+ closeOnBackdropClick: false,
2464
+ backdropClass: 'dr-popover-transparent-backdrop',
2465
+ };
2466
+ var DEFAULT_MODEL = {
2467
+ position: 'bottom',
2468
+ class: '',
2469
+ overlayConfig: {},
2470
+ manualClosing: { enabled: false },
2471
+ };
2472
+ function getAlignmentDimension(position) {
2473
+ if (!POPUP_POSITIONS[position])
2474
+ return exports.DrPopoverAlignmentDimension.Width;
2475
+ if ((position === null || position === void 0 ? void 0 : position.includes('left')) || (position === null || position === void 0 ? void 0 : position.includes('right'))) {
2476
+ return exports.DrPopoverAlignmentDimension.Height;
2445
2477
  }
2446
- DrDatePickerService.prototype.getQuarterDisplay = function (value, format) {
2447
- return 'Q' + moment$2(value).quarter() + format.charAt(1) + moment$2(value).year();
2448
- };
2449
- DrDatePickerService.prototype.setTimeframe = function (format) {
2450
- var lowerCaseFormat = format.toLowerCase();
2451
- switch (true) {
2452
- case lowerCaseFormat.includes('q'):
2453
- this.timeframe = 'quarter';
2454
- break;
2455
- case lowerCaseFormat.includes('d'):
2456
- this.timeframe = 'day';
2457
- break;
2458
- case lowerCaseFormat.includes('m'):
2459
- this.timeframe = 'month';
2460
- break;
2461
- case lowerCaseFormat.includes('y'):
2462
- this.timeframe = 'year';
2463
- break;
2464
- default:
2465
- this.timeframe = 'day';
2466
- }
2467
- };
2468
- return DrDatePickerService;
2469
- }());
2470
- DrDatePickerService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrDatePickerService_Factory() { return new DrDatePickerService(); }, token: DrDatePickerService, providedIn: "root" });
2471
- DrDatePickerService.decorators = [
2472
- { type: i0.Injectable, args: [{
2473
- providedIn: 'root',
2474
- },] }
2475
- ];
2478
+ return exports.DrPopoverAlignmentDimension.Width;
2479
+ }
2476
2480
 
2477
- var moment$1 = require('moment');
2478
- var DrDatePickerCustomHeaderComponent = /** @class */ (function () {
2479
- function DrDatePickerCustomHeaderComponent(_calendar, _dateAdapter, _dateFormats, cdr, datePickerService) {
2480
- var _this = this;
2481
- this._calendar = _calendar;
2482
- this._dateAdapter = _dateAdapter;
2483
- this._dateFormats = _dateFormats;
2481
+ var DrPopoverComponent = /** @class */ (function () {
2482
+ function DrPopoverComponent(cdr, componentFactoryResolver, viewContainerRef, elementRef, popoverRef) {
2484
2483
  this.cdr = cdr;
2485
- this.datePickerService = datePickerService;
2486
- this._destroyed = new rxjs.Subject();
2487
- this.quarters = [1, 2, 3, 4];
2488
- this.selectedQuarter = 1;
2489
- this.timeframeOptions = [{
2490
- title: 'Day',
2491
- value: 'month',
2492
- format: MAT_DEFAULT_DATE_FORMAT,
2493
- periodLabel: function () { return _this._dateAdapter
2494
- .format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
2495
- .toLocaleUpperCase(); }
2496
- }, {
2497
- title: 'Month',
2498
- value: 'year',
2499
- format: MONTH_YEAR_FORMAT,
2500
- periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
2501
- }, {
2502
- title: 'Quarter',
2503
- value: 'none',
2504
- format: QUARTER_FORMAT,
2505
- periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
2506
- }, {
2507
- title: 'Year',
2508
- value: 'multi-year',
2509
- format: YEAR_FORMAT,
2510
- periodLabel: function () {
2511
- var currentYear = moment$1(_this._calendar.activeDate).year();
2512
- var startPeriod = Math.floor(currentYear / 24) * 24;
2513
- return startPeriod + '-' + (startPeriod + 23);
2514
- }
2515
- }];
2516
- this.pagingSetup = {
2517
- 'year': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
2518
- 'none': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
2519
- 'month': function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
2520
- 'multi-year': function (forward) { return _this.pagingDateChange('addCalendarYears', 24, forward); }
2521
- };
2522
- this.selectedTimeframe = 'month';
2523
- this.timeframeSelection = false;
2524
- this.periodMonthLabel = '';
2525
- this.periodYearLabel = '';
2526
- _calendar.stateChanges.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
2527
- this.datePickerService.format
2528
- .pipe(operators.take(1))
2529
- .subscribe(function (value) {
2530
- _this.selectedTimeframe = _this.timeframeOptions.filter(function (option) { return option.format == value; })[0].value;
2531
- _this.setPeriodLabels();
2532
- });
2533
- _calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
2484
+ this.componentFactoryResolver = componentFactoryResolver;
2485
+ this.viewContainerRef = viewContainerRef;
2486
+ this.elementRef = elementRef;
2487
+ this.popoverRef = popoverRef;
2488
+ this.class = '';
2489
+ this.isContentTemplate = false;
2490
+ this.popover = true;
2534
2491
  }
2535
- DrDatePickerCustomHeaderComponent.prototype.ngOnDestroy = function () {
2536
- this._destroyed.next();
2537
- this._destroyed.complete();
2538
- };
2539
- DrDatePickerCustomHeaderComponent.prototype.setPeriodLabels = function () {
2540
- var _this = this;
2541
- var currentTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this._calendar.currentView; })[0];
2542
- var fullPeriodLabel = currentTimeframeOption.periodLabel();
2543
- if (this._calendar.currentView === 'month') {
2544
- this.periodMonthLabel = fullPeriodLabel.slice(0, 3);
2545
- this.periodYearLabel = fullPeriodLabel.slice(4);
2546
- }
2547
- else {
2548
- this.periodMonthLabel = '';
2549
- this.periodYearLabel = fullPeriodLabel;
2492
+ DrPopoverComponent.prototype.clickOutside = function (e) {
2493
+ var isTargetHost = this.hostRef instanceof i0.ElementRef && (this.hostRef.nativeElement === e.target || this.hostRef.nativeElement.contains(e.target));
2494
+ var isTargetInPopover = this.elementRef.nativeElement.contains(e.target);
2495
+ var isTargetInDatepicker = e.target.closest('mat-datepicker-popup');
2496
+ var isTargetInSelect = e.target.closest('ng-dropdown-panel');
2497
+ var isTargetInDatepickerContent = e.target.closest('mat-datepicker-content');
2498
+ if (!isTargetHost
2499
+ && !isTargetInPopover
2500
+ && !isTargetInDatepicker
2501
+ && !isTargetInSelect
2502
+ && !isTargetInDatepickerContent
2503
+ && !this.manualClosing.enabled) {
2504
+ this.popoverRef.close();
2550
2505
  }
2551
- this.cdr.markForCheck();
2552
2506
  };
2553
- DrDatePickerCustomHeaderComponent.prototype.setTimeframe = function () {
2554
- var _this = this;
2555
- this.timeframeSelection = false;
2556
- this._calendar.currentView = this.selectedTimeframe;
2557
- var chosenTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this.selectedTimeframe; })[0];
2558
- this.datePickerService.format.next(chosenTimeframeOption.format);
2559
- this.datePickerService.setTimeframe(chosenTimeframeOption.format);
2560
- if (this.selectedTimeframe == 'none') {
2561
- this.selectedQuarter = moment$1(this._calendar.activeDate).quarter();
2507
+ DrPopoverComponent.prototype.ngOnInit = function () {
2508
+ this.isContentTemplate = this.content instanceof i0.TemplateRef;
2509
+ if (!this.isContentTemplate) {
2510
+ this.componentRef = this.viewContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
2511
+ Object.assign(this.componentRef.instance, this.contentContext);
2512
+ this.popoverContainer.nativeElement.appendChild(this.componentRef.location.nativeElement);
2562
2513
  }
2514
+ if (this.alignment === 'host') {
2515
+ this[getAlignmentDimension(this.position)] = '100%';
2516
+ }
2517
+ this.cdr.detectChanges();
2563
2518
  };
2564
- Object.defineProperty(DrDatePickerCustomHeaderComponent.prototype, "currentViewIsQuater", {
2565
- get: function () {
2566
- return !['month', 'year', 'multi-year'].includes(this._calendar.currentView);
2567
- },
2568
- enumerable: false,
2569
- configurable: true
2570
- });
2571
- DrDatePickerCustomHeaderComponent.prototype.switchViewOnClickOnPeriodLabel = function (view) {
2572
- this._calendar.currentView = view;
2573
- };
2574
- DrDatePickerCustomHeaderComponent.prototype.onSelectQuater = function (quarterNumber) {
2575
- var monthsInQuarter = 3;
2576
- this.selectedQuarter = moment$1(this._calendar.activeDate).quarter();
2577
- var unadaptedDate = this._dateAdapter.addCalendarMonths(this._calendar.activeDate, monthsInQuarter * (quarterNumber - this.selectedQuarter));
2578
- this._calendar.activeDate = unadaptedDate;
2579
- this.datePickerService.updatedQuater.next(moment$1(unadaptedDate));
2580
- this.datePickerService.calendarInstance.close();
2581
- };
2582
- DrDatePickerCustomHeaderComponent.prototype.pagingClicked = function (forward) {
2583
- this.pagingSetup[this._calendar.currentView] && this.pagingSetup[this._calendar.currentView](forward);
2584
- };
2585
- DrDatePickerCustomHeaderComponent.prototype.pagingDateChange = function (actionCall, amount, forward) {
2586
- this._calendar.activeDate = this._dateAdapter[actionCall](this._calendar.activeDate, forward ? amount : -amount);
2587
- this.setPeriodLabels();
2588
- };
2589
- return DrDatePickerCustomHeaderComponent;
2519
+ return DrPopoverComponent;
2590
2520
  }());
2591
- DrDatePickerCustomHeaderComponent.decorators = [
2521
+ DrPopoverComponent.decorators = [
2592
2522
  { type: i0.Component, args: [{
2593
- selector: 'dr-date-picker_custom-header.component',
2594
- template: "<div class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select \n class=\"dr-datepicker__timeframe-select\"\n [(ngModel)]=\"selectedTimeframe\"\n [items]=\"timeframeOptions\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe()\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i> \n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel('year')\">{{periodMonthLabel + ' '}}</span> \n <span (click)=\"switchViewOnClickOnPeriodLabel('multi-year')\">{{periodYearLabel}}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuater\">\n <div *ngFor=\"let quarter of quarters\" \n class=\"quarter-selector\" (click)=\"onSelectQuater(quarter)\"\n [class]=\"quarter == selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n",
2523
+ selector: 'dr-popover',
2524
+ template: "<div class=\"dr-popover\" [class]=\"class\" #popoverContainer>\n <ng-container *ngIf=\"isContentTemplate\">\n <ng-container *ngTemplateOutlet=\"content; context: contentContext\"></ng-container>\n </ng-container>\n</div>\n",
2525
+ animations: [
2526
+ animations.trigger('popover', POPUP_ANIMATION),
2527
+ ],
2595
2528
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2596
- styles: [":host{height:54px;align-items:center;font-family:\"Poppins\";font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 8px;grid-gap:4px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#F2F2FB;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#F2F2FB;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"]
2529
+ styles: [".dr-popover{display:flex;background:#fff;border:1px solid #E5E5E5;border-radius:5px;box-sizing:border-box;box-shadow:0 4px 14px #0003;font-size:12px;color:#545a6b;max-height:100vh;max-width:100vw;overflow:auto}::ng-deep .dr-popover-transparent-backdrop{background-color:transparent}\n"]
2597
2530
  },] }
2598
2531
  ];
2599
- DrDatePickerCustomHeaderComponent.ctorParameters = function () { return [
2600
- { type: datepicker.MatCalendar },
2601
- { type: core.DateAdapter },
2602
- { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
2532
+ DrPopoverComponent.ctorParameters = function () { return [
2603
2533
  { type: i0.ChangeDetectorRef },
2604
- { type: DrDatePickerService }
2534
+ { type: i0.ComponentFactoryResolver },
2535
+ { type: i0.ViewContainerRef },
2536
+ { type: i0.ElementRef },
2537
+ { type: DrPopoverRef }
2605
2538
  ]; };
2539
+ DrPopoverComponent.propDecorators = {
2540
+ content: [{ type: i0.Input }],
2541
+ contentContext: [{ type: i0.Input }],
2542
+ class: [{ type: i0.Input }],
2543
+ hostRef: [{ type: i0.Input }],
2544
+ manualClosing: [{ type: i0.Input }],
2545
+ alignment: [{ type: i0.Input }],
2546
+ position: [{ type: i0.Input }],
2547
+ popoverContainer: [{ type: i0.ViewChild, args: ['popoverContainer', { read: i0.ElementRef, static: true },] }],
2548
+ width: [{ type: i0.HostBinding, args: ['style.width',] }],
2549
+ height: [{ type: i0.HostBinding, args: ['style.height',] }],
2550
+ popover: [{ type: i0.HostBinding, args: ['@popover',] }],
2551
+ clickOutside: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
2552
+ };
2606
2553
 
2607
- var moment = require('moment');
2608
- var noop = function () { };
2609
- var ɵ0$1 = noop;
2610
- var DrDatePickerComponent = /** @class */ (function () {
2611
- function DrDatePickerComponent(cdr, _dateAdapter, datePickerService) {
2612
- var _this = this;
2613
- this.cdr = cdr;
2614
- this._dateAdapter = _dateAdapter;
2615
- this.datePickerService = datePickerService;
2616
- this._destroyed = new rxjs.Subject();
2617
- this.readonly = true;
2618
- this._format = MAT_DEFAULT_DATE_FORMAT;
2619
- this.customHeader = DrDatePickerCustomHeaderComponent;
2620
- this.onChangeFormat = new i0.EventEmitter();
2621
- this.timeframeSelection = false;
2622
- this.takeEndOfPeriod = false;
2623
- this.placeholder = 'Select';
2624
- this.min = null;
2625
- this.max = null;
2626
- this.calendarViewSetup = {
2627
- 'year': function (calendar) { return calendar.currentView = 'multi-year'; },
2628
- 'month': function (calendar) { return calendar.currentView = 'year'; },
2629
- 'quarter': function (calendar) { return calendar.currentView = 'none'; },
2630
- 'day': function (calendar) { return calendar.currentView = 'month'; }
2631
- };
2632
- this.pagingSetup = {
2633
- 'year': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
2634
- 'quarter': function (forward) { return _this.pagingDateChange('addCalendarMonths', 3, forward); },
2635
- 'month': function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
2636
- 'day': function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); }
2637
- };
2638
- this.innerValue = null;
2639
- this.onTouchedCallback = noop;
2640
- this.onChangeCallback = noop;
2641
- datePickerService.format
2642
- .pipe(operators.takeUntil(this._destroyed))
2643
- .subscribe(function (value) {
2644
- _this._format = value;
2645
- _this.onChangeFormat.emit(_this.normalizeValue(value));
2646
- cdr.markForCheck();
2647
- });
2648
- datePickerService.updatedQuater
2649
- .pipe(operators.takeUntil(this._destroyed))
2650
- .subscribe(function (value) {
2651
- _this.tryToNormalaizeTimeframe(value, 'quarter');
2652
- _this.writeValue(value);
2653
- _this.onChangeCallback(value);
2654
- });
2554
+ var DrPopoverService = /** @class */ (function () {
2555
+ function DrPopoverService(overlay, overlayPositionBuilder, injector) {
2556
+ this.overlay = overlay;
2557
+ this.overlayPositionBuilder = overlayPositionBuilder;
2558
+ this.injector = injector;
2655
2559
  }
2656
- Object.defineProperty(DrDatePickerComponent.prototype, "format", {
2657
- set: function (value) {
2658
- if (value) {
2659
- value = this.normalizeValue(value);
2660
- this._format = value;
2661
- this.datePickerService.format.next(value);
2662
- this.datePickerService.setTimeframe(value);
2663
- this.cdr.markForCheck();
2664
- }
2665
- },
2666
- enumerable: false,
2667
- configurable: true
2668
- });
2669
- DrDatePickerComponent.prototype.ngAfterViewInit = function () {
2670
- var _this = this;
2671
- this.datePickerService.calendarInstance = this.dp;
2672
- if (this._format === MAT_DEFAULT_DATE_FORMAT) {
2560
+ DrPopoverService.prototype.open = function (content, popoverModel) {
2561
+ if (!content)
2673
2562
  return;
2674
- }
2675
- setTimeout(function () {
2676
- var popupInstance = _this.dp._popupComponentRef.instance;
2677
- var calenderInstance = popupInstance._calendar._calendarHeaderPortal._attachedHost._attachedRef.instance;
2678
- calenderInstance.currentPeriodClicked = function () {
2679
- this.calendarViewSetup[this.datePickerService.timeframe] && this.calendarViewSetup[this.datePickerService.timeframe](this.calendar);
2680
- };
2681
- }, 1000);
2682
- };
2683
- DrDatePickerComponent.prototype.tryToNormalaizeTimeframe = function (normalizedRef, timeframe) {
2684
- if (this.takeEndOfPeriod) {
2685
- normalizedRef.endOf(timeframe);
2686
- }
2687
- normalizedRef.set('hour', 12);
2563
+ var model = Object.assign(Object.assign({}, DEFAULT_MODEL), popoverModel);
2564
+ var overlayRef = this.createOverlay(model);
2565
+ var popoverRef = new DrPopoverRef(overlayRef);
2566
+ this.attachOverlayContainer(content, model, overlayRef, popoverRef);
2567
+ this.registerListeners(model, overlayRef, popoverRef);
2568
+ return popoverRef;
2688
2569
  };
2689
- Object.defineProperty(DrDatePickerComponent.prototype, "value", {
2690
- get: function () {
2691
- return this.innerValue;
2692
- },
2693
- set: function (v) {
2694
- if (v !== this.innerValue) {
2695
- this.innerValue = v;
2696
- this.onChangeCallback(v);
2697
- }
2698
- this.cdr.markForCheck();
2699
- },
2700
- enumerable: false,
2701
- configurable: true
2702
- });
2703
- DrDatePickerComponent.prototype.registerOnChange = function (fn) {
2704
- this.onChangeCallback = fn;
2570
+ DrPopoverService.prototype.attachOverlayContainer = function (content, _a, overlayRef, popoverRef) {
2571
+ var contentContext = _a.contentContext, position = _a.position, elementClass = _a.class, manualClosing = _a.manualClosing, hostRef = _a.hostRef, alignment = _a.alignment;
2572
+ var componentPortal = new portal.ComponentPortal(DrPopoverComponent, null, this.createInjector(popoverRef));
2573
+ var contentRef = overlayRef.attach(componentPortal);
2574
+ popoverRef.componentRef = contentRef;
2575
+ contentRef.instance.content = content;
2576
+ contentRef.instance.contentContext = Object.assign(Object.assign({}, contentContext), { closePopover: popoverRef.close.bind(popoverRef) });
2577
+ contentRef.instance.class = elementClass + ' ' + position;
2578
+ contentRef.instance.manualClosing = manualClosing;
2579
+ contentRef.instance.hostRef = hostRef;
2580
+ contentRef.instance.alignment = alignment;
2581
+ contentRef.instance.position = position;
2705
2582
  };
2706
- DrDatePickerComponent.prototype.registerOnTouched = function (fn) {
2707
- this.onTouchedCallback = fn;
2583
+ DrPopoverService.prototype.createOverlay = function (popoverModel) {
2584
+ var overlayConfig = this.getOverlayConfig(popoverModel);
2585
+ return this.overlay.create(overlayConfig);
2708
2586
  };
2709
- DrDatePickerComponent.prototype.writeValue = function (value) {
2710
- if (value !== this.innerValue) {
2711
- if (value && typeof value === 'number') {
2712
- this.innerValue = moment.unix(value);
2713
- }
2714
- else {
2715
- this.innerValue = value;
2716
- }
2717
- this.tryToNormalaizeTimeframe(this.innerValue, this.datePickerService.timeframe);
2718
- this.cdr.markForCheck();
2587
+ DrPopoverService.prototype.getOverlayConfig = function (popoverModel) {
2588
+ if (!POPUP_POSITIONS[popoverModel.position])
2589
+ throw new Error("DrPopover does not support the '" + (popoverModel === null || popoverModel === void 0 ? void 0 : popoverModel.position) + "' position!");
2590
+ var config = Object.assign(Object.assign({}, DEFAULT_CONFIG), popoverModel.overlayConfig || {});
2591
+ var hostElement = this.getHostElement(popoverModel.hostRef);
2592
+ var positionStrategy = this.overlayPositionBuilder
2593
+ .flexibleConnectedTo(popoverModel.hostRef)
2594
+ .withPositions([POPUP_POSITIONS[popoverModel.position]]);
2595
+ var overlayConfig = new i1.OverlayConfig(Object.assign({ scrollStrategy: this.overlay.scrollStrategies.noop(), positionStrategy: positionStrategy }, config));
2596
+ if (popoverModel.alignment === 'host' && hostElement) {
2597
+ var alignmentDimension = getAlignmentDimension(popoverModel.position);
2598
+ overlayConfig[alignmentDimension] = hostElement.getBoundingClientRect()[alignmentDimension];
2719
2599
  }
2600
+ return overlayConfig;
2720
2601
  };
2721
- Object.defineProperty(DrDatePickerComponent.prototype, "quarterDisplay", {
2722
- get: function () {
2723
- return this.datePickerService.getQuarterDisplay(this.value, this._format);
2724
- },
2725
- enumerable: false,
2726
- configurable: true
2727
- });
2728
- DrDatePickerComponent.prototype.normalizeValue = function (value) {
2729
- if (value.includes('d')) {
2730
- value = value.replace(/d/g, 'D');
2602
+ DrPopoverService.prototype.createInjector = function (popoverRef) {
2603
+ var injectionTokens = [
2604
+ { provide: DrPopoverRef, useValue: popoverRef },
2605
+ ];
2606
+ return i0.Injector.create({ providers: injectionTokens, parent: this.injector });
2607
+ };
2608
+ DrPopoverService.prototype.registerListeners = function (popoverModel, overlayRef, popoverRef) {
2609
+ var config = popoverModel.overlayConfig || {};
2610
+ var targetElement = popoverModel.targetElement;
2611
+ var hostElement = this.getHostElement(popoverModel.hostRef);
2612
+ if ((config === null || config === void 0 ? void 0 : config.closeOnBackdropClick) && (config === null || config === void 0 ? void 0 : config.hasBackdrop)) {
2613
+ overlayRef.backdropClick().subscribe(function () { return popoverRef.close(); });
2731
2614
  }
2732
- else if (value.includes('D')) {
2733
- value = value.replace(/D/g, 'd');
2615
+ if (targetElement) {
2616
+ targetElement.addEventListener('mouseup', function () { return popoverRef.close(); }, { once: true });
2734
2617
  }
2735
- return value;
2736
- };
2737
- DrDatePickerComponent.prototype.chosenMonthHandler = function (normalizedMonth, datepicker) {
2738
- if (this.datePickerService.timeframe === 'month') {
2739
- this.tryToNormalaizeTimeframe(normalizedMonth, 'month');
2740
- this.writeValue(normalizedMonth);
2741
- this.onChangeCallback(normalizedMonth);
2742
- datepicker.close();
2618
+ if (popoverModel.alignment === 'host' && hostElement) {
2619
+ var alignmentDimension_1 = getAlignmentDimension(popoverModel.position);
2620
+ var resizeObserver_1 = new ResizeObserver(function (entries) {
2621
+ entries.forEach(function (host) {
2622
+ var _a;
2623
+ return overlayRef.updateSize((_a = {}, _a[alignmentDimension_1] = host.target.getBoundingClientRect()[alignmentDimension_1], _a));
2624
+ });
2625
+ });
2626
+ resizeObserver_1.observe(hostElement);
2627
+ popoverRef.onClose.pipe(operators.first()).subscribe(function () { return resizeObserver_1.unobserve(hostElement); });
2743
2628
  }
2744
2629
  };
2745
- DrDatePickerComponent.prototype.chosenYearHandler = function (normalizedYear, datepicker) {
2746
- if (this.datePickerService.timeframe === 'year') {
2747
- this.tryToNormalaizeTimeframe(normalizedYear, 'year');
2748
- this.writeValue(normalizedYear);
2749
- this.onChangeCallback(normalizedYear);
2750
- datepicker.close();
2630
+ DrPopoverService.prototype.getHostElement = function (hostRef) {
2631
+ if (!hostRef || hostRef.x)
2632
+ return null;
2633
+ if (hostRef.nativeElement)
2634
+ return hostRef.nativeElement;
2635
+ return hostRef;
2636
+ };
2637
+ return DrPopoverService;
2638
+ }());
2639
+ DrPopoverService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrPopoverService_Factory() { return new DrPopoverService(i0__namespace.ɵɵinject(i1__namespace.Overlay), i0__namespace.ɵɵinject(i1__namespace.OverlayPositionBuilder), i0__namespace.ɵɵinject(i0__namespace.INJECTOR)); }, token: DrPopoverService, providedIn: "root" });
2640
+ DrPopoverService.decorators = [
2641
+ { type: i0.Injectable, args: [{
2642
+ providedIn: 'root',
2643
+ },] }
2644
+ ];
2645
+ DrPopoverService.ctorParameters = function () { return [
2646
+ { type: i1.Overlay },
2647
+ { type: i1.OverlayPositionBuilder },
2648
+ { type: i0.Injector }
2649
+ ]; };
2650
+
2651
+ var DrPopoverDirective = /** @class */ (function () {
2652
+ function DrPopoverDirective(elementRef, drPopoverService) {
2653
+ this.elementRef = elementRef;
2654
+ this.drPopoverService = drPopoverService;
2655
+ this.contentContext = {};
2656
+ this.position = 'bottom';
2657
+ this.class = '';
2658
+ this.overlayConfig = {};
2659
+ this.manualClosing = { enabled: false };
2660
+ this.popoverClose = new i0.EventEmitter();
2661
+ this.showStateChange = new i0.EventEmitter();
2662
+ }
2663
+ DrPopoverDirective.prototype.togglePopover = function () {
2664
+ if (this.popoverRef) {
2665
+ this.closePopover();
2666
+ }
2667
+ else {
2668
+ this.renderPopover();
2669
+ this.showStateChange.emit({ isShown: !!this.popoverRef });
2751
2670
  }
2752
2671
  };
2753
- DrDatePickerComponent.prototype.pagingClicked = function (forward) {
2754
- this.pagingSetup[this.datePickerService.timeframe] && this.pagingSetup[this.datePickerService.timeframe](forward);
2755
- this.datePickerService.calendarInstance.close();
2672
+ DrPopoverDirective.prototype.closePopover = function (res) {
2673
+ if (this.popoverRef) {
2674
+ this.popoverRef.close(res);
2675
+ this.popoverRef = null;
2676
+ }
2756
2677
  };
2757
- DrDatePickerComponent.prototype.pagingDateChange = function (actionCall, amount, forward) {
2758
- var newValue = this._dateAdapter[actionCall](this.innerValue, forward ? amount : -amount);
2759
- this.writeValue(newValue);
2760
- this.onChangeCallback(newValue);
2678
+ DrPopoverDirective.prototype.renderPopover = function () {
2679
+ var _this = this;
2680
+ var popoverRef = this.popoverRef = this.drPopoverService.open(this.content, {
2681
+ hostRef: this.elementRef,
2682
+ overlayConfig: this.overlayConfig,
2683
+ class: this.class,
2684
+ manualClosing: this.manualClosing,
2685
+ position: this.position,
2686
+ contentContext: this.contentContext,
2687
+ alignment: this.alignment,
2688
+ });
2689
+ popoverRef.onClose.pipe(operators.first()).subscribe(function (res) {
2690
+ _this.closePopover();
2691
+ _this.popoverClose.emit(res);
2692
+ _this.showStateChange.emit({ isShown: !!_this.popoverRef });
2693
+ });
2761
2694
  };
2762
- DrDatePickerComponent.prototype.ngOnDestroy = function () {
2763
- this._destroyed.next();
2764
- this._destroyed.complete();
2695
+ DrPopoverDirective.prototype.ngOnDestroy = function () {
2696
+ this.closePopover();
2765
2697
  };
2766
- return DrDatePickerComponent;
2698
+ return DrPopoverDirective;
2767
2699
  }());
2768
- DrDatePickerComponent.decorators = [
2769
- { type: i0.Component, args: [{
2770
- selector: 'dr-date-picker',
2771
- template: "<div class=\"dr-datepicker__with-timeframe-selection\"\n *ngIf=\"timeframeSelection;else noTimeframeSelection\">\n <div class=\"dr-input-date-paging__flip-page-button\"\n (click)=\"pagingClicked(false)\"\n >\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i> \n </div>\n <div class=\"dr-input-date-paging__quarter-display\"\n *ngIf=\"_format.includes('Q')\"\n (click)=\"datePicker.open()\"\n >{{quarterDisplay}}</div>\n <input [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [placeholder]=\"placeholder\"\n [drDatePickerFormat]=\"_format\"\n [readonly]=\"readonly\"\n [class]=\"_format.includes('Q') ? 'when-quarter' : ''\"\n [min]=\"min\"\n [max]=\"max\"/>\n <div class=\"dr-input-date-paging__flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n <mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenYearHandler($event, datePicker)\"\n (monthSelected)=\"chosenMonthHandler($event, datePicker)\">\n </mat-datepicker>\n</div>\n\n<ng-template class=\"dr-datepicker__no-timeframe-selection\"\n #noTimeframeSelection>\n <i class=\"dr-icon-schedule\"></i>\n <input [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [placeholder]=\"placeholder\"\n [drDatePickerFormat]=\"_format\"\n [readonly]=\"readonly\"\n [min]=\"min\"\n [max]=\"max\"/>\n <mat-datepicker #datePicker\n (yearSelected)=\"chosenYearHandler($event, datePicker)\"\n (monthSelected)=\"chosenMonthHandler($event, datePicker)\">\n </mat-datepicker>\n</ng-template>\n\n",
2772
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2773
- providers: [
2774
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true }
2775
- ],
2776
- styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host.period-datepicker{border:none}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#E5E6EA}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}:host .dr-datepicker__with-timeframe-selection{display:flex;align-items:center}:host .dr-datepicker__with-timeframe-selection .dr-input-date-paging__flip-page-button{width:25px;height:25px;border-radius:16px;padding:0;background-color:#fff}:host .dr-datepicker__with-timeframe-selection .dr-input-date-paging__flip-page-button i{position:relative;color:#0c142b;top:unset;left:unset}:host .dr-datepicker__with-timeframe-selection .dr-input-date-paging__flip-page-button:hover{background-color:#f2f2fb;color:#4646ce}:host .dr-datepicker__with-timeframe-selection input{width:90px;padding:0;border-radius:5px;text-decoration:underline;text-align:center}:host .dr-datepicker__with-timeframe-selection input:hover{background-color:#f2f2fb;color:#4646ce}:host .dr-input-date-paging__quarter-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-input-date-paging__quarter-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#F2F2FB;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#F3F7FF}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#F3F7FF;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#F3F7FF;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}\n"]
2700
+ DrPopoverDirective.decorators = [
2701
+ { type: i0.Directive, args: [{
2702
+ selector: '[drPopover]'
2777
2703
  },] }
2778
2704
  ];
2779
- DrDatePickerComponent.ctorParameters = function () { return [
2780
- { type: i0.ChangeDetectorRef },
2781
- { type: core.DateAdapter },
2782
- { type: DrDatePickerService }
2705
+ DrPopoverDirective.ctorParameters = function () { return [
2706
+ { type: i0.ElementRef },
2707
+ { type: DrPopoverService }
2783
2708
  ]; };
2784
- DrDatePickerComponent.propDecorators = {
2785
- _format: [{ type: i0.Input }],
2786
- onChangeFormat: [{ type: i0.Output }],
2787
- format: [{ type: i0.Input }],
2788
- timeframeSelection: [{ type: i0.Input }],
2789
- takeEndOfPeriod: [{ type: i0.Input }],
2790
- placeholder: [{ type: i0.Input }],
2791
- min: [{ type: i0.Input }],
2792
- max: [{ type: i0.Input }],
2793
- dp: [{ type: i0.ViewChild, args: ['datePicker',] }]
2709
+ DrPopoverDirective.propDecorators = {
2710
+ content: [{ type: i0.Input, args: ['drPopover',] }],
2711
+ contentContext: [{ type: i0.Input, args: ['drPopoverContext',] }],
2712
+ position: [{ type: i0.Input, args: ['drPopoverPosition',] }],
2713
+ class: [{ type: i0.Input, args: ['drPopoverClass',] }],
2714
+ overlayConfig: [{ type: i0.Input, args: ['drPopoverOverlayConfig',] }],
2715
+ manualClosing: [{ type: i0.Input, args: ['drPopoverManualClosing',] }],
2716
+ alignment: [{ type: i0.Input, args: ['drPopoverAlignment',] }],
2717
+ popoverClose: [{ type: i0.Output, args: ['drPopoverClose',] }],
2718
+ showStateChange: [{ type: i0.Output, args: ['drPopoverShowStateChange',] }],
2719
+ togglePopover: [{ type: i0.HostListener, args: ['click',] }]
2794
2720
  };
2795
2721
 
2796
- var DrDatePickerFormatDirective = /** @class */ (function () {
2797
- function DrDatePickerFormatDirective(matDateFormat, ngControl) {
2798
- this.matDateFormat = matDateFormat;
2799
- this.ngControl = ngControl;
2722
+ var DrDropdownService = /** @class */ (function () {
2723
+ function DrDropdownService() {
2724
+ this.actionItem = new rxjs.Subject();
2800
2725
  }
2801
- Object.defineProperty(DrDatePickerFormatDirective.prototype, "datePickerFormat", {
2802
- set: function (format) {
2803
- var _a;
2804
- if (this.configDateParse) {
2805
- this.matDateFormat.updateDateFormat(this.configDateParse, this.configDateDisplay);
2806
- }
2807
- else {
2808
- this.matDateFormat.updateDateFormat({ dateInput: format });
2809
- }
2810
- var value = this.ngControl.value;
2811
- (_a = this.ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.writeValue(value);
2726
+ Object.defineProperty(DrDropdownService.prototype, "addMenu", {
2727
+ set: function (item) {
2728
+ this.menuInView = item;
2812
2729
  },
2813
2730
  enumerable: false,
2814
2731
  configurable: true
2815
2732
  });
2816
- return DrDatePickerFormatDirective;
2733
+ DrDropdownService.prototype.destroy = function () {
2734
+ if (this.menuInView) {
2735
+ this.menuInView.destroy();
2736
+ }
2737
+ };
2738
+ return DrDropdownService;
2817
2739
  }());
2818
- DrDatePickerFormatDirective.decorators = [
2819
- { type: i0.Directive, args: [{
2820
- selector: '[drDatePickerFormat]',
2821
- providers: [
2822
- {
2823
- provide: core.DateAdapter,
2824
- useClass: materialMomentAdapter.MomentDateAdapter
2825
- },
2826
- {
2827
- provide: core.MAT_DATE_FORMATS,
2828
- useClass: CustomDateFormat
2829
- }
2830
- ]
2740
+ DrDropdownService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrDropdownService_Factory() { return new DrDropdownService(); }, token: DrDropdownService, providedIn: "root" });
2741
+ DrDropdownService.decorators = [
2742
+ { type: i0.Injectable, args: [{
2743
+ providedIn: 'root'
2831
2744
  },] }
2832
2745
  ];
2833
- DrDatePickerFormatDirective.ctorParameters = function () { return [
2834
- { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
2835
- { type: forms.NgControl, decorators: [{ type: i0.Optional }] }
2836
- ]; };
2837
- DrDatePickerFormatDirective.propDecorators = {
2838
- configDateParse: [{ type: i0.Input }],
2839
- configDateDisplay: [{ type: i0.Input }],
2840
- datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
2841
- };
2842
-
2843
- var DrPopoverRef = /** @class */ (function () {
2844
- function DrPopoverRef(overlayRef) {
2845
- this.overlayRef = overlayRef;
2846
- this.onClose$ = new rxjs.Subject();
2847
- // FIXME: this decision was made because of the incompatible rxjs version
2848
- /**
2849
- * Correct type is @type {Observable<any>}
2850
- */
2851
- this.onClose = this.onClose$.asObservable();
2852
- this.onBackdropClick = this.overlayRef.backdropClick();
2853
- }
2854
- DrPopoverRef.prototype.close = function (res) {
2855
- this.overlayRef.detach();
2856
- this.overlayRef.dispose();
2857
- this.onClose$.next(res);
2858
- this.onClose$.complete();
2859
- };
2860
- return DrPopoverRef;
2861
- }());
2862
-
2863
- exports.DrPopoverAlignmentDimension = void 0;
2864
- (function (DrPopoverAlignmentDimension) {
2865
- DrPopoverAlignmentDimension["Width"] = "width";
2866
- DrPopoverAlignmentDimension["Height"] = "height";
2867
- })(exports.DrPopoverAlignmentDimension || (exports.DrPopoverAlignmentDimension = {}));
2868
- var DEFAULT_CONFIG = {
2869
- hasBackdrop: false,
2870
- closeOnBackdropClick: false,
2871
- backdropClass: 'dr-popover-transparent-backdrop',
2872
- };
2873
- var DEFAULT_MODEL = {
2874
- position: 'bottom',
2875
- class: '',
2876
- overlayConfig: {},
2877
- manualClosing: { enabled: false },
2878
- };
2879
- function getAlignmentDimension(position) {
2880
- if (!POPUP_POSITIONS[position])
2881
- return exports.DrPopoverAlignmentDimension.Width;
2882
- if ((position === null || position === void 0 ? void 0 : position.includes('left')) || (position === null || position === void 0 ? void 0 : position.includes('right'))) {
2883
- return exports.DrPopoverAlignmentDimension.Height;
2884
- }
2885
- return exports.DrPopoverAlignmentDimension.Width;
2886
- }
2746
+ DrDropdownService.ctorParameters = function () { return []; };
2887
2747
 
2888
- var DrPopoverComponent = /** @class */ (function () {
2889
- function DrPopoverComponent(cdr, componentFactoryResolver, viewContainerRef, elementRef, popoverRef) {
2748
+ var DrDropdownComponent = /** @class */ (function () {
2749
+ function DrDropdownComponent(menuService, cdr) {
2750
+ this.menuService = menuService;
2890
2751
  this.cdr = cdr;
2891
- this.componentFactoryResolver = componentFactoryResolver;
2892
- this.viewContainerRef = viewContainerRef;
2893
- this.elementRef = elementRef;
2894
- this.popoverRef = popoverRef;
2895
- this.class = '';
2896
- this.isContentTemplate = false;
2897
- this.popover = true;
2752
+ this.position = 'left';
2898
2753
  }
2899
- DrPopoverComponent.prototype.clickOutside = function (e) {
2900
- var isTargetHost = this.hostRef instanceof i0.ElementRef && (this.hostRef.nativeElement === e.target || this.hostRef.nativeElement.contains(e.target));
2901
- var isTargetInPopover = this.elementRef.nativeElement.contains(e.target);
2902
- var isTargetInDatepicker = e.target.closest('mat-datepicker-popup');
2903
- var isTargetInSelect = e.target.closest('ng-dropdown-panel');
2904
- var isTargetInDatepickerContent = e.target.closest('mat-datepicker-content');
2905
- if (!isTargetHost
2906
- && !isTargetInPopover
2907
- && !isTargetInDatepicker
2908
- && !isTargetInSelect
2909
- && !isTargetInDatepickerContent
2910
- && !this.manualClosing.enabled) {
2911
- this.popoverRef.close();
2754
+ Object.defineProperty(DrDropdownComponent.prototype, "options", {
2755
+ set: function (data) {
2756
+ if (data) {
2757
+ this.option = data.option;
2758
+ this.position = data.position;
2759
+ this.drDropdownInHover = data.drDropdownInHover;
2760
+ this.containerClass = data.class;
2761
+ this.list = data.list || [];
2762
+ this.list.forEach(function (item) {
2763
+ var _a, _b;
2764
+ if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
2765
+ item.childOptions = {
2766
+ list: item.children,
2767
+ class: ((_b = item === null || item === void 0 ? void 0 : item.childOptions) === null || _b === void 0 ? void 0 : _b.class) || '',
2768
+ position: 'child'
2769
+ };
2770
+ }
2771
+ });
2772
+ this.cdr.markForCheck();
2773
+ }
2774
+ },
2775
+ enumerable: false,
2776
+ configurable: true
2777
+ });
2778
+ DrDropdownComponent.prototype.onMouseLeave = function () {
2779
+ if (this.drDropdownInHover)
2780
+ this.menuService.destroy();
2781
+ };
2782
+ DrDropdownComponent.prototype.onClickedOutside = function () {
2783
+ if (this.firstInit) {
2784
+ this.menuService.destroy();
2785
+ }
2786
+ else {
2787
+ this.firstInit = true;
2912
2788
  }
2913
2789
  };
2914
- DrPopoverComponent.prototype.ngOnInit = function () {
2915
- this.isContentTemplate = this.content instanceof i0.TemplateRef;
2916
- if (!this.isContentTemplate) {
2917
- this.componentRef = this.viewContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
2918
- Object.assign(this.componentRef.instance, this.contentContext);
2919
- this.popoverContainer.nativeElement.appendChild(this.componentRef.location.nativeElement);
2790
+ DrDropdownComponent.prototype.hide = function () {
2791
+ this.menuService.destroy();
2792
+ };
2793
+ DrDropdownComponent.prototype.disabled = function (act) {
2794
+ if (!act.disabled) {
2795
+ return false;
2920
2796
  }
2921
- if (this.alignment === 'host') {
2922
- this[getAlignmentDimension(this.position)] = '100%';
2797
+ if (typeof act.disabled === 'boolean') {
2798
+ return act.disabled;
2799
+ }
2800
+ else {
2801
+ return act.disabled(act.data);
2923
2802
  }
2924
- this.cdr.detectChanges();
2925
2803
  };
2926
- return DrPopoverComponent;
2804
+ DrDropdownComponent.prototype.selected = function (act) {
2805
+ if (!act.selected) {
2806
+ return false;
2807
+ }
2808
+ if (typeof act.selected === 'boolean') {
2809
+ return act.selected;
2810
+ }
2811
+ else {
2812
+ return act.selected(act.data);
2813
+ }
2814
+ };
2815
+ DrDropdownComponent.prototype.tooltipToShow = function (act) {
2816
+ if (act.toolTipIfDisabled && !this.disabled(act))
2817
+ return '';
2818
+ return act.toolTip;
2819
+ };
2820
+ DrDropdownComponent.prototype.tooltipPosition = function (widthMoreRight) {
2821
+ return widthMoreRight ? 'right' : 'left';
2822
+ };
2823
+ DrDropdownComponent.prototype.action = function (act) {
2824
+ if (!this.disabled(act)) {
2825
+ if (act.action) {
2826
+ act.action(act.data);
2827
+ }
2828
+ else {
2829
+ this.menuService.actionItem.next({ event: act.event || act.title || 'default', data: act.data });
2830
+ }
2831
+ this.hide();
2832
+ }
2833
+ };
2834
+ DrDropdownComponent.prototype.onActionIconClick = function ($event, actionIcon, data) {
2835
+ $event.stopPropagation();
2836
+ if (!this.disabled(actionIcon)) {
2837
+ actionIcon.action(data);
2838
+ this.hide();
2839
+ }
2840
+ };
2841
+ return DrDropdownComponent;
2927
2842
  }());
2928
- DrPopoverComponent.decorators = [
2843
+ DrDropdownComponent.decorators = [
2929
2844
  { type: i0.Component, args: [{
2930
- selector: 'dr-popover',
2931
- template: "<div class=\"dr-popover\" [class]=\"class\" #popoverContainer>\n <ng-container *ngIf=\"isContentTemplate\">\n <ng-container *ngTemplateOutlet=\"content; context: contentContext\"></ng-container>\n </ng-container>\n</div>\n",
2932
- animations: [
2933
- animations.trigger('popover', POPUP_ANIMATION),
2934
- ],
2845
+ selector: 'dr-dropdown',
2846
+ template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
2935
2847
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2936
- styles: [".dr-popover{display:flex;background:#fff;border:1px solid #E5E5E5;border-radius:5px;box-sizing:border-box;box-shadow:0 4px 14px #0003;font-size:12px;color:#545a6b;max-height:100vh;max-width:100vw;overflow:auto}::ng-deep .dr-popover-transparent-backdrop{background-color:transparent}\n"]
2848
+ styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden;transition-delay:.2s}::ng-deep .dr-dropdown__container__item:hover>*>.dr-dropdown{visibility:visible;transition-delay:0s}::ng-deep .dr-dropdown__tooltip>.default-content{max-width:300px;white-space:normal!important}.dr-dropdown{position:absolute;z-index:-1;top:0;left:0;width:auto}.dr-dropdown__container{display:flex;flex-direction:column;background:#fff;border-radius:4px;box-shadow:0 4px 8px 1px #00000040;padding:8px 0;overflow-y:auto;max-height:60vh}.dr-dropdown__container__item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}.dr-dropdown__container__item:hover{background-color:#f9faff}.dr-dropdown__container__item:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.dr-dropdown__container__item.item-disabled,.dr-dropdown__container__item.item-disabled i,.dr-dropdown__container__item.item-disabled .dr-dropdown__container__item__text{color:#bcbcbc}.dr-dropdown__container__item i:first-child{margin-right:8px}.dr-dropdown__container__item__text{margin-right:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item i{color:#4e566c}.dr-dropdown__container__item i:hover{color:#4646ce}.dr-dropdown__container__item .showOnHover{visibility:hidden}.dr-dropdown.content-top{transform:translate(-50%,-100%)}.dr-dropdown.content-top-left{transform:translate(-100%,-100%)}.dr-dropdown.content-bottom{transform:translate(-50%,50%)}.dr-dropdown.content-bottom-left{transform:translate(-90%,35%)}.dr-dropdown.content-bottom-right{transform:translateY(15%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
2937
2849
  },] }
2938
2850
  ];
2939
- DrPopoverComponent.ctorParameters = function () { return [
2940
- { type: i0.ChangeDetectorRef },
2941
- { type: i0.ComponentFactoryResolver },
2942
- { type: i0.ViewContainerRef },
2943
- { type: i0.ElementRef },
2944
- { type: DrPopoverRef }
2851
+ DrDropdownComponent.ctorParameters = function () { return [
2852
+ { type: DrDropdownService },
2853
+ { type: i0.ChangeDetectorRef }
2945
2854
  ]; };
2946
- DrPopoverComponent.propDecorators = {
2947
- content: [{ type: i0.Input }],
2948
- contentContext: [{ type: i0.Input }],
2949
- class: [{ type: i0.Input }],
2950
- hostRef: [{ type: i0.Input }],
2951
- manualClosing: [{ type: i0.Input }],
2952
- alignment: [{ type: i0.Input }],
2953
- position: [{ type: i0.Input }],
2954
- popoverContainer: [{ type: i0.ViewChild, args: ['popoverContainer', { read: i0.ElementRef, static: true },] }],
2955
- width: [{ type: i0.HostBinding, args: ['style.width',] }],
2956
- height: [{ type: i0.HostBinding, args: ['style.height',] }],
2957
- popover: [{ type: i0.HostBinding, args: ['@popover',] }],
2958
- clickOutside: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
2855
+ DrDropdownComponent.propDecorators = {
2856
+ viewMenu: [{ type: i0.ViewChild, args: ['listMenu',] }],
2857
+ menuContainer: [{ type: i0.ViewChild, args: ['menuContainer',] }],
2858
+ options: [{ type: i0.Input }]
2959
2859
  };
2960
2860
 
2961
- var DrPopoverService = /** @class */ (function () {
2962
- function DrPopoverService(overlay, overlayPositionBuilder, injector) {
2963
- this.overlay = overlay;
2964
- this.overlayPositionBuilder = overlayPositionBuilder;
2965
- this.injector = injector;
2861
+ var DrDropdownDirective = /** @class */ (function () {
2862
+ function DrDropdownDirective(componentFactoryResolver, viewContainerRef, service, el, _document) {
2863
+ this.componentFactoryResolver = componentFactoryResolver;
2864
+ this.viewContainerRef = viewContainerRef;
2865
+ this.service = service;
2866
+ this.el = el;
2867
+ this._document = _document;
2868
+ this.position = 'left';
2966
2869
  }
2967
- DrPopoverService.prototype.open = function (content, popoverModel) {
2968
- if (!content)
2870
+ DrDropdownDirective.prototype.elementHover = function () {
2871
+ if (!this.drDropdownInHover)
2969
2872
  return;
2970
- var model = Object.assign(Object.assign({}, DEFAULT_MODEL), popoverModel);
2971
- var overlayRef = this.createOverlay(model);
2972
- var popoverRef = new DrPopoverRef(overlayRef);
2973
- this.attachOverlayContainer(content, model, overlayRef, popoverRef);
2974
- this.registerListeners(model, overlayRef, popoverRef);
2975
- return popoverRef;
2976
- };
2977
- DrPopoverService.prototype.attachOverlayContainer = function (content, _a, overlayRef, popoverRef) {
2978
- var contentContext = _a.contentContext, position = _a.position, elementClass = _a.class, manualClosing = _a.manualClosing, hostRef = _a.hostRef, alignment = _a.alignment;
2979
- var componentPortal = new portal.ComponentPortal(DrPopoverComponent, null, this.createInjector(popoverRef));
2980
- var contentRef = overlayRef.attach(componentPortal);
2981
- popoverRef.componentRef = contentRef;
2982
- contentRef.instance.content = content;
2983
- contentRef.instance.contentContext = Object.assign(Object.assign({}, contentContext), { closePopover: popoverRef.close.bind(popoverRef) });
2984
- contentRef.instance.class = elementClass + ' ' + position;
2985
- contentRef.instance.manualClosing = manualClosing;
2986
- contentRef.instance.hostRef = hostRef;
2987
- contentRef.instance.alignment = alignment;
2988
- contentRef.instance.position = position;
2989
- };
2990
- DrPopoverService.prototype.createOverlay = function (popoverModel) {
2991
- var overlayConfig = this.getOverlayConfig(popoverModel);
2992
- return this.overlay.create(overlayConfig);
2873
+ this.openDropdown();
2993
2874
  };
2994
- DrPopoverService.prototype.getOverlayConfig = function (popoverModel) {
2995
- if (!POPUP_POSITIONS[popoverModel.position])
2996
- throw new Error("DrPopover does not support the '" + (popoverModel === null || popoverModel === void 0 ? void 0 : popoverModel.position) + "' position!");
2997
- var config = Object.assign(Object.assign({}, DEFAULT_CONFIG), popoverModel.overlayConfig || {});
2998
- var hostElement = this.getHostElement(popoverModel.hostRef);
2999
- var positionStrategy = this.overlayPositionBuilder
3000
- .flexibleConnectedTo(popoverModel.hostRef)
3001
- .withPositions([POPUP_POSITIONS[popoverModel.position]]);
3002
- var overlayConfig = new i1.OverlayConfig(Object.assign({ scrollStrategy: this.overlay.scrollStrategies.noop(), positionStrategy: positionStrategy }, config));
3003
- if (popoverModel.alignment === 'host' && hostElement) {
3004
- var alignmentDimension = getAlignmentDimension(popoverModel.position);
3005
- overlayConfig[alignmentDimension] = hostElement.getBoundingClientRect()[alignmentDimension];
3006
- }
3007
- return overlayConfig;
2875
+ DrDropdownDirective.prototype.elementClick = function () {
2876
+ this.openDropdown();
3008
2877
  };
3009
- DrPopoverService.prototype.createInjector = function (popoverRef) {
3010
- var injectionTokens = [
3011
- { provide: DrPopoverRef, useValue: popoverRef },
3012
- ];
3013
- return i0.Injector.create({ providers: injectionTokens, parent: this.injector });
2878
+ DrDropdownDirective.prototype.documentClick = function (e) {
2879
+ this.closeDropdown(e);
3014
2880
  };
3015
- DrPopoverService.prototype.registerListeners = function (popoverModel, overlayRef, popoverRef) {
3016
- var config = popoverModel.overlayConfig || {};
3017
- var targetElement = popoverModel.targetElement;
3018
- var hostElement = this.getHostElement(popoverModel.hostRef);
3019
- if ((config === null || config === void 0 ? void 0 : config.closeOnBackdropClick) && (config === null || config === void 0 ? void 0 : config.hasBackdrop)) {
3020
- overlayRef.backdropClick().subscribe(function () { return popoverRef.close(); });
3021
- }
3022
- if (targetElement) {
3023
- targetElement.addEventListener('mouseup', function () { return popoverRef.close(); }, { once: true });
2881
+ DrDropdownDirective.prototype.openDropdown = function () {
2882
+ var option = this.el.nativeElement.getBoundingClientRect();
2883
+ this._document.querySelectorAll('dr-dropdown').forEach(function (item) { return item.remove(); });
2884
+ if (this.contentCmpRef && this.contentCmpRef.destroyCbs) {
2885
+ this.contentCmpRef.destroy();
2886
+ this.contentCmpRef = null;
3024
2887
  }
3025
- if (popoverModel.alignment === 'host' && hostElement) {
3026
- var alignmentDimension_1 = getAlignmentDimension(popoverModel.position);
3027
- var resizeObserver_1 = new ResizeObserver(function (entries) {
3028
- entries.forEach(function (host) {
3029
- var _a;
3030
- return overlayRef.updateSize((_a = {}, _a[alignmentDimension_1] = host.target.getBoundingClientRect()[alignmentDimension_1], _a));
3031
- });
2888
+ else {
2889
+ this.service.destroy();
2890
+ this.showMenu({
2891
+ option: option,
2892
+ drDropdownInHover: this.drDropdownInHover,
2893
+ position: this.position,
2894
+ list: this.drDropdown,
2895
+ class: this.drDropdownClass
3032
2896
  });
3033
- resizeObserver_1.observe(hostElement);
3034
- popoverRef.onClose.pipe(operators.first()).subscribe(function () { return resizeObserver_1.unobserve(hostElement); });
3035
2897
  }
3036
2898
  };
3037
- DrPopoverService.prototype.getHostElement = function (hostRef) {
3038
- if (!hostRef || hostRef.x)
3039
- return null;
3040
- if (hostRef.nativeElement)
3041
- return hostRef.nativeElement;
3042
- return hostRef;
3043
- };
3044
- return DrPopoverService;
3045
- }());
3046
- DrPopoverService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrPopoverService_Factory() { return new DrPopoverService(i0__namespace.ɵɵinject(i1__namespace.Overlay), i0__namespace.ɵɵinject(i1__namespace.OverlayPositionBuilder), i0__namespace.ɵɵinject(i0__namespace.INJECTOR)); }, token: DrPopoverService, providedIn: "root" });
3047
- DrPopoverService.decorators = [
3048
- { type: i0.Injectable, args: [{
3049
- providedIn: 'root',
3050
- },] }
3051
- ];
3052
- DrPopoverService.ctorParameters = function () { return [
3053
- { type: i1.Overlay },
3054
- { type: i1.OverlayPositionBuilder },
3055
- { type: i0.Injector }
3056
- ]; };
3057
-
3058
- var DrPopoverDirective = /** @class */ (function () {
3059
- function DrPopoverDirective(elementRef, drPopoverService) {
3060
- this.elementRef = elementRef;
3061
- this.drPopoverService = drPopoverService;
3062
- this.contentContext = {};
3063
- this.position = 'bottom';
3064
- this.class = '';
3065
- this.overlayConfig = {};
3066
- this.manualClosing = { enabled: false };
3067
- this.popoverClose = new i0.EventEmitter();
3068
- this.showStateChange = new i0.EventEmitter();
3069
- }
3070
- DrPopoverDirective.prototype.togglePopover = function () {
3071
- if (this.popoverRef) {
3072
- this.closePopover();
3073
- }
3074
- else {
3075
- this.renderPopover();
3076
- this.showStateChange.emit({ isShown: !!this.popoverRef });
2899
+ DrDropdownDirective.prototype.closeDropdown = function (e) {
2900
+ var menuItem = e.target.classList;
2901
+ if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
2902
+ return;
3077
2903
  }
3078
- };
3079
- DrPopoverDirective.prototype.closePopover = function (res) {
3080
- if (this.popoverRef) {
3081
- this.popoverRef.close(res);
3082
- this.popoverRef = null;
2904
+ var elems = this._document.querySelectorAll('dr-dropdown');
2905
+ if (!e.target.contains(this.el.nativeElement) && this.contentCmpRef || elems.length && !e.target.contains(this.el.nativeElement)) {
2906
+ setTimeout(function () { return elems.forEach(function (item) { return item.remove(); }); }, 100);
3083
2907
  }
3084
2908
  };
3085
- DrPopoverDirective.prototype.renderPopover = function () {
3086
- var _this = this;
3087
- var popoverRef = this.popoverRef = this.drPopoverService.open(this.content, {
3088
- hostRef: this.elementRef,
3089
- overlayConfig: this.overlayConfig,
3090
- class: this.class,
3091
- manualClosing: this.manualClosing,
3092
- position: this.position,
3093
- contentContext: this.contentContext,
3094
- alignment: this.alignment,
3095
- });
3096
- popoverRef.onClose.pipe(operators.first()).subscribe(function (res) {
3097
- _this.closePopover();
3098
- _this.popoverClose.emit(res);
3099
- _this.showStateChange.emit({ isShown: !!_this.popoverRef });
3100
- });
2909
+ DrDropdownDirective.prototype.showMenu = function (options) {
2910
+ var componentFactory;
2911
+ componentFactory = this.componentFactoryResolver.resolveComponentFactory(DrDropdownComponent);
2912
+ this.contentCmpRef = this.viewContainerRef.createComponent(componentFactory);
2913
+ this.service.addMenu = this.contentCmpRef;
2914
+ this._document.querySelector('nb-layout').appendChild(this.contentCmpRef.location.nativeElement);
2915
+ this.contentCmpRef.instance.options = options;
3101
2916
  };
3102
- DrPopoverDirective.prototype.ngOnDestroy = function () {
3103
- this.closePopover();
2917
+ DrDropdownDirective.prototype.ngOnDestroy = function () {
2918
+ if (this.contentCmpRef) {
2919
+ this.contentCmpRef.destroy();
2920
+ }
3104
2921
  };
3105
- return DrPopoverDirective;
2922
+ return DrDropdownDirective;
3106
2923
  }());
3107
- DrPopoverDirective.decorators = [
2924
+ DrDropdownDirective.decorators = [
3108
2925
  { type: i0.Directive, args: [{
3109
- selector: '[drPopover]'
2926
+ selector: '[drDropdown]'
3110
2927
  },] }
3111
2928
  ];
3112
- DrPopoverDirective.ctorParameters = function () { return [
2929
+ DrDropdownDirective.ctorParameters = function () { return [
2930
+ { type: i0.ComponentFactoryResolver },
2931
+ { type: i0.ViewContainerRef },
2932
+ { type: DrDropdownService },
3113
2933
  { type: i0.ElementRef },
3114
- { type: DrPopoverService }
2934
+ { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
3115
2935
  ]; };
3116
- DrPopoverDirective.propDecorators = {
3117
- content: [{ type: i0.Input, args: ['drPopover',] }],
3118
- contentContext: [{ type: i0.Input, args: ['drPopoverContext',] }],
3119
- position: [{ type: i0.Input, args: ['drPopoverPosition',] }],
3120
- class: [{ type: i0.Input, args: ['drPopoverClass',] }],
3121
- overlayConfig: [{ type: i0.Input, args: ['drPopoverOverlayConfig',] }],
3122
- manualClosing: [{ type: i0.Input, args: ['drPopoverManualClosing',] }],
3123
- alignment: [{ type: i0.Input, args: ['drPopoverAlignment',] }],
3124
- popoverClose: [{ type: i0.Output, args: ['drPopoverClose',] }],
3125
- showStateChange: [{ type: i0.Output, args: ['drPopoverShowStateChange',] }],
3126
- togglePopover: [{ type: i0.HostListener, args: ['click',] }]
2936
+ DrDropdownDirective.propDecorators = {
2937
+ position: [{ type: i0.Input }],
2938
+ drDropdown: [{ type: i0.Input }],
2939
+ drDropdownClass: [{ type: i0.Input }],
2940
+ drDropdownInHover: [{ type: i0.Input }],
2941
+ contentCmpRef: [{ type: i0.ViewChild, args: [DrDropdownComponent, { static: true, read: i0.ViewContainerRef },] }],
2942
+ elementHover: [{ type: i0.HostListener, args: ['mouseenter',] }],
2943
+ elementClick: [{ type: i0.HostListener, args: ['click',] }],
2944
+ documentClick: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
3127
2945
  };
3128
2946
 
3129
- var DrDropdownService = /** @class */ (function () {
3130
- function DrDropdownService() {
3131
- this.actionItem = new rxjs.Subject();
2947
+ var DrDropdownPositionDirective = /** @class */ (function () {
2948
+ function DrDropdownPositionDirective(el, renderer) {
2949
+ this.el = el;
2950
+ this.renderer = renderer;
2951
+ this.position = 'left';
3132
2952
  }
3133
- Object.defineProperty(DrDropdownService.prototype, "addMenu", {
3134
- set: function (item) {
3135
- this.menuInView = item;
3136
- },
3137
- enumerable: false,
3138
- configurable: true
3139
- });
3140
- DrDropdownService.prototype.destroy = function () {
3141
- if (this.menuInView) {
3142
- this.menuInView.destroy();
3143
- }
3144
- };
3145
- return DrDropdownService;
3146
- }());
3147
- DrDropdownService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrDropdownService_Factory() { return new DrDropdownService(); }, token: DrDropdownService, providedIn: "root" });
3148
- DrDropdownService.decorators = [
3149
- { type: i0.Injectable, args: [{
3150
- providedIn: 'root'
3151
- },] }
3152
- ];
3153
- DrDropdownService.ctorParameters = function () { return []; };
3154
-
3155
- var DrDropdownComponent = /** @class */ (function () {
3156
- function DrDropdownComponent(menuService, cdr) {
3157
- this.menuService = menuService;
3158
- this.cdr = cdr;
3159
- this.position = 'left';
3160
- }
3161
- Object.defineProperty(DrDropdownComponent.prototype, "options", {
3162
- set: function (data) {
3163
- if (data) {
3164
- this.option = data.option;
3165
- this.position = data.position;
3166
- this.drDropdownInHover = data.drDropdownInHover;
3167
- this.containerClass = data.class;
3168
- this.list = data.list || [];
3169
- this.list.forEach(function (item) {
3170
- var _a, _b;
3171
- if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
3172
- item.childOptions = {
3173
- list: item.children,
3174
- class: ((_b = item === null || item === void 0 ? void 0 : item.childOptions) === null || _b === void 0 ? void 0 : _b.class) || '',
3175
- position: 'child'
3176
- };
3177
- }
3178
- });
3179
- this.cdr.markForCheck();
3180
- }
3181
- },
3182
- enumerable: false,
3183
- configurable: true
3184
- });
3185
- DrDropdownComponent.prototype.onMouseLeave = function () {
3186
- if (this.drDropdownInHover)
3187
- this.menuService.destroy();
3188
- };
3189
- DrDropdownComponent.prototype.onClickedOutside = function () {
3190
- if (this.firstInit) {
3191
- this.menuService.destroy();
3192
- }
3193
- else {
3194
- this.firstInit = true;
3195
- }
3196
- };
3197
- DrDropdownComponent.prototype.hide = function () {
3198
- this.menuService.destroy();
3199
- };
3200
- DrDropdownComponent.prototype.disabled = function (act) {
3201
- if (!act.disabled) {
3202
- return false;
3203
- }
3204
- if (typeof act.disabled === 'boolean') {
3205
- return act.disabled;
3206
- }
3207
- else {
3208
- return act.disabled(act.data);
3209
- }
3210
- };
3211
- DrDropdownComponent.prototype.selected = function (act) {
3212
- if (!act.selected) {
3213
- return false;
3214
- }
3215
- if (typeof act.selected === 'boolean') {
3216
- return act.selected;
3217
- }
3218
- else {
3219
- return act.selected(act.data);
3220
- }
3221
- };
3222
- DrDropdownComponent.prototype.tooltipToShow = function (act) {
3223
- if (act.toolTipIfDisabled && !this.disabled(act))
3224
- return '';
3225
- return act.toolTip;
3226
- };
3227
- DrDropdownComponent.prototype.tooltipPosition = function (widthMoreRight) {
3228
- return widthMoreRight ? 'right' : 'left';
3229
- };
3230
- DrDropdownComponent.prototype.action = function (act) {
3231
- if (!this.disabled(act)) {
3232
- if (act.action) {
3233
- act.action(act.data);
3234
- }
3235
- else {
3236
- this.menuService.actionItem.next({ event: act.event || act.title || 'default', data: act.data });
3237
- }
3238
- this.hide();
3239
- }
3240
- };
3241
- DrDropdownComponent.prototype.onActionIconClick = function ($event, actionIcon, data) {
3242
- $event.stopPropagation();
3243
- if (!this.disabled(actionIcon)) {
3244
- actionIcon.action(data);
3245
- this.hide();
3246
- }
3247
- };
3248
- return DrDropdownComponent;
3249
- }());
3250
- DrDropdownComponent.decorators = [
3251
- { type: i0.Component, args: [{
3252
- selector: 'dr-dropdown',
3253
- template: "<div #menuContainer\n (mouseleave)=\"onMouseLeave()\"\n (clickOutside)=\"onClickedOutside()\"\n [drDropdownPosition]=\"option\"\n #dropdownPosition=\"dropdownPosition\"\n [position]=\"position\"\n [class]=\"containerClass\"\n class=\"dr-dropdown\">\n <div class=\"dr-dropdown__container\">\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\n (click)=\"action(act)\"\n [drTooltip]=\"tooltipToShow(act)\"\n [drTooltipPosition]=\"tooltipPosition(dropdownPosition.widthMoreRight)\"\n [drTooltipOptions]=\"{ withoutArrow: true }\"\n [drTooltipClass]=\"'dr-dropdown__tooltip'\"\n class=\"dr-dropdown__container__item\"\n [class.item-disabled]=\"disabled(act)\"\n [class.item-selected]=\"selected(act)\">\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\n <i *ngFor=\"let actionIcon of act.actionIcons\"\n [class]=\"actionIcon.icon\"\n [class.showOnHover]=\"actionIcon.showOnHover\"\n (click)=\"onActionIconClick($event, actionIcon, act.data)\"></i>\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\n </div>\n </div>\n</div>\n",
3254
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3255
- styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden;transition-delay:.2s}::ng-deep .dr-dropdown__container__item:hover>*>.dr-dropdown{visibility:visible;transition-delay:0s}::ng-deep .dr-dropdown__tooltip>.default-content{max-width:300px;white-space:normal!important}.dr-dropdown{position:absolute;z-index:-1;top:0;left:0;width:auto}.dr-dropdown__container{display:flex;flex-direction:column;background:#fff;border-radius:4px;box-shadow:0 4px 8px 1px #00000040;padding:8px 0;overflow-y:auto;max-height:60vh}.dr-dropdown__container__item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}.dr-dropdown__container__item:hover{background-color:#f9faff}.dr-dropdown__container__item:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.dr-dropdown__container__item.item-disabled,.dr-dropdown__container__item.item-disabled i,.dr-dropdown__container__item.item-disabled .dr-dropdown__container__item__text{color:#bcbcbc}.dr-dropdown__container__item i:first-child{margin-right:8px}.dr-dropdown__container__item__text{margin-right:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item i{color:#4e566c}.dr-dropdown__container__item i:hover{color:#4646ce}.dr-dropdown__container__item .showOnHover{visibility:hidden}.dr-dropdown.content-top{transform:translate(-50%,-100%)}.dr-dropdown.content-top-left{transform:translate(-100%,-100%)}.dr-dropdown.content-bottom{transform:translate(-50%,50%)}.dr-dropdown.content-bottom-left{transform:translate(-90%,35%)}.dr-dropdown.content-bottom-right{transform:translateY(15%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
3256
- },] }
3257
- ];
3258
- DrDropdownComponent.ctorParameters = function () { return [
3259
- { type: DrDropdownService },
3260
- { type: i0.ChangeDetectorRef }
3261
- ]; };
3262
- DrDropdownComponent.propDecorators = {
3263
- viewMenu: [{ type: i0.ViewChild, args: ['listMenu',] }],
3264
- menuContainer: [{ type: i0.ViewChild, args: ['menuContainer',] }],
3265
- options: [{ type: i0.Input }]
3266
- };
3267
-
3268
- var DrDropdownDirective = /** @class */ (function () {
3269
- function DrDropdownDirective(componentFactoryResolver, viewContainerRef, service, el, _document) {
3270
- this.componentFactoryResolver = componentFactoryResolver;
3271
- this.viewContainerRef = viewContainerRef;
3272
- this.service = service;
3273
- this.el = el;
3274
- this._document = _document;
3275
- this.position = 'left';
3276
- }
3277
- DrDropdownDirective.prototype.elementHover = function () {
3278
- if (!this.drDropdownInHover)
3279
- return;
3280
- this.openDropdown();
3281
- };
3282
- DrDropdownDirective.prototype.elementClick = function () {
3283
- this.openDropdown();
3284
- };
3285
- DrDropdownDirective.prototype.documentClick = function (e) {
3286
- this.closeDropdown(e);
3287
- };
3288
- DrDropdownDirective.prototype.openDropdown = function () {
3289
- var option = this.el.nativeElement.getBoundingClientRect();
3290
- this._document.querySelectorAll('dr-dropdown').forEach(function (item) { return item.remove(); });
3291
- if (this.contentCmpRef && this.contentCmpRef.destroyCbs) {
3292
- this.contentCmpRef.destroy();
3293
- this.contentCmpRef = null;
3294
- }
3295
- else {
3296
- this.service.destroy();
3297
- this.showMenu({
3298
- option: option,
3299
- drDropdownInHover: this.drDropdownInHover,
3300
- position: this.position,
3301
- list: this.drDropdown,
3302
- class: this.drDropdownClass
3303
- });
3304
- }
3305
- };
3306
- DrDropdownDirective.prototype.closeDropdown = function (e) {
3307
- var menuItem = e.target.classList;
3308
- if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
3309
- return;
3310
- }
3311
- var elems = this._document.querySelectorAll('dr-dropdown');
3312
- if (!e.target.contains(this.el.nativeElement) && this.contentCmpRef || elems.length && !e.target.contains(this.el.nativeElement)) {
3313
- setTimeout(function () { return elems.forEach(function (item) { return item.remove(); }); }, 100);
3314
- }
3315
- };
3316
- DrDropdownDirective.prototype.showMenu = function (options) {
3317
- var componentFactory;
3318
- componentFactory = this.componentFactoryResolver.resolveComponentFactory(DrDropdownComponent);
3319
- this.contentCmpRef = this.viewContainerRef.createComponent(componentFactory);
3320
- this.service.addMenu = this.contentCmpRef;
3321
- this._document.querySelector('nb-layout').appendChild(this.contentCmpRef.location.nativeElement);
3322
- this.contentCmpRef.instance.options = options;
3323
- };
3324
- DrDropdownDirective.prototype.ngOnDestroy = function () {
3325
- if (this.contentCmpRef) {
3326
- this.contentCmpRef.destroy();
3327
- }
3328
- };
3329
- return DrDropdownDirective;
3330
- }());
3331
- DrDropdownDirective.decorators = [
3332
- { type: i0.Directive, args: [{
3333
- selector: '[drDropdown]'
3334
- },] }
3335
- ];
3336
- DrDropdownDirective.ctorParameters = function () { return [
3337
- { type: i0.ComponentFactoryResolver },
3338
- { type: i0.ViewContainerRef },
3339
- { type: DrDropdownService },
3340
- { type: i0.ElementRef },
3341
- { type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
3342
- ]; };
3343
- DrDropdownDirective.propDecorators = {
3344
- position: [{ type: i0.Input }],
3345
- drDropdown: [{ type: i0.Input }],
3346
- drDropdownClass: [{ type: i0.Input }],
3347
- drDropdownInHover: [{ type: i0.Input }],
3348
- contentCmpRef: [{ type: i0.ViewChild, args: [DrDropdownComponent, { static: true, read: i0.ViewContainerRef },] }],
3349
- elementHover: [{ type: i0.HostListener, args: ['mouseenter',] }],
3350
- elementClick: [{ type: i0.HostListener, args: ['click',] }],
3351
- documentClick: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
3352
- };
3353
-
3354
- var DrDropdownPositionDirective = /** @class */ (function () {
3355
- function DrDropdownPositionDirective(el, renderer) {
3356
- this.el = el;
3357
- this.renderer = renderer;
3358
- this.position = 'left';
3359
- }
3360
- DrDropdownPositionDirective.prototype.ngOnInit = function () {
3361
- setTimeout(this.calculatePosition.bind(this), 1);
2953
+ DrDropdownPositionDirective.prototype.ngOnInit = function () {
2954
+ setTimeout(this.calculatePosition.bind(this), 1);
3362
2955
  };
3363
2956
  DrDropdownPositionDirective.prototype.calculatePosition = function () {
3364
2957
  var xDifference = 0;
@@ -3436,510 +3029,1039 @@
3436
3029
  this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
3437
3030
  }
3438
3031
  };
3439
- return DrDropdownPositionDirective;
3032
+ return DrDropdownPositionDirective;
3033
+ }());
3034
+ DrDropdownPositionDirective.decorators = [
3035
+ { type: i0.Directive, args: [{
3036
+ selector: '[drDropdownPosition]',
3037
+ exportAs: 'dropdownPosition'
3038
+ },] }
3039
+ ];
3040
+ DrDropdownPositionDirective.ctorParameters = function () { return [
3041
+ { type: i0.ElementRef },
3042
+ { type: i0.Renderer2 }
3043
+ ]; };
3044
+ DrDropdownPositionDirective.propDecorators = {
3045
+ drDropdownPosition: [{ type: i0.Input }],
3046
+ position: [{ type: i0.Input }]
3047
+ };
3048
+
3049
+ var DrDropdownItemShowPipe = /** @class */ (function () {
3050
+ function DrDropdownItemShowPipe() {
3051
+ }
3052
+ DrDropdownItemShowPipe.prototype.transform = function (arr) {
3053
+ return arr.filter(function (item) { return item.show ? item.show(item.data) : true; });
3054
+ };
3055
+ return DrDropdownItemShowPipe;
3056
+ }());
3057
+ DrDropdownItemShowPipe.decorators = [
3058
+ { type: i0.Pipe, args: [{
3059
+ name: 'drDropdownItemShowPipe'
3060
+ },] }
3061
+ ];
3062
+
3063
+ var DrTabComponent = /** @class */ (function () {
3064
+ function DrTabComponent() {
3065
+ }
3066
+ DrTabComponent.prototype.ngOnInit = function () {
3067
+ };
3068
+ return DrTabComponent;
3069
+ }());
3070
+ DrTabComponent.decorators = [
3071
+ { type: i0.Component, args: [{
3072
+ selector: 'dr-tab',
3073
+ template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
3074
+ },] }
3075
+ ];
3076
+ DrTabComponent.ctorParameters = function () { return []; };
3077
+ DrTabComponent.propDecorators = {
3078
+ label: [{ type: i0.Input }],
3079
+ disabled: [{ type: i0.Input }],
3080
+ contentTemplate: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
3081
+ };
3082
+
3083
+ var DrTabsComponent = /** @class */ (function () {
3084
+ function DrTabsComponent() {
3085
+ this.selectedTab = 0;
3086
+ this.selectedTabChange = new i0.EventEmitter();
3087
+ }
3088
+ DrTabsComponent.prototype.selectedIndexChange = function ($event) {
3089
+ this.selectedTab = $event;
3090
+ this.selectedTabChange.emit($event);
3091
+ };
3092
+ return DrTabsComponent;
3093
+ }());
3094
+ DrTabsComponent.decorators = [
3095
+ { type: i0.Component, args: [{
3096
+ selector: 'dr-tabs',
3097
+ template: "<mat-tab-group disableRipple [selectedIndex]=\"selectedTab\"\n (selectedIndexChange)=\"selectedIndexChange($event)\"\n [class.with-radio]=\"withRadio\"\n [class.vertical]=\"vertical\"\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",
3098
+ styles: [":host{width:100%}:host ::ng-deep .mat-tab-group,:host ::ng-deep .mat-tab-body-wrapper{height:100%}: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:#579bf2;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:#579bf2!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-labels{flex-direction:column;padding:0;border-right:1px solid #D5DAE5}: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}: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}\n"]
3099
+ },] }
3100
+ ];
3101
+ DrTabsComponent.ctorParameters = function () { return []; };
3102
+ DrTabsComponent.propDecorators = {
3103
+ selectedTab: [{ type: i0.Input }],
3104
+ withRadio: [{ type: i0.Input }],
3105
+ vertical: [{ type: i0.Input }],
3106
+ selectedTabChange: [{ type: i0.Output }],
3107
+ tabsContentList: [{ type: i0.ContentChildren, args: [DrTabComponent,] }]
3108
+ };
3109
+
3110
+ var DrAccordionComponent = /** @class */ (function () {
3111
+ function DrAccordionComponent() {
3112
+ this.openCloseItems = new rxjs.Subject();
3113
+ this.multiValue = false;
3114
+ }
3115
+ Object.defineProperty(DrAccordionComponent.prototype, "multi", {
3116
+ /**
3117
+ * Allow multiple items to be expanded at the same time.
3118
+ */
3119
+ get: function () {
3120
+ return this.multiValue;
3121
+ },
3122
+ set: function (val) {
3123
+ this.multiValue = !!val;
3124
+ },
3125
+ enumerable: false,
3126
+ configurable: true
3127
+ });
3128
+ /**
3129
+ * Opens all enabled accordion items.
3130
+ */
3131
+ DrAccordionComponent.prototype.openAll = function () {
3132
+ if (this.multi) {
3133
+ this.openCloseItems.next(false);
3134
+ }
3135
+ };
3136
+ /**
3137
+ * Closes all enabled accordion items.
3138
+ */
3139
+ DrAccordionComponent.prototype.closeAll = function () {
3140
+ this.openCloseItems.next(true);
3141
+ };
3142
+ return DrAccordionComponent;
3143
+ }());
3144
+ DrAccordionComponent.decorators = [
3145
+ { type: i0.Component, args: [{
3146
+ selector: 'dr-accordion',
3147
+ template: '<ng-content select="dr-accordion-item"></ng-content>',
3148
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3149
+ styles: [":host{display:block;box-shadow:#2c33491a 0 5px 10px}\n"]
3150
+ },] }
3151
+ ];
3152
+ DrAccordionComponent.propDecorators = {
3153
+ multi: [{ type: i0.Input, args: ['multi',] }]
3154
+ };
3155
+
3156
+ var DrAccordionItemComponent = /** @class */ (function () {
3157
+ function DrAccordionItemComponent(accordion, cd) {
3158
+ this.accordion = accordion;
3159
+ this.cd = cd;
3160
+ /**
3161
+ * Emits whenever the expanded state of the accordion changes.
3162
+ * Primarily used to facilitate two-way binding.
3163
+ */
3164
+ this.collapsedChange = new i0.EventEmitter();
3165
+ this.accordionItemInvalidate = new rxjs.Subject();
3166
+ this.collapsedValue = true;
3167
+ this.disabledValue = false;
3168
+ this.destroy$ = new rxjs.Subject();
3169
+ }
3170
+ Object.defineProperty(DrAccordionItemComponent.prototype, "collapsed", {
3171
+ /**
3172
+ * Item is collapse (`true` by default)
3173
+ * @type {boolean}
3174
+ */
3175
+ get: function () {
3176
+ return this.collapsedValue;
3177
+ },
3178
+ set: function (val) {
3179
+ this.collapsedValue = !!val;
3180
+ this.collapsedChange.emit(this.collapsedValue);
3181
+ this.invalidate();
3182
+ },
3183
+ enumerable: false,
3184
+ configurable: true
3185
+ });
3186
+ Object.defineProperty(DrAccordionItemComponent.prototype, "expanded", {
3187
+ /**
3188
+ * Item is expanded (`false` by default)
3189
+ */
3190
+ get: function () {
3191
+ return !this.collapsed;
3192
+ },
3193
+ set: function (val) {
3194
+ this.collapsedValue = !val;
3195
+ },
3196
+ enumerable: false,
3197
+ configurable: true
3198
+ });
3199
+ Object.defineProperty(DrAccordionItemComponent.prototype, "disabled", {
3200
+ /**
3201
+ * Item is disabled and cannot be opened.
3202
+ * @type {boolean}
3203
+ */
3204
+ get: function () {
3205
+ return this.disabledValue;
3206
+ },
3207
+ set: function (val) {
3208
+ this.disabledValue = !!val;
3209
+ this.invalidate();
3210
+ },
3211
+ enumerable: false,
3212
+ configurable: true
3213
+ });
3214
+ /**
3215
+ * Open/close the item
3216
+ */
3217
+ DrAccordionItemComponent.prototype.toggle = function () {
3218
+ if (!this.disabled) {
3219
+ // we need this temporary variable as `openCloseItems.next` will change current value we need to save
3220
+ var willSet = !this.collapsed;
3221
+ if (!this.accordion.multi) {
3222
+ this.accordion.openCloseItems.next(true);
3223
+ }
3224
+ this.collapsed = willSet;
3225
+ }
3226
+ };
3227
+ /**
3228
+ * Open the item.
3229
+ */
3230
+ DrAccordionItemComponent.prototype.open = function () {
3231
+ if (!this.disabled) {
3232
+ this.collapsed = false;
3233
+ }
3234
+ };
3235
+ /**
3236
+ * Collapse the item.
3237
+ */
3238
+ DrAccordionItemComponent.prototype.close = function () {
3239
+ if (!this.disabled) {
3240
+ this.collapsed = true;
3241
+ }
3242
+ };
3243
+ DrAccordionItemComponent.prototype.ngOnInit = function () {
3244
+ var _this = this;
3245
+ this.accordion.openCloseItems
3246
+ .pipe(operators.takeUntil(this.destroy$))
3247
+ .subscribe(function (collapsed) {
3248
+ if (!_this.disabled) {
3249
+ _this.collapsed = collapsed;
3250
+ }
3251
+ });
3252
+ };
3253
+ DrAccordionItemComponent.prototype.ngOnChanges = function (changes) {
3254
+ this.accordionItemInvalidate.next(true);
3255
+ };
3256
+ DrAccordionItemComponent.prototype.ngOnDestroy = function () {
3257
+ this.destroy$.next();
3258
+ this.destroy$.complete();
3259
+ this.accordionItemInvalidate.complete();
3260
+ };
3261
+ DrAccordionItemComponent.prototype.invalidate = function () {
3262
+ this.accordionItemInvalidate.next(true);
3263
+ this.cd.markForCheck();
3264
+ };
3265
+ return DrAccordionItemComponent;
3266
+ }());
3267
+ DrAccordionItemComponent.decorators = [
3268
+ { type: i0.Component, args: [{
3269
+ selector: 'dr-accordion-item',
3270
+ template: "\n <ng-content select=\"dr-accordion-item-header\"></ng-content>\n <ng-content select=\"dr-accordion-item-body\"></ng-content>\n ",
3271
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3272
+ styles: [":host{background-color:#fff;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:16px;font-weight:400;line-height:1.25rem;display:flex;flex-direction:column}\n"]
3273
+ },] }
3274
+ ];
3275
+ DrAccordionItemComponent.ctorParameters = function () { return [
3276
+ { type: DrAccordionComponent, decorators: [{ type: i0.Host }] },
3277
+ { type: i0.ChangeDetectorRef }
3278
+ ]; };
3279
+ DrAccordionItemComponent.propDecorators = {
3280
+ collapsed: [{ type: i0.Input, args: ['collapsed',] }, { type: i0.HostBinding, args: ['class.collapsed',] }],
3281
+ expanded: [{ type: i0.Input, args: ['expanded',] }, { type: i0.HostBinding, args: ['class.expanded',] }],
3282
+ disabled: [{ type: i0.Input, args: ['disabled',] }, { type: i0.HostBinding, args: ['class.disabled',] }],
3283
+ collapsedChange: [{ type: i0.Output }]
3284
+ };
3285
+
3286
+ var DrAccordionItemHeaderComponent = /** @class */ (function () {
3287
+ function DrAccordionItemHeaderComponent(accordionItem, cd) {
3288
+ this.accordionItem = accordionItem;
3289
+ this.cd = cd;
3290
+ this.destroy$ = new rxjs.Subject();
3291
+ }
3292
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "isCollapsed", {
3293
+ get: function () {
3294
+ return this.accordionItem.collapsed;
3295
+ },
3296
+ enumerable: false,
3297
+ configurable: true
3298
+ });
3299
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "expanded", {
3300
+ get: function () {
3301
+ return !this.accordionItem.collapsed;
3302
+ },
3303
+ enumerable: false,
3304
+ configurable: true
3305
+ });
3306
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "tabbable", {
3307
+ get: function () {
3308
+ return this.accordionItem.disabled ? '-1' : '0';
3309
+ },
3310
+ enumerable: false,
3311
+ configurable: true
3312
+ });
3313
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "disabled", {
3314
+ get: function () {
3315
+ return this.accordionItem.disabled;
3316
+ },
3317
+ enumerable: false,
3318
+ configurable: true
3319
+ });
3320
+ DrAccordionItemHeaderComponent.prototype.toggle = function () {
3321
+ this.accordionItem.toggle();
3322
+ };
3323
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "state", {
3324
+ get: function () {
3325
+ if (this.isCollapsed) {
3326
+ return 'collapsed';
3327
+ }
3328
+ return 'expanded';
3329
+ },
3330
+ enumerable: false,
3331
+ configurable: true
3332
+ });
3333
+ DrAccordionItemHeaderComponent.prototype.ngOnInit = function () {
3334
+ var _this = this;
3335
+ this.accordionItem.accordionItemInvalidate
3336
+ .pipe(operators.takeUntil(this.destroy$))
3337
+ .subscribe(function () { return _this.cd.markForCheck(); });
3338
+ };
3339
+ DrAccordionItemHeaderComponent.prototype.ngOnDestroy = function () {
3340
+ this.destroy$.next();
3341
+ this.destroy$.complete();
3342
+ };
3343
+ return DrAccordionItemHeaderComponent;
3344
+ }());
3345
+ DrAccordionItemHeaderComponent.decorators = [
3346
+ { type: i0.Component, args: [{
3347
+ selector: 'dr-accordion-item-header',
3348
+ template: "\n <ng-content select=\"dr-accordion-item-title\"></ng-content>\n <ng-content select=\"dr-accordion-item-description\"></ng-content>\n <ng-content></ng-content>\n <i class=\"dr-icon-arrow-down expansion-indicator\"\n [@expansionIndicator]=\"state\"\n *ngIf=\"!disabled\">\n </i>\n ",
3349
+ animations: [
3350
+ animations.trigger('expansionIndicator', [
3351
+ animations.state('expanded', animations.style({
3352
+ transform: 'rotate(180deg)',
3353
+ })),
3354
+ animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3355
+ animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3356
+ ]),
3357
+ ],
3358
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3359
+ styles: [":host{display:flex;align-items:center;cursor:pointer;position:relative;border-bottom:1px solid #edf1f7;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:13px;font-weight:600;line-height:1.5rem;padding:1.25rem;text-transform:capitalize}:host:focus{outline:0}:host .expansion-indicator{font-size:24px;position:absolute;right:10px;font-weight:700}\n"]
3360
+ },] }
3361
+ ];
3362
+ DrAccordionItemHeaderComponent.ctorParameters = function () { return [
3363
+ { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3364
+ { type: i0.ChangeDetectorRef }
3365
+ ]; };
3366
+ DrAccordionItemHeaderComponent.propDecorators = {
3367
+ isCollapsed: [{ type: i0.HostBinding, args: ['class.accordion-item-header-collapsed',] }],
3368
+ expanded: [{ type: i0.HostBinding, args: ['class.accordion-item-header-expanded',] }, { type: i0.HostBinding, args: ['attr.aria-expanded',] }],
3369
+ tabbable: [{ type: i0.HostBinding, args: ['attr.tabindex',] }],
3370
+ disabled: [{ type: i0.HostBinding, args: ['attr.aria-disabled',] }],
3371
+ toggle: [{ type: i0.HostListener, args: ['click',] }, { type: i0.HostListener, args: ['keydown.space',] }, { type: i0.HostListener, args: ['keydown.enter',] }]
3372
+ };
3373
+
3374
+ var accordionItemBodyTrigger = animations.trigger('accordionItemBody', [
3375
+ animations.state('collapsed', animations.style({
3376
+ overflow: 'hidden',
3377
+ visibility: 'hidden',
3378
+ height: 0,
3379
+ })),
3380
+ animations.state('expanded', animations.style({
3381
+ overflow: 'hidden',
3382
+ visibility: 'visible',
3383
+ })),
3384
+ animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3385
+ animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3386
+ ]);
3387
+ var DrAccordionItemBodyComponent = /** @class */ (function () {
3388
+ function DrAccordionItemBodyComponent(accordionItem, cd) {
3389
+ this.accordionItem = accordionItem;
3390
+ this.cd = cd;
3391
+ this.destroy$ = new rxjs.Subject();
3392
+ }
3393
+ Object.defineProperty(DrAccordionItemBodyComponent.prototype, "state", {
3394
+ get: function () {
3395
+ return this.accordionItem.collapsed ? 'collapsed' : 'expanded';
3396
+ },
3397
+ enumerable: false,
3398
+ configurable: true
3399
+ });
3400
+ DrAccordionItemBodyComponent.prototype.ngOnInit = function () {
3401
+ var _this = this;
3402
+ this.accordionItem.accordionItemInvalidate
3403
+ .pipe(operators.takeUntil(this.destroy$))
3404
+ .subscribe(function () { return _this.cd.markForCheck(); });
3405
+ };
3406
+ DrAccordionItemBodyComponent.prototype.ngOnDestroy = function () {
3407
+ this.destroy$.next();
3408
+ this.destroy$.complete();
3409
+ };
3410
+ return DrAccordionItemBodyComponent;
3411
+ }());
3412
+ DrAccordionItemBodyComponent.decorators = [
3413
+ { type: i0.Component, args: [{
3414
+ selector: 'dr-accordion-item-body',
3415
+ template: "\n <div [@accordionItemBody]=\"{ value: state }\">\n <div class=\"item-body\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
3416
+ animations: [accordionItemBodyTrigger],
3417
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3418
+ styles: [".item-body{flex:1;-ms-flex:1 1 auto;overflow:auto;position:relative}\n"]
3419
+ },] }
3420
+ ];
3421
+ DrAccordionItemBodyComponent.ctorParameters = function () { return [
3422
+ { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3423
+ { type: i0.ChangeDetectorRef }
3424
+ ]; };
3425
+
3426
+ var DrModelDebounceChangeDirective = /** @class */ (function () {
3427
+ function DrModelDebounceChangeDirective(ngModel) {
3428
+ this.ngModel = ngModel;
3429
+ this.debounce = 200;
3430
+ this.ngModelDebounceChange = new i0.EventEmitter();
3431
+ }
3432
+ DrModelDebounceChangeDirective.prototype.ngOnInit = function () {
3433
+ var _this = this;
3434
+ this.subscription = this.ngModel.control.valueChanges
3435
+ .pipe(operators.skip(1), operators.debounceTime(this.debounce), operators.distinctUntilChanged())
3436
+ .subscribe(function (value) { return _this.ngModelDebounceChange.emit(value); });
3437
+ };
3438
+ DrModelDebounceChangeDirective.prototype.ngOnDestroy = function () {
3439
+ this.subscription.unsubscribe();
3440
+ };
3441
+ return DrModelDebounceChangeDirective;
3440
3442
  }());
3441
- DrDropdownPositionDirective.decorators = [
3443
+ DrModelDebounceChangeDirective.decorators = [
3442
3444
  { type: i0.Directive, args: [{
3443
- selector: '[drDropdownPosition]',
3444
- exportAs: 'dropdownPosition'
3445
+ selector: '[ngModelDebounceChange]'
3445
3446
  },] }
3446
3447
  ];
3447
- DrDropdownPositionDirective.ctorParameters = function () { return [
3448
- { type: i0.ElementRef },
3449
- { type: i0.Renderer2 }
3448
+ DrModelDebounceChangeDirective.ctorParameters = function () { return [
3449
+ { type: forms.NgModel }
3450
3450
  ]; };
3451
- DrDropdownPositionDirective.propDecorators = {
3452
- drDropdownPosition: [{ type: i0.Input }],
3453
- position: [{ type: i0.Input }]
3451
+ DrModelDebounceChangeDirective.propDecorators = {
3452
+ debounce: [{ type: i0.Input }],
3453
+ ngModelDebounceChange: [{ type: i0.Output }]
3454
3454
  };
3455
3455
 
3456
- var DrDropdownItemShowPipe = /** @class */ (function () {
3457
- function DrDropdownItemShowPipe() {
3456
+ var MAT_DEFAULT_DATE_FORMAT = 'MM/DD/yyyy';
3457
+ var DATE_INPUT_FORMAT = 'YYYY/MM/DD';
3458
+ var YEAR_FORMAT = 'yyyy';
3459
+ var MONTH_YEAR_FORMAT = 'MM/yyyy';
3460
+ var QUARTER_FORMAT = 'Q/yyyy';
3461
+ var CustomDateFormat = /** @class */ (function () {
3462
+ function CustomDateFormat() {
3463
+ this._parse = {
3464
+ dateInput: DATE_INPUT_FORMAT
3465
+ };
3466
+ this._display = {
3467
+ dateInput: DATE_INPUT_FORMAT,
3468
+ monthYearLabel: 'MMM YYYY',
3469
+ dateA11yLabel: 'LL',
3470
+ monthYearA11yLabel: 'MMM YYYY',
3471
+ quarterYearLabel: 'Q/YYYY',
3472
+ yearLabel: 'YYYY'
3473
+ };
3458
3474
  }
3459
- DrDropdownItemShowPipe.prototype.transform = function (arr) {
3460
- return arr.filter(function (item) { return item.show ? item.show(item.data) : true; });
3475
+ Object.defineProperty(CustomDateFormat.prototype, "parse", {
3476
+ get: function () {
3477
+ return this._parse;
3478
+ },
3479
+ set: function (parse) {
3480
+ this._parse = Object.assign({}, this._parse, parse);
3481
+ },
3482
+ enumerable: false,
3483
+ configurable: true
3484
+ });
3485
+ Object.defineProperty(CustomDateFormat.prototype, "display", {
3486
+ get: function () {
3487
+ return this._display;
3488
+ },
3489
+ set: function (display) {
3490
+ this._display = Object.assign({}, this._display, display);
3491
+ },
3492
+ enumerable: false,
3493
+ configurable: true
3494
+ });
3495
+ CustomDateFormat.prototype.updateDateFormat = function (parse, display) {
3496
+ this.parse = parse;
3497
+ if (!display) {
3498
+ display = parse;
3499
+ }
3500
+ this.display = display;
3461
3501
  };
3462
- return DrDropdownItemShowPipe;
3502
+ return CustomDateFormat;
3463
3503
  }());
3464
- DrDropdownItemShowPipe.decorators = [
3465
- { type: i0.Pipe, args: [{
3466
- name: 'drDropdownItemShowPipe'
3504
+ exports.DatePickerPeriodPosition = void 0;
3505
+ (function (DatePickerPeriodPosition) {
3506
+ DatePickerPeriodPosition[DatePickerPeriodPosition["END_OF_PERIOD"] = 0] = "END_OF_PERIOD";
3507
+ DatePickerPeriodPosition[DatePickerPeriodPosition["MIDDLE_OF_PERIOD"] = 1] = "MIDDLE_OF_PERIOD";
3508
+ DatePickerPeriodPosition[DatePickerPeriodPosition["START_OF_PERIOD"] = 2] = "START_OF_PERIOD";
3509
+ DatePickerPeriodPosition[DatePickerPeriodPosition["DEFAULT"] = 3] = "DEFAULT";
3510
+ })(exports.DatePickerPeriodPosition || (exports.DatePickerPeriodPosition = {}));
3511
+
3512
+ var components$2 = [DateTagComponent,
3513
+ DayTagComponent,
3514
+ WeekTagComponent,
3515
+ MonthTagComponent,
3516
+ QuarterTagComponent,
3517
+ AnyTagComponent,
3518
+ YearTagComponent,
3519
+ ForecastTagComponent];
3520
+ var ɵ0$1 = { useUtc: true };
3521
+ var DateTagModule = /** @class */ (function () {
3522
+ function DateTagModule() {
3523
+ }
3524
+ return DateTagModule;
3525
+ }());
3526
+ DateTagModule.decorators = [
3527
+ { type: i0.NgModule, args: [{
3528
+ imports: [
3529
+ common.CommonModule,
3530
+ core.MatNativeDateModule,
3531
+ datepicker.MatDatepickerModule,
3532
+ forms.FormsModule,
3533
+ formField.MatFormFieldModule,
3534
+ forms.ReactiveFormsModule,
3535
+ input.MatInputModule,
3536
+ materialMomentAdapter.MatMomentDateModule,
3537
+ select.MatSelectModule
3538
+ ],
3539
+ exports: components$2,
3540
+ providers: [
3541
+ { provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$1 }
3542
+ ],
3543
+ declarations: components$2,
3467
3544
  },] }
3468
3545
  ];
3546
+ ;
3469
3547
 
3470
- var DrTabComponent = /** @class */ (function () {
3471
- function DrTabComponent() {
3548
+ var ListTagModule = /** @class */ (function () {
3549
+ function ListTagModule() {
3472
3550
  }
3473
- DrTabComponent.prototype.ngOnInit = function () {
3474
- };
3475
- return DrTabComponent;
3551
+ return ListTagModule;
3476
3552
  }());
3477
- DrTabComponent.decorators = [
3478
- { type: i0.Component, args: [{
3479
- selector: 'dr-tab',
3480
- template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
3553
+ ListTagModule.decorators = [
3554
+ { type: i0.NgModule, args: [{
3555
+ imports: [
3556
+ common.CommonModule,
3557
+ forms.FormsModule,
3558
+ formField.MatFormFieldModule,
3559
+ forms.ReactiveFormsModule,
3560
+ materialMomentAdapter.MatMomentDateModule,
3561
+ select.MatSelectModule,
3562
+ buttonToggle.MatButtonToggleModule,
3563
+ ],
3564
+ exports: [ListTagComponent],
3565
+ providers: [],
3566
+ declarations: [
3567
+ ListTagComponent
3568
+ ],
3481
3569
  },] }
3482
3570
  ];
3483
- DrTabComponent.ctorParameters = function () { return []; };
3484
- DrTabComponent.propDecorators = {
3485
- label: [{ type: i0.Input }],
3486
- disabled: [{ type: i0.Input }],
3487
- contentTemplate: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
3488
- };
3489
3571
 
3490
- var DrTabsComponent = /** @class */ (function () {
3491
- function DrTabsComponent() {
3492
- this.selectedTab = 0;
3493
- this.selectedTabChange = new i0.EventEmitter();
3572
+ var DrTagModule = /** @class */ (function () {
3573
+ function DrTagModule() {
3494
3574
  }
3495
- DrTabsComponent.prototype.selectedIndexChange = function ($event) {
3496
- this.selectedTab = $event;
3497
- this.selectedTabChange.emit($event);
3498
- };
3499
- return DrTabsComponent;
3575
+ return DrTagModule;
3500
3576
  }());
3501
- DrTabsComponent.decorators = [
3502
- { type: i0.Component, args: [{
3503
- selector: 'dr-tabs',
3504
- template: "<mat-tab-group disableRipple [selectedIndex]=\"selectedTab\"\n (selectedIndexChange)=\"selectedIndexChange($event)\"\n [class.with-radio]=\"withRadio\"\n [class.vertical]=\"vertical\"\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",
3505
- styles: [":host{width:100%}:host ::ng-deep .mat-tab-group,:host ::ng-deep .mat-tab-body-wrapper{height:100%}: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:#579bf2;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:#579bf2!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-labels{flex-direction:column;padding:0;border-right:1px solid #D5DAE5}: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}: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}\n"]
3577
+ DrTagModule.decorators = [
3578
+ { type: i0.NgModule, args: [{
3579
+ imports: [
3580
+ common.CommonModule,
3581
+ DateTagModule,
3582
+ ListTagModule
3583
+ ],
3584
+ exports: [DrTagComponent],
3585
+ providers: [],
3586
+ declarations: [
3587
+ DrTagComponent
3588
+ ],
3506
3589
  },] }
3507
3590
  ];
3508
- DrTabsComponent.ctorParameters = function () { return []; };
3509
- DrTabsComponent.propDecorators = {
3510
- selectedTab: [{ type: i0.Input }],
3511
- withRadio: [{ type: i0.Input }],
3512
- vertical: [{ type: i0.Input }],
3513
- selectedTabChange: [{ type: i0.Output }],
3514
- tabsContentList: [{ type: i0.ContentChildren, args: [DrTabComponent,] }]
3515
- };
3516
3591
 
3517
- var DrAccordionComponent = /** @class */ (function () {
3518
- function DrAccordionComponent() {
3519
- this.openCloseItems = new rxjs.Subject();
3520
- this.multiValue = false;
3592
+ var moment$2 = require('moment');
3593
+ var DrDatePickerService = /** @class */ (function () {
3594
+ function DrDatePickerService() {
3595
+ this.isTimeframeSelectionEnabled = false;
3596
+ this.timeframe = 'day';
3597
+ this.format$ = new rxjs.BehaviorSubject(MAT_DEFAULT_DATE_FORMAT);
3598
+ this.updatedQuarter$ = new rxjs.Subject();
3599
+ this.formatConfig = {
3600
+ day: MAT_DEFAULT_DATE_FORMAT,
3601
+ month: MONTH_YEAR_FORMAT,
3602
+ year: YEAR_FORMAT,
3603
+ quarter: QUARTER_FORMAT,
3604
+ };
3605
+ }
3606
+ DrDatePickerService.prototype.getQuarterDisplay = function (value) {
3607
+ return 'Q' + moment$2(value).quarter() + this.format$.getValue().charAt(1) + moment$2(value).year();
3608
+ };
3609
+ DrDatePickerService.prototype.getTimeframe = function (format) {
3610
+ var defaultFrame = 'day';
3611
+ if (!format) {
3612
+ return defaultFrame;
3613
+ }
3614
+ var lowerCaseFormat = format.toLowerCase();
3615
+ switch (true) {
3616
+ case lowerCaseFormat.includes('q'):
3617
+ return 'quarter';
3618
+ case lowerCaseFormat.includes('d'):
3619
+ return 'day';
3620
+ case lowerCaseFormat.includes('m'):
3621
+ return 'month';
3622
+ case lowerCaseFormat.includes('y'):
3623
+ return 'year';
3624
+ default:
3625
+ return defaultFrame;
3626
+ }
3627
+ };
3628
+ DrDatePickerService.prototype.getConfiguredFormat = function (timeframe) {
3629
+ return this.formatConfig[timeframe];
3630
+ };
3631
+ DrDatePickerService.prototype.updateTimeframeAndFormat = function (format) {
3632
+ var normalizedFormat = this.normalizeValue(format || this.format$.getValue());
3633
+ this.timeframe = this.getTimeframe(normalizedFormat);
3634
+ this.format$.next(this.getConfiguredFormat(this.timeframe));
3635
+ };
3636
+ DrDatePickerService.prototype.normalizeValue = function (value) {
3637
+ return value.replace(/d/g, 'D');
3638
+ };
3639
+ return DrDatePickerService;
3640
+ }());
3641
+ DrDatePickerService.decorators = [
3642
+ { type: i0.Injectable }
3643
+ ];
3644
+
3645
+ var moment$1 = require('moment');
3646
+ var DrDatePickerCustomHeaderComponent = /** @class */ (function () {
3647
+ function DrDatePickerCustomHeaderComponent(_calendar, _dateAdapter, _dateFormats, cdr, datePickerService) {
3648
+ var _this = this;
3649
+ this._calendar = _calendar;
3650
+ this._dateAdapter = _dateAdapter;
3651
+ this._dateFormats = _dateFormats;
3652
+ this.cdr = cdr;
3653
+ this.datePickerService = datePickerService;
3654
+ this._destroyed = new rxjs.Subject();
3655
+ this.quarters = [1, 2, 3, 4];
3656
+ this.selectedQuarter = 1;
3657
+ this.timeframeOptions = [{
3658
+ title: 'Day',
3659
+ value: 'month',
3660
+ format: this.datePickerService.formatConfig.day,
3661
+ periodLabel: function () { return _this._dateAdapter
3662
+ .format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
3663
+ .toLocaleUpperCase(); }
3664
+ }, {
3665
+ title: 'Month',
3666
+ value: 'year',
3667
+ format: this.datePickerService.formatConfig.month,
3668
+ periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
3669
+ }, {
3670
+ title: 'Quarter',
3671
+ value: 'none',
3672
+ format: this.datePickerService.formatConfig.quarter,
3673
+ periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
3674
+ }, {
3675
+ title: 'Year',
3676
+ value: 'multi-year',
3677
+ format: this.datePickerService.formatConfig.year,
3678
+ periodLabel: function () {
3679
+ var currentYear = moment$1(_this._calendar.activeDate).year();
3680
+ var startPeriod = Math.floor(currentYear / 24) * 24;
3681
+ return startPeriod + '-' + (startPeriod + 23);
3682
+ }
3683
+ }];
3684
+ this.pagingSetup = {
3685
+ 'year': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
3686
+ 'none': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
3687
+ 'month': function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
3688
+ 'multi-year': function (forward) { return _this.pagingDateChange('addCalendarYears', 24, forward); }
3689
+ };
3690
+ this.selectedTimeframe = 'month';
3691
+ this.timeframeSelection = false;
3692
+ this.periodMonthLabel = '';
3693
+ this.periodYearLabel = '';
3694
+ _calendar.stateChanges.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
3695
+ this.datePickerService.format$
3696
+ .pipe(operators.take(1))
3697
+ .subscribe(function (value) {
3698
+ _this.selectedTimeframe = _this.timeframeOptions.filter(function (option) { return option.format == value; })[0].value;
3699
+ _this.setPeriodLabels();
3700
+ });
3701
+ _calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
3521
3702
  }
3522
- Object.defineProperty(DrAccordionComponent.prototype, "multi", {
3523
- /**
3524
- * Allow multiple items to be expanded at the same time.
3525
- */
3703
+ DrDatePickerCustomHeaderComponent.prototype.ngOnDestroy = function () {
3704
+ this._destroyed.next();
3705
+ this._destroyed.complete();
3706
+ };
3707
+ DrDatePickerCustomHeaderComponent.prototype.setPeriodLabels = function () {
3708
+ var _this = this;
3709
+ var currentTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this._calendar.currentView; })[0];
3710
+ var fullPeriodLabel = currentTimeframeOption.periodLabel();
3711
+ if (this._calendar.currentView === 'month') {
3712
+ this.periodMonthLabel = fullPeriodLabel.slice(0, 3);
3713
+ this.periodYearLabel = fullPeriodLabel.slice(4);
3714
+ }
3715
+ else {
3716
+ this.periodMonthLabel = '';
3717
+ this.periodYearLabel = fullPeriodLabel;
3718
+ }
3719
+ this.cdr.markForCheck();
3720
+ };
3721
+ DrDatePickerCustomHeaderComponent.prototype.setTimeframe = function () {
3722
+ var _this = this;
3723
+ this.timeframeSelection = false;
3724
+ this._calendar.currentView = this.selectedTimeframe;
3725
+ var chosenTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this.selectedTimeframe; })[0];
3726
+ this.datePickerService.updateTimeframeAndFormat(chosenTimeframeOption.format);
3727
+ if (this.selectedTimeframe == 'none') {
3728
+ this.selectedQuarter = moment$1(this._calendar.activeDate).quarter();
3729
+ }
3730
+ };
3731
+ Object.defineProperty(DrDatePickerCustomHeaderComponent.prototype, "currentViewIsQuarter", {
3526
3732
  get: function () {
3527
- return this.multiValue;
3528
- },
3529
- set: function (val) {
3530
- this.multiValue = !!val;
3733
+ return !['month', 'year', 'multi-year'].includes(this._calendar.currentView);
3531
3734
  },
3532
3735
  enumerable: false,
3533
3736
  configurable: true
3534
3737
  });
3535
- /**
3536
- * Opens all enabled accordion items.
3537
- */
3538
- DrAccordionComponent.prototype.openAll = function () {
3539
- if (this.multi) {
3540
- this.openCloseItems.next(false);
3541
- }
3738
+ DrDatePickerCustomHeaderComponent.prototype.switchViewOnClickOnPeriodLabel = function (view) {
3739
+ this._calendar.currentView = view;
3542
3740
  };
3543
- /**
3544
- * Closes all enabled accordion items.
3545
- */
3546
- DrAccordionComponent.prototype.closeAll = function () {
3547
- this.openCloseItems.next(true);
3741
+ DrDatePickerCustomHeaderComponent.prototype.onSelectQuarter = function (quarterNumber) {
3742
+ var monthsInQuarter = 3;
3743
+ this.selectedQuarter = moment$1(this._calendar.activeDate).quarter();
3744
+ var unadaptedDate = this._dateAdapter.addCalendarMonths(this._calendar.activeDate, monthsInQuarter * (quarterNumber - this.selectedQuarter));
3745
+ this._calendar.activeDate = unadaptedDate;
3746
+ this.datePickerService.updatedQuarter$.next(moment$1(unadaptedDate));
3747
+ this.datePickerService.calendarInstance.close();
3548
3748
  };
3549
- return DrAccordionComponent;
3749
+ DrDatePickerCustomHeaderComponent.prototype.pagingClicked = function (forward) {
3750
+ this.pagingSetup[this._calendar.currentView] && this.pagingSetup[this._calendar.currentView](forward);
3751
+ };
3752
+ DrDatePickerCustomHeaderComponent.prototype.pagingDateChange = function (actionCall, amount, forward) {
3753
+ this._calendar.activeDate = this._dateAdapter[actionCall](this._calendar.activeDate, forward ? amount : -amount);
3754
+ this.setPeriodLabels();
3755
+ };
3756
+ return DrDatePickerCustomHeaderComponent;
3550
3757
  }());
3551
- DrAccordionComponent.decorators = [
3758
+ DrDatePickerCustomHeaderComponent.decorators = [
3552
3759
  { type: i0.Component, args: [{
3553
- selector: 'dr-accordion',
3554
- template: '<ng-content select="dr-accordion-item"></ng-content>',
3760
+ selector: 'dr-date-picker_custom-header.component',
3761
+ template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [(ngModel)]=\"selectedTimeframe\"\n [items]=\"timeframeOptions\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe()\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel('year')\">{{periodMonthLabel + ' '}}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel('multi-year')\">{{periodYearLabel}}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter == selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n",
3555
3762
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3556
- styles: [":host{display:block;box-shadow:#2c33491a 0 5px 10px}\n"]
3763
+ styles: [":host{height:54px;align-items:center;font-family:\"Poppins\";font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 8px;grid-gap:4px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#F2F2FB;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#F2F2FB;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"]
3557
3764
  },] }
3558
3765
  ];
3559
- DrAccordionComponent.propDecorators = {
3560
- multi: [{ type: i0.Input, args: ['multi',] }]
3561
- };
3766
+ DrDatePickerCustomHeaderComponent.ctorParameters = function () { return [
3767
+ { type: datepicker.MatCalendar },
3768
+ { type: core.DateAdapter },
3769
+ { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
3770
+ { type: i0.ChangeDetectorRef },
3771
+ { type: DrDatePickerService }
3772
+ ]; };
3562
3773
 
3563
- var DrAccordionItemComponent = /** @class */ (function () {
3564
- function DrAccordionItemComponent(accordion, cd) {
3565
- this.accordion = accordion;
3566
- this.cd = cd;
3567
- /**
3568
- * Emits whenever the expanded state of the accordion changes.
3569
- * Primarily used to facilitate two-way binding.
3570
- */
3571
- this.collapsedChange = new i0.EventEmitter();
3572
- this.accordionItemInvalidate = new rxjs.Subject();
3573
- this.collapsedValue = true;
3574
- this.disabledValue = false;
3575
- this.destroy$ = new rxjs.Subject();
3774
+ var moment = require('moment');
3775
+ var noop = function () { };
3776
+ var ɵ0 = noop;
3777
+ var DrDatePickerComponent = /** @class */ (function () {
3778
+ function DrDatePickerComponent(cdr, dateAdapter, datePickerService) {
3779
+ var _this = this;
3780
+ this.cdr = cdr;
3781
+ this.dateAdapter = dateAdapter;
3782
+ this.datePickerService = datePickerService;
3783
+ // Whether to transform date, taking end, start, middle of preiod (i.e. set middle of month if timeframe='month')
3784
+ this.periodPosition = exports.DatePickerPeriodPosition.DEFAULT;
3785
+ this.placeholder = 'Select';
3786
+ this.calendarViewsTimeframeMapping = {
3787
+ year: 'multi-year',
3788
+ month: 'year',
3789
+ quarter: 'none',
3790
+ day: 'month',
3791
+ };
3792
+ this.customHeader = DrDatePickerCustomHeaderComponent;
3793
+ this.readonly = true;
3794
+ this.innerValue = null;
3795
+ this.destroyed$ = new rxjs.Subject();
3796
+ this.onTouchedCallback = noop;
3797
+ this.onChangeCallback = noop;
3798
+ datePickerService.updatedQuarter$
3799
+ .pipe(operators.takeUntil(this.destroyed$))
3800
+ .subscribe(function (value) {
3801
+ _this.setValueFromMoment(value);
3802
+ });
3576
3803
  }
3577
- Object.defineProperty(DrAccordionItemComponent.prototype, "collapsed", {
3578
- /**
3579
- * Item is collapse (`true` by default)
3580
- * @type {boolean}
3581
- */
3582
- get: function () {
3583
- return this.collapsedValue;
3584
- },
3585
- set: function (val) {
3586
- this.collapsedValue = !!val;
3587
- this.collapsedChange.emit(this.collapsedValue);
3588
- this.invalidate();
3804
+ Object.defineProperty(DrDatePickerComponent.prototype, "format", {
3805
+ set: function (value) {
3806
+ this.datePickerService.updateTimeframeAndFormat(value);
3589
3807
  },
3590
3808
  enumerable: false,
3591
3809
  configurable: true
3592
3810
  });
3593
- Object.defineProperty(DrAccordionItemComponent.prototype, "expanded", {
3594
- /**
3595
- * Item is expanded (`false` by default)
3596
- */
3597
- get: function () {
3598
- return !this.collapsed;
3811
+ Object.defineProperty(DrDatePickerComponent.prototype, "min", {
3812
+ set: function (minDate) {
3813
+ this._min = moment.unix(minDate);
3599
3814
  },
3600
- set: function (val) {
3601
- this.collapsedValue = !val;
3815
+ enumerable: false,
3816
+ configurable: true
3817
+ });
3818
+ Object.defineProperty(DrDatePickerComponent.prototype, "max", {
3819
+ set: function (maxDate) {
3820
+ this._max = moment.unix(maxDate);
3602
3821
  },
3603
3822
  enumerable: false,
3604
3823
  configurable: true
3605
3824
  });
3606
- Object.defineProperty(DrAccordionItemComponent.prototype, "disabled", {
3607
- /**
3608
- * Item is disabled and cannot be opened.
3609
- * @type {boolean}
3610
- */
3825
+ Object.defineProperty(DrDatePickerComponent.prototype, "value", {
3611
3826
  get: function () {
3612
- return this.disabledValue;
3827
+ return this.innerValue;
3613
3828
  },
3614
- set: function (val) {
3615
- this.disabledValue = !!val;
3616
- this.invalidate();
3829
+ set: function (v) {
3830
+ if (v !== this.innerValue) {
3831
+ this.setValueFromMoment(v);
3832
+ }
3833
+ this.cdr.markForCheck();
3617
3834
  },
3618
3835
  enumerable: false,
3619
3836
  configurable: true
3620
3837
  });
3838
+ DrDatePickerComponent.prototype.ngAfterViewInit = function () {
3839
+ this.datePickerService.calendarInstance = this.dp;
3840
+ this.dp.startView = this.calendarViewsTimeframeMapping[this.datePickerService.timeframe];
3841
+ };
3842
+ DrDatePickerComponent.prototype.ngOnDestroy = function () {
3843
+ this.destroyed$.next();
3844
+ this.destroyed$.complete();
3845
+ };
3621
3846
  /**
3622
- * Open/close the item
3847
+ * Updating component inner value according to datepicker timeframe (day, month etc.)
3848
+ * and date position in period (start, end, middle)
3623
3849
  */
3624
- DrAccordionItemComponent.prototype.toggle = function () {
3625
- if (!this.disabled) {
3626
- // we need this temporary variable as `openCloseItems.next` will change current value we need to save
3627
- var willSet = !this.collapsed;
3628
- if (!this.accordion.multi) {
3629
- this.accordion.openCloseItems.next(true);
3630
- }
3631
- this.collapsed = willSet;
3850
+ DrDatePickerComponent.prototype.tryToNormalaizeTimeframe = function () {
3851
+ var timeframe = this.datePickerService.timeframe;
3852
+ switch (this.periodPosition) {
3853
+ case exports.DatePickerPeriodPosition.START_OF_PERIOD:
3854
+ this.innerValue.startOf(timeframe);
3855
+ break;
3856
+ case exports.DatePickerPeriodPosition.END_OF_PERIOD:
3857
+ this.innerValue.endOf(timeframe);
3858
+ break;
3859
+ case exports.DatePickerPeriodPosition.MIDDLE_OF_PERIOD:
3860
+ this.innerValue.startOf(timeframe);
3861
+ var endOfPeriod = this.innerValue.clone().endOf(timeframe);
3862
+ var diff = endOfPeriod.diff(this.innerValue, 'seconds');
3863
+ this.innerValue.add(diff / 2 + 1, 'seconds');
3864
+ break;
3865
+ default:
3866
+ this.innerValue.startOf(timeframe);
3867
+ break;
3632
3868
  }
3633
3869
  };
3634
- /**
3635
- * Open the item.
3636
- */
3637
- DrAccordionItemComponent.prototype.open = function () {
3638
- if (!this.disabled) {
3639
- this.collapsed = false;
3870
+ DrDatePickerComponent.prototype.chosenPeriodHandler = function (chosenDate, timeframe) {
3871
+ if (this.datePickerService.timeframe === timeframe) {
3872
+ this.setValueFromMoment(chosenDate);
3873
+ this.dp.close();
3640
3874
  }
3641
3875
  };
3642
3876
  /**
3643
- * Collapse the item.
3877
+ * Setting value from outside of component via ngModel or formControl updates
3644
3878
  */
3645
- DrAccordionItemComponent.prototype.close = function () {
3646
- if (!this.disabled) {
3647
- this.collapsed = true;
3879
+ DrDatePickerComponent.prototype.writeValue = function (value) {
3880
+ this.innerValue = value ? moment.unix(value) : value;
3881
+ if (this.innerValue) {
3882
+ this.tryToNormalaizeTimeframe();
3648
3883
  }
3884
+ this.cdr.markForCheck();
3649
3885
  };
3650
- DrAccordionItemComponent.prototype.ngOnInit = function () {
3651
- var _this = this;
3652
- this.accordion.openCloseItems
3653
- .pipe(operators.takeUntil(this.destroy$))
3654
- .subscribe(function (collapsed) {
3655
- if (!_this.disabled) {
3656
- _this.collapsed = collapsed;
3657
- }
3658
- });
3886
+ DrDatePickerComponent.prototype.registerOnChange = function (fn) {
3887
+ this.onChangeCallback = fn;
3659
3888
  };
3660
- DrAccordionItemComponent.prototype.ngOnChanges = function (changes) {
3661
- this.accordionItemInvalidate.next(true);
3889
+ DrDatePickerComponent.prototype.registerOnTouched = function (fn) {
3890
+ this.onTouchedCallback = fn;
3662
3891
  };
3663
- DrAccordionItemComponent.prototype.ngOnDestroy = function () {
3664
- this.destroy$.next();
3665
- this.destroy$.complete();
3666
- this.accordionItemInvalidate.complete();
3892
+ /**
3893
+ * Set inner value from Moment and propagate
3894
+ * @param momentDate
3895
+ */
3896
+ DrDatePickerComponent.prototype.setValueFromMoment = function (momentDate) {
3897
+ this.setValue(momentDate.unix());
3667
3898
  };
3668
- DrAccordionItemComponent.prototype.invalidate = function () {
3669
- this.accordionItemInvalidate.next(true);
3670
- this.cd.markForCheck();
3899
+ /**
3900
+ * Set inner value from timestamp and propagate
3901
+ * @param timestamp
3902
+ */
3903
+ DrDatePickerComponent.prototype.setValue = function (timestamp) {
3904
+ this.writeValue(timestamp);
3905
+ this.onChangeCallback(this.innerValue.unix());
3671
3906
  };
3672
- return DrAccordionItemComponent;
3907
+ return DrDatePickerComponent;
3673
3908
  }());
3674
- DrAccordionItemComponent.decorators = [
3909
+ DrDatePickerComponent.decorators = [
3675
3910
  { type: i0.Component, args: [{
3676
- selector: 'dr-accordion-item',
3677
- template: "\n <ng-content select=\"dr-accordion-item-header\"></ng-content>\n <ng-content select=\"dr-accordion-item-body\"></ng-content>\n ",
3911
+ selector: 'dr-date-picker',
3912
+ template: "<i class=\"dr-icon-schedule\"></i>\n<input [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [placeholder]=\"placeholder\"\n [drDatePickerFormat]=\"datePickerService.format$ | async\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"/>\n<mat-datepicker #datePicker\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, 'year')\"\n (monthSelected)=\"chosenPeriodHandler($event, 'month')\">\n</mat-datepicker>\n",
3678
3913
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3679
- styles: [":host{background-color:#fff;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:16px;font-weight:400;line-height:1.25rem;display:flex;flex-direction:column}\n"]
3914
+ providers: [
3915
+ { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true },
3916
+ { provide: DrDatePickerService }
3917
+ ],
3918
+ styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#E5E6EA}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#F2F2FB;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#F3F7FF}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#F3F7FF;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#F3F7FF;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}\n"]
3680
3919
  },] }
3681
3920
  ];
3682
- DrAccordionItemComponent.ctorParameters = function () { return [
3683
- { type: DrAccordionComponent, decorators: [{ type: i0.Host }] },
3684
- { type: i0.ChangeDetectorRef }
3921
+ DrDatePickerComponent.ctorParameters = function () { return [
3922
+ { type: i0.ChangeDetectorRef },
3923
+ { type: core.DateAdapter },
3924
+ { type: DrDatePickerService }
3685
3925
  ]; };
3686
- DrAccordionItemComponent.propDecorators = {
3687
- collapsed: [{ type: i0.Input, args: ['collapsed',] }, { type: i0.HostBinding, args: ['class.collapsed',] }],
3688
- expanded: [{ type: i0.Input, args: ['expanded',] }, { type: i0.HostBinding, args: ['class.expanded',] }],
3689
- disabled: [{ type: i0.Input, args: ['disabled',] }, { type: i0.HostBinding, args: ['class.disabled',] }],
3690
- collapsedChange: [{ type: i0.Output }]
3926
+ DrDatePickerComponent.propDecorators = {
3927
+ format: [{ type: i0.Input }],
3928
+ min: [{ type: i0.Input }],
3929
+ max: [{ type: i0.Input }],
3930
+ periodPosition: [{ type: i0.Input }],
3931
+ placeholder: [{ type: i0.Input }],
3932
+ dp: [{ type: i0.ViewChild, args: ['datePicker',] }]
3691
3933
  };
3692
3934
 
3693
- var DrAccordionItemHeaderComponent = /** @class */ (function () {
3694
- function DrAccordionItemHeaderComponent(accordionItem, cd) {
3695
- this.accordionItem = accordionItem;
3696
- this.cd = cd;
3697
- this.destroy$ = new rxjs.Subject();
3935
+ var DrDatePickerWithTimeframeComponent = /** @class */ (function (_super) {
3936
+ __extends(DrDatePickerWithTimeframeComponent, _super);
3937
+ function DrDatePickerWithTimeframeComponent(cdr, dateAdapter, datePickerService) {
3938
+ var _this = _super.call(this, cdr, dateAdapter, datePickerService) || this;
3939
+ _this.cdr = cdr;
3940
+ _this.dateAdapter = dateAdapter;
3941
+ _this.datePickerService = datePickerService;
3942
+ _this.isDashboardDatepicker = false;
3943
+ _this.onChangeFormat = new i0.EventEmitter();
3944
+ _this.pagingSetup = {
3945
+ 'year': function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
3946
+ 'quarter': function (forward) { return _this.pagingDateChange('addCalendarMonths', 3, forward); },
3947
+ 'month': function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
3948
+ 'day': function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); }
3949
+ };
3950
+ datePickerService.isTimeframeSelectionEnabled = true;
3951
+ datePickerService.format$
3952
+ .pipe(operators.takeUntil(_this.destroyed$))
3953
+ .subscribe(function (value) {
3954
+ _this.onChangeFormat.emit(datePickerService.normalizeValue(value));
3955
+ });
3956
+ return _this;
3698
3957
  }
3699
- Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "isCollapsed", {
3700
- get: function () {
3701
- return this.accordionItem.collapsed;
3702
- },
3703
- enumerable: false,
3704
- configurable: true
3705
- });
3706
- Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "expanded", {
3707
- get: function () {
3708
- return !this.accordionItem.collapsed;
3709
- },
3710
- enumerable: false,
3711
- configurable: true
3712
- });
3713
- Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "tabbable", {
3958
+ Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "isDashboardClassDisplayed", {
3714
3959
  get: function () {
3715
- return this.accordionItem.disabled ? '-1' : '0';
3960
+ return this.isDashboardDatepicker;
3716
3961
  },
3717
3962
  enumerable: false,
3718
3963
  configurable: true
3719
3964
  });
3720
- Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "disabled", {
3965
+ ;
3966
+ Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "quarterDisplay", {
3721
3967
  get: function () {
3722
- return this.accordionItem.disabled;
3968
+ return this.datePickerService.getQuarterDisplay(this.value);
3723
3969
  },
3724
3970
  enumerable: false,
3725
3971
  configurable: true
3726
3972
  });
3727
- DrAccordionItemHeaderComponent.prototype.toggle = function () {
3728
- this.accordionItem.toggle();
3973
+ DrDatePickerWithTimeframeComponent.prototype.ngOnInit = function () {
3974
+ if (this.dateFormatConfig) {
3975
+ this.datePickerService.formatConfig = Object.assign(Object.assign({}, this.datePickerService.formatConfig), this.dateFormatConfig);
3976
+ }
3729
3977
  };
3730
- Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "state", {
3731
- get: function () {
3732
- if (this.isCollapsed) {
3733
- return 'collapsed';
3734
- }
3735
- return 'expanded';
3736
- },
3737
- enumerable: false,
3738
- configurable: true
3739
- });
3740
- DrAccordionItemHeaderComponent.prototype.ngOnInit = function () {
3741
- var _this = this;
3742
- this.accordionItem.accordionItemInvalidate
3743
- .pipe(operators.takeUntil(this.destroy$))
3744
- .subscribe(function () { return _this.cd.markForCheck(); });
3978
+ DrDatePickerWithTimeframeComponent.prototype.pagingClicked = function (forward) {
3979
+ this.pagingSetup[this.datePickerService.timeframe] && this.pagingSetup[this.datePickerService.timeframe](forward);
3980
+ this.dp.close();
3745
3981
  };
3746
- DrAccordionItemHeaderComponent.prototype.ngOnDestroy = function () {
3747
- this.destroy$.next();
3748
- this.destroy$.complete();
3982
+ DrDatePickerWithTimeframeComponent.prototype.pagingDateChange = function (actionCall, amount, forward) {
3983
+ var newValue = this.dateAdapter[actionCall](this.innerValue, forward ? amount : -amount);
3984
+ this.setValueFromMoment(newValue);
3749
3985
  };
3750
- return DrAccordionItemHeaderComponent;
3751
- }());
3752
- DrAccordionItemHeaderComponent.decorators = [
3986
+ return DrDatePickerWithTimeframeComponent;
3987
+ }(DrDatePickerComponent));
3988
+ DrDatePickerWithTimeframeComponent.decorators = [
3753
3989
  { type: i0.Component, args: [{
3754
- selector: 'dr-accordion-item-header',
3755
- template: "\n <ng-content select=\"dr-accordion-item-title\"></ng-content>\n <ng-content select=\"dr-accordion-item-description\"></ng-content>\n <ng-content></ng-content>\n <i class=\"dr-icon-arrow-down expansion-indicator\"\n [@expansionIndicator]=\"state\"\n *ngIf=\"!disabled\">\n </i>\n ",
3756
- animations: [
3757
- animations.trigger('expansionIndicator', [
3758
- animations.state('expanded', animations.style({
3759
- transform: 'rotate(180deg)',
3760
- })),
3761
- animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3762
- animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3763
- ]),
3764
- ],
3990
+ selector: 'dr-date-picker-with-timeframe',
3991
+ template: "<div class=\"dr-input-date-paging__flip-page-button\"\n (click)=\"pagingClicked(false)\"\n>\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n</div>\n<div class=\"dr-datepicker__input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n <div\n class=\"dr-input-date-paging__formatted-value-display\"\n (click)=\"datepickerInput.click()\"\n >\n {{\n !value\n ? placeholder\n : (datePickerService.format$.getValue()?.includes('Q') ? quarterDisplay : value.format(datePickerService.format$.getValue()))\n }}\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<div class=\"dr-input-date-paging__flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n</div>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, 'year')\"\n (monthSelected)=\"chosenPeriodHandler($event, 'month')\">\n</mat-datepicker>\n",
3765
3992
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3766
- styles: [":host{display:flex;align-items:center;cursor:pointer;position:relative;border-bottom:1px solid #edf1f7;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:13px;font-weight:600;line-height:1.5rem;padding:1.25rem;text-transform:capitalize}:host:focus{outline:0}:host .expansion-indicator{font-size:24px;position:absolute;right:10px;font-weight:700}\n"]
3993
+ providers: [
3994
+ { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
3995
+ { provide: DrDatePickerService }
3996
+ ],
3997
+ styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#E5E6EA}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#F2F2FB;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#F3F7FF}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#F3F7FF;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#F3F7FF;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.dr-date-picker-on-dashboard{width:180px;justify-content:space-between}:host.dr-date-picker-on-dashboard mat-datepicker{position:absolute}:host.dr-date-picker-on-dashboard .dr-datepicker__input-container{display:flex;flex-direction:row;justify-content:center;align-items:center;margin-left:-10px}:host.dr-date-picker-on-dashboard .dr-datepicker__input-container .dr-input-date-paging__formatted-value-display{font-weight:600;width:auto;margin-left:5px}:host.dr-date-picker-on-dashboard .dr-datepicker__input-container .dr-icon-date{display:block;position:relative;top:0;margin-right:8px;color:#4e566c}:host .dr-input-date-paging__flip-page-button{width:25px;height:25px;border-radius:16px;padding:0;background-color:#fff}:host .dr-input-date-paging__flip-page-button i{position:relative;color:#0c142b;top:unset;left:unset}:host .dr-input-date-paging__flip-page-button:hover{background-color:#f2f2fb;color:#4646ce}:host input{visibility:hidden;position:absolute;width:100%}:host .dr-input-date-paging__formatted-value-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-input-date-paging__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}\n"]
3767
3998
  },] }
3768
3999
  ];
3769
- DrAccordionItemHeaderComponent.ctorParameters = function () { return [
3770
- { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3771
- { type: i0.ChangeDetectorRef }
4000
+ DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
4001
+ { type: i0.ChangeDetectorRef },
4002
+ { type: core.DateAdapter },
4003
+ { type: DrDatePickerService }
3772
4004
  ]; };
3773
- DrAccordionItemHeaderComponent.propDecorators = {
3774
- isCollapsed: [{ type: i0.HostBinding, args: ['class.accordion-item-header-collapsed',] }],
3775
- expanded: [{ type: i0.HostBinding, args: ['class.accordion-item-header-expanded',] }, { type: i0.HostBinding, args: ['attr.aria-expanded',] }],
3776
- tabbable: [{ type: i0.HostBinding, args: ['attr.tabindex',] }],
3777
- disabled: [{ type: i0.HostBinding, args: ['attr.aria-disabled',] }],
3778
- toggle: [{ type: i0.HostListener, args: ['click',] }, { type: i0.HostListener, args: ['keydown.space',] }, { type: i0.HostListener, args: ['keydown.enter',] }]
4005
+ DrDatePickerWithTimeframeComponent.propDecorators = {
4006
+ isDashboardClassDisplayed: [{ type: i0.HostBinding, args: ['class.dr-date-picker-on-dashboard',] }],
4007
+ isDashboardDatepicker: [{ type: i0.Input }],
4008
+ dateFormatConfig: [{ type: i0.Input }],
4009
+ onChangeFormat: [{ type: i0.Output }]
3779
4010
  };
3780
4011
 
3781
- var accordionItemBodyTrigger = animations.trigger('accordionItemBody', [
3782
- animations.state('collapsed', animations.style({
3783
- overflow: 'hidden',
3784
- visibility: 'hidden',
3785
- height: 0,
3786
- })),
3787
- animations.state('expanded', animations.style({
3788
- overflow: 'hidden',
3789
- visibility: 'visible',
3790
- })),
3791
- animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3792
- animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3793
- ]);
3794
- var DrAccordionItemBodyComponent = /** @class */ (function () {
3795
- function DrAccordionItemBodyComponent(accordionItem, cd) {
3796
- this.accordionItem = accordionItem;
3797
- this.cd = cd;
3798
- this.destroy$ = new rxjs.Subject();
4012
+ var DrDatePickerFormatDirective = /** @class */ (function () {
4013
+ function DrDatePickerFormatDirective(matDateFormat, ngControl) {
4014
+ this.matDateFormat = matDateFormat;
4015
+ this.ngControl = ngControl;
3799
4016
  }
3800
- Object.defineProperty(DrAccordionItemBodyComponent.prototype, "state", {
3801
- get: function () {
3802
- return this.accordionItem.collapsed ? 'collapsed' : 'expanded';
4017
+ Object.defineProperty(DrDatePickerFormatDirective.prototype, "datePickerFormat", {
4018
+ set: function (format) {
4019
+ var _a;
4020
+ if (this.configDateParse) {
4021
+ this.matDateFormat.updateDateFormat(this.configDateParse, this.configDateDisplay);
4022
+ }
4023
+ else {
4024
+ this.matDateFormat.updateDateFormat({ dateInput: format });
4025
+ }
4026
+ var value = this.ngControl.value;
4027
+ (_a = this.ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.writeValue(value);
3803
4028
  },
3804
4029
  enumerable: false,
3805
4030
  configurable: true
3806
4031
  });
3807
- DrAccordionItemBodyComponent.prototype.ngOnInit = function () {
3808
- var _this = this;
3809
- this.accordionItem.accordionItemInvalidate
3810
- .pipe(operators.takeUntil(this.destroy$))
3811
- .subscribe(function () { return _this.cd.markForCheck(); });
3812
- };
3813
- DrAccordionItemBodyComponent.prototype.ngOnDestroy = function () {
3814
- this.destroy$.next();
3815
- this.destroy$.complete();
3816
- };
3817
- return DrAccordionItemBodyComponent;
3818
- }());
3819
- DrAccordionItemBodyComponent.decorators = [
3820
- { type: i0.Component, args: [{
3821
- selector: 'dr-accordion-item-body',
3822
- template: "\n <div [@accordionItemBody]=\"{ value: state }\">\n <div class=\"item-body\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
3823
- animations: [accordionItemBodyTrigger],
3824
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
3825
- styles: [".item-body{flex:1;-ms-flex:1 1 auto;overflow:auto;position:relative}\n"]
3826
- },] }
3827
- ];
3828
- DrAccordionItemBodyComponent.ctorParameters = function () { return [
3829
- { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3830
- { type: i0.ChangeDetectorRef }
3831
- ]; };
3832
-
3833
- var DrModelDebounceChangeDirective = /** @class */ (function () {
3834
- function DrModelDebounceChangeDirective(ngModel) {
3835
- this.ngModel = ngModel;
3836
- this.debounce = 200;
3837
- this.ngModelDebounceChange = new i0.EventEmitter();
3838
- }
3839
- DrModelDebounceChangeDirective.prototype.ngOnInit = function () {
3840
- var _this = this;
3841
- this.subscription = this.ngModel.control.valueChanges
3842
- .pipe(operators.skip(1), operators.debounceTime(this.debounce), operators.distinctUntilChanged())
3843
- .subscribe(function (value) { return _this.ngModelDebounceChange.emit(value); });
3844
- };
3845
- DrModelDebounceChangeDirective.prototype.ngOnDestroy = function () {
3846
- this.subscription.unsubscribe();
3847
- };
3848
- return DrModelDebounceChangeDirective;
4032
+ return DrDatePickerFormatDirective;
3849
4033
  }());
3850
- DrModelDebounceChangeDirective.decorators = [
4034
+ DrDatePickerFormatDirective.decorators = [
3851
4035
  { type: i0.Directive, args: [{
3852
- selector: '[ngModelDebounceChange]'
4036
+ selector: '[drDatePickerFormat]',
4037
+ providers: [
4038
+ {
4039
+ provide: core.DateAdapter,
4040
+ useClass: materialMomentAdapter.MomentDateAdapter
4041
+ },
4042
+ {
4043
+ provide: core.MAT_DATE_FORMATS,
4044
+ useClass: CustomDateFormat
4045
+ }
4046
+ ]
3853
4047
  },] }
3854
4048
  ];
3855
- DrModelDebounceChangeDirective.ctorParameters = function () { return [
3856
- { type: forms.NgModel }
4049
+ DrDatePickerFormatDirective.ctorParameters = function () { return [
4050
+ { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
4051
+ { type: forms.NgControl, decorators: [{ type: i0.Optional }] }
3857
4052
  ]; };
3858
- DrModelDebounceChangeDirective.propDecorators = {
3859
- debounce: [{ type: i0.Input }],
3860
- ngModelDebounceChange: [{ type: i0.Output }]
4053
+ DrDatePickerFormatDirective.propDecorators = {
4054
+ configDateParse: [{ type: i0.Input }],
4055
+ configDateDisplay: [{ type: i0.Input }],
4056
+ datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
3861
4057
  };
3862
4058
 
3863
- var components$2 = [DateTagComponent,
3864
- DayTagComponent,
3865
- WeekTagComponent,
3866
- MonthTagComponent,
3867
- QuarterTagComponent,
3868
- AnyTagComponent,
3869
- YearTagComponent,
3870
- ForecastTagComponent];
3871
- var ɵ0 = { useUtc: true };
3872
- var DateTagModule = /** @class */ (function () {
3873
- function DateTagModule() {
3874
- }
3875
- return DateTagModule;
3876
- }());
3877
- DateTagModule.decorators = [
3878
- { type: i0.NgModule, args: [{
3879
- imports: [
3880
- common.CommonModule,
3881
- core.MatNativeDateModule,
3882
- datepicker.MatDatepickerModule,
3883
- forms.FormsModule,
3884
- formField.MatFormFieldModule,
3885
- forms.ReactiveFormsModule,
3886
- input.MatInputModule,
3887
- materialMomentAdapter.MatMomentDateModule,
3888
- select.MatSelectModule
3889
- ],
3890
- exports: components$2,
3891
- providers: [
3892
- { provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0 }
3893
- ],
3894
- declarations: components$2,
3895
- },] }
3896
- ];
3897
- ;
3898
-
3899
- var ListTagModule = /** @class */ (function () {
3900
- function ListTagModule() {
3901
- }
3902
- return ListTagModule;
3903
- }());
3904
- ListTagModule.decorators = [
3905
- { type: i0.NgModule, args: [{
3906
- imports: [
3907
- common.CommonModule,
3908
- forms.FormsModule,
3909
- formField.MatFormFieldModule,
3910
- forms.ReactiveFormsModule,
3911
- materialMomentAdapter.MatMomentDateModule,
3912
- select.MatSelectModule,
3913
- buttonToggle.MatButtonToggleModule,
3914
- ],
3915
- exports: [ListTagComponent],
3916
- providers: [],
3917
- declarations: [
3918
- ListTagComponent
3919
- ],
3920
- },] }
3921
- ];
3922
-
3923
- var DrTagModule = /** @class */ (function () {
3924
- function DrTagModule() {
3925
- }
3926
- return DrTagModule;
3927
- }());
3928
- DrTagModule.decorators = [
3929
- { type: i0.NgModule, args: [{
3930
- imports: [
3931
- common.CommonModule,
3932
- DateTagModule,
3933
- ListTagModule
3934
- ],
3935
- exports: [DrTagComponent],
3936
- providers: [],
3937
- declarations: [
3938
- DrTagComponent
3939
- ],
3940
- },] }
3941
- ];
3942
-
4059
+ // !!! Please do not use such approach in other places
4060
+ // Hard fix for 'none' calendar view selection
4061
+ datepicker.MatCalendar.prototype.focusActiveCell = function () {
4062
+ var _a;
4063
+ (_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
4064
+ };
3943
4065
  var components$1 = [
3944
4066
  DrButtonComponent,
3945
4067
  RadioButtonComponent,
@@ -3950,6 +4072,7 @@
3950
4072
  DrToggleComponent,
3951
4073
  DrToggleButtonComponent,
3952
4074
  DrDatePickerComponent,
4075
+ DrDatePickerWithTimeframeComponent,
3953
4076
  DrDatePickerFormatDirective,
3954
4077
  DrDatePickerCustomHeaderComponent,
3955
4078
  DrModelDebounceChangeDirective
@@ -3969,9 +4092,6 @@
3969
4092
  common.CommonModule,
3970
4093
  ngSelect.NgSelectModule,
3971
4094
  datepicker.MatDatepickerModule
3972
- ],
3973
- providers: [
3974
- DrDatePickerService
3975
4095
  ]
3976
4096
  },] }
3977
4097
  ];
@@ -4143,6 +4263,8 @@
4143
4263
 
4144
4264
  exports.AnyTagComponent = AnyTagComponent;
4145
4265
  exports.CheckboxComponent = CheckboxComponent;
4266
+ exports.CustomDateFormat = CustomDateFormat;
4267
+ exports.DATE_INPUT_FORMAT = DATE_INPUT_FORMAT;
4146
4268
  exports.DateTagComponent = DateTagComponent;
4147
4269
  exports.DateTagModule = DateTagModule;
4148
4270
  exports.DayTagComponent = DayTagComponent;
@@ -4155,8 +4277,6 @@
4155
4277
  exports.DrAvatarModule = DrAvatarModule;
4156
4278
  exports.DrAvatarPipe = DrAvatarPipe;
4157
4279
  exports.DrButtonComponent = DrButtonComponent;
4158
- exports.DrDatePickerComponent = DrDatePickerComponent;
4159
- exports.DrDatePickerFormatDirective = DrDatePickerFormatDirective;
4160
4280
  exports.DrDropdownComponent = DrDropdownComponent;
4161
4281
  exports.DrDropdownDirective = DrDropdownDirective;
4162
4282
  exports.DrDropdownItemShowPipe = DrDropdownItemShowPipe;
@@ -4188,18 +4308,24 @@
4188
4308
  exports.ISpinnerOptions = ISpinnerOptions;
4189
4309
  exports.ListTagComponent = ListTagComponent;
4190
4310
  exports.ListTagModule = ListTagModule;
4311
+ exports.MAT_DEFAULT_DATE_FORMAT = MAT_DEFAULT_DATE_FORMAT;
4312
+ exports.MONTH_YEAR_FORMAT = MONTH_YEAR_FORMAT;
4191
4313
  exports.MonthTagComponent = MonthTagComponent;
4314
+ exports.QUARTER_FORMAT = QUARTER_FORMAT;
4192
4315
  exports.QuarterTagComponent = QuarterTagComponent;
4193
4316
  exports.RadioButtonComponent = RadioButtonComponent;
4194
4317
  exports.RadioGroupComponent = RadioGroupComponent;
4195
4318
  exports.TooltipComponent = TooltipComponent;
4196
4319
  exports.WeekTagComponent = WeekTagComponent;
4320
+ exports.YEAR_FORMAT = YEAR_FORMAT;
4197
4321
  exports.YearTagComponent = YearTagComponent;
4198
4322
  exports["ɵa"] = components$2;
4199
4323
  exports["ɵb"] = POPUP_ANIMATION;
4200
- exports["ɵc"] = DrDatePickerService;
4201
- exports["ɵd"] = CustomDateFormat;
4202
- exports["ɵe"] = DrDatePickerCustomHeaderComponent;
4324
+ exports["ɵc"] = DrDatePickerComponent;
4325
+ exports["ɵd"] = DrDatePickerService;
4326
+ exports["ɵe"] = DrDatePickerWithTimeframeComponent;
4327
+ exports["ɵf"] = DrDatePickerFormatDirective;
4328
+ exports["ɵg"] = DrDatePickerCustomHeaderComponent;
4203
4329
 
4204
4330
  Object.defineProperty(exports, '__esModule', { value: true });
4205
4331