@datarailsshared/datarailsshared 1.4.48-bratans → 1.4.49

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 (27) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +52 -98
  2. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  3. package/datarailsshared-datarailsshared-1.4.49.tgz +0 -0
  4. package/datarailsshared-datarailsshared.d.ts +0 -1
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/datarailsshared-datarailsshared.js +1 -2
  7. package/esm2015/lib/dr-inputs/button/button.component.js +2 -2
  8. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +9 -19
  9. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +8 -23
  10. package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +4 -32
  11. package/esm2015/lib/dr-inputs/dr-inputs.module.js +2 -4
  12. package/esm2015/lib/models/datePicker.js +1 -3
  13. package/esm2015/lib/utils/dr-shared-utils.js +27 -0
  14. package/esm2015/public-api.js +2 -1
  15. package/fesm2015/datarailsshared-datarailsshared.js +44 -86
  16. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  17. package/lib/dr-inputs/button/button.component.d.ts +1 -1
  18. package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +1 -3
  19. package/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.d.ts +1 -2
  20. package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +0 -2
  21. package/lib/models/datePicker.d.ts +1 -4
  22. package/lib/utils/dr-shared-utils.d.ts +8 -0
  23. package/package.json +1 -1
  24. package/public-api.d.ts +1 -0
  25. package/datarailsshared-datarailsshared-1.4.48-bratans.tgz +0 -0
  26. package/esm2015/lib/dr-inputs/date-pickers/dr-show-timeframe.pipe.js +0 -12
  27. package/lib/dr-inputs/date-pickers/dr-show-timeframe.pipe.d.ts +0 -6
@@ -2399,7 +2399,7 @@
2399
2399
  { type: i0.Component, args: [{
2400
2400
  selector: 'dr-button',
2401
2401
  template: "<button (click)=\"onClick($event)\" [disabled]=\"_disabled\" [attr.is-loading]=\"_isLoading\" [attr.bold]=\"isBold\"\n [attr.icon]=\"!!icon\" [attr.iconAfterLabel]=\"!!iconAfterLabel\" [attr.theme]=\"theme\">\n <ng-container *ngIf=\"!_isLoading\">\n <i *ngIf=\"icon\" class=\"dr\" [class]=\"icon\" [style.color]=\"iconColor || 'inherit'\"></i>\n <ng-content></ng-content>\n <i *ngIf=\"theme === 'dropdown'\" class=\"dr-icon-arrow-down\"></i>\n <i *ngIf=\"iconAfterLabel\" class=\"dr dr-last\" [class]=\"iconAfterLabel\" [style.color]=\"iconColor || 'inherit'\"></i>\n </ng-container>\n <i *ngIf=\"_isLoading\" class=\"dr dr-spinner dr-icon-load\"></i>\n</button>\n",
2402
- styles: [":host{display:inline-block}:host.disabled,:host.loading{pointer-events:none}:host button[theme]{cursor:pointer;border-radius:16px;padding:5px 16px;font-family:\"Poppins\";font-style:normal;font-weight:400;font-size:14px;line-height:22px;color:#4e566c;border:1px solid #7F7FDD;display:flex;justify-content:space-between;align-items:center;height:32px}:host button[theme] .dr{padding:0;margin-left:5.35px;margin-right:8.64px}:host button[theme] .dr-spinner{animation-name:rotate;animation-iteration-count:infinite;animation-duration:1s}@keyframes rotate{0%{transform:rotate()}to{transform:rotate(360deg)}}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=secondary]{padding:5px 16px;background:#FFFFFF;border-radius:16px;min-width:90px}:host button[theme][theme~=split-secondary-first]:hover:not([disabled]),:host button[theme][theme~=split-secondary-last]:hover:not([disabled]),:host button[theme][theme~=secondary]:hover:not([disabled]){color:#4e566c;transition:.2ms ease-in all;background:#F2F2FB;box-shadow:0 4px 14px #0000001a;border:1px solid #4646CE}:host button[theme][theme~=split-secondary-first]:active,:host button[theme][theme~=split-secondary-last]:active,:host button[theme][theme~=secondary]:active{box-shadow:none;background:#F2F2FB}:host button[theme][theme~=split-secondary-first][disabled],:host button[theme][theme~=split-secondary-last][disabled],:host button[theme][theme~=secondary][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-secondary-first][is-loading=true],:host button[theme][theme~=split-secondary-last][is-loading=true],:host button[theme][theme~=secondary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-last],:host button[theme][theme~=primary]{background:#4646CE;color:#fff;border:none;min-width:90px}:host button[theme][theme~=split-primary-first]:hover:not([disabled]),:host button[theme][theme~=split-primary-last]:hover:not([disabled]),:host button[theme][theme~=primary]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#25258C 0%,#4646CE 100%);box-shadow:0 4px 14px #0000001a;border:none}:host button[theme][theme~=split-primary-first]:active,:host button[theme][theme~=split-primary-last]:active,:host button[theme][theme~=primary]:active{background:#25258C}:host button[theme][theme~=split-primary-first][disabled],:host button[theme][theme~=split-primary-last][disabled],:host button[theme][theme~=primary][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-primary-first][is-loading=true],:host button[theme][theme~=split-primary-last][is-loading=true],:host button[theme][theme~=primary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first] .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=primary] .dr{margin:0}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover,:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{min-width:unset;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:10px;padding-right:8px}:host button[theme][theme~=split-secondary-first][icon=true],:host button[theme][theme~=split-secondary-first]:hover[icon=true],:host button[theme][theme~=split-primary-first][icon=true],:host button[theme][theme~=split-primary-first]:hover[icon=true]{padding-left:6px;padding-right:2px}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{border-right:1px solid #fff!important}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover{border-right:none!important}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover,:host button[theme][theme~=split-primary-last],:host button[theme][theme~=split-primary-last]:hover{min-width:unset;border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px;padding-right:10px}:host button[theme][theme~=split-secondary-last][icon=true],:host button[theme][theme~=split-secondary-last]:hover[icon=true],:host button[theme][theme~=split-primary-last][icon=true],:host button[theme][theme~=split-primary-last]:hover[icon=true]{padding-left:2px;padding-right:6px}:host button[theme][theme~=split-secondary-last] .dr,:host button[theme][theme~=split-secondary-last]:hover .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=split-primary-last]:hover .dr{margin:0}:host button[theme][theme~=split-primary-last],:host button[theme][theme~=split-primary-last]:hover{border-left:none}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover{margin-left:-1px}:host button[theme][theme~=danger]{background:#BF1D30;color:#fff;border:none;min-width:90px}:host button[theme][theme~=danger]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#740e1a 0%,#BF1D30 100%);box-shadow:0 4px 14px #0000001a;border-radius:16px;border:none}:host button[theme][theme~=danger]:active{background:#740e1a}:host button[theme][theme~=danger][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=danger][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=ghost]{background:none;border:none;color:#151b3f;padding:4px 8px}:host button[theme][theme~=ghost] .dr{margin-left:4.5px;margin-right:12.5px}:host button[theme][theme~=ghost]:hover:not([disabled]){color:#4646ce;background:#F2F2FB;border-radius:4px}:host button[theme][theme~=ghost][disabled]{color:#727583;cursor:default;pointer-events:none}:host button[theme][theme~=text-link]{background:none;border:none;color:#0b5af9}:host button[theme][theme~=text-link][disabled]{color:#727583;pointer-events:none}:host button[theme][theme~=primary-icon]{padding:8px;width:28px;height:28px;justify-content:center;color:#fff;background:#4646CE;border:none}:host button[theme][theme~=primary-icon]:hover,:host button[theme][theme~=primary-icon]:active{background:linear-gradient(96.89deg,#131318 0%,#4646CE 100%)}:host button[theme][theme~=primary-icon][disabled]{color:#bcbcbc;background:#E5E6EA;cursor:default;pointer-events:none}:host button[theme][theme~=primary-icon] .dr{margin:0}:host button[theme][theme~=secondary-icon]{background:white;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:1px solid #7F7FDD}:host button[theme][theme~=secondary-icon]:hover,:host button[theme][theme~=secondary-icon]:active{color:#4646ce;background:#F2F2FB}:host button[theme][theme~=secondary-icon][disabled]{color:#bcbcbc;background:#E5E6EA;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=secondary-icon] .dr{margin:0}:host button[theme][theme~=simple-text]{color:#0c142b;border:none;background:none}:host button[theme][theme~=simple-text] .dr{margin:0 8px 0 0}:host button[theme][theme~=icon]{background:none;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:none}:host button[theme][theme~=icon]:hover,:host button[theme][theme~=icon]:active{background:#F0F3FC;color:#4646ce}:host button[theme][theme~=icon][disabled]{color:#bcbcbc;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=icon][disabled]:hover,:host button[theme][theme~=icon][disabled]:active{background:none}:host button[theme][theme~=icon] .dr{margin:0}:host button[theme][theme~=dropdown]{padding:0 8px;background:#FFFFFF;border-radius:6px;border:1px solid #C3C4CE;min-width:unset;box-shadow:none}:host button[theme][theme~=dropdown]:hover{border-color:#85889c}:host button[theme][theme~=dropdown]:active{border-color:#4646ce}:host button[theme][theme~=dropdown] i:first-child{margin-right:3px}:host button[theme][theme~=dropdown] i:last-child{margin-left:3px}:host button[theme][theme~=link-btn]{padding:5px 8px;border:none;background:none;border-radius:5px;color:#0c142b}:host button[theme][theme~=link-btn] .dr{margin:0 4px 0 0}:host button[theme][theme~=link-btn] .dr-last{margin-right:0;margin-left:4px}:host button[theme][theme~=link-btn]:hover{background:#F2F2FB;color:#4646ce}:host button[theme][theme~=link-btn]:active{background:#F2F2FB;color:#25258c}:host button[theme][theme~=link-btn]:disabled{background:none;color:#727583}:host button[theme][theme~=link-btn]:disabled .dr{color:#bcbcbc}:host button[theme][bold=true]{font-weight:600}:host button[theme][icon=true]{padding-left:8px}:host button[theme][icon=false]{justify-content:center}\n"]
2402
+ styles: [":host{display:inline-block}:host.disabled,:host.loading{pointer-events:none}:host button[theme]{cursor:pointer;border-radius:16px;padding:5px 16px;font-family:\"Poppins\";font-style:normal;font-weight:400;font-size:14px;line-height:22px;color:#4e566c;border:1px solid #7F7FDD;display:flex;justify-content:space-between;align-items:center;height:32px}:host button[theme] .dr{padding:0;margin-left:5.35px;margin-right:8.64px}:host button[theme] .dr-spinner{animation-name:rotate;animation-iteration-count:infinite;animation-duration:1s}@keyframes rotate{0%{transform:rotate()}to{transform:rotate(360deg)}}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=secondary]{padding:5px 16px;background:#FFFFFF;border-radius:16px;min-width:90px}:host button[theme][theme~=split-secondary-first]:hover:not([disabled]),:host button[theme][theme~=split-secondary-last]:hover:not([disabled]),:host button[theme][theme~=secondary]:hover:not([disabled]){color:#4e566c;transition:.2ms ease-in all;background:#F2F2FB;box-shadow:0 4px 14px #0000001a;border:1px solid #4646CE}:host button[theme][theme~=split-secondary-first]:active,:host button[theme][theme~=split-secondary-last]:active,:host button[theme][theme~=secondary]:active{box-shadow:none;background:#F2F2FB}:host button[theme][theme~=split-secondary-first][disabled],:host button[theme][theme~=split-secondary-last][disabled],:host button[theme][theme~=secondary][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-secondary-first][is-loading=true],:host button[theme][theme~=split-secondary-last][is-loading=true],:host button[theme][theme~=secondary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-last],:host button[theme][theme~=primary]{background:#4646CE;color:#fff;border:none;min-width:90px}:host button[theme][theme~=split-primary-first]:hover:not([disabled]),:host button[theme][theme~=split-primary-last]:hover:not([disabled]),:host button[theme][theme~=primary]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#25258C 0%,#4646CE 100%);box-shadow:0 4px 14px #0000001a;border:none}:host button[theme][theme~=split-primary-first]:active,:host button[theme][theme~=split-primary-last]:active,:host button[theme][theme~=primary]:active{background:#25258C}:host button[theme][theme~=split-primary-first][disabled],:host button[theme][theme~=split-primary-last][disabled],:host button[theme][theme~=primary][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-primary-first][is-loading=true],:host button[theme][theme~=split-primary-last][is-loading=true],:host button[theme][theme~=primary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first] .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=primary] .dr{margin:0}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover,:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{min-width:unset;border-bottom-right-radius:0;border-top-right-radius:0;padding-left:10px;padding-right:8px}:host button[theme][theme~=split-secondary-first][icon=true],:host button[theme][theme~=split-secondary-first]:hover[icon=true],:host button[theme][theme~=split-primary-first][icon=true],:host button[theme][theme~=split-primary-first]:hover[icon=true]{padding-left:6px;padding-right:2px}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{border-right:1px solid #fff!important}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover{border-right:none!important}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover,:host button[theme][theme~=split-primary-last],:host button[theme][theme~=split-primary-last]:hover{min-width:unset;border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px;padding-right:10px}:host button[theme][theme~=split-secondary-last][icon=true],:host button[theme][theme~=split-secondary-last]:hover[icon=true],:host button[theme][theme~=split-primary-last][icon=true],:host button[theme][theme~=split-primary-last]:hover[icon=true]{padding-left:2px;padding-right:6px}:host button[theme][theme~=split-secondary-last] .dr,:host button[theme][theme~=split-secondary-last]:hover .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=split-primary-last]:hover .dr{margin:0}:host button[theme][theme~=split-primary-last],:host button[theme][theme~=split-primary-last]:hover{border-left:none}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover{margin-left:-1px}:host button[theme][theme~=danger]{background:#BF1D30;color:#fff;border:none;min-width:90px}:host button[theme][theme~=danger]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#740e1a 0%,#BF1D30 100%);box-shadow:0 4px 14px #0000001a;border-radius:16px;border:none}:host button[theme][theme~=danger]:active{background:#740e1a}:host button[theme][theme~=danger][disabled]{background:#F0F1F4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=danger][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=ghost]{background:none;border:none;color:#151b3f;padding:4px 8px}:host button[theme][theme~=ghost] .dr{margin-left:4.5px;margin-right:12.5px}:host button[theme][theme~=ghost]:hover:not([disabled]){color:#4646ce;background:#F2F2FB;border-radius:4px}:host button[theme][theme~=ghost][disabled]{color:#727583;cursor:default;pointer-events:none}:host button[theme][theme~=text-link]{background:none;border:none;color:#0b5af9}:host button[theme][theme~=text-link][disabled]{color:#727583;pointer-events:none}:host button[theme][theme~=primary-icon]{padding:8px;width:28px;height:28px;justify-content:center;color:#fff;background:#4646CE;border:none}:host button[theme][theme~=primary-icon]:hover,:host button[theme][theme~=primary-icon]:active{background:linear-gradient(96.89deg,#131318 0%,#4646CE 100%)}:host button[theme][theme~=primary-icon][disabled]{color:#bcbcbc;background:#E5E6EA;cursor:default;pointer-events:none}:host button[theme][theme~=primary-icon] .dr{margin:0}:host button[theme][theme~=secondary-icon]{background:white;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:1px solid #7F7FDD}:host button[theme][theme~=secondary-icon]:hover,:host button[theme][theme~=secondary-icon]:active{color:#4646ce;background:#F2F2FB}:host button[theme][theme~=secondary-icon][disabled]{color:#bcbcbc;background:#E5E6EA;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=secondary-icon] .dr{margin:0}:host button[theme][theme~=simple-text]{color:#0c142b;border:none;background:none}:host button[theme][theme~=simple-text] .dr{margin:0 8px 0 0}:host button[theme][theme~=icon]{background:none;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:none}:host button[theme][theme~=icon]:hover,:host button[theme][theme~=icon]:active{background:#F0F3FC;color:#4646ce}:host button[theme][theme~=icon][disabled]{color:#bcbcbc;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=icon][disabled]:hover,:host button[theme][theme~=icon][disabled]:active{background:none}:host button[theme][theme~=icon] .dr{margin:0}:host button[theme][theme~=dropdown],:host button[theme][theme~=primary-square]{background:#FFFFFF;border-radius:6px;border:1px solid #C3C4CE;box-shadow:none;min-width:unset}:host button[theme][theme~=dropdown]:hover,:host button[theme][theme~=primary-square]:hover{border-color:#85889c}:host button[theme][theme~=dropdown]:active,:host button[theme][theme~=primary-square]:active{border-color:#4646ce}:host button[theme][theme~=dropdown] i:first-child,:host button[theme][theme~=primary-square] i:first-child{margin-right:3px}:host button[theme][theme~=dropdown] i:last-child,:host button[theme][theme~=primary-square] i:last-child{margin-left:3px}:host button[theme][theme~=dropdown]{padding:0 8px}:host button[theme][theme~=primary-square]{padding:0;-webkit-user-select:none;user-select:none}:host button[theme][theme~=primary-square]:hover{background-color:#f9f7ff;border:1px solid #7E828E}:host button[theme][theme~=primary-square]:active{background-color:#f2f2fb;border:1px solid #4646CE}:host button[theme][theme~=primary-square][disabled]{opacity:.6;pointer-events:none}:host button[theme][theme~=link-btn]{padding:5px 8px;border:none;background:none;border-radius:5px;color:#0c142b}:host button[theme][theme~=link-btn] .dr{margin:0 4px 0 0}:host button[theme][theme~=link-btn] .dr-last{margin-right:0;margin-left:4px}:host button[theme][theme~=link-btn]:hover{background:#F2F2FB;color:#4646ce}:host button[theme][theme~=link-btn]:active{background:#F2F2FB;color:#25258c}:host button[theme][theme~=link-btn]:disabled{background:none;color:#727583}:host button[theme][theme~=link-btn]:disabled .dr{color:#bcbcbc}:host button[theme][bold=true]{font-weight:600}:host button[theme][icon=true]:not([theme~=\"primary-square\"]){padding-left:8px}:host button[theme][icon=false]{justify-content:center}:host.dr-button-selected button[theme][theme~=primary-square]{background-color:#f2f2fb;border:1px solid #4646CE}\n"]
2403
2403
  },] }
2404
2404
  ];
2405
2405
  DrButtonComponent.ctorParameters = function () { return []; };
@@ -3465,7 +3465,6 @@
3465
3465
  DateFromats["YEAR_FORMAT"] = "yyyy";
3466
3466
  DateFromats["MONTH_YEAR_FORMAT"] = "MM/yyyy";
3467
3467
  DateFromats["QUARTER_FORMAT"] = "Q/yyyy";
3468
- DateFromats["WEEK_FORMAT"] = "W/yyyy";
3469
3468
  })(exports.DateFromats || (exports.DateFromats = {}));
3470
3469
  var CustomDateFormat = /** @class */ (function () {
3471
3470
  function CustomDateFormat() {
@@ -3522,7 +3521,6 @@
3522
3521
  TimeframeOption["DAY"] = "day";
3523
3522
  TimeframeOption["MONTH"] = "month";
3524
3523
  TimeframeOption["QUARTER"] = "quarter";
3525
- TimeframeOption["WEEK"] = "week";
3526
3524
  TimeframeOption["YEAR"] = "year";
3527
3525
  })(exports.TimeframeOption || (exports.TimeframeOption = {}));
3528
3526
  exports.CalendarView = void 0;
@@ -3613,34 +3611,14 @@
3613
3611
  },] }
3614
3612
  ];
3615
3613
 
3616
- var DrDatePickerService = /** @class */ (function () {
3617
- function DrDatePickerService() {
3618
- this.isTimeframeSelectionEnabled = false;
3619
- this.timeframe = exports.TimeframeOption.DAY;
3620
- this.format$ = new rxjs.BehaviorSubject(exports.DateFromats.MAT_DEFAULT_DATE_FORMAT);
3621
- this.updatedQuarter$ = new rxjs.Subject();
3622
- this.availableTimeframes = [
3623
- exports.TimeframeOption.DAY,
3624
- exports.TimeframeOption.WEEK,
3625
- exports.TimeframeOption.MONTH,
3626
- exports.TimeframeOption.QUARTER,
3627
- exports.TimeframeOption.YEAR
3628
- ];
3629
- this.formatConfig = {
3630
- day: exports.DateFromats.MAT_DEFAULT_DATE_FORMAT,
3631
- month: exports.DateFromats.MONTH_YEAR_FORMAT,
3632
- year: exports.DateFromats.YEAR_FORMAT,
3633
- quarter: exports.DateFromats.QUARTER_FORMAT,
3634
- week: exports.DateFromats.WEEK_FORMAT
3635
- };
3614
+ var DrSharedUtils = /** @class */ (function () {
3615
+ function DrSharedUtils() {
3636
3616
  }
3637
- DrDatePickerService.prototype.getQuarterDisplay = function (value) {
3638
- return 'Q' + value.format(this.formatConfig.quarter);
3639
- };
3640
- DrDatePickerService.prototype.getWeekDisplay = function (value) {
3641
- return 'W' + value.format(this.formatConfig.week);
3642
- };
3643
- DrDatePickerService.prototype.getTimeframe = function (format) {
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) {
3644
3622
  var defaultFrame = exports.TimeframeOption.DAY;
3645
3623
  if (!format) {
3646
3624
  return defaultFrame;
@@ -3653,14 +3631,34 @@
3653
3631
  return exports.TimeframeOption.DAY;
3654
3632
  case lowerCaseFormat.includes('m'):
3655
3633
  return exports.TimeframeOption.MONTH;
3656
- case lowerCaseFormat.includes('w'):
3657
- return exports.TimeframeOption.WEEK;
3658
3634
  case lowerCaseFormat.includes('y'):
3659
3635
  return exports.TimeframeOption.YEAR;
3660
3636
  default:
3661
3637
  return defaultFrame;
3662
3638
  }
3663
3639
  };
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
+ };
3664
3662
  DrDatePickerService.prototype.getConfiguredFormat = function (timeframe) {
3665
3663
  return this.formatConfig[timeframe];
3666
3664
  };
@@ -3692,37 +3690,25 @@
3692
3690
  this.quarters = [1, 2, 3, 4];
3693
3691
  this.selectedQuarter = 1;
3694
3692
  this.timeframeOptions = [{
3695
- timeframe: exports.TimeframeOption.DAY,
3696
- value: exports.CalendarView.FOR_DAYS,
3697
3693
  title: 'Day',
3698
- format: this.datePickerService.formatConfig.day,
3699
- periodLabel: function () { return _this._dateAdapter
3700
- .format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
3701
- .toLocaleUpperCase(); }
3702
- }, {
3703
- timeframe: exports.TimeframeOption.WEEK,
3704
3694
  value: exports.CalendarView.FOR_DAYS,
3705
- title: 'Week',
3706
- format: this.datePickerService.formatConfig.week,
3695
+ format: this.datePickerService.formatConfig.day,
3707
3696
  periodLabel: function () { return _this._dateAdapter
3708
3697
  .format(_this._calendar.activeDate, _this._dateFormats.display.monthYearLabel)
3709
3698
  .toLocaleUpperCase(); }
3710
3699
  }, {
3711
- timeframe: exports.TimeframeOption.MONTH,
3712
- value: exports.CalendarView.FOR_MONTHS,
3713
3700
  title: 'Month',
3701
+ value: exports.CalendarView.FOR_MONTHS,
3714
3702
  format: this.datePickerService.formatConfig.month,
3715
3703
  periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
3716
3704
  }, {
3717
- timeframe: exports.TimeframeOption.QUARTER,
3718
- value: exports.CalendarView.FOR_QUARTERS,
3719
3705
  title: 'Quarter',
3706
+ value: exports.CalendarView.FOR_QUARTERS,
3720
3707
  format: this.datePickerService.formatConfig.quarter,
3721
3708
  periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
3722
3709
  }, {
3723
- timeframe: exports.TimeframeOption.YEAR,
3724
- value: exports.CalendarView.FOR_YEARS,
3725
3710
  title: 'Year',
3711
+ value: exports.CalendarView.FOR_YEARS,
3726
3712
  format: this.datePickerService.formatConfig.year,
3727
3713
  periodLabel: function () {
3728
3714
  var currentYear = moment$1(_this._calendar.activeDate).year();
@@ -3748,9 +3734,6 @@
3748
3734
  _this.selectedTimeframe = _this.timeframeOptions.filter(function (option) { return option.format == value; })[0].value;
3749
3735
  _calendar.currentView = _this.selectedTimeframe;
3750
3736
  _this.setPeriodLabels();
3751
- if (_this.selectedTimeframe === exports.CalendarView.FOR_QUARTERS) {
3752
- _this.selectedQuarter = moment$1(_this._calendar.activeDate).quarter();
3753
- }
3754
3737
  });
3755
3738
  _calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
3756
3739
  }
@@ -3762,7 +3745,7 @@
3762
3745
  var _this = this;
3763
3746
  var currentTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this._calendar.currentView; })[0];
3764
3747
  var fullPeriodLabel = currentTimeframeOption.periodLabel();
3765
- if (this._calendar.currentView === exports.CalendarView.FOR_DAYS) {
3748
+ if (this._calendar.currentView === 'month') {
3766
3749
  this.periodMonthLabel = fullPeriodLabel.slice(0, 3);
3767
3750
  this.periodYearLabel = fullPeriodLabel.slice(4);
3768
3751
  }
@@ -3812,7 +3795,7 @@
3812
3795
  DrDatePickerCustomHeaderComponent.decorators = [
3813
3796
  { type: i0.Component, args: [{
3814
3797
  selector: 'dr-date-picker_custom-header.component',
3815
- 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 | drShowTimeframePipe: datePickerService.availableTimeframes\"\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(calendarView.FOR_MONTHS)\">{{periodMonthLabel + ' '}}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{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",
3798
+ 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(calendarView.FOR_MONTHS)\">{{periodMonthLabel + ' '}}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{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",
3816
3799
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3817
3800
  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"]
3818
3801
  },] }
@@ -3990,7 +3973,7 @@
3990
3973
  var DrDatePickerWithTimeframeComponent = /** @class */ (function (_super) {
3991
3974
  __extends(DrDatePickerWithTimeframeComponent, _super);
3992
3975
  function DrDatePickerWithTimeframeComponent(cdr, dateAdapter, datePickerService) {
3993
- var _a;
3976
+ var _b;
3994
3977
  var _this = _super.call(this, cdr, dateAdapter, datePickerService) || this;
3995
3978
  _this.cdr = cdr;
3996
3979
  _this.dateAdapter = dateAdapter;
@@ -3998,18 +3981,16 @@
3998
3981
  _this.isDashboardDatepicker = false;
3999
3982
  _this.canSelectTimeframe = true;
4000
3983
  _this.onChangeFormat = new i0.EventEmitter();
4001
- _this.pagingSetup = (_a = {},
4002
- _a[exports.TimeframeOption.YEAR] = function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
4003
- _a[exports.TimeframeOption.QUARTER] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 3, forward); },
4004
- _a[exports.TimeframeOption.MONTH] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
4005
- _a[exports.TimeframeOption.DAY] = function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); },
4006
- _a[exports.TimeframeOption.WEEK] = function (forward) { return _this.pagingDateChange('addCalendarDays', 7, forward); },
4007
- _a);
3984
+ _this.pagingSetup = (_b = {},
3985
+ _b[exports.TimeframeOption.YEAR] = function (forward) { return _this.pagingDateChange('addCalendarYears', 1, forward); },
3986
+ _b[exports.TimeframeOption.QUARTER] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 3, forward); },
3987
+ _b[exports.TimeframeOption.MONTH] = function (forward) { return _this.pagingDateChange('addCalendarMonths', 1, forward); },
3988
+ _b[exports.TimeframeOption.DAY] = function (forward) { return _this.pagingDateChange('addCalendarDays', 1, forward); },
3989
+ _b);
4008
3990
  datePickerService.isTimeframeSelectionEnabled = true;
4009
3991
  datePickerService.format$
4010
3992
  .pipe(operators.takeUntil(_this.destroyed$))
4011
3993
  .subscribe(function (value) {
4012
- datePickerService.format$.getValue();
4013
3994
  _this.onChangeFormat.emit(datePickerService.normalizeValue(value));
4014
3995
  });
4015
3996
  return _this;
@@ -4032,34 +4013,23 @@
4032
4013
  enumerable: false,
4033
4014
  configurable: true
4034
4015
  });
4035
- Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "availableTimeframes", {
4036
- set: function (value) {
4037
- if (value && value.length) {
4038
- this.datePickerService.availableTimeframes = value;
4039
- }
4040
- },
4041
- enumerable: false,
4042
- configurable: true
4043
- });
4044
4016
  Object.defineProperty(DrDatePickerWithTimeframeComponent.prototype, "displayedFormattedValue", {
4045
4017
  get: function () {
4018
+ var _a;
4046
4019
  if (!this.value) {
4047
4020
  return this.placeholder;
4048
4021
  }
4049
- var formatCached = this.datePickerService.format$.getValue();
4050
- switch (true) {
4051
- case formatCached === null || formatCached === void 0 ? void 0 : formatCached.includes('Q'):
4052
- return this.datePickerService.getQuarterDisplay(this.value);
4053
- case formatCached === null || formatCached === void 0 ? void 0 : formatCached.includes('W'):
4054
- return this.datePickerService.getWeekDisplay(this.value);
4055
- default:
4056
- return this.value.format(formatCached);
4057
- }
4022
+ return ((_a = this.datePickerService.format$.getValue()) === null || _a === void 0 ? void 0 : _a.includes('Q'))
4023
+ ? this.datePickerService.getQuarterDisplay(this.value)
4024
+ : this.value.format(this.datePickerService.format$.getValue());
4058
4025
  },
4059
4026
  enumerable: false,
4060
4027
  configurable: true
4061
4028
  });
4062
4029
  DrDatePickerWithTimeframeComponent.prototype.ngOnInit = function () {
4030
+ if (this.dateFormatConfig) {
4031
+ this.datePickerService.formatConfig = Object.assign(Object.assign({}, this.datePickerService.formatConfig), this.dateFormatConfig);
4032
+ }
4063
4033
  this.datePickerService.isTimeframeSelectionEnabled = this.canSelectTimeframe;
4064
4034
  this.cdr.markForCheck();
4065
4035
  };
@@ -4095,7 +4065,6 @@
4095
4065
  isDashboardDatepicker: [{ type: i0.Input }],
4096
4066
  dateFormatConfig: [{ type: i0.Input }],
4097
4067
  canSelectTimeframe: [{ type: i0.Input }],
4098
- availableTimeframes: [{ type: i0.Input }],
4099
4068
  onChangeFormat: [{ type: i0.Output }]
4100
4069
  };
4101
4070
 
@@ -4146,20 +4115,6 @@
4146
4115
  datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
4147
4116
  };
4148
4117
 
4149
- var DrShowTimeframePipe = /** @class */ (function () {
4150
- function DrShowTimeframePipe() {
4151
- }
4152
- DrShowTimeframePipe.prototype.transform = function (arr, showOptions) {
4153
- return arr.filter(function (item) { return showOptions.includes(item.timeframe); });
4154
- };
4155
- return DrShowTimeframePipe;
4156
- }());
4157
- DrShowTimeframePipe.decorators = [
4158
- { type: i0.Pipe, args: [{
4159
- name: 'drShowTimeframePipe'
4160
- },] }
4161
- ];
4162
-
4163
4118
  // !!! Please do not use such approach in other places
4164
4119
  // Hard fix for 'none' calendar view selection
4165
4120
  datepicker.MatCalendar.prototype.focusActiveCell = function () {
@@ -4179,8 +4134,7 @@
4179
4134
  DrDatePickerWithTimeframeComponent,
4180
4135
  DrDatePickerFormatDirective,
4181
4136
  DrDatePickerCustomHeaderComponent,
4182
- DrModelDebounceChangeDirective,
4183
- DrShowTimeframePipe
4137
+ DrModelDebounceChangeDirective
4184
4138
  ];
4185
4139
  var DrInputsModule = /** @class */ (function () {
4186
4140
  function DrInputsModule() {
@@ -4396,6 +4350,7 @@
4396
4350
  exports.DrPopoverRef = DrPopoverRef;
4397
4351
  exports.DrPopoverService = DrPopoverService;
4398
4352
  exports.DrSelectComponent = DrSelectComponent;
4353
+ exports.DrSharedUtils = DrSharedUtils;
4399
4354
  exports.DrSpinnerComponent = DrSpinnerComponent;
4400
4355
  exports.DrSpinnerDirective = DrSpinnerDirective;
4401
4356
  exports.DrSpinnerModule = DrSpinnerModule;
@@ -4425,7 +4380,6 @@
4425
4380
  exports["ɵe"] = DrDatePickerWithTimeframeComponent;
4426
4381
  exports["ɵf"] = DrDatePickerFormatDirective;
4427
4382
  exports["ɵg"] = DrDatePickerCustomHeaderComponent;
4428
- exports["ɵh"] = DrShowTimeframePipe;
4429
4383
 
4430
4384
  Object.defineProperty(exports, '__esModule', { value: true });
4431
4385