@datarailsshared/datarailsshared 1.4.172 → 1.4.175
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 +49 -19
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.175.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/date-tags/forecast-tag/forecast-tag.component.js +10 -1
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.js +8 -3
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +1 -1
- package/esm2015/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.js +13 -4
- package/esm2015/lib/dr-scenario/services/scenario.service.js +20 -15
- package/esm2015/public-api.js +1 -1
- package/fesm2015/datarailsshared-datarailsshared.js +46 -20
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-scenario/components/dr-scenario-configuration/dr-scenario-configuration.component.d.ts +3 -1
- package/lib/dr-scenario/services/scenario.service.d.ts +3 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/datarailsshared-datarailsshared-1.4.172.tgz +0 -0
|
@@ -573,6 +573,13 @@
|
|
|
573
573
|
{ type: i0.Component, args: [{
|
|
574
574
|
template: "<div class=\"forecast-tag__container\">\n <div class=\"forecast-tag__forecast\">\n <p class=\"tag__label\">{{ name }}</p>\n <dr-select placeholder=\"Select\"\n [(ngModel)]=\"forecastValue\"\n bindLabel=\"label\"\n bindValue=\"value\"\n [disabled]=\"disabled\"\n [items]=\"forecastTags\"\n (ngModelChange)=\"changeTagInputHandler($event)\"></dr-select>\n </div>\n <div class=\"forecast-tag__year\">\n <p class=\"tag__label\">Year</p>\n <dr-date-picker format=\"year\"\n [(ngModel)]=\"dateObj.date\"\n [datepickerFilter]=\"dateFilter.bind(this)\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"changeYearInputHandler($event)\"></dr-date-picker>\n </div>\n</div>\n",
|
|
575
575
|
selector: 'forecast-tag',
|
|
576
|
+
providers: [
|
|
577
|
+
{
|
|
578
|
+
provide: core.DateAdapter,
|
|
579
|
+
useClass: materialMomentAdapter.MomentDateAdapter,
|
|
580
|
+
deps: [core.MAT_DATE_LOCALE, materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
581
|
+
}
|
|
582
|
+
],
|
|
576
583
|
styles: [".tag__label{margin:0 0 4px;color:#0c142b;font-size:14px;font-weight:400;line-height:22px}.forecast-tag__container{display:flex;align-items:center}.forecast-tag__year{width:50%;margin-left:24px}.forecast-tag__forecast{width:50%}\n"]
|
|
577
584
|
},] }
|
|
578
585
|
];
|
|
@@ -4394,10 +4401,10 @@
|
|
|
4394
4401
|
enumerable: false,
|
|
4395
4402
|
configurable: true
|
|
4396
4403
|
});
|
|
4397
|
-
ScenarioService.prototype.initScenarioTags = function (
|
|
4398
|
-
if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length)
|
|
4404
|
+
ScenarioService.prototype.initScenarioTags = function (wholeTagsConfig, currentTagsConfig, isMultipleDimension) {
|
|
4405
|
+
if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length))
|
|
4399
4406
|
return;
|
|
4400
|
-
this.wholeTagsConfig = wholeTagsConfig;
|
|
4407
|
+
this.wholeTagsConfig = _.cloneDeep(wholeTagsConfig);
|
|
4401
4408
|
this.currentTagsConfig = currentTagsConfig;
|
|
4402
4409
|
this.isMultipleDimension = isMultipleDimension;
|
|
4403
4410
|
};
|
|
@@ -4410,13 +4417,14 @@
|
|
|
4410
4417
|
var scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
|
|
4411
4418
|
var scenarioTagsUi = [];
|
|
4412
4419
|
_.forEach(scenarioTagsConfig, function (scenarioTag) {
|
|
4413
|
-
var
|
|
4414
|
-
var
|
|
4415
|
-
var tag =
|
|
4416
|
-
if (
|
|
4417
|
-
_this.
|
|
4420
|
+
var isTagWithSubTags = scenarioTag.type === exports.TagTypes.DATE;
|
|
4421
|
+
var tagWithSubTags = isTagWithSubTags && _.find(scenarioTagsUi, { type: scenarioTag.type });
|
|
4422
|
+
var tag = tagWithSubTags || _this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isTagWithSubTags);
|
|
4423
|
+
if (isTagWithSubTags) {
|
|
4424
|
+
_this.updateScenarioSubTags(tag, scenarioTag);
|
|
4425
|
+
tag.subTags = _this.sortedScenarioSubTags(tag);
|
|
4418
4426
|
}
|
|
4419
|
-
if (
|
|
4427
|
+
if (tagWithSubTags)
|
|
4420
4428
|
return;
|
|
4421
4429
|
scenarioTagsUi.push(tag);
|
|
4422
4430
|
});
|
|
@@ -4477,12 +4485,16 @@
|
|
|
4477
4485
|
}
|
|
4478
4486
|
return tag;
|
|
4479
4487
|
};
|
|
4480
|
-
ScenarioService.prototype.
|
|
4481
|
-
|
|
4482
|
-
|
|
4488
|
+
ScenarioService.prototype.sortedScenarioSubTags = function (tag) {
|
|
4489
|
+
var SUB_TAGS_ORDER = [TagsConfigSubType.DAY, TagsConfigSubType.WEEK, TagsConfigSubType.MONTH, TagsConfigSubType.QUARTER, TagsConfigSubType.YEAR];
|
|
4490
|
+
return _.orderBy(tag.subTags, function (subTag) { return _.indexOf(SUB_TAGS_ORDER, subTag.subType); });
|
|
4491
|
+
};
|
|
4492
|
+
ScenarioService.prototype.updateScenarioSubTags = function (tag, scenarioTag) {
|
|
4493
|
+
if (!tag.subTags) {
|
|
4494
|
+
tag.subTags = [];
|
|
4483
4495
|
}
|
|
4484
4496
|
var tagSubType = scenarioTag.options.sub_type;
|
|
4485
|
-
|
|
4497
|
+
tag.subTags.push({
|
|
4486
4498
|
subType: tagSubType,
|
|
4487
4499
|
name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
|
|
4488
4500
|
});
|
|
@@ -5127,7 +5139,12 @@
|
|
|
5127
5139
|
* Setting value from outside of component via ngModel or formControl updates
|
|
5128
5140
|
*/
|
|
5129
5141
|
DrDatePickerComponent.prototype.writeValue = function (value) {
|
|
5130
|
-
|
|
5142
|
+
/*
|
|
5143
|
+
* We need keep local timestamp for Electron Application
|
|
5144
|
+
* Issue in electron: when we select date, date select with -1 (if we're choosing 2023, output will be 2022)
|
|
5145
|
+
*/
|
|
5146
|
+
var convertedValue = document.is_electron ? moment.unix(value) : moment.unix(value).utc();
|
|
5147
|
+
this.innerValue = value ? convertedValue : value;
|
|
5131
5148
|
if (this.innerValue) {
|
|
5132
5149
|
this.tryToNormalaizeTimeframe();
|
|
5133
5150
|
}
|
|
@@ -5175,7 +5192,7 @@
|
|
|
5175
5192
|
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true },
|
|
5176
5193
|
DrDatePickerService
|
|
5177
5194
|
],
|
|
5178
|
-
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 #
|
|
5195
|
+
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 #9EA1AA;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#4646ce!important;color:#151b3f}:host.disabled{pointer-events:none;border:1px solid #aeabac;background:#f0f1f4}:host.disabled:after{color:#aeabac}: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:#9ea1aa}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\\e9b6\";font-family:DataRails;font-size:24px;color:#6d6e6f;top:0;bottom:0;right:8px;position:absolute;display:flex;align-items:center;justify-content:center}:host i{display:flex;align-items:center;position:absolute;color:#999;left:8px;top:0;bottom:0}: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:#aeabac;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"]
|
|
5179
5196
|
},] }
|
|
5180
5197
|
];
|
|
5181
5198
|
DrDatePickerComponent.ctorParameters = function () { return [
|
|
@@ -5377,7 +5394,7 @@
|
|
|
5377
5394
|
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
|
|
5378
5395
|
{ provide: DrDatePickerService }
|
|
5379
5396
|
],
|
|
5380
|
-
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 #
|
|
5397
|
+
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 #9EA1AA;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#4646ce!important;color:#151b3f}:host.disabled{pointer-events:none;border:1px solid #aeabac;background:#f0f1f4}:host.disabled:after{color:#aeabac}: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:#9ea1aa}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\\e9b6\";font-family:DataRails;font-size:24px;color:#6d6e6f;top:0;bottom:0;right:8px;position:absolute;display:flex;align-items:center;justify-content:center}:host i{display:flex;align-items:center;position:absolute;color:#999;left:8px;top:0;bottom:0}: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:#aeabac;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.disabled{background:transparent;color:inherit}:host.disabled.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{text-decoration:none;color:#6d6e6f;font-weight:normal}: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"]
|
|
5381
5398
|
},] }
|
|
5382
5399
|
];
|
|
5383
5400
|
DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
|
|
@@ -6816,10 +6833,23 @@
|
|
|
6816
6833
|
this.toggleButtonMode = exports.ToggleButtonMode;
|
|
6817
6834
|
this._scenarioTags = [];
|
|
6818
6835
|
this.wholeTagsConfig = [];
|
|
6819
|
-
this.selectedScenario = exports.Scenario.ACTUALS;
|
|
6820
6836
|
this.isMultipleDimension = false;
|
|
6821
6837
|
this.scenarioDataChanged = new i0.EventEmitter();
|
|
6822
6838
|
}
|
|
6839
|
+
Object.defineProperty(DrScenarioConfigurationComponent.prototype, "selectedScenario", {
|
|
6840
|
+
get: function () {
|
|
6841
|
+
return this._selectedScenario || exports.Scenario.ACTUALS;
|
|
6842
|
+
},
|
|
6843
|
+
set: function (scenario) {
|
|
6844
|
+
if (!Object.values(exports.Scenario).includes(scenario)) {
|
|
6845
|
+
this._selectedScenario = exports.Scenario.ACTUALS;
|
|
6846
|
+
return;
|
|
6847
|
+
}
|
|
6848
|
+
this._selectedScenario = scenario;
|
|
6849
|
+
},
|
|
6850
|
+
enumerable: false,
|
|
6851
|
+
configurable: true
|
|
6852
|
+
});
|
|
6823
6853
|
Object.defineProperty(DrScenarioConfigurationComponent.prototype, "scenarioTags", {
|
|
6824
6854
|
get: function () {
|
|
6825
6855
|
return this._scenarioTags;
|
|
@@ -6840,7 +6870,7 @@
|
|
|
6840
6870
|
});
|
|
6841
6871
|
DrScenarioConfigurationComponent.prototype.ngOnInit = function () {
|
|
6842
6872
|
this.scenarios = this.scenarioService.scenarios;
|
|
6843
|
-
this.scenarioService.initScenarioTags(this.
|
|
6873
|
+
this.scenarioService.initScenarioTags(this.wholeTagsConfig, this.currentTagsConfig, this.isMultipleDimension);
|
|
6844
6874
|
this.scenarioTags = this.scenarioService.getScenarioTagsByScenario(this.selectedScenario);
|
|
6845
6875
|
};
|
|
6846
6876
|
DrScenarioConfigurationComponent.prototype.onScenarioChange = function (scenario) {
|
|
@@ -6889,7 +6919,7 @@
|
|
|
6889
6919
|
DrScenarioConfigurationComponent.decorators = [
|
|
6890
6920
|
{ type: i0.Component, args: [{
|
|
6891
6921
|
selector: 'dr-scenario-configuration',
|
|
6892
|
-
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=\"
|
|
6922
|
+
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 [mode]=\"toggleButtonMode.DOTTED\"\n (ngModelChange)=\"onScenarioDataChange()\"></dr-toggle-button>\n </div>\n </div>\n </div>\n </div>\n</div>\n",
|
|
6893
6923
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
6894
6924
|
providers: [ScenarioService],
|
|
6895
6925
|
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"]
|