@datarailsshared/datarailsshared 1.4.42-dragons → 1.4.44

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.
@@ -3611,14 +3611,23 @@
3611
3611
  },] }
3612
3612
  ];
3613
3613
 
3614
- var DrSharedUtils = /** @class */ (function () {
3615
- function DrSharedUtils() {
3614
+ var DrDatePickerService = /** @class */ (function () {
3615
+ function DrDatePickerService() {
3616
+ this.isTimeframeSelectionEnabled = false;
3617
+ this.timeframe = exports.TimeframeOption.DAY;
3618
+ this.format$ = new rxjs.BehaviorSubject(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
3619
+ this.updatedQuarter$ = new rxjs.Subject();
3620
+ this.formatConfig = {
3621
+ day: exports.DateFromats.MAT_DEFAULT_DATE_FORMAT,
3622
+ month: exports.DateFromats.MONTH_YEAR_FORMAT,
3623
+ year: exports.DateFromats.YEAR_FORMAT,
3624
+ quarter: exports.DateFromats.QUARTER_FORMAT,
3625
+ };
3616
3626
  }
3617
- /**
3618
- * Get timeframe (day, year, month, quarter) based on passed format
3619
- * @param format - date format string. Examples: MM/DD/YYYY, Q/YYYY
3620
- */
3621
- DrSharedUtils.getTimeframeByDateFormat = function (format) {
3627
+ DrDatePickerService.prototype.getQuarterDisplay = function (value) {
3628
+ return 'Q' + value.quarter() + this.format$.getValue().charAt(1) + value.year();
3629
+ };
3630
+ DrDatePickerService.prototype.getTimeframe = function (format) {
3622
3631
  var defaultFrame = exports.TimeframeOption.DAY;
3623
3632
  if (!format) {
3624
3633
  return defaultFrame;
@@ -3637,28 +3646,6 @@
3637
3646
  return defaultFrame;
3638
3647
  }
3639
3648
  };
3640
- return DrSharedUtils;
3641
- }());
3642
-
3643
- var DrDatePickerService = /** @class */ (function () {
3644
- function DrDatePickerService() {
3645
- this.isTimeframeSelectionEnabled = false;
3646
- this.timeframe = exports.TimeframeOption.DAY;
3647
- this.format$ = new rxjs.BehaviorSubject(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
3648
- this.updatedQuarter$ = new rxjs.Subject();
3649
- this.formatConfig = {
3650
- day: exports.DateFromats.MAT_DEFAULT_DATE_FORMAT,
3651
- month: exports.DateFromats.MONTH_YEAR_FORMAT,
3652
- year: exports.DateFromats.YEAR_FORMAT,
3653
- quarter: exports.DateFromats.QUARTER_FORMAT,
3654
- };
3655
- }
3656
- DrDatePickerService.prototype.getQuarterDisplay = function (value) {
3657
- return 'Q' + value.quarter() + this.format$.getValue().charAt(1) + value.year();
3658
- };
3659
- DrDatePickerService.prototype.getTimeframe = function (format) {
3660
- return DrSharedUtils.getTimeframeByDateFormat(format);
3661
- };
3662
3649
  DrDatePickerService.prototype.getConfiguredFormat = function (timeframe) {
3663
3650
  return this.formatConfig[timeframe];
3664
3651
  };
@@ -3729,9 +3716,10 @@
3729
3716
  this.calendarView = exports.CalendarView;
3730
3717
  _calendar.stateChanges.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
3731
3718
  this.datePickerService.format$
3732
- .pipe(operators.take(1))
3719
+ .pipe(operators.takeUntil(this._destroyed))
3733
3720
  .subscribe(function (value) {
3734
3721
  _this.selectedTimeframe = _this.timeframeOptions.filter(function (option) { return option.format == value; })[0].value;
3722
+ _calendar.currentView = _this.selectedTimeframe;
3735
3723
  _this.setPeriodLabels();
3736
3724
  });
3737
3725
  _calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
@@ -3978,6 +3966,7 @@
3978
3966
  _this.dateAdapter = dateAdapter;
3979
3967
  _this.datePickerService = datePickerService;
3980
3968
  _this.isDashboardDatepicker = false;
3969
+ _this.canSelectTimeframe = true;
3981
3970
  _this.onChangeFormat = new i0.EventEmitter();
3982
3971
  _this.pagingSetup = (_b = {},
3983
3972
  _b[exports.TimeframeOption.YEAR] = function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
@@ -4001,6 +3990,16 @@
4001
3990
  configurable: true
4002
3991
  });
4003
3992
  ;
3993
+ Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "dateFormatConfig", {
3994
+ set: function (value) {
3995
+ if (value) {
3996
+ this.datePickerService.formatConfig = Object.assign(Object.assign({}, this.datePickerService.formatConfig), value);
3997
+ this.cdr.markForCheck();
3998
+ }
3999
+ },
4000
+ enumerable: false,
4001
+ configurable: true
4002
+ });
4004
4003
  Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "displayedFormattedValue", {
4005
4004
  get: function () {
4006
4005
  var _a;
@@ -4018,6 +4017,8 @@
4018
4017
  if (this.dateFormatConfig) {
4019
4018
  this.datePickerService.formatConfig = Object.assign(Object.assign({}, this.datePickerService.formatConfig), this.dateFormatConfig);
4020
4019
  }
4020
+ this.datePickerService.isTimeframeSelectionEnabled = this.canSelectTimeframe;
4021
+ this.cdr.markForCheck();
4021
4022
  };
4022
4023
  DrDatePickerWithTimeframeComponent.prototype.pagingClicked = function (forward) {
4023
4024
  this.pagingSetup[this.datePickerService.timeframe] && this.pagingSetup[this.datePickerService.timeframe](forward);
@@ -4038,7 +4039,7 @@
4038
4039
  { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
4039
4040
  { provide: DrDatePickerService }
4040
4041
  ],
4041
- 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__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-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__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-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}\n"]
4042
+ 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:after{visibility:hidden}: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__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-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__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-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}\n"]
4042
4043
  },] }
4043
4044
  ];
4044
4045
  DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
@@ -4050,6 +4051,7 @@
4050
4051
  isDashboardClassDisplayed: [{ type: i0.HostBinding, args: ['class.dr-date-picker-on-dashboard',] }],
4051
4052
  isDashboardDatepicker: [{ type: i0.Input }],
4052
4053
  dateFormatConfig: [{ type: i0.Input }],
4054
+ canSelectTimeframe: [{ type: i0.Input }],
4053
4055
  onChangeFormat: [{ type: i0.Output }]
4054
4056
  };
4055
4057
 
@@ -4335,7 +4337,6 @@
4335
4337
  exports.DrPopoverRef = DrPopoverRef;
4336
4338
  exports.DrPopoverService = DrPopoverService;
4337
4339
  exports.DrSelectComponent = DrSelectComponent;
4338
- exports.DrSharedUtils = DrSharedUtils;
4339
4340
  exports.DrSpinnerComponent = DrSpinnerComponent;
4340
4341
  exports.DrSpinnerDirective = DrSpinnerDirective;
4341
4342
  exports.DrSpinnerModule = DrSpinnerModule;