@datarailsshared/datarailsshared 1.4.164-rocket → 1.4.165-rocket

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 (29) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +9 -443
  2. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  3. package/datarailsshared-datarailsshared-1.4.165-rocket.tgz +0 -0
  4. package/datarailsshared-datarailsshared.d.ts +0 -2
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/datarailsshared-datarailsshared.js +1 -3
  7. package/esm2015/lib/date-tags/year-tag/year-tag.component.js +9 -4
  8. package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +2 -1
  9. package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +2 -1
  10. package/esm2015/public-api.js +1 -4
  11. package/fesm2015/datarailsshared-datarailsshared.js +12 -412
  12. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  13. package/lib/date-tags/date-tag.module.d.ts +2 -1
  14. package/lib/date-tags/year-tag/year-tag.component.d.ts +3 -1
  15. package/package.json +1 -1
  16. package/public-api.d.ts +0 -3
  17. package/datarailsshared-datarailsshared-1.4.164-rocket.tgz +0 -0
  18. package/esm2015/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.js +0 -87
  19. package/esm2015/lib/dr-scenario/components/dr-scenario-tag-configuration/dr-scenario-tag-configuration.component.js +0 -74
  20. package/esm2015/lib/dr-scenario/consts/scenario-tags-config.js +0 -73
  21. package/esm2015/lib/dr-scenario/dr-scenario.module.js +0 -28
  22. package/esm2015/lib/dr-scenario/interfaces/scenario.js +0 -8
  23. package/esm2015/lib/dr-scenario/services/scenario.service.js +0 -160
  24. package/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.d.ts +0 -25
  25. package/lib/dr-scenario/components/dr-scenario-tag-configuration/dr-scenario-tag-configuration.component.d.ts +0 -26
  26. package/lib/dr-scenario/consts/scenario-tags-config.d.ts +0 -24
  27. package/lib/dr-scenario/dr-scenario.module.d.ts +0 -2
  28. package/lib/dr-scenario/interfaces/scenario.d.ts +0 -43
  29. package/lib/dr-scenario/services/scenario.service.d.ts +0 -21
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, ViewEncapsulation, Input, Output, HostBinding, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, ViewChild, ContentChild, Pipe, TemplateRef, HostListener, Directive, ComponentFactoryResolver, ViewContainerRef, Injector, Injectable, Host, Optional, NgModule } from '@angular/core';
2
+ import { EventEmitter, Component, ViewEncapsulation, Input, Output, HostBinding, ChangeDetectorRef, ChangeDetectionStrategy, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, ViewChild, ContentChild, Pipe, TemplateRef, HostListener, Directive, ComponentFactoryResolver, ViewContainerRef, Injector, Injectable, Host, Optional, NgModule } from '@angular/core';
3
3
  import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS } from '@angular/material/core';
4
4
  import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
5
5
  import * as _ from 'lodash';
6
- import { find, map, merge, forEach, some, orderBy, filter as filter$1, reduce, cloneDeep, isObject, isNil, isNumber, includes } from 'lodash';
6
+ import { find, map, merge, forEach, some, reduce, isObject, isNil, isNumber } from 'lodash';
7
7
  import { NG_VALUE_ACCESSOR, FormGroupDirective, FormGroup, FormControl, NgModel, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
8
  import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
9
9
  import { Subject, from, merge as merge$1, fromEvent, noop as noop$1, BehaviorSubject } from 'rxjs';
@@ -514,8 +514,9 @@ const YEAR_FORMATS = {
514
514
  };
515
515
  const ɵ0$5 = YEAR_FORMATS;
516
516
  class YearTagComponent extends AnyTagComponent {
517
- constructor() {
517
+ constructor(cdr) {
518
518
  super();
519
+ this.cdr = cdr;
519
520
  this.lockedDate = [];
520
521
  }
521
522
  get isLocked() {
@@ -524,8 +525,10 @@ class YearTagComponent extends AnyTagComponent {
524
525
  initDate() {
525
526
  this.date = this.defaultValue || moment$4().unix();
526
527
  this.dateObj.date = this.date;
528
+ this.cdr.markForCheck();
527
529
  }
528
530
  initName() {
531
+ console.warn('bla bla bla');
529
532
  if (!this.name) {
530
533
  this.name = 'Year';
531
534
  }
@@ -566,7 +569,9 @@ YearTagComponent.decorators = [
566
569
  styles: [":host.locked>.tag-wrapper>dr-date-picker{opacity:.4}.tag__label{margin:0 0 4px;color:#0c142b;font-size:14px;font-weight:400;line-height:22px}\n"]
567
570
  },] }
568
571
  ];
569
- YearTagComponent.ctorParameters = () => [];
572
+ YearTagComponent.ctorParameters = () => [
573
+ { type: ChangeDetectorRef }
574
+ ];
570
575
  YearTagComponent.propDecorators = {
571
576
  isLocked: [{ type: HostBinding, args: ['class.locked',] }],
572
577
  lockedDate: [{ type: Input }]
@@ -3595,14 +3600,6 @@ var TooltipPosition;
3595
3600
  TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
3596
3601
  })(TooltipPosition || (TooltipPosition = {}));
3597
3602
 
3598
- var Scenario;
3599
- (function (Scenario) {
3600
- Scenario["ACTUALS"] = "Actuals";
3601
- Scenario["FORECAST"] = "Forecast";
3602
- Scenario["BUDGET"] = "Budget";
3603
- Scenario["NONE"] = "None";
3604
- })(Scenario || (Scenario = {}));
3605
-
3606
3603
  class DrModelDebounceChangeDirective {
3607
3604
  constructor(ngModel) {
3608
3605
  this.ngModel = ngModel;
@@ -3665,232 +3662,6 @@ class ChatMessage {
3665
3662
  }
3666
3663
  }
3667
3664
 
3668
- const allDateTags = {
3669
- [TagsConfigSubType.YEAR]: {
3670
- name: 'Date',
3671
- toggle: false,
3672
- },
3673
- [TagsConfigSubType.QUARTER]: {
3674
- name: 'Date',
3675
- toggle: false,
3676
- },
3677
- [TagsConfigSubType.MONTH]: {
3678
- name: 'Date',
3679
- toggle: false,
3680
- },
3681
- [TagsConfigSubType.DAY]: {
3682
- name: 'Date',
3683
- toggle: false,
3684
- },
3685
- [TagsConfigSubType.WEEK]: {
3686
- name: 'Date',
3687
- toggle: false,
3688
- }
3689
- };
3690
- function getScenarioTagDataConfig(isMultipleDimension) {
3691
- return {
3692
- [Scenario.ACTUALS]: Object.assign(Object.assign({}, allDateTags), { [TagsConfigSubType.MONTH]: {
3693
- name: 'Date',
3694
- toggle: true,
3695
- }, [TagsConfigSubType.FILE_STATUS]: {
3696
- toggle: false,
3697
- } }),
3698
- [Scenario.BUDGET]: {
3699
- [TagsConfigSubType.BUDGET_CYCLE]: {
3700
- toggle: true,
3701
- acceptableDateTags: [TagsConfigSubType.YEAR],
3702
- hidden: !isMultipleDimension,
3703
- },
3704
- [TagsConfigSubType.PLAN]: {
3705
- toggle: false,
3706
- turnOffDateTags: true,
3707
- hidden: isMultipleDimension,
3708
- },
3709
- [TagsConfigSubType.YEAR]: {
3710
- name: 'Date',
3711
- toggle: true,
3712
- },
3713
- [TagsConfigSubType.QUARTER]: {
3714
- name: 'Date',
3715
- toggle: false,
3716
- },
3717
- [TagsConfigSubType.FILE_STATUS]: {
3718
- toggle: false,
3719
- },
3720
- },
3721
- [Scenario.FORECAST]: {
3722
- [TagsConfigSubType.FORECAST_NEW]: {
3723
- toggle: true,
3724
- name: 'Date',
3725
- },
3726
- [TagsConfigSubType.FILE_STATUS]: {
3727
- toggle: false,
3728
- },
3729
- },
3730
- [Scenario.NONE]: Object.assign(Object.assign({}, allDateTags), { [TagsConfigSubType.MONTH]: {
3731
- name: 'Date',
3732
- toggle: true,
3733
- }, [TagsConfigSubType.FILE_STATUS]: {
3734
- toggle: true,
3735
- } }),
3736
- };
3737
- }
3738
-
3739
- class ScenarioService {
3740
- constructor() {
3741
- this.DEFAULT_FORECAST_DATE_TAG = 'Month';
3742
- }
3743
- get scenarios() {
3744
- return orderBy(Object.values(Scenario), (scenario) => scenario === Scenario.NONE ? 1 : 0);
3745
- }
3746
- get areExistingTagsConfig() {
3747
- return !!this.currentTagsConfig;
3748
- }
3749
- initScenarioTags(scenario, wholeTagsConfig, currentTagsConfig, isMultipleDimension = true) {
3750
- if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length) || !scenario)
3751
- return;
3752
- this.wholeTagsConfig = wholeTagsConfig;
3753
- this.currentTagsConfig = currentTagsConfig;
3754
- this.isMultipleDimension = isMultipleDimension;
3755
- }
3756
- getTagsConfigByScenarioTags(scenarioTags, tagsConfig) {
3757
- const scenarioTagsConfig = filter$1(tagsConfig, (tagConfig) => some(scenarioTags, (scenarioTag) => scenarioTag.toggle && scenarioTag.selectedTagSubType === tagConfig.options.sub_type));
3758
- return this.sortScenarioTags(scenarioTagsConfig);
3759
- }
3760
- getScenarioTagsByScenario(scenario) {
3761
- const scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
3762
- const scenarioTagsUi = [];
3763
- forEach(scenarioTagsConfig, (scenarioTag) => {
3764
- const isDateTag = scenarioTag.type === TagTypes.DATE;
3765
- const dateTag = isDateTag && find(scenarioTagsUi, { type: TagTypes.DATE });
3766
- const tag = dateTag || this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isDateTag);
3767
- if (isDateTag) {
3768
- this.updateScenarioDateTag(tag, scenarioTag);
3769
- }
3770
- if (dateTag)
3771
- return;
3772
- scenarioTagsUi.push(tag);
3773
- });
3774
- if (this.areExistingTagsConfig) {
3775
- this.initExistingTagsConfig(scenario, scenarioTagsUi);
3776
- }
3777
- const isTagNotSupportingDates = some(scenarioTagsUi, { turnOffDateTags: true, toggle: true });
3778
- if (isTagNotSupportingDates) {
3779
- this.turnOffDateTag(scenarioTagsUi);
3780
- }
3781
- const tagWithSpecificDateTags = find(scenarioTagsUi, (tag) => { var _a; return tag.toggle && !!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length); });
3782
- if (tagWithSpecificDateTags) {
3783
- this.hideNotAvailableTags(tagWithSpecificDateTags, scenarioTagsUi);
3784
- }
3785
- return this.sortScenarioTags(scenarioTagsUi);
3786
- }
3787
- sortScenarioTags(scenarioTagsUi) {
3788
- return orderBy(scenarioTagsUi, [
3789
- (tag) => (tag.type === TagTypes.DATE ? 0 : 1),
3790
- (tag) => (tag.name === 'File Status')
3791
- ]);
3792
- }
3793
- initExistingTagsConfig(scenario, scenarioTagsUi) {
3794
- forEach(this.currentTagsConfig, (tagConfig) => {
3795
- var _a, _b;
3796
- const tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
3797
- const scenarioTagDataConfig = getScenarioTagDataConfig(this.isMultipleDimension);
3798
- if (!((_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType]))
3799
- return;
3800
- const scenarioTagUi = tagConfig.type === TagTypes.DATE
3801
- ? find(scenarioTagsUi, { type: tagConfig.type })
3802
- : find(scenarioTagsUi, { selectedTagSubType: tagSubType });
3803
- scenarioTagUi.toggle = true;
3804
- scenarioTagUi.selectedTagSubType = tagSubType;
3805
- });
3806
- }
3807
- prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isDateTag) {
3808
- const toggleStatus = isDateTag
3809
- ? some(scenarioTagsConfig, (tag) => tag.type === TagTypes.DATE && tag.scenarioData.toggle)
3810
- : scenarioTag.scenarioData.toggle;
3811
- const selectedTagSubType = isDateTag
3812
- ? this.getScenarioSelectedDateTag(scenario, scenarioTagsConfig)
3813
- : scenarioTag.options.sub_type;
3814
- const tag = {
3815
- toggle: this.areExistingTagsConfig ? false : toggleStatus,
3816
- name: scenarioTag.scenarioData.name || scenarioTag.name,
3817
- description: scenarioTag.scenarioData.description || scenarioTag.description,
3818
- type: scenarioTag.type,
3819
- selectedTagSubType,
3820
- };
3821
- if (scenarioTag.scenarioData.turnOffDateTags) {
3822
- tag.turnOffDateTags = scenarioTag.scenarioData.turnOffDateTags;
3823
- }
3824
- if (scenarioTag.scenarioData.acceptableDateTags) {
3825
- tag.acceptableDateTags = scenarioTag.scenarioData.acceptableDateTags;
3826
- }
3827
- return tag;
3828
- }
3829
- updateScenarioDateTag(dateTag, scenarioTag) {
3830
- if (!dateTag.subTags) {
3831
- dateTag.subTags = [];
3832
- }
3833
- const tagSubType = scenarioTag.options.sub_type;
3834
- dateTag.subTags.push({
3835
- subType: tagSubType,
3836
- name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
3837
- });
3838
- }
3839
- turnOffDateTag(scenarioTags) {
3840
- const dateTag = find(scenarioTags, { type: TagTypes.DATE });
3841
- if (!dateTag)
3842
- return;
3843
- dateTag.toggle = false;
3844
- }
3845
- hideNotAvailableTags(tagWithSpecificDateTags, scenarioTags) {
3846
- var _a;
3847
- const subTags = (_a = find(scenarioTags, { type: TagTypes.DATE })) === null || _a === void 0 ? void 0 : _a.subTags;
3848
- if (!subTags.length)
3849
- return;
3850
- forEach(scenarioTags, (tag) => {
3851
- var _a;
3852
- if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
3853
- return;
3854
- if (tag !== tagWithSpecificDateTags) {
3855
- tag.toggle = false;
3856
- }
3857
- });
3858
- forEach(subTags, (subTag) => {
3859
- subTag.hidden = !tagWithSpecificDateTags.acceptableDateTags.includes(subTag.subType);
3860
- });
3861
- }
3862
- getScenarioSelectedDateTag(scenario, dateTags) {
3863
- var _a, _b;
3864
- const monthSubType = (_b = (_a = find(dateTags, (tag) => tag.options.sub_type === TagsConfigSubType.MONTH)) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type;
3865
- const scenarioSelectedDateTag = {
3866
- [Scenario.ACTUALS]: () => monthSubType,
3867
- [Scenario.BUDGET]: () => { var _a, _b; return (_b = (_a = find(dateTags, (tag) => tag.options.sub_type === TagsConfigSubType.YEAR)) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
3868
- [Scenario.FORECAST]: () => { var _a, _b; return (_b = (_a = find(dateTags, (tag) => tag.options.sub_type === TagsConfigSubType.FORECAST_NEW)) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
3869
- [Scenario.NONE]: () => monthSubType,
3870
- };
3871
- if (!scenarioSelectedDateTag[scenario])
3872
- return;
3873
- return scenarioSelectedDateTag[scenario]();
3874
- }
3875
- getScenarioTagsConfig(scenario, tagsConfig) {
3876
- return reduce(tagsConfig, (acc, tagConfig) => {
3877
- var _a, _b;
3878
- const tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
3879
- const scenarioTagDataConfig = getScenarioTagDataConfig(this.isMultipleDimension);
3880
- const scenarioTagConfig = (_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType];
3881
- if (!scenarioTagConfig || scenarioTagConfig.hidden)
3882
- return acc;
3883
- const clonedTagConfig = cloneDeep(tagConfig);
3884
- const scenarioTag = Object.assign(Object.assign({}, clonedTagConfig), { scenarioData: scenarioTagConfig });
3885
- acc.push(scenarioTag);
3886
- return acc;
3887
- }, []);
3888
- }
3889
- }
3890
- ScenarioService.decorators = [
3891
- { type: Injectable }
3892
- ];
3893
-
3894
3665
  class DrSharedUtils {
3895
3666
  /**
3896
3667
  * Get timeframe (day, year, month, quarter) based on passed format
@@ -3936,6 +3707,7 @@ class DrSharedUtils {
3936
3707
  }
3937
3708
  }
3938
3709
 
3710
+ // @ts-ignore
3939
3711
  const moment$2 = require('moment');
3940
3712
  class DrDatePickerService {
3941
3713
  constructor() {
@@ -4124,6 +3896,7 @@ DrDatePickerService.decorators = [
4124
3896
  { type: Injectable }
4125
3897
  ];
4126
3898
 
3899
+ // @ts-ignore
4127
3900
  const moment$1 = require('moment');
4128
3901
  class DrDatePickerCustomHeaderComponent {
4129
3902
  constructor(_calendar, _dateAdapter, _dateFormats, cdr, datePickerService) {
@@ -5903,184 +5676,11 @@ DrChatModule.decorators = [
5903
5676
  },] }
5904
5677
  ];
5905
5678
 
5906
- class DrScenarioConfigurationComponent {
5907
- constructor(scenarioService) {
5908
- this.scenarioService = scenarioService;
5909
- this.toggleButtonTheme = ToggleButtonTheme;
5910
- this._scenarioTags = [];
5911
- this.wholeTagsConfig = [];
5912
- this.selectedScenario = Scenario.ACTUALS;
5913
- this.scenarioDataChanged = new EventEmitter();
5914
- }
5915
- get scenarioTags() {
5916
- return this._scenarioTags;
5917
- }
5918
- set scenarioTags(tags) {
5919
- this._scenarioTags = tags;
5920
- this.tagNotSupportingDates = find(tags, { turnOffDateTags: true });
5921
- }
5922
- ngOnInit() {
5923
- this.scenarios = this.scenarioService.scenarios;
5924
- this.scenarioService.initScenarioTags(this.selectedScenario, this.wholeTagsConfig, this.currentTagsConfig);
5925
- this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(this.selectedScenario);
5926
- }
5927
- onScenarioChange(scenario) {
5928
- this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(scenario);
5929
- this.onScenarioDataChange();
5930
- }
5931
- onScenarioTagToggle(tag) {
5932
- this.tagNotSupportingDatesHandler(tag);
5933
- this.tagAcceptableDateHandler(tag);
5934
- this.onScenarioDataChange();
5935
- }
5936
- onScenarioDataChange() {
5937
- this.scenarioDataChanged.emit({
5938
- scenario: this.selectedScenario,
5939
- tagsConfig: this.scenarioService.getTagsConfigByScenarioTags(this.scenarioTags, this.wholeTagsConfig),
5940
- });
5941
- }
5942
- tagNotSupportingDatesHandler(tag) {
5943
- if (!this.tagNotSupportingDates || !tag.toggle)
5944
- return;
5945
- if (tag.type === TagTypes.DATE) {
5946
- this.tagNotSupportingDates.toggle = false;
5947
- }
5948
- if (tag === this.tagNotSupportingDates) {
5949
- const dateTag = find(this.scenarioTags, { type: TagTypes.DATE });
5950
- if (dateTag) {
5951
- dateTag.toggle = false;
5952
- }
5953
- }
5954
- }
5955
- tagAcceptableDateHandler(tag) {
5956
- var _a;
5957
- if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
5958
- return;
5959
- const dateTag = find(this.scenarioTags, { type: TagTypes.DATE });
5960
- if (!dateTag)
5961
- return;
5962
- dateTag.subTags = map(dateTag.subTags, (subTag) => {
5963
- subTag.hidden = tag.toggle && !includes(tag.acceptableDateTags, subTag.subType);
5964
- return subTag;
5965
- });
5966
- dateTag.selectedTagSubType = tag.acceptableDateTags[0];
5967
- }
5968
- }
5969
- DrScenarioConfigurationComponent.decorators = [
5970
- { type: Component, args: [{
5971
- selector: 'dr-scenario-configuration',
5972
- template: "<div class=\"scenario\">\n <div class=\"scenario__list\">\n <p class=\"scenario__title scenario__title-list\">Scenario</p>\n <dr-select [(ngModel)]=\"selectedScenario\"\n placeholder=\"select\"\n [items]=\"scenarios\"\n (ngModelChange)=\"onScenarioChange($event)\"></dr-select>\n </div>\n <div class=\"scenario__tags\">\n <p class=\"scenario__title--extra scenario__tags__title\">Tags</p>\n <div class=\"scenario__tag\" *ngFor=\"let tag of scenarioTags\">\n <div class=\"scenario__tag__header\">\n <p class=\"scenario__title\">{{ tag.name }}</p>\n <dr-toggle [(ngModel)]=\"tag.toggle\"\n (ngModelChange)=\"onScenarioTagToggle(tag)\"></dr-toggle>\n </div>\n <div class=\"scenario__tag__description\">\n <p class=\"scenario__text\">{{ tag.description }}</p>\n </div>\n <div *ngIf=\"tag.toggle\" class=\"scenario__tag__body\">\n <div *ngIf=\"tag.subTags?.length\" class=\"scenario__sub-tag\">\n <dr-toggle-button [(ngModel)]=\"tag.selectedTagSubType\"\n bindHidden=\"hidden\"\n bindLabel=\"name\"\n bindValue=\"subType\"\n [items]=\"tag.subTags\"\n [theme]=\"toggleButtonTheme.DOTTED\"\n (ngModelChange)=\"onScenarioDataChange()\"></dr-toggle-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n",
5973
- changeDetection: ChangeDetectionStrategy.OnPush,
5974
- styles: [".scenario__text,.scenario__title,.scenario__title--extra{padding:0;margin:0;color:#0c142b;font-weight:400;font-size:14px;line-height:22px}.scenario__title{font-weight:600}.scenario__title--extra{font-weight:700}.scenario__tags{margin-top:24px}.scenario__tags__title{margin-bottom:16px}.scenario__title-list{margin-bottom:4px}.scenario__tag{margin-bottom:24px;padding-top:16px;border-top:1px solid #dfe0e3}.scenario__tag__description{margin-top:5px}.scenario__tag__header{display:flex;justify-content:space-between}.scenario__sub-tag{margin-top:8px}:host::ng-deep .toggle-container__item{padding:2px 8px!important}\n"]
5975
- },] }
5976
- ];
5977
- DrScenarioConfigurationComponent.ctorParameters = () => [
5978
- { type: ScenarioService }
5979
- ];
5980
- DrScenarioConfigurationComponent.propDecorators = {
5981
- currentTagsConfig: [{ type: Input }],
5982
- wholeTagsConfig: [{ type: Input }],
5983
- selectedScenario: [{ type: Input }],
5984
- scenarioDataChanged: [{ type: Output }]
5985
- };
5986
-
5987
- class DrScenarioTagConfigurationComponent {
5988
- constructor() {
5989
- this.connectedTags = {};
5990
- this.dynamicTagValues = {};
5991
- this.lockedDates = [];
5992
- this.scenarioTagDataChanged = new EventEmitter();
5993
- this.currentTagsMap = {};
5994
- this._currentTags = [];
5995
- this.dynamicTagsToSave = [];
5996
- this.tagsToSave = [];
5997
- }
5998
- set currentTags(tags) {
5999
- this._currentTags = tags;
6000
- this.currentTagsMap = reduce(tags, (acc, curr) => {
6001
- var _a;
6002
- const tagId = (_a = find(this.tagsConfig, { name: curr.name })) === null || _a === void 0 ? void 0 : _a.id;
6003
- if (isNaN(tagId))
6004
- return acc;
6005
- acc[tagId] = curr;
6006
- return acc;
6007
- }, {});
6008
- }
6009
- get currentTags() {
6010
- return this._currentTags;
6011
- }
6012
- ngOnChanges(simpleChanges) {
6013
- this.currentTags = this.currentTags;
6014
- }
6015
- onTagChange($event) {
6016
- const savedTag = find(this.tagsToSave, { id: $event.id });
6017
- if (savedTag) {
6018
- merge(savedTag, $event);
6019
- }
6020
- else {
6021
- this.tagsToSave.push($event);
6022
- }
6023
- this.onScenarioTagDataChanged();
6024
- }
6025
- onDynamicTagsChange($event) {
6026
- this.dynamicTagsToSave = $event;
6027
- this.onScenarioTagDataChanged();
6028
- }
6029
- onScenarioTagDataChanged() {
6030
- const tags = [...this.dynamicTagsToSave, ...this.tagsToSave];
6031
- this.scenarioTagDataChanged.emit({
6032
- scenario: this.scenario,
6033
- tagsConfig: this.tagsConfig,
6034
- tags,
6035
- });
6036
- }
6037
- }
6038
- DrScenarioTagConfigurationComponent.decorators = [
6039
- { type: Component, args: [{
6040
- selector: 'dr-scenario-tag-configuration',
6041
- template: "<div class=\"scenario-tag-configuration\"\n *ngFor=\"let tagConfig of tagsConfig\">\n <dr-tag [tagConfig]=\"tagConfig\"\n [selectedTag]=\"currentTagsMap[tagConfig.id]\"\n [lockedDate]=\"lockedDates\"\n [fiscalYearStartsFrom]=\"fiscalYearStartsFrom\"\n [fiscalYearBack]=\"fiscalYearBack\"\n [tagsConfig]=\"tagsConfig\"\n [dynamicTagValues]=\"dynamicTagValues\"\n [connectedTags]=\"connectedTags[tagConfig.id]\"\n [isDynamicTagAddEnabled]=\"isDynamicAddEnabled\"\n (tagChange)=\"onTagChange($event)\"\n (dynamicTagChange)=\"onDynamicTagsChange($event)\"></dr-tag>\n</div>\n",
6042
- changeDetection: ChangeDetectionStrategy.OnPush,
6043
- styles: [".scenario-tag-configuration{margin-bottom:24px}.scenario-tag-configuration:last-child{margin-bottom:0}:host::ng-deep .tag__label,:host::ng-deep .dynamic-tag__label{font-weight:600!important}\n"]
6044
- },] }
6045
- ];
6046
- DrScenarioTagConfigurationComponent.propDecorators = {
6047
- tagsConfig: [{ type: Input }],
6048
- currentTags: [{ type: Input }],
6049
- scenario: [{ type: Input }],
6050
- connectedTags: [{ type: Input }],
6051
- dynamicTagValues: [{ type: Input }],
6052
- lockedDates: [{ type: Input }],
6053
- fiscalYearStartsFrom: [{ type: Input }],
6054
- fiscalYearBack: [{ type: Input }],
6055
- isDynamicAddEnabled: [{ type: Input }],
6056
- scenarioTagDataChanged: [{ type: Output }]
6057
- };
6058
-
6059
- const COMPONENTS = [
6060
- DrScenarioConfigurationComponent,
6061
- DrScenarioTagConfigurationComponent,
6062
- ];
6063
- class DrScenarioModule {
6064
- }
6065
- DrScenarioModule.decorators = [
6066
- { type: NgModule, args: [{
6067
- declarations: [...COMPONENTS],
6068
- providers: [ScenarioService],
6069
- imports: [
6070
- CommonModule,
6071
- DrInputsModule,
6072
- FormsModule,
6073
- DrTagModule
6074
- ],
6075
- exports: [...COMPONENTS],
6076
- },] }
6077
- ];
6078
-
6079
5679
  /* components */
6080
5680
 
6081
5681
  /**
6082
5682
  * Generated bundle index. Do not edit.
6083
5683
  */
6084
5684
 
6085
- export { AnyTagComponent, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DateTags, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrChatModule, DrDetailsListComponent, DrDetailsListModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrScenarioModule, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, Scenario, ScenarioService, SpinnerSize, SpinnerType, TagTypes, TimeframeOption, ToggleButtonTheme, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, DrScenarioConfigurationComponent as ɵba, DrScenarioTagConfigurationComponent as ɵbb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, DrSelectAddItemComponent as ɵi, TooltipInfoComponent as ɵj, TooltipInfoSimpleComponent as ɵk, TooltipNoBodyComponent as ɵl, TooltipProcessDefaultComponent as ɵm, DrDynamicTagModule as ɵn, DrDynamicTagComponent as ɵo, StepperComponent as ɵp, DialogWrapperComponent as ɵq, DialogModalWrapperComponent as ɵr, DrChatComponent as ɵs, DrChatCustomMessageService as ɵt, DrChatMessageComponent as ɵu, DrChatFormComponent as ɵv, DrChatSuggestionsComponent as ɵw, DrChatMessageTextComponent as ɵx, DrChatMessageFileComponent as ɵy, DrChatCustomMessageDirective as ɵz };
5685
+ export { AnyTagComponent, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DateTags, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrChatModule, DrDetailsListComponent, DrDetailsListModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TagTypes, TimeframeOption, ToggleButtonTheme, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, DrSelectAddItemComponent as ɵi, TooltipInfoComponent as ɵj, TooltipInfoSimpleComponent as ɵk, TooltipNoBodyComponent as ɵl, TooltipProcessDefaultComponent as ɵm, DrDynamicTagModule as ɵn, DrDynamicTagComponent as ɵo, StepperComponent as ɵp, DialogWrapperComponent as ɵq, DialogModalWrapperComponent as ɵr, DrChatComponent as ɵs, DrChatCustomMessageService as ɵt, DrChatMessageComponent as ɵu, DrChatFormComponent as ɵv, DrChatSuggestionsComponent as ɵw, DrChatMessageTextComponent as ɵx, DrChatMessageFileComponent as ɵy, DrChatCustomMessageDirective as ɵz };
6086
5686
  //# sourceMappingURL=datarailsshared-datarailsshared.js.map