@datarailsshared/datarailsshared 1.4.163-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 (25) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +60 -30
  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.metadata.json +1 -1
  5. package/esm2015/lib/date-tags/day-tag/day-tag.component.js +3 -8
  6. package/esm2015/lib/date-tags/month-tag/month-tag.component.js +3 -8
  7. package/esm2015/lib/date-tags/year-tag/year-tag.component.js +11 -11
  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/lib/dr-inputs/dr-toggle-button/dr-toggle-button.component.js +8 -3
  11. package/esm2015/lib/dr-inputs/dr-toggle-button/toggle-button-theme.js +6 -0
  12. package/esm2015/lib/dr-tags/dr-tag.component.js +17 -5
  13. package/esm2015/lib/models/serverTags.js +13 -1
  14. package/esm2015/public-api.js +3 -1
  15. package/fesm2015/datarailsshared-datarailsshared.js +58 -32
  16. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  17. package/lib/date-tags/date-tag.module.d.ts +2 -1
  18. package/lib/date-tags/year-tag/year-tag.component.d.ts +3 -1
  19. package/lib/dr-inputs/dr-toggle-button/dr-toggle-button.component.d.ts +3 -0
  20. package/lib/dr-inputs/dr-toggle-button/toggle-button-theme.d.ts +4 -0
  21. package/lib/dr-tags/dr-tag.component.d.ts +7 -3
  22. package/lib/models/serverTags.d.ts +15 -1
  23. package/package.json +1 -1
  24. package/public-api.d.ts +2 -1
  25. package/datarailsshared-datarailsshared-1.4.163-rocket.tgz +0 -0
@@ -612,13 +612,8 @@
612
612
  configurable: true
613
613
  });
614
614
  MonthTagComponent.prototype.initDate = function () {
615
- if (this.defaultValue) {
616
- this.date = this.defaultValue;
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) {
@@ -894,8 +889,9 @@
894
889
  var ɵ0$5 = YEAR_FORMATS;
895
890
  var YearTagComponent = /** @class */ (function (_super) {
896
891
  __extends(YearTagComponent, _super);
897
- function YearTagComponent() {
892
+ function YearTagComponent(cdr) {
898
893
  var _this = _super.call(this) || this;
894
+ _this.cdr = cdr;
899
895
  _this.lockedDate = [];
900
896
  return _this;
901
897
  }
@@ -907,15 +903,12 @@
907
903
  configurable: true
908
904
  });
909
905
  YearTagComponent.prototype.initDate = function () {
910
- if (this.defaultValue) {
911
- this.date = this.defaultValue;
912
- this.dateObj.date = this.date;
913
- }
914
- else {
915
- this.dateObj.date = moment$4().unix();
916
- }
906
+ this.date = this.defaultValue || moment$4().unix();
907
+ this.dateObj.date = this.date;
908
+ this.cdr.markForCheck();
917
909
  };
918
910
  YearTagComponent.prototype.initName = function () {
911
+ console.warn('bla bla bla');
919
912
  if (!this.name) {
920
913
  this.name = 'Year';
921
914
  }
@@ -957,7 +950,9 @@
957
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"]
958
951
  },] }
959
952
  ];
960
- YearTagComponent.ctorParameters = function () { return []; };
953
+ YearTagComponent.ctorParameters = function () { return [
954
+ { type: i0.ChangeDetectorRef }
955
+ ]; };
961
956
  YearTagComponent.propDecorators = {
962
957
  isLocked: [{ type: i0.HostBinding, args: ['class.locked',] }],
963
958
  lockedDate: [{ type: i0.Input }]
@@ -970,30 +965,52 @@
970
965
  TagTypes["LIST"] = "LIST";
971
966
  TagTypes["DATE"] = "DATE";
972
967
  })(exports.TagTypes || (exports.TagTypes = {}));
968
+ var TagsConfigSubType;
969
+ (function (TagsConfigSubType) {
970
+ TagsConfigSubType["YEAR"] = "year";
971
+ TagsConfigSubType["PLAN"] = "plan";
972
+ TagsConfigSubType["BUDGET_CYCLE"] = "budget cycle";
973
+ TagsConfigSubType["MONTH"] = "month";
974
+ TagsConfigSubType["WEEK"] = "week";
975
+ TagsConfigSubType["DAY"] = "day";
976
+ TagsConfigSubType["FORECAST_NEW"] = "forecast_new";
977
+ TagsConfigSubType["QUARTER"] = "quarter";
978
+ TagsConfigSubType["FILE_STATUS"] = "file_status";
979
+ })(TagsConfigSubType || (TagsConfigSubType = {}));
973
980
 
974
981
  var DrTagComponent = /** @class */ (function () {
975
982
  function DrTagComponent() {
976
983
  this.lockedDate = [];
977
984
  this.dynamicTagValues = {};
978
- this.connectedTags = [];
979
985
  this.tagChange = new i0.EventEmitter(); // Not emit value for dynamic tag
980
986
  this.dynamicTagChange = new i0.EventEmitter();
981
987
  this.dynamicTagAdd = new i0.EventEmitter();
982
988
  this.currentTagConnectedToDynamic = false;
983
989
  this.tagTypes = exports.TagTypes;
984
990
  this.connectedTagsValues = [];
991
+ this._connectedTags = [];
985
992
  this.selectedTag = {
986
993
  id: 0,
987
994
  value: undefined,
988
995
  name: ''
989
996
  };
990
997
  }
998
+ Object.defineProperty(DrTagComponent.prototype, "connectedTags", {
999
+ get: function () {
1000
+ return this._connectedTags;
1001
+ },
1002
+ set: function (tags) {
1003
+ this._connectedTags = tags || [];
1004
+ },
1005
+ enumerable: false,
1006
+ configurable: true
1007
+ });
1008
+ DrTagComponent.prototype.ngOnChanges = function () {
1009
+ this.calculateDynamicTag();
1010
+ };
991
1011
  DrTagComponent.prototype.ngOnInit = function () {
992
- var _this = this;
993
1012
  var _a, _b;
994
- this.currentTagDynamic = this.tagConfig.options.is_custom;
995
- this.currentTagConnectedToDynamic = _.some(this.tagsConfig, function (tagConfig) { return tagConfig.options.is_custom
996
- && ['year'].includes(_this.tagConfig.options.sub_type); });
1013
+ this.calculateDynamicTag();
997
1014
  this.dateTag = {
998
1015
  type: this.tagConfig.type,
999
1016
  sub_type: this.tagConfig.options.sub_type,
@@ -1108,6 +1125,12 @@
1108
1125
  }
1109
1126
  });
1110
1127
  };
1128
+ DrTagComponent.prototype.calculateDynamicTag = function () {
1129
+ var _this = this;
1130
+ this.currentTagDynamic = this.tagConfig.options.is_custom;
1131
+ this.currentTagConnectedToDynamic = _.some(this.tagsConfig, function (tagConfig) { return tagConfig.options.is_custom
1132
+ && ['year'].includes(_this.tagConfig.options.sub_type); });
1133
+ };
1111
1134
  return DrTagComponent;
1112
1135
  }());
1113
1136
  DrTagComponent.decorators = [
@@ -1201,13 +1224,8 @@
1201
1224
  configurable: true
1202
1225
  });
1203
1226
  DayTagComponent.prototype.initDate = function () {
1204
- if (this.defaultValue) {
1205
- this.date = this.defaultValue;
1206
- this.dateObj.date = this.date;
1207
- }
1208
- else {
1209
- this.dateObj.date = moment$3().unix();
1210
- }
1227
+ this.date = this.defaultValue || moment$3().unix();
1228
+ this.dateObj.date = this.date;
1211
1229
  };
1212
1230
  DayTagComponent.prototype.initName = function () {
1213
1231
  if (!this.name) {
@@ -2443,12 +2461,20 @@
2443
2461
  elementClass: [{ type: i0.HostBinding, args: ['class',] }]
2444
2462
  };
2445
2463
 
2464
+ exports.ToggleButtonTheme = void 0;
2465
+ (function (ToggleButtonTheme) {
2466
+ ToggleButtonTheme["DEFAULT"] = "default";
2467
+ ToggleButtonTheme["DOTTED"] = "dotted";
2468
+ })(exports.ToggleButtonTheme || (exports.ToggleButtonTheme = {}));
2469
+
2446
2470
  var DrToggleButtonComponent = /** @class */ (function () {
2447
2471
  function DrToggleButtonComponent(cdr) {
2448
2472
  this.cdr = cdr;
2449
2473
  this._disabled = false;
2450
2474
  this.bindLabel = null;
2451
2475
  this.bindValue = null;
2476
+ this.bindHidden = null;
2477
+ this.theme = exports.ToggleButtonTheme.DEFAULT;
2452
2478
  this.onChange = function () {
2453
2479
  };
2454
2480
  this.onTouched = function () {
@@ -2485,12 +2511,12 @@
2485
2511
  DrToggleButtonComponent.decorators = [
2486
2512
  { type: i0.Component, args: [{
2487
2513
  selector: 'dr-toggle-button',
2488
- template: "<div class=\"toggle-container\" [class.disabled]=\"_disabled\">\n <div\n *ngFor=\"let item of items\"\n (click)=\"setValue(item)\"\n [class.selected]=\"item[bindValue] === selectedValue || item === selectedValue\"\n [class.disabled]=\"item.disabled\"\n class=\"toggle-container__item\"\n >\n {{ item[bindLabel] || item.name || item }}\n </div>\n</div>\n",
2514
+ 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
2515
  providers: [
2490
2516
  { provide: forms.NG_VALUE_ACCESSOR, useExisting: i0.forwardRef(function () { return DrToggleButtonComponent; }), multi: true }
2491
2517
  ],
2492
2518
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2493
- styles: [".toggle-container{display:flex;flex-wrap:nowrap;background:#f6f7f8;border:1px solid #c3c4ce;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{font-weight:400;background:#f2f2fb;border:1px solid #7f7fdd;color:#25258c}.toggle-container__item.disabled{pointer-events:none;cursor:default;background:#f0f1f4;color:#9ea1aa;border:1px solid #c3c4ce}\n"]
2519
+ 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
2520
  },] }
2495
2521
  ];
2496
2522
  DrToggleButtonComponent.ctorParameters = function () { return [
@@ -2500,6 +2526,8 @@
2500
2526
  items: [{ type: i0.Input }],
2501
2527
  bindLabel: [{ type: i0.Input }],
2502
2528
  bindValue: [{ type: i0.Input }],
2529
+ bindHidden: [{ type: i0.Input }],
2530
+ theme: [{ type: i0.Input }],
2503
2531
  selectedValue: [{ type: i0.Input }],
2504
2532
  disabled: [{ type: i0.Input }]
2505
2533
  };
@@ -4313,6 +4341,7 @@
4313
4341
  return DrSharedUtils;
4314
4342
  }());
4315
4343
 
4344
+ // @ts-ignore
4316
4345
  var moment$2 = require('moment');
4317
4346
  var DrDatePickerService = /** @class */ (function () {
4318
4347
  function DrDatePickerService() {
@@ -4503,6 +4532,7 @@
4503
4532
  { type: i0.Injectable }
4504
4533
  ];
4505
4534
 
4535
+ // @ts-ignore
4506
4536
  var moment$1 = require('moment');
4507
4537
  var DrDatePickerCustomHeaderComponent = /** @class */ (function () {
4508
4538
  function DrDatePickerCustomHeaderComponent(_calendar, _dateAdapter, _dateFormats, cdr, datePickerService) {