@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
@@ -889,8 +889,9 @@
889
889
  var ɵ0$5 = YEAR_FORMATS;
890
890
  var YearTagComponent = /** @class */ (function (_super) {
891
891
  __extends(YearTagComponent, _super);
892
- function YearTagComponent() {
892
+ function YearTagComponent(cdr) {
893
893
  var _this = _super.call(this) || this;
894
+ _this.cdr = cdr;
894
895
  _this.lockedDate = [];
895
896
  return _this;
896
897
  }
@@ -904,8 +905,10 @@
904
905
  YearTagComponent.prototype.initDate = function () {
905
906
  this.date = this.defaultValue || moment$4().unix();
906
907
  this.dateObj.date = this.date;
908
+ this.cdr.markForCheck();
907
909
  };
908
910
  YearTagComponent.prototype.initName = function () {
911
+ console.warn('bla bla bla');
909
912
  if (!this.name) {
910
913
  this.name = 'Year';
911
914
  }
@@ -947,7 +950,9 @@
947
950
  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"]
948
951
  },] }
949
952
  ];
950
- YearTagComponent.ctorParameters = function () { return []; };
953
+ YearTagComponent.ctorParameters = function () { return [
954
+ { type: i0.ChangeDetectorRef }
955
+ ]; };
951
956
  YearTagComponent.propDecorators = {
952
957
  isLocked: [{ type: i0.HostBinding, args: ['class.locked',] }],
953
958
  lockedDate: [{ type: i0.Input }]
@@ -4223,14 +4228,6 @@
4223
4228
  TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
4224
4229
  })(exports.TooltipPosition || (exports.TooltipPosition = {}));
4225
4230
 
4226
- exports.Scenario = void 0;
4227
- (function (Scenario) {
4228
- Scenario["ACTUALS"] = "Actuals";
4229
- Scenario["FORECAST"] = "Forecast";
4230
- Scenario["BUDGET"] = "Budget";
4231
- Scenario["NONE"] = "None";
4232
- })(exports.Scenario || (exports.Scenario = {}));
4233
-
4234
4231
  var DrModelDebounceChangeDirective = /** @class */ (function () {
4235
4232
  function DrModelDebounceChangeDirective(ngModel) {
4236
4233
  this.ngModel = ngModel;
@@ -4296,248 +4293,6 @@
4296
4293
  return ChatMessage;
4297
4294
  }());
4298
4295
 
4299
- var _a;
4300
- var allDateTags = (_a = {},
4301
- _a[TagsConfigSubType.YEAR] = {
4302
- name: 'Date',
4303
- toggle: false,
4304
- },
4305
- _a[TagsConfigSubType.QUARTER] = {
4306
- name: 'Date',
4307
- toggle: false,
4308
- },
4309
- _a[TagsConfigSubType.MONTH] = {
4310
- name: 'Date',
4311
- toggle: false,
4312
- },
4313
- _a[TagsConfigSubType.DAY] = {
4314
- name: 'Date',
4315
- toggle: false,
4316
- },
4317
- _a[TagsConfigSubType.WEEK] = {
4318
- name: 'Date',
4319
- toggle: false,
4320
- },
4321
- _a);
4322
- function getScenarioTagDataConfig(isMultipleDimension) {
4323
- var _a, _b, _c, _d, _e;
4324
- return _a = {},
4325
- _a[exports.Scenario.ACTUALS] = Object.assign(Object.assign({}, allDateTags), (_b = {}, _b[TagsConfigSubType.MONTH] = {
4326
- name: 'Date',
4327
- toggle: true,
4328
- }, _b[TagsConfigSubType.FILE_STATUS] = {
4329
- toggle: false,
4330
- }, _b)),
4331
- _a[exports.Scenario.BUDGET] = (_c = {},
4332
- _c[TagsConfigSubType.BUDGET_CYCLE] = {
4333
- toggle: true,
4334
- acceptableDateTags: [TagsConfigSubType.YEAR],
4335
- hidden: !isMultipleDimension,
4336
- },
4337
- _c[TagsConfigSubType.PLAN] = {
4338
- toggle: false,
4339
- turnOffDateTags: true,
4340
- hidden: isMultipleDimension,
4341
- },
4342
- _c[TagsConfigSubType.YEAR] = {
4343
- name: 'Date',
4344
- toggle: true,
4345
- },
4346
- _c[TagsConfigSubType.QUARTER] = {
4347
- name: 'Date',
4348
- toggle: false,
4349
- },
4350
- _c[TagsConfigSubType.FILE_STATUS] = {
4351
- toggle: false,
4352
- },
4353
- _c),
4354
- _a[exports.Scenario.FORECAST] = (_d = {},
4355
- _d[TagsConfigSubType.FORECAST_NEW] = {
4356
- toggle: true,
4357
- name: 'Date',
4358
- },
4359
- _d[TagsConfigSubType.FILE_STATUS] = {
4360
- toggle: false,
4361
- },
4362
- _d),
4363
- _a[exports.Scenario.NONE] = Object.assign(Object.assign({}, allDateTags), (_e = {}, _e[TagsConfigSubType.MONTH] = {
4364
- name: 'Date',
4365
- toggle: true,
4366
- }, _e[TagsConfigSubType.FILE_STATUS] = {
4367
- toggle: true,
4368
- }, _e)),
4369
- _a;
4370
- }
4371
-
4372
- var ScenarioService = /** @class */ (function () {
4373
- function ScenarioService() {
4374
- this.DEFAULT_FORECAST_DATE_TAG = 'Month';
4375
- }
4376
- Object.defineProperty(ScenarioService.prototype, "scenarios", {
4377
- get: function () {
4378
- return _.orderBy(Object.values(exports.Scenario), function (scenario) { return scenario === exports.Scenario.NONE ? 1 : 0; });
4379
- },
4380
- enumerable: false,
4381
- configurable: true
4382
- });
4383
- Object.defineProperty(ScenarioService.prototype, "areExistingTagsConfig", {
4384
- get: function () {
4385
- return !!this.currentTagsConfig;
4386
- },
4387
- enumerable: false,
4388
- configurable: true
4389
- });
4390
- ScenarioService.prototype.initScenarioTags = function (scenario, wholeTagsConfig, currentTagsConfig, isMultipleDimension) {
4391
- if (isMultipleDimension === void 0) { isMultipleDimension = true; }
4392
- if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length) || !scenario)
4393
- return;
4394
- this.wholeTagsConfig = wholeTagsConfig;
4395
- this.currentTagsConfig = currentTagsConfig;
4396
- this.isMultipleDimension = isMultipleDimension;
4397
- };
4398
- ScenarioService.prototype.getTagsConfigByScenarioTags = function (scenarioTags, tagsConfig) {
4399
- var scenarioTagsConfig = _.filter(tagsConfig, function (tagConfig) { return _.some(scenarioTags, function (scenarioTag) { return scenarioTag.toggle && scenarioTag.selectedTagSubType === tagConfig.options.sub_type; }); });
4400
- return this.sortScenarioTags(scenarioTagsConfig);
4401
- };
4402
- ScenarioService.prototype.getScenarioTagsByScenario = function (scenario) {
4403
- var _this = this;
4404
- var scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
4405
- var scenarioTagsUi = [];
4406
- _.forEach(scenarioTagsConfig, function (scenarioTag) {
4407
- var isDateTag = scenarioTag.type === exports.TagTypes.DATE;
4408
- var dateTag = isDateTag && _.find(scenarioTagsUi, { type: exports.TagTypes.DATE });
4409
- var tag = dateTag || _this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isDateTag);
4410
- if (isDateTag) {
4411
- _this.updateScenarioDateTag(tag, scenarioTag);
4412
- }
4413
- if (dateTag)
4414
- return;
4415
- scenarioTagsUi.push(tag);
4416
- });
4417
- if (this.areExistingTagsConfig) {
4418
- this.initExistingTagsConfig(scenario, scenarioTagsUi);
4419
- }
4420
- var isTagNotSupportingDates = _.some(scenarioTagsUi, { turnOffDateTags: true, toggle: true });
4421
- if (isTagNotSupportingDates) {
4422
- this.turnOffDateTag(scenarioTagsUi);
4423
- }
4424
- var tagWithSpecificDateTags = _.find(scenarioTagsUi, function (tag) { var _a; return tag.toggle && !!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length); });
4425
- if (tagWithSpecificDateTags) {
4426
- this.hideNotAvailableTags(tagWithSpecificDateTags, scenarioTagsUi);
4427
- }
4428
- return this.sortScenarioTags(scenarioTagsUi);
4429
- };
4430
- ScenarioService.prototype.sortScenarioTags = function (scenarioTagsUi) {
4431
- return _.orderBy(scenarioTagsUi, [
4432
- function (tag) { return (tag.type === exports.TagTypes.DATE ? 0 : 1); },
4433
- function (tag) { return (tag.name === 'File Status'); }
4434
- ]);
4435
- };
4436
- ScenarioService.prototype.initExistingTagsConfig = function (scenario, scenarioTagsUi) {
4437
- var _this = this;
4438
- _.forEach(this.currentTagsConfig, function (tagConfig) {
4439
- var _a, _b;
4440
- var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
4441
- var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
4442
- if (!((_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType]))
4443
- return;
4444
- var scenarioTagUi = tagConfig.type === exports.TagTypes.DATE
4445
- ? _.find(scenarioTagsUi, { type: tagConfig.type })
4446
- : _.find(scenarioTagsUi, { selectedTagSubType: tagSubType });
4447
- scenarioTagUi.toggle = true;
4448
- scenarioTagUi.selectedTagSubType = tagSubType;
4449
- });
4450
- };
4451
- ScenarioService.prototype.prepareScenarioTag = function (scenarioTagsConfig, scenarioTag, scenario, isDateTag) {
4452
- var toggleStatus = isDateTag
4453
- ? _.some(scenarioTagsConfig, function (tag) { return tag.type === exports.TagTypes.DATE && tag.scenarioData.toggle; })
4454
- : scenarioTag.scenarioData.toggle;
4455
- var selectedTagSubType = isDateTag
4456
- ? this.getScenarioSelectedDateTag(scenario, scenarioTagsConfig)
4457
- : scenarioTag.options.sub_type;
4458
- var tag = {
4459
- toggle: this.areExistingTagsConfig ? false : toggleStatus,
4460
- name: scenarioTag.scenarioData.name || scenarioTag.name,
4461
- description: scenarioTag.scenarioData.description || scenarioTag.description,
4462
- type: scenarioTag.type,
4463
- selectedTagSubType: selectedTagSubType,
4464
- };
4465
- if (scenarioTag.scenarioData.turnOffDateTags) {
4466
- tag.turnOffDateTags = scenarioTag.scenarioData.turnOffDateTags;
4467
- }
4468
- if (scenarioTag.scenarioData.acceptableDateTags) {
4469
- tag.acceptableDateTags = scenarioTag.scenarioData.acceptableDateTags;
4470
- }
4471
- return tag;
4472
- };
4473
- ScenarioService.prototype.updateScenarioDateTag = function (dateTag, scenarioTag) {
4474
- if (!dateTag.subTags) {
4475
- dateTag.subTags = [];
4476
- }
4477
- var tagSubType = scenarioTag.options.sub_type;
4478
- dateTag.subTags.push({
4479
- subType: tagSubType,
4480
- name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
4481
- });
4482
- };
4483
- ScenarioService.prototype.turnOffDateTag = function (scenarioTags) {
4484
- var dateTag = _.find(scenarioTags, { type: exports.TagTypes.DATE });
4485
- if (!dateTag)
4486
- return;
4487
- dateTag.toggle = false;
4488
- };
4489
- ScenarioService.prototype.hideNotAvailableTags = function (tagWithSpecificDateTags, scenarioTags) {
4490
- var _a;
4491
- var subTags = (_a = _.find(scenarioTags, { type: exports.TagTypes.DATE })) === null || _a === void 0 ? void 0 : _a.subTags;
4492
- if (!subTags.length)
4493
- return;
4494
- _.forEach(scenarioTags, function (tag) {
4495
- var _a;
4496
- if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
4497
- return;
4498
- if (tag !== tagWithSpecificDateTags) {
4499
- tag.toggle = false;
4500
- }
4501
- });
4502
- _.forEach(subTags, function (subTag) {
4503
- subTag.hidden = !tagWithSpecificDateTags.acceptableDateTags.includes(subTag.subType);
4504
- });
4505
- };
4506
- ScenarioService.prototype.getScenarioSelectedDateTag = function (scenario, dateTags) {
4507
- var _c;
4508
- var _a, _b;
4509
- var monthSubType = (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.MONTH; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type;
4510
- var scenarioSelectedDateTag = (_c = {},
4511
- _c[exports.Scenario.ACTUALS] = function () { return monthSubType; },
4512
- _c[exports.Scenario.BUDGET] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.YEAR; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
4513
- _c[exports.Scenario.FORECAST] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.FORECAST_NEW; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
4514
- _c[exports.Scenario.NONE] = function () { return monthSubType; },
4515
- _c);
4516
- if (!scenarioSelectedDateTag[scenario])
4517
- return;
4518
- return scenarioSelectedDateTag[scenario]();
4519
- };
4520
- ScenarioService.prototype.getScenarioTagsConfig = function (scenario, tagsConfig) {
4521
- var _this = this;
4522
- return _.reduce(tagsConfig, function (acc, tagConfig) {
4523
- var _a, _b;
4524
- var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
4525
- var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
4526
- var scenarioTagConfig = (_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType];
4527
- if (!scenarioTagConfig || scenarioTagConfig.hidden)
4528
- return acc;
4529
- var clonedTagConfig = _.cloneDeep(tagConfig);
4530
- var scenarioTag = Object.assign(Object.assign({}, clonedTagConfig), { scenarioData: scenarioTagConfig });
4531
- acc.push(scenarioTag);
4532
- return acc;
4533
- }, []);
4534
- };
4535
- return ScenarioService;
4536
- }());
4537
- ScenarioService.decorators = [
4538
- { type: i0.Injectable }
4539
- ];
4540
-
4541
4296
  var DrSharedUtils = /** @class */ (function () {
4542
4297
  function DrSharedUtils() {
4543
4298
  }
@@ -4586,6 +4341,7 @@
4586
4341
  return DrSharedUtils;
4587
4342
  }());
4588
4343
 
4344
+ // @ts-ignore
4589
4345
  var moment$2 = require('moment');
4590
4346
  var DrDatePickerService = /** @class */ (function () {
4591
4347
  function DrDatePickerService() {
@@ -4776,6 +4532,7 @@
4776
4532
  { type: i0.Injectable }
4777
4533
  ];
4778
4534
 
4535
+ // @ts-ignore
4779
4536
  var moment$1 = require('moment');
4780
4537
  var DrDatePickerCustomHeaderComponent = /** @class */ (function () {
4781
4538
  function DrDatePickerCustomHeaderComponent(_calendar, _dateAdapter, _dateFormats, cdr, datePickerService) {
@@ -6752,193 +6509,6 @@
6752
6509
  },] }
6753
6510
  ];
6754
6511
 
6755
- var DrScenarioConfigurationComponent = /** @class */ (function () {
6756
- function DrScenarioConfigurationComponent(scenarioService) {
6757
- this.scenarioService = scenarioService;
6758
- this.toggleButtonTheme = exports.ToggleButtonTheme;
6759
- this._scenarioTags = [];
6760
- this.wholeTagsConfig = [];
6761
- this.selectedScenario = exports.Scenario.ACTUALS;
6762
- this.scenarioDataChanged = new i0.EventEmitter();
6763
- }
6764
- Object.defineProperty(DrScenarioConfigurationComponent.prototype, "scenarioTags", {
6765
- get: function () {
6766
- return this._scenarioTags;
6767
- },
6768
- set: function (tags) {
6769
- this._scenarioTags = tags;
6770
- this.tagNotSupportingDates = _.find(tags, { turnOffDateTags: true });
6771
- },
6772
- enumerable: false,
6773
- configurable: true
6774
- });
6775
- DrScenarioConfigurationComponent.prototype.ngOnInit = function () {
6776
- this.scenarios = this.scenarioService.scenarios;
6777
- this.scenarioService.initScenarioTags(this.selectedScenario, this.wholeTagsConfig, this.currentTagsConfig);
6778
- this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(this.selectedScenario);
6779
- };
6780
- DrScenarioConfigurationComponent.prototype.onScenarioChange = function (scenario) {
6781
- this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(scenario);
6782
- this.onScenarioDataChange();
6783
- };
6784
- DrScenarioConfigurationComponent.prototype.onScenarioTagToggle = function (tag) {
6785
- this.tagNotSupportingDatesHandler(tag);
6786
- this.tagAcceptableDateHandler(tag);
6787
- this.onScenarioDataChange();
6788
- };
6789
- DrScenarioConfigurationComponent.prototype.onScenarioDataChange = function () {
6790
- this.scenarioDataChanged.emit({
6791
- scenario: this.selectedScenario,
6792
- tagsConfig: this.scenarioService.getTagsConfigByScenarioTags(this.scenarioTags, this.wholeTagsConfig),
6793
- });
6794
- };
6795
- DrScenarioConfigurationComponent.prototype.tagNotSupportingDatesHandler = function (tag) {
6796
- if (!this.tagNotSupportingDates || !tag.toggle)
6797
- return;
6798
- if (tag.type === exports.TagTypes.DATE) {
6799
- this.tagNotSupportingDates.toggle = false;
6800
- }
6801
- if (tag === this.tagNotSupportingDates) {
6802
- var dateTag = _.find(this.scenarioTags, { type: exports.TagTypes.DATE });
6803
- if (dateTag) {
6804
- dateTag.toggle = false;
6805
- }
6806
- }
6807
- };
6808
- DrScenarioConfigurationComponent.prototype.tagAcceptableDateHandler = function (tag) {
6809
- var _a;
6810
- if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
6811
- return;
6812
- var dateTag = _.find(this.scenarioTags, { type: exports.TagTypes.DATE });
6813
- if (!dateTag)
6814
- return;
6815
- dateTag.subTags = _.map(dateTag.subTags, function (subTag) {
6816
- subTag.hidden = tag.toggle && !_.includes(tag.acceptableDateTags, subTag.subType);
6817
- return subTag;
6818
- });
6819
- dateTag.selectedTagSubType = tag.acceptableDateTags[0];
6820
- };
6821
- return DrScenarioConfigurationComponent;
6822
- }());
6823
- DrScenarioConfigurationComponent.decorators = [
6824
- { type: i0.Component, args: [{
6825
- selector: 'dr-scenario-configuration',
6826
- 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",
6827
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
6828
- 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"]
6829
- },] }
6830
- ];
6831
- DrScenarioConfigurationComponent.ctorParameters = function () { return [
6832
- { type: ScenarioService }
6833
- ]; };
6834
- DrScenarioConfigurationComponent.propDecorators = {
6835
- currentTagsConfig: [{ type: i0.Input }],
6836
- wholeTagsConfig: [{ type: i0.Input }],
6837
- selectedScenario: [{ type: i0.Input }],
6838
- scenarioDataChanged: [{ type: i0.Output }]
6839
- };
6840
-
6841
- var DrScenarioTagConfigurationComponent = /** @class */ (function () {
6842
- function DrScenarioTagConfigurationComponent() {
6843
- this.connectedTags = {};
6844
- this.dynamicTagValues = {};
6845
- this.lockedDates = [];
6846
- this.scenarioTagDataChanged = new i0.EventEmitter();
6847
- this.currentTagsMap = {};
6848
- this._currentTags = [];
6849
- this.dynamicTagsToSave = [];
6850
- this.tagsToSave = [];
6851
- }
6852
- Object.defineProperty(DrScenarioTagConfigurationComponent.prototype, "currentTags", {
6853
- get: function () {
6854
- return this._currentTags;
6855
- },
6856
- set: function (tags) {
6857
- var _this = this;
6858
- this._currentTags = tags;
6859
- this.currentTagsMap = _.reduce(tags, function (acc, curr) {
6860
- var _a;
6861
- var tagId = (_a = _.find(_this.tagsConfig, { name: curr.name })) === null || _a === void 0 ? void 0 : _a.id;
6862
- if (isNaN(tagId))
6863
- return acc;
6864
- acc[tagId] = curr;
6865
- return acc;
6866
- }, {});
6867
- },
6868
- enumerable: false,
6869
- configurable: true
6870
- });
6871
- DrScenarioTagConfigurationComponent.prototype.ngOnChanges = function (simpleChanges) {
6872
- this.currentTags = this.currentTags;
6873
- };
6874
- DrScenarioTagConfigurationComponent.prototype.onTagChange = function ($event) {
6875
- var savedTag = _.find(this.tagsToSave, { id: $event.id });
6876
- if (savedTag) {
6877
- _.merge(savedTag, $event);
6878
- }
6879
- else {
6880
- this.tagsToSave.push($event);
6881
- }
6882
- this.onScenarioTagDataChanged();
6883
- };
6884
- DrScenarioTagConfigurationComponent.prototype.onDynamicTagsChange = function ($event) {
6885
- this.dynamicTagsToSave = $event;
6886
- this.onScenarioTagDataChanged();
6887
- };
6888
- DrScenarioTagConfigurationComponent.prototype.onScenarioTagDataChanged = function () {
6889
- var tags = __spreadArray(__spreadArray([], __read(this.dynamicTagsToSave)), __read(this.tagsToSave));
6890
- this.scenarioTagDataChanged.emit({
6891
- scenario: this.scenario,
6892
- tagsConfig: this.tagsConfig,
6893
- tags: tags,
6894
- });
6895
- };
6896
- return DrScenarioTagConfigurationComponent;
6897
- }());
6898
- DrScenarioTagConfigurationComponent.decorators = [
6899
- { type: i0.Component, args: [{
6900
- selector: 'dr-scenario-tag-configuration',
6901
- 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",
6902
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
6903
- 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"]
6904
- },] }
6905
- ];
6906
- DrScenarioTagConfigurationComponent.propDecorators = {
6907
- tagsConfig: [{ type: i0.Input }],
6908
- currentTags: [{ type: i0.Input }],
6909
- scenario: [{ type: i0.Input }],
6910
- connectedTags: [{ type: i0.Input }],
6911
- dynamicTagValues: [{ type: i0.Input }],
6912
- lockedDates: [{ type: i0.Input }],
6913
- fiscalYearStartsFrom: [{ type: i0.Input }],
6914
- fiscalYearBack: [{ type: i0.Input }],
6915
- isDynamicAddEnabled: [{ type: i0.Input }],
6916
- scenarioTagDataChanged: [{ type: i0.Output }]
6917
- };
6918
-
6919
- var COMPONENTS = [
6920
- DrScenarioConfigurationComponent,
6921
- DrScenarioTagConfigurationComponent,
6922
- ];
6923
- var DrScenarioModule = /** @class */ (function () {
6924
- function DrScenarioModule() {
6925
- }
6926
- return DrScenarioModule;
6927
- }());
6928
- DrScenarioModule.decorators = [
6929
- { type: i0.NgModule, args: [{
6930
- declarations: __spreadArray([], __read(COMPONENTS)),
6931
- providers: [ScenarioService],
6932
- imports: [
6933
- common.CommonModule,
6934
- DrInputsModule,
6935
- forms.FormsModule,
6936
- DrTagModule
6937
- ],
6938
- exports: __spreadArray([], __read(COMPONENTS)),
6939
- },] }
6940
- ];
6941
-
6942
6512
  /* components */
6943
6513
 
6944
6514
  /**
@@ -6986,7 +6556,6 @@
6986
6556
  exports.DrPopoverModule = DrPopoverModule;
6987
6557
  exports.DrPopoverRef = DrPopoverRef;
6988
6558
  exports.DrPopoverService = DrPopoverService;
6989
- exports.DrScenarioModule = DrScenarioModule;
6990
6559
  exports.DrSelectComponent = DrSelectComponent;
6991
6560
  exports.DrSharedUtils = DrSharedUtils;
6992
6561
  exports.DrSpinnerComponent = DrSpinnerComponent;
@@ -7010,14 +6579,11 @@
7010
6579
  exports.QuarterTagComponent = QuarterTagComponent;
7011
6580
  exports.RadioButtonComponent = RadioButtonComponent;
7012
6581
  exports.RadioGroupComponent = RadioGroupComponent;
7013
- exports.ScenarioService = ScenarioService;
7014
6582
  exports.TooltipComponent = TooltipComponent;
7015
6583
  exports.WeekTagComponent = WeekTagComponent;
7016
6584
  exports.YearTagComponent = YearTagComponent;
7017
6585
  exports["ɵa"] = components$2;
7018
6586
  exports["ɵb"] = POPUP_ANIMATION;
7019
- exports["ɵba"] = DrScenarioConfigurationComponent;
7020
- exports["ɵbb"] = DrScenarioTagConfigurationComponent;
7021
6587
  exports["ɵc"] = DrDatePickerComponent;
7022
6588
  exports["ɵd"] = DrDatePickerService;
7023
6589
  exports["ɵe"] = DrDatePickerWithTimeframeComponent;