@datarailsshared/datarailsshared 1.4.152 → 1.4.153-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.
- package/bundles/datarailsshared-datarailsshared.umd.js +516 -40
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.153-rocket.tgz +0 -0
- package/datarailsshared-datarailsshared.d.ts +2 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/datarailsshared-datarailsshared.js +3 -1
- package/esm2015/lib/date-tags/day-tag/day-tag.component.js +3 -8
- package/esm2015/lib/date-tags/month-tag/month-tag.component.js +3 -8
- package/esm2015/lib/date-tags/year-tag/year-tag.component.js +3 -8
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.js +17 -9
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +3 -3
- package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +5 -2
- package/esm2015/lib/dr-inputs/dr-inputs.module.js +3 -2
- package/esm2015/lib/dr-inputs/dr-toggle-button/dr-toggle-button.component.js +8 -3
- package/esm2015/lib/dr-inputs/dr-toggle-button/toggle-button-theme.js +6 -0
- package/esm2015/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.js +87 -0
- package/esm2015/lib/dr-scenario/components/dr-scenario-tag-configuration/dr-scenario-tag-configuration.component.js +74 -0
- package/esm2015/lib/dr-scenario/consts/scenario-tags-config.js +73 -0
- package/esm2015/lib/dr-scenario/dr-scenario.module.js +28 -0
- package/esm2015/lib/dr-scenario/interfaces/scenario.js +8 -0
- package/esm2015/lib/dr-scenario/services/scenario.service.js +160 -0
- package/esm2015/lib/dr-tags/dr-tag.component.js +17 -5
- package/esm2015/lib/models/serverTags.js +13 -1
- package/esm2015/public-api.js +6 -1
- package/fesm2015/datarailsshared-datarailsshared.js +478 -41
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.d.ts +12 -12
- package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +11 -12
- package/lib/dr-inputs/dr-toggle-button/dr-toggle-button.component.d.ts +3 -0
- package/lib/dr-inputs/dr-toggle-button/toggle-button-theme.d.ts +4 -0
- package/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.d.ts +25 -0
- package/lib/dr-scenario/components/dr-scenario-tag-configuration/dr-scenario-tag-configuration.component.d.ts +26 -0
- package/lib/dr-scenario/consts/scenario-tags-config.d.ts +24 -0
- package/lib/dr-scenario/dr-scenario.module.d.ts +2 -0
- package/lib/dr-scenario/interfaces/scenario.d.ts +43 -0
- package/lib/dr-scenario/services/scenario.service.d.ts +21 -0
- package/lib/dr-tags/dr-tag.component.d.ts +7 -3
- package/lib/models/serverTags.d.ts +15 -1
- package/package.json +1 -1
- package/public-api.d.ts +5 -1
- package/datarailsshared-datarailsshared-1.4.152.tgz +0 -0
|
@@ -612,13 +612,8 @@
|
|
|
612
612
|
configurable: true
|
|
613
613
|
});
|
|
614
614
|
MonthTagComponent.prototype.initDate = function () {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
this.dateObj.date = this.date;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
this.dateObj.date = moment$7().unix();
|
|
621
|
-
}
|
|
615
|
+
this.date = this.defaultValue || moment$7().unix();
|
|
616
|
+
this.dateObj.date = this.date;
|
|
622
617
|
};
|
|
623
618
|
MonthTagComponent.prototype.initName = function () {
|
|
624
619
|
if (!this.name) {
|
|
@@ -907,13 +902,8 @@
|
|
|
907
902
|
configurable: true
|
|
908
903
|
});
|
|
909
904
|
YearTagComponent.prototype.initDate = function () {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
this.dateObj.date = this.date;
|
|
913
|
-
}
|
|
914
|
-
else {
|
|
915
|
-
this.dateObj.date = moment$4().unix();
|
|
916
|
-
}
|
|
905
|
+
this.date = this.defaultValue || moment$4().unix();
|
|
906
|
+
this.dateObj.date = this.date;
|
|
917
907
|
};
|
|
918
908
|
YearTagComponent.prototype.initName = function () {
|
|
919
909
|
if (!this.name) {
|
|
@@ -970,30 +960,52 @@
|
|
|
970
960
|
TagTypes["LIST"] = "LIST";
|
|
971
961
|
TagTypes["DATE"] = "DATE";
|
|
972
962
|
})(exports.TagTypes || (exports.TagTypes = {}));
|
|
963
|
+
var TagsConfigSubType;
|
|
964
|
+
(function (TagsConfigSubType) {
|
|
965
|
+
TagsConfigSubType["YEAR"] = "year";
|
|
966
|
+
TagsConfigSubType["PLAN"] = "plan";
|
|
967
|
+
TagsConfigSubType["BUDGET_CYCLE"] = "budget cycle";
|
|
968
|
+
TagsConfigSubType["MONTH"] = "month";
|
|
969
|
+
TagsConfigSubType["WEEK"] = "week";
|
|
970
|
+
TagsConfigSubType["DAY"] = "day";
|
|
971
|
+
TagsConfigSubType["FORECAST_NEW"] = "forecast_new";
|
|
972
|
+
TagsConfigSubType["QUARTER"] = "quarter";
|
|
973
|
+
TagsConfigSubType["FILE_STATUS"] = "file_status";
|
|
974
|
+
})(TagsConfigSubType || (TagsConfigSubType = {}));
|
|
973
975
|
|
|
974
976
|
var DrTagComponent = /** @class */ (function () {
|
|
975
977
|
function DrTagComponent() {
|
|
976
978
|
this.lockedDate = [];
|
|
977
979
|
this.dynamicTagValues = {};
|
|
978
|
-
this.connectedTags = [];
|
|
979
980
|
this.tagChange = new i0.EventEmitter(); // Not emit value for dynamic tag
|
|
980
981
|
this.dynamicTagChange = new i0.EventEmitter();
|
|
981
982
|
this.dynamicTagAdd = new i0.EventEmitter();
|
|
982
983
|
this.currentTagConnectedToDynamic = false;
|
|
983
984
|
this.tagTypes = exports.TagTypes;
|
|
984
985
|
this.connectedTagsValues = [];
|
|
986
|
+
this._connectedTags = [];
|
|
985
987
|
this.selectedTag = {
|
|
986
988
|
id: 0,
|
|
987
989
|
value: undefined,
|
|
988
990
|
name: ''
|
|
989
991
|
};
|
|
990
992
|
}
|
|
993
|
+
Object.defineProperty(DrTagComponent.prototype, "connectedTags", {
|
|
994
|
+
get: function () {
|
|
995
|
+
return this._connectedTags;
|
|
996
|
+
},
|
|
997
|
+
set: function (tags) {
|
|
998
|
+
this._connectedTags = tags || [];
|
|
999
|
+
},
|
|
1000
|
+
enumerable: false,
|
|
1001
|
+
configurable: true
|
|
1002
|
+
});
|
|
1003
|
+
DrTagComponent.prototype.ngOnChanges = function () {
|
|
1004
|
+
this.calculateDynamicTag();
|
|
1005
|
+
};
|
|
991
1006
|
DrTagComponent.prototype.ngOnInit = function () {
|
|
992
|
-
var _this = this;
|
|
993
1007
|
var _a, _b;
|
|
994
|
-
this.
|
|
995
|
-
this.currentTagConnectedToDynamic = _.some(this.tagsConfig, function (tagConfig) { return tagConfig.options.is_custom
|
|
996
|
-
&& ['year'].includes(_this.tagConfig.options.sub_type); });
|
|
1008
|
+
this.calculateDynamicTag();
|
|
997
1009
|
this.dateTag = {
|
|
998
1010
|
type: this.tagConfig.type,
|
|
999
1011
|
sub_type: this.tagConfig.options.sub_type,
|
|
@@ -1108,6 +1120,12 @@
|
|
|
1108
1120
|
}
|
|
1109
1121
|
});
|
|
1110
1122
|
};
|
|
1123
|
+
DrTagComponent.prototype.calculateDynamicTag = function () {
|
|
1124
|
+
var _this = this;
|
|
1125
|
+
this.currentTagDynamic = this.tagConfig.options.is_custom;
|
|
1126
|
+
this.currentTagConnectedToDynamic = _.some(this.tagsConfig, function (tagConfig) { return tagConfig.options.is_custom
|
|
1127
|
+
&& ['year'].includes(_this.tagConfig.options.sub_type); });
|
|
1128
|
+
};
|
|
1111
1129
|
return DrTagComponent;
|
|
1112
1130
|
}());
|
|
1113
1131
|
DrTagComponent.decorators = [
|
|
@@ -1201,13 +1219,8 @@
|
|
|
1201
1219
|
configurable: true
|
|
1202
1220
|
});
|
|
1203
1221
|
DayTagComponent.prototype.initDate = function () {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
this.dateObj.date = this.date;
|
|
1207
|
-
}
|
|
1208
|
-
else {
|
|
1209
|
-
this.dateObj.date = moment$3().unix();
|
|
1210
|
-
}
|
|
1222
|
+
this.date = this.defaultValue || moment$3().unix();
|
|
1223
|
+
this.dateObj.date = this.date;
|
|
1211
1224
|
};
|
|
1212
1225
|
DayTagComponent.prototype.initName = function () {
|
|
1213
1226
|
if (!this.name) {
|
|
@@ -2443,12 +2456,20 @@
|
|
|
2443
2456
|
elementClass: [{ type: i0.HostBinding, args: ['class',] }]
|
|
2444
2457
|
};
|
|
2445
2458
|
|
|
2459
|
+
exports.ToggleButtonTheme = void 0;
|
|
2460
|
+
(function (ToggleButtonTheme) {
|
|
2461
|
+
ToggleButtonTheme["DEFAULT"] = "default";
|
|
2462
|
+
ToggleButtonTheme["DOTTED"] = "dotted";
|
|
2463
|
+
})(exports.ToggleButtonTheme || (exports.ToggleButtonTheme = {}));
|
|
2464
|
+
|
|
2446
2465
|
var DrToggleButtonComponent = /** @class */ (function () {
|
|
2447
2466
|
function DrToggleButtonComponent(cdr) {
|
|
2448
2467
|
this.cdr = cdr;
|
|
2449
2468
|
this._disabled = false;
|
|
2450
2469
|
this.bindLabel = null;
|
|
2451
2470
|
this.bindValue = null;
|
|
2471
|
+
this.bindHidden = null;
|
|
2472
|
+
this.theme = exports.ToggleButtonTheme.DEFAULT;
|
|
2452
2473
|
this.onChange = function () {
|
|
2453
2474
|
};
|
|
2454
2475
|
this.onTouched = function () {
|
|
@@ -2485,12 +2506,12 @@
|
|
|
2485
2506
|
DrToggleButtonComponent.decorators = [
|
|
2486
2507
|
{ type: i0.Component, args: [{
|
|
2487
2508
|
selector: 'dr-toggle-button',
|
|
2488
|
-
template: "<div class=\"toggle-container\"
|
|
2509
|
+
template: "<div class=\"toggle-container\"\n [class.disabled]=\"_disabled\"\n [attr.theme]=\"theme\">\n <ng-container *ngFor=\"let item of items\">\n <div *ngIf=\"!item?.[bindHidden]\"\n [class.selected]=\"item[bindValue] === selectedValue || item === selectedValue\"\n [class.disabled]=\"item.disabled\"\n class=\"toggle-container__item\">{{ item[bindLabel] || item.name || item }}</div>\n </ng-container>\n</div>\n",
|
|
2489
2510
|
providers: [
|
|
2490
2511
|
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return DrToggleButtonComponent; }), multi: true }
|
|
2491
2512
|
],
|
|
2492
2513
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2493
|
-
styles: [".toggle-container{display:flex;flex-wrap:nowrap;
|
|
2514
|
+
styles: [".toggle-container{display:flex;flex-wrap:nowrap;box-sizing:border-box;border-radius:20px;height:28px}.toggle-container.disabled{pointer-events:none}.toggle-container__item{height:28px;display:flex;align-items:center;justify-content:center;padding:4px 16px;border-radius:20px;margin:-1px;cursor:pointer;font-weight:400;font-size:12px;line-height:20px;white-space:nowrap;color:#4e566c}.toggle-container__item.selected{background:#f2f2fb!important;border:1px solid #7f7fdd!important;color:#25258c!important}.toggle-container__item.disabled{pointer-events:none;cursor:default;background:#f0f1f4;color:#9ea1aa;border:1px solid #c3c4ce}.toggle-container[theme~=default]{background:#f6f7f8;border:1px solid #c3c4ce}.toggle-container[theme~=dotted] .toggle-container__item{border:1px solid #9ea1aa;border-radius:18px;margin-left:5px;color:#0c142b}.toggle-container[theme~=dotted] .toggle-container__item:hover{background:#f0f1f4}.toggle-container[theme~=dotted] .toggle-container__item:hover .toggle-container[theme~=dotted] .toggle-container__item.selected{background:unset}.toggle-container[theme~=dotted] .toggle-container__item:first-child{margin-left:0}\n"]
|
|
2494
2515
|
},] }
|
|
2495
2516
|
];
|
|
2496
2517
|
DrToggleButtonComponent.ctorParameters = function () { return [
|
|
@@ -2500,6 +2521,8 @@
|
|
|
2500
2521
|
items: [{ type: i0.Input }],
|
|
2501
2522
|
bindLabel: [{ type: i0.Input }],
|
|
2502
2523
|
bindValue: [{ type: i0.Input }],
|
|
2524
|
+
bindHidden: [{ type: i0.Input }],
|
|
2525
|
+
theme: [{ type: i0.Input }],
|
|
2503
2526
|
selectedValue: [{ type: i0.Input }],
|
|
2504
2527
|
disabled: [{ type: i0.Input }]
|
|
2505
2528
|
};
|
|
@@ -4129,6 +4152,14 @@
|
|
|
4129
4152
|
TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
|
|
4130
4153
|
})(exports.TooltipPosition || (exports.TooltipPosition = {}));
|
|
4131
4154
|
|
|
4155
|
+
exports.Scenario = void 0;
|
|
4156
|
+
(function (Scenario) {
|
|
4157
|
+
Scenario["ACTUALS"] = "Actuals";
|
|
4158
|
+
Scenario["FORECAST"] = "Forecast";
|
|
4159
|
+
Scenario["BUDGET"] = "Budget";
|
|
4160
|
+
Scenario["NONE"] = "None";
|
|
4161
|
+
})(exports.Scenario || (exports.Scenario = {}));
|
|
4162
|
+
|
|
4132
4163
|
var DrModelDebounceChangeDirective = /** @class */ (function () {
|
|
4133
4164
|
function DrModelDebounceChangeDirective(ngModel) {
|
|
4134
4165
|
this.ngModel = ngModel;
|
|
@@ -4194,6 +4225,248 @@
|
|
|
4194
4225
|
return ChatMessage;
|
|
4195
4226
|
}());
|
|
4196
4227
|
|
|
4228
|
+
var _a;
|
|
4229
|
+
var allDateTags = (_a = {},
|
|
4230
|
+
_a[TagsConfigSubType.YEAR] = {
|
|
4231
|
+
name: 'Date',
|
|
4232
|
+
toggle: false,
|
|
4233
|
+
},
|
|
4234
|
+
_a[TagsConfigSubType.QUARTER] = {
|
|
4235
|
+
name: 'Date',
|
|
4236
|
+
toggle: false,
|
|
4237
|
+
},
|
|
4238
|
+
_a[TagsConfigSubType.MONTH] = {
|
|
4239
|
+
name: 'Date',
|
|
4240
|
+
toggle: false,
|
|
4241
|
+
},
|
|
4242
|
+
_a[TagsConfigSubType.DAY] = {
|
|
4243
|
+
name: 'Date',
|
|
4244
|
+
toggle: false,
|
|
4245
|
+
},
|
|
4246
|
+
_a[TagsConfigSubType.WEEK] = {
|
|
4247
|
+
name: 'Date',
|
|
4248
|
+
toggle: false,
|
|
4249
|
+
},
|
|
4250
|
+
_a);
|
|
4251
|
+
function getScenarioTagDataConfig(isMultipleDimension) {
|
|
4252
|
+
var _a, _b, _c, _d, _e;
|
|
4253
|
+
return _a = {},
|
|
4254
|
+
_a[exports.Scenario.ACTUALS] = Object.assign(Object.assign({}, allDateTags), (_b = {}, _b[TagsConfigSubType.MONTH] = {
|
|
4255
|
+
name: 'Date',
|
|
4256
|
+
toggle: true,
|
|
4257
|
+
}, _b[TagsConfigSubType.FILE_STATUS] = {
|
|
4258
|
+
toggle: false,
|
|
4259
|
+
}, _b)),
|
|
4260
|
+
_a[exports.Scenario.BUDGET] = (_c = {},
|
|
4261
|
+
_c[TagsConfigSubType.BUDGET_CYCLE] = {
|
|
4262
|
+
toggle: true,
|
|
4263
|
+
acceptableDateTags: [TagsConfigSubType.YEAR],
|
|
4264
|
+
hidden: !isMultipleDimension,
|
|
4265
|
+
},
|
|
4266
|
+
_c[TagsConfigSubType.PLAN] = {
|
|
4267
|
+
toggle: false,
|
|
4268
|
+
turnOffDateTags: true,
|
|
4269
|
+
hidden: isMultipleDimension,
|
|
4270
|
+
},
|
|
4271
|
+
_c[TagsConfigSubType.YEAR] = {
|
|
4272
|
+
name: 'Date',
|
|
4273
|
+
toggle: true,
|
|
4274
|
+
},
|
|
4275
|
+
_c[TagsConfigSubType.QUARTER] = {
|
|
4276
|
+
name: 'Date',
|
|
4277
|
+
toggle: false,
|
|
4278
|
+
},
|
|
4279
|
+
_c[TagsConfigSubType.FILE_STATUS] = {
|
|
4280
|
+
toggle: false,
|
|
4281
|
+
},
|
|
4282
|
+
_c),
|
|
4283
|
+
_a[exports.Scenario.FORECAST] = (_d = {},
|
|
4284
|
+
_d[TagsConfigSubType.FORECAST_NEW] = {
|
|
4285
|
+
toggle: true,
|
|
4286
|
+
name: 'Date',
|
|
4287
|
+
},
|
|
4288
|
+
_d[TagsConfigSubType.FILE_STATUS] = {
|
|
4289
|
+
toggle: false,
|
|
4290
|
+
},
|
|
4291
|
+
_d),
|
|
4292
|
+
_a[exports.Scenario.NONE] = Object.assign(Object.assign({}, allDateTags), (_e = {}, _e[TagsConfigSubType.MONTH] = {
|
|
4293
|
+
name: 'Date',
|
|
4294
|
+
toggle: true,
|
|
4295
|
+
}, _e[TagsConfigSubType.FILE_STATUS] = {
|
|
4296
|
+
toggle: true,
|
|
4297
|
+
}, _e)),
|
|
4298
|
+
_a;
|
|
4299
|
+
}
|
|
4300
|
+
|
|
4301
|
+
var ScenarioService = /** @class */ (function () {
|
|
4302
|
+
function ScenarioService() {
|
|
4303
|
+
this.DEFAULT_FORECAST_DATE_TAG = 'Month';
|
|
4304
|
+
}
|
|
4305
|
+
Object.defineProperty(ScenarioService.prototype, "scenarios", {
|
|
4306
|
+
get: function () {
|
|
4307
|
+
return _.orderBy(Object.values(exports.Scenario), function (scenario) { return scenario === exports.Scenario.NONE ? 1 : 0; });
|
|
4308
|
+
},
|
|
4309
|
+
enumerable: false,
|
|
4310
|
+
configurable: true
|
|
4311
|
+
});
|
|
4312
|
+
Object.defineProperty(ScenarioService.prototype, "areExistingTagsConfig", {
|
|
4313
|
+
get: function () {
|
|
4314
|
+
return !!this.currentTagsConfig;
|
|
4315
|
+
},
|
|
4316
|
+
enumerable: false,
|
|
4317
|
+
configurable: true
|
|
4318
|
+
});
|
|
4319
|
+
ScenarioService.prototype.initScenarioTags = function (scenario, wholeTagsConfig, currentTagsConfig, isMultipleDimension) {
|
|
4320
|
+
if (isMultipleDimension === void 0) { isMultipleDimension = true; }
|
|
4321
|
+
if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length) || !scenario)
|
|
4322
|
+
return;
|
|
4323
|
+
this.wholeTagsConfig = wholeTagsConfig;
|
|
4324
|
+
this.currentTagsConfig = currentTagsConfig;
|
|
4325
|
+
this.isMultipleDimension = isMultipleDimension;
|
|
4326
|
+
};
|
|
4327
|
+
ScenarioService.prototype.getTagsConfigByScenarioTags = function (scenarioTags, tagsConfig) {
|
|
4328
|
+
var scenarioTagsConfig = _.filter(tagsConfig, function (tagConfig) { return _.some(scenarioTags, function (scenarioTag) { return scenarioTag.toggle && scenarioTag.selectedTagSubType === tagConfig.options.sub_type; }); });
|
|
4329
|
+
return this.sortScenarioTags(scenarioTagsConfig);
|
|
4330
|
+
};
|
|
4331
|
+
ScenarioService.prototype.getScenarioTagsByScenario = function (scenario) {
|
|
4332
|
+
var _this = this;
|
|
4333
|
+
var scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
|
|
4334
|
+
var scenarioTagsUi = [];
|
|
4335
|
+
_.forEach(scenarioTagsConfig, function (scenarioTag) {
|
|
4336
|
+
var isDateTag = scenarioTag.type === exports.TagTypes.DATE;
|
|
4337
|
+
var dateTag = isDateTag && _.find(scenarioTagsUi, { type: exports.TagTypes.DATE });
|
|
4338
|
+
var tag = dateTag || _this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isDateTag);
|
|
4339
|
+
if (isDateTag) {
|
|
4340
|
+
_this.updateScenarioDateTag(tag, scenarioTag);
|
|
4341
|
+
}
|
|
4342
|
+
if (dateTag)
|
|
4343
|
+
return;
|
|
4344
|
+
scenarioTagsUi.push(tag);
|
|
4345
|
+
});
|
|
4346
|
+
if (this.areExistingTagsConfig) {
|
|
4347
|
+
this.initExistingTagsConfig(scenario, scenarioTagsUi);
|
|
4348
|
+
}
|
|
4349
|
+
var isTagNotSupportingDates = _.some(scenarioTagsUi, { turnOffDateTags: true, toggle: true });
|
|
4350
|
+
if (isTagNotSupportingDates) {
|
|
4351
|
+
this.turnOffDateTag(scenarioTagsUi);
|
|
4352
|
+
}
|
|
4353
|
+
var tagWithSpecificDateTags = _.find(scenarioTagsUi, function (tag) { var _a; return tag.toggle && !!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length); });
|
|
4354
|
+
if (tagWithSpecificDateTags) {
|
|
4355
|
+
this.hideNotAvailableTags(tagWithSpecificDateTags, scenarioTagsUi);
|
|
4356
|
+
}
|
|
4357
|
+
return this.sortScenarioTags(scenarioTagsUi);
|
|
4358
|
+
};
|
|
4359
|
+
ScenarioService.prototype.sortScenarioTags = function (scenarioTagsUi) {
|
|
4360
|
+
return _.orderBy(scenarioTagsUi, [
|
|
4361
|
+
function (tag) { return (tag.type === exports.TagTypes.DATE ? 0 : 1); },
|
|
4362
|
+
function (tag) { return (tag.name === 'File Status'); }
|
|
4363
|
+
]);
|
|
4364
|
+
};
|
|
4365
|
+
ScenarioService.prototype.initExistingTagsConfig = function (scenario, scenarioTagsUi) {
|
|
4366
|
+
var _this = this;
|
|
4367
|
+
_.forEach(this.currentTagsConfig, function (tagConfig) {
|
|
4368
|
+
var _a, _b;
|
|
4369
|
+
var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
|
|
4370
|
+
var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
|
|
4371
|
+
if (!((_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType]))
|
|
4372
|
+
return;
|
|
4373
|
+
var scenarioTagUi = tagConfig.type === exports.TagTypes.DATE
|
|
4374
|
+
? _.find(scenarioTagsUi, { type: tagConfig.type })
|
|
4375
|
+
: _.find(scenarioTagsUi, { selectedTagSubType: tagSubType });
|
|
4376
|
+
scenarioTagUi.toggle = true;
|
|
4377
|
+
scenarioTagUi.selectedTagSubType = tagSubType;
|
|
4378
|
+
});
|
|
4379
|
+
};
|
|
4380
|
+
ScenarioService.prototype.prepareScenarioTag = function (scenarioTagsConfig, scenarioTag, scenario, isDateTag) {
|
|
4381
|
+
var toggleStatus = isDateTag
|
|
4382
|
+
? _.some(scenarioTagsConfig, function (tag) { return tag.type === exports.TagTypes.DATE && tag.scenarioData.toggle; })
|
|
4383
|
+
: scenarioTag.scenarioData.toggle;
|
|
4384
|
+
var selectedTagSubType = isDateTag
|
|
4385
|
+
? this.getScenarioSelectedDateTag(scenario, scenarioTagsConfig)
|
|
4386
|
+
: scenarioTag.options.sub_type;
|
|
4387
|
+
var tag = {
|
|
4388
|
+
toggle: this.areExistingTagsConfig ? false : toggleStatus,
|
|
4389
|
+
name: scenarioTag.scenarioData.name || scenarioTag.name,
|
|
4390
|
+
description: scenarioTag.scenarioData.description || scenarioTag.description,
|
|
4391
|
+
type: scenarioTag.type,
|
|
4392
|
+
selectedTagSubType: selectedTagSubType,
|
|
4393
|
+
};
|
|
4394
|
+
if (scenarioTag.scenarioData.turnOffDateTags) {
|
|
4395
|
+
tag.turnOffDateTags = scenarioTag.scenarioData.turnOffDateTags;
|
|
4396
|
+
}
|
|
4397
|
+
if (scenarioTag.scenarioData.acceptableDateTags) {
|
|
4398
|
+
tag.acceptableDateTags = scenarioTag.scenarioData.acceptableDateTags;
|
|
4399
|
+
}
|
|
4400
|
+
return tag;
|
|
4401
|
+
};
|
|
4402
|
+
ScenarioService.prototype.updateScenarioDateTag = function (dateTag, scenarioTag) {
|
|
4403
|
+
if (!dateTag.subTags) {
|
|
4404
|
+
dateTag.subTags = [];
|
|
4405
|
+
}
|
|
4406
|
+
var tagSubType = scenarioTag.options.sub_type;
|
|
4407
|
+
dateTag.subTags.push({
|
|
4408
|
+
subType: tagSubType,
|
|
4409
|
+
name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
|
|
4410
|
+
});
|
|
4411
|
+
};
|
|
4412
|
+
ScenarioService.prototype.turnOffDateTag = function (scenarioTags) {
|
|
4413
|
+
var dateTag = _.find(scenarioTags, { type: exports.TagTypes.DATE });
|
|
4414
|
+
if (!dateTag)
|
|
4415
|
+
return;
|
|
4416
|
+
dateTag.toggle = false;
|
|
4417
|
+
};
|
|
4418
|
+
ScenarioService.prototype.hideNotAvailableTags = function (tagWithSpecificDateTags, scenarioTags) {
|
|
4419
|
+
var _a;
|
|
4420
|
+
var subTags = (_a = _.find(scenarioTags, { type: exports.TagTypes.DATE })) === null || _a === void 0 ? void 0 : _a.subTags;
|
|
4421
|
+
if (!subTags.length)
|
|
4422
|
+
return;
|
|
4423
|
+
_.forEach(scenarioTags, function (tag) {
|
|
4424
|
+
var _a;
|
|
4425
|
+
if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
|
|
4426
|
+
return;
|
|
4427
|
+
if (tag !== tagWithSpecificDateTags) {
|
|
4428
|
+
tag.toggle = false;
|
|
4429
|
+
}
|
|
4430
|
+
});
|
|
4431
|
+
_.forEach(subTags, function (subTag) {
|
|
4432
|
+
subTag.hidden = !tagWithSpecificDateTags.acceptableDateTags.includes(subTag.subType);
|
|
4433
|
+
});
|
|
4434
|
+
};
|
|
4435
|
+
ScenarioService.prototype.getScenarioSelectedDateTag = function (scenario, dateTags) {
|
|
4436
|
+
var _c;
|
|
4437
|
+
var _a, _b;
|
|
4438
|
+
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;
|
|
4439
|
+
var scenarioSelectedDateTag = (_c = {},
|
|
4440
|
+
_c[exports.Scenario.ACTUALS] = function () { return monthSubType; },
|
|
4441
|
+
_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; },
|
|
4442
|
+
_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; },
|
|
4443
|
+
_c[exports.Scenario.NONE] = function () { return monthSubType; },
|
|
4444
|
+
_c);
|
|
4445
|
+
if (!scenarioSelectedDateTag[scenario])
|
|
4446
|
+
return;
|
|
4447
|
+
return scenarioSelectedDateTag[scenario]();
|
|
4448
|
+
};
|
|
4449
|
+
ScenarioService.prototype.getScenarioTagsConfig = function (scenario, tagsConfig) {
|
|
4450
|
+
var _this = this;
|
|
4451
|
+
return _.reduce(tagsConfig, function (acc, tagConfig) {
|
|
4452
|
+
var _a, _b;
|
|
4453
|
+
var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
|
|
4454
|
+
var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
|
|
4455
|
+
var scenarioTagConfig = (_b = scenarioTagDataConfig === null || scenarioTagDataConfig === void 0 ? void 0 : scenarioTagDataConfig[scenario]) === null || _b === void 0 ? void 0 : _b[tagSubType];
|
|
4456
|
+
if (!scenarioTagConfig || scenarioTagConfig.hidden)
|
|
4457
|
+
return acc;
|
|
4458
|
+
var clonedTagConfig = _.cloneDeep(tagConfig);
|
|
4459
|
+
var scenarioTag = Object.assign(Object.assign({}, clonedTagConfig), { scenarioData: scenarioTagConfig });
|
|
4460
|
+
acc.push(scenarioTag);
|
|
4461
|
+
return acc;
|
|
4462
|
+
}, []);
|
|
4463
|
+
};
|
|
4464
|
+
return ScenarioService;
|
|
4465
|
+
}());
|
|
4466
|
+
ScenarioService.decorators = [
|
|
4467
|
+
{ type: i0.Injectable }
|
|
4468
|
+
];
|
|
4469
|
+
|
|
4197
4470
|
var DrSharedUtils = /** @class */ (function () {
|
|
4198
4471
|
function DrSharedUtils() {
|
|
4199
4472
|
}
|
|
@@ -4242,6 +4515,7 @@
|
|
|
4242
4515
|
return DrSharedUtils;
|
|
4243
4516
|
}());
|
|
4244
4517
|
|
|
4518
|
+
// @ts-ignore
|
|
4245
4519
|
var moment$2 = require('moment');
|
|
4246
4520
|
var DrDatePickerService = /** @class */ (function () {
|
|
4247
4521
|
function DrDatePickerService() {
|
|
@@ -4428,8 +4702,9 @@
|
|
|
4428
4702
|
};
|
|
4429
4703
|
return DrDatePickerService;
|
|
4430
4704
|
}());
|
|
4705
|
+
DrDatePickerService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DrDatePickerService_Factory() { return new DrDatePickerService(); }, token: DrDatePickerService, providedIn: "root" });
|
|
4431
4706
|
DrDatePickerService.decorators = [
|
|
4432
|
-
{ type: i0.Injectable }
|
|
4707
|
+
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
4433
4708
|
];
|
|
4434
4709
|
|
|
4435
4710
|
var moment$1 = require('moment');
|
|
@@ -4655,13 +4930,17 @@
|
|
|
4655
4930
|
}
|
|
4656
4931
|
return true;
|
|
4657
4932
|
};
|
|
4658
|
-
datePickerService.updatedQuarter
|
|
4659
|
-
|
|
4660
|
-
|
|
4933
|
+
if (datePickerService && datePickerService.updatedQuarter$) {
|
|
4934
|
+
datePickerService.updatedQuarter$.pipe(operators.takeUntil(this.destroyed$)).subscribe(function (value) {
|
|
4935
|
+
_this.setValueFromMoment(value);
|
|
4936
|
+
});
|
|
4937
|
+
}
|
|
4661
4938
|
}
|
|
4662
4939
|
Object.defineProperty(DrDatePickerComponent.prototype, "format", {
|
|
4663
4940
|
set: function (value) {
|
|
4664
|
-
this.datePickerService
|
|
4941
|
+
if (this.datePickerService) {
|
|
4942
|
+
this.datePickerService.updateTimeframeAndFormat(value);
|
|
4943
|
+
}
|
|
4665
4944
|
},
|
|
4666
4945
|
enumerable: false,
|
|
4667
4946
|
configurable: true
|
|
@@ -4693,6 +4972,14 @@
|
|
|
4693
4972
|
enumerable: false,
|
|
4694
4973
|
configurable: true
|
|
4695
4974
|
});
|
|
4975
|
+
DrDatePickerComponent.prototype.ngOnInit = function () {
|
|
4976
|
+
var _this = this;
|
|
4977
|
+
if (this.datePickerService && this.datePickerService.updatedQuarter$) {
|
|
4978
|
+
this.datePickerService.updatedQuarter$.pipe(operators.takeUntil(this.destroyed$)).subscribe(function (value) {
|
|
4979
|
+
_this.setValueFromMoment(value);
|
|
4980
|
+
});
|
|
4981
|
+
}
|
|
4982
|
+
};
|
|
4696
4983
|
DrDatePickerComponent.prototype.ngAfterViewInit = function () {
|
|
4697
4984
|
this.datePickerService.fiscalYearMonthsModifier = this.fiscalYearMonthsModifier;
|
|
4698
4985
|
this.datePickerService.datePickerInstance = this.datePicker;
|
|
@@ -4817,10 +5104,7 @@
|
|
|
4817
5104
|
selector: 'dr-date-picker',
|
|
4818
5105
|
template: "<i class=\"dr-icon-schedule\"></i>\n<input [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [matDatepickerFilter]=\"dateFilter\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [drDatePickerFormat]=\"datePickerService.format$ | async\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"/>\n<mat-datepicker #datePicker\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\">\n</mat-datepicker>\n",
|
|
4819
5106
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4820
|
-
providers: [
|
|
4821
|
-
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true },
|
|
4822
|
-
{ provide: DrDatePickerService }
|
|
4823
|
-
],
|
|
5107
|
+
providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true }],
|
|
4824
5108
|
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #c3c4ce;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#e5e6ea}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}\n"]
|
|
4825
5109
|
},] }
|
|
4826
5110
|
];
|
|
@@ -5017,13 +5301,13 @@
|
|
|
5017
5301
|
DrDatePickerWithTimeframeComponent.decorators = [
|
|
5018
5302
|
{ type: i0.Component, args: [{
|
|
5019
5303
|
selector: 'dr-date-picker-with-timeframe',
|
|
5020
|
-
template: "<dr-button [disabled]=\"isPrevDateDisabled\"
|
|
5304
|
+
template: "<dr-button [disabled]=\"isPrevDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n \n <div class=\"dr-datepicker-input-container__formatted-value-display\" (click)=\"datepickerInput.click()\">\n <span *ngIf=\"presetTagSelected && datePickerService.isUsingDateTagPresets\"> {{ presetTagSelected }} </span>\n <span>{{ presetTagSelected && datePickerService.isUsingDateTagPresets ? '(' + displayedFormattedValue + ')' : displayedFormattedValue }}</span>\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button [disabled]=\"isNextDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\"\n [panelClass]=\"datePickerService.isUsingDateTagPresets ? 'date-picker-preset-tag' : 'dr-timeframe-datepicker'\"\n >\n</mat-datepicker>\n",
|
|
5021
5305
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5022
5306
|
providers: [
|
|
5023
5307
|
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
|
|
5024
5308
|
{ provide: DrDatePickerService }
|
|
5025
5309
|
],
|
|
5026
|
-
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #c3c4ce;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#e5e6ea}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.
|
|
5310
|
+
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #c3c4ce;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#e5e6ea}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\";height:0;width:0;border-style:solid;border-width:5px 5px 2.5px;right:11px;top:13px}:host i{position:absolute;color:#999;left:8px;top:3px}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.dr-date-picker-on-dashboard{width:-moz-fit-content;width:fit-content;justify-content:space-between}:host.dr-date-picker-on-dashboard mat-datepicker{position:absolute}:host.dr-date-picker-on-dashboard:after{visibility:hidden}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container{display:flex;flex-direction:row;justify-content:center;align-items:center;margin-left:-10px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{font-weight:600;width:auto;margin-left:5px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container .dr-icon-date{display:block;position:relative;top:0;margin-right:8px;color:#4e566c}:host .dr-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__formatted-value-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}::ng-deep .date-picker-preset-tag{width:386px!important}::ng-deep .date-picker-preset-tag .mat-calendar-content{padding-left:32px!important;padding-right:32px!important}\n"]
|
|
5027
5311
|
},] }
|
|
5028
5312
|
];
|
|
5029
5313
|
DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
|
|
@@ -5325,7 +5609,8 @@
|
|
|
5325
5609
|
datepicker.MatDatepickerModule,
|
|
5326
5610
|
tooltip.MatTooltipModule,
|
|
5327
5611
|
DrTooltipModule
|
|
5328
|
-
]
|
|
5612
|
+
],
|
|
5613
|
+
entryComponents: [DrDatePickerCustomHeaderComponent]
|
|
5329
5614
|
},] }
|
|
5330
5615
|
];
|
|
5331
5616
|
|
|
@@ -6390,6 +6675,193 @@
|
|
|
6390
6675
|
},] }
|
|
6391
6676
|
];
|
|
6392
6677
|
|
|
6678
|
+
var DrScenarioConfigurationComponent = /** @class */ (function () {
|
|
6679
|
+
function DrScenarioConfigurationComponent(scenarioService) {
|
|
6680
|
+
this.scenarioService = scenarioService;
|
|
6681
|
+
this.toggleButtonTheme = exports.ToggleButtonTheme;
|
|
6682
|
+
this._scenarioTags = [];
|
|
6683
|
+
this.wholeTagsConfig = [];
|
|
6684
|
+
this.selectedScenario = exports.Scenario.ACTUALS;
|
|
6685
|
+
this.scenarioDataChanged = new i0.EventEmitter();
|
|
6686
|
+
}
|
|
6687
|
+
Object.defineProperty(DrScenarioConfigurationComponent.prototype, "scenarioTags", {
|
|
6688
|
+
get: function () {
|
|
6689
|
+
return this._scenarioTags;
|
|
6690
|
+
},
|
|
6691
|
+
set: function (tags) {
|
|
6692
|
+
this._scenarioTags = tags;
|
|
6693
|
+
this.tagNotSupportingDates = _.find(tags, { turnOffDateTags: true });
|
|
6694
|
+
},
|
|
6695
|
+
enumerable: false,
|
|
6696
|
+
configurable: true
|
|
6697
|
+
});
|
|
6698
|
+
DrScenarioConfigurationComponent.prototype.ngOnInit = function () {
|
|
6699
|
+
this.scenarios = this.scenarioService.scenarios;
|
|
6700
|
+
this.scenarioService.initScenarioTags(this.selectedScenario, this.wholeTagsConfig, this.currentTagsConfig);
|
|
6701
|
+
this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(this.selectedScenario);
|
|
6702
|
+
};
|
|
6703
|
+
DrScenarioConfigurationComponent.prototype.onScenarioChange = function (scenario) {
|
|
6704
|
+
this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(scenario);
|
|
6705
|
+
this.onScenarioDataChange();
|
|
6706
|
+
};
|
|
6707
|
+
DrScenarioConfigurationComponent.prototype.onScenarioTagToggle = function (tag) {
|
|
6708
|
+
this.tagNotSupportingDatesHandler(tag);
|
|
6709
|
+
this.tagAcceptableDateHandler(tag);
|
|
6710
|
+
this.onScenarioDataChange();
|
|
6711
|
+
};
|
|
6712
|
+
DrScenarioConfigurationComponent.prototype.onScenarioDataChange = function () {
|
|
6713
|
+
this.scenarioDataChanged.emit({
|
|
6714
|
+
scenario: this.selectedScenario,
|
|
6715
|
+
tagsConfig: this.scenarioService.getTagsConfigByScenarioTags(this.scenarioTags, this.wholeTagsConfig),
|
|
6716
|
+
});
|
|
6717
|
+
};
|
|
6718
|
+
DrScenarioConfigurationComponent.prototype.tagNotSupportingDatesHandler = function (tag) {
|
|
6719
|
+
if (!this.tagNotSupportingDates || !tag.toggle)
|
|
6720
|
+
return;
|
|
6721
|
+
if (tag.type === exports.TagTypes.DATE) {
|
|
6722
|
+
this.tagNotSupportingDates.toggle = false;
|
|
6723
|
+
}
|
|
6724
|
+
if (tag === this.tagNotSupportingDates) {
|
|
6725
|
+
var dateTag = _.find(this.scenarioTags, { type: exports.TagTypes.DATE });
|
|
6726
|
+
if (dateTag) {
|
|
6727
|
+
dateTag.toggle = false;
|
|
6728
|
+
}
|
|
6729
|
+
}
|
|
6730
|
+
};
|
|
6731
|
+
DrScenarioConfigurationComponent.prototype.tagAcceptableDateHandler = function (tag) {
|
|
6732
|
+
var _a;
|
|
6733
|
+
if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
|
|
6734
|
+
return;
|
|
6735
|
+
var dateTag = _.find(this.scenarioTags, { type: exports.TagTypes.DATE });
|
|
6736
|
+
if (!dateTag)
|
|
6737
|
+
return;
|
|
6738
|
+
dateTag.subTags = _.map(dateTag.subTags, function (subTag) {
|
|
6739
|
+
subTag.hidden = tag.toggle && !_.includes(tag.acceptableDateTags, subTag.subType);
|
|
6740
|
+
return subTag;
|
|
6741
|
+
});
|
|
6742
|
+
dateTag.selectedTagSubType = tag.acceptableDateTags[0];
|
|
6743
|
+
};
|
|
6744
|
+
return DrScenarioConfigurationComponent;
|
|
6745
|
+
}());
|
|
6746
|
+
DrScenarioConfigurationComponent.decorators = [
|
|
6747
|
+
{ type: i0.Component, args: [{
|
|
6748
|
+
selector: 'dr-scenario-configuration',
|
|
6749
|
+
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",
|
|
6750
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
6751
|
+
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"]
|
|
6752
|
+
},] }
|
|
6753
|
+
];
|
|
6754
|
+
DrScenarioConfigurationComponent.ctorParameters = function () { return [
|
|
6755
|
+
{ type: ScenarioService }
|
|
6756
|
+
]; };
|
|
6757
|
+
DrScenarioConfigurationComponent.propDecorators = {
|
|
6758
|
+
currentTagsConfig: [{ type: i0.Input }],
|
|
6759
|
+
wholeTagsConfig: [{ type: i0.Input }],
|
|
6760
|
+
selectedScenario: [{ type: i0.Input }],
|
|
6761
|
+
scenarioDataChanged: [{ type: i0.Output }]
|
|
6762
|
+
};
|
|
6763
|
+
|
|
6764
|
+
var DrScenarioTagConfigurationComponent = /** @class */ (function () {
|
|
6765
|
+
function DrScenarioTagConfigurationComponent() {
|
|
6766
|
+
this.connectedTags = {};
|
|
6767
|
+
this.dynamicTagValues = {};
|
|
6768
|
+
this.lockedDates = [];
|
|
6769
|
+
this.scenarioTagDataChanged = new i0.EventEmitter();
|
|
6770
|
+
this.currentTagsMap = {};
|
|
6771
|
+
this._currentTags = [];
|
|
6772
|
+
this.dynamicTagsToSave = [];
|
|
6773
|
+
this.tagsToSave = [];
|
|
6774
|
+
}
|
|
6775
|
+
Object.defineProperty(DrScenarioTagConfigurationComponent.prototype, "currentTags", {
|
|
6776
|
+
get: function () {
|
|
6777
|
+
return this._currentTags;
|
|
6778
|
+
},
|
|
6779
|
+
set: function (tags) {
|
|
6780
|
+
var _this = this;
|
|
6781
|
+
this._currentTags = tags;
|
|
6782
|
+
this.currentTagsMap = _.reduce(tags, function (acc, curr) {
|
|
6783
|
+
var _a;
|
|
6784
|
+
var tagId = (_a = _.find(_this.tagsConfig, { name: curr.name })) === null || _a === void 0 ? void 0 : _a.id;
|
|
6785
|
+
if (isNaN(tagId))
|
|
6786
|
+
return acc;
|
|
6787
|
+
acc[tagId] = curr;
|
|
6788
|
+
return acc;
|
|
6789
|
+
}, {});
|
|
6790
|
+
},
|
|
6791
|
+
enumerable: false,
|
|
6792
|
+
configurable: true
|
|
6793
|
+
});
|
|
6794
|
+
DrScenarioTagConfigurationComponent.prototype.ngOnChanges = function (simpleChanges) {
|
|
6795
|
+
this.currentTags = this.currentTags;
|
|
6796
|
+
};
|
|
6797
|
+
DrScenarioTagConfigurationComponent.prototype.onTagChange = function ($event) {
|
|
6798
|
+
var savedTag = _.find(this.tagsToSave, { id: $event.id });
|
|
6799
|
+
if (savedTag) {
|
|
6800
|
+
_.merge(savedTag, $event);
|
|
6801
|
+
}
|
|
6802
|
+
else {
|
|
6803
|
+
this.tagsToSave.push($event);
|
|
6804
|
+
}
|
|
6805
|
+
this.onScenarioTagDataChanged();
|
|
6806
|
+
};
|
|
6807
|
+
DrScenarioTagConfigurationComponent.prototype.onDynamicTagsChange = function ($event) {
|
|
6808
|
+
this.dynamicTagsToSave = $event;
|
|
6809
|
+
this.onScenarioTagDataChanged();
|
|
6810
|
+
};
|
|
6811
|
+
DrScenarioTagConfigurationComponent.prototype.onScenarioTagDataChanged = function () {
|
|
6812
|
+
var tags = __spreadArray(__spreadArray([], __read(this.dynamicTagsToSave)), __read(this.tagsToSave));
|
|
6813
|
+
this.scenarioTagDataChanged.emit({
|
|
6814
|
+
scenario: this.scenario,
|
|
6815
|
+
tagsConfig: this.tagsConfig,
|
|
6816
|
+
tags: tags,
|
|
6817
|
+
});
|
|
6818
|
+
};
|
|
6819
|
+
return DrScenarioTagConfigurationComponent;
|
|
6820
|
+
}());
|
|
6821
|
+
DrScenarioTagConfigurationComponent.decorators = [
|
|
6822
|
+
{ type: i0.Component, args: [{
|
|
6823
|
+
selector: 'dr-scenario-tag-configuration',
|
|
6824
|
+
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",
|
|
6825
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
6826
|
+
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"]
|
|
6827
|
+
},] }
|
|
6828
|
+
];
|
|
6829
|
+
DrScenarioTagConfigurationComponent.propDecorators = {
|
|
6830
|
+
tagsConfig: [{ type: i0.Input }],
|
|
6831
|
+
currentTags: [{ type: i0.Input }],
|
|
6832
|
+
scenario: [{ type: i0.Input }],
|
|
6833
|
+
connectedTags: [{ type: i0.Input }],
|
|
6834
|
+
dynamicTagValues: [{ type: i0.Input }],
|
|
6835
|
+
lockedDates: [{ type: i0.Input }],
|
|
6836
|
+
fiscalYearStartsFrom: [{ type: i0.Input }],
|
|
6837
|
+
fiscalYearBack: [{ type: i0.Input }],
|
|
6838
|
+
isDynamicAddEnabled: [{ type: i0.Input }],
|
|
6839
|
+
scenarioTagDataChanged: [{ type: i0.Output }]
|
|
6840
|
+
};
|
|
6841
|
+
|
|
6842
|
+
var COMPONENTS = [
|
|
6843
|
+
DrScenarioConfigurationComponent,
|
|
6844
|
+
DrScenarioTagConfigurationComponent,
|
|
6845
|
+
];
|
|
6846
|
+
var DrScenarioModule = /** @class */ (function () {
|
|
6847
|
+
function DrScenarioModule() {
|
|
6848
|
+
}
|
|
6849
|
+
return DrScenarioModule;
|
|
6850
|
+
}());
|
|
6851
|
+
DrScenarioModule.decorators = [
|
|
6852
|
+
{ type: i0.NgModule, args: [{
|
|
6853
|
+
declarations: __spreadArray([], __read(COMPONENTS)),
|
|
6854
|
+
providers: [ScenarioService],
|
|
6855
|
+
imports: [
|
|
6856
|
+
common.CommonModule,
|
|
6857
|
+
DrInputsModule,
|
|
6858
|
+
forms.FormsModule,
|
|
6859
|
+
DrTagModule
|
|
6860
|
+
],
|
|
6861
|
+
exports: __spreadArray([], __read(COMPONENTS)),
|
|
6862
|
+
},] }
|
|
6863
|
+
];
|
|
6864
|
+
|
|
6393
6865
|
/* components */
|
|
6394
6866
|
|
|
6395
6867
|
/**
|
|
@@ -6435,6 +6907,7 @@
|
|
|
6435
6907
|
exports.DrPopoverModule = DrPopoverModule;
|
|
6436
6908
|
exports.DrPopoverRef = DrPopoverRef;
|
|
6437
6909
|
exports.DrPopoverService = DrPopoverService;
|
|
6910
|
+
exports.DrScenarioModule = DrScenarioModule;
|
|
6438
6911
|
exports.DrSelectComponent = DrSelectComponent;
|
|
6439
6912
|
exports.DrSharedUtils = DrSharedUtils;
|
|
6440
6913
|
exports.DrSpinnerComponent = DrSpinnerComponent;
|
|
@@ -6458,11 +6931,14 @@
|
|
|
6458
6931
|
exports.QuarterTagComponent = QuarterTagComponent;
|
|
6459
6932
|
exports.RadioButtonComponent = RadioButtonComponent;
|
|
6460
6933
|
exports.RadioGroupComponent = RadioGroupComponent;
|
|
6934
|
+
exports.ScenarioService = ScenarioService;
|
|
6461
6935
|
exports.TooltipComponent = TooltipComponent;
|
|
6462
6936
|
exports.WeekTagComponent = WeekTagComponent;
|
|
6463
6937
|
exports.YearTagComponent = YearTagComponent;
|
|
6464
6938
|
exports["ɵa"] = components$2;
|
|
6465
6939
|
exports["ɵb"] = POPUP_ANIMATION;
|
|
6940
|
+
exports["ɵba"] = DrScenarioConfigurationComponent;
|
|
6941
|
+
exports["ɵbb"] = DrScenarioTagConfigurationComponent;
|
|
6466
6942
|
exports["ɵc"] = DrDatePickerComponent;
|
|
6467
6943
|
exports["ɵd"] = DrDatePickerService;
|
|
6468
6944
|
exports["ɵe"] = DrDatePickerWithTimeframeComponent;
|