@datarailsshared/datarailsshared 1.3.7 → 1.3.10

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 (30) hide show
  1. package/_datarailsshared.styles.css +4 -0
  2. package/assets/styles/_styles.scss +2 -0
  3. package/bundles/datarailsshared-datarailsshared.umd.js +141 -70
  4. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  5. package/datarailsshared-datarailsshared-1.3.10.tgz +0 -0
  6. package/datarailsshared-datarailsshared.metadata.json +1 -1
  7. package/esm2015/lib/date-tags/day-tag/day-tag.component.js +3 -2
  8. package/esm2015/lib/dr-avatar/dr-avatar.component.js +17 -10
  9. package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +5 -3
  10. package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker.component.js +2 -2
  11. package/esm2015/lib/dr-inputs/dr-input/dr-input.component.js +17 -21
  12. package/esm2015/lib/dr-inputs/dr-toggle/dr-toggle.component.js +2 -2
  13. package/esm2015/lib/dr-popover/dr-popover-ref.js +15 -0
  14. package/esm2015/lib/dr-popover/dr-popover.component.js +22 -18
  15. package/esm2015/lib/dr-popover/dr-popover.directive.js +63 -20
  16. package/esm2015/lib/dr-popover/dr-popover.module.js +4 -4
  17. package/esm2015/lib/models/popover.js +2 -0
  18. package/esm2015/public-api.js +2 -1
  19. package/fesm2015/datarailsshared-datarailsshared.js +135 -70
  20. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  21. package/lib/dr-avatar/dr-avatar.component.d.ts +4 -2
  22. package/lib/dr-inputs/dr-input/dr-input.component.d.ts +11 -13
  23. package/lib/dr-inputs/dr-toggle/dr-toggle.component.d.ts +1 -1
  24. package/lib/dr-popover/dr-popover-ref.d.ts +12 -0
  25. package/lib/dr-popover/dr-popover.component.d.ts +7 -5
  26. package/lib/dr-popover/dr-popover.directive.d.ts +19 -9
  27. package/lib/models/popover.d.ts +1 -0
  28. package/package.json +1 -1
  29. package/public-api.d.ts +1 -0
  30. package/datarailsshared-datarailsshared-1.3.7.tgz +0 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('moment'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/common'), require('rxjs'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/button-toggle'), require('@ng-select/ng-select'), require('@angular/material/tooltip')) :
3
- typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/forms', '@angular/material/core', '@angular/material-moment-adapter', 'moment', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/common', 'rxjs', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@angular/material/select', '@angular/material/button-toggle', '@ng-select/ng-select', '@angular/material/tooltip'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.forms, global.ng.material.core, global.ng.materialMomentAdapter, global.momentImported, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.common, global.rxjs, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global.ng.material.select, global.ng.material.buttonToggle, global.ngSelect, global.ng.material.tooltip));
5
- }(this, (function (exports, i0, forms, core, materialMomentAdapter, momentImported, animations, overlay, portal, common, rxjs, datepicker, formField, input, select, buttonToggle, ngSelect, tooltip) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('moment'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/button-toggle'), require('@ng-select/ng-select'), require('@angular/material/tooltip')) :
3
+ typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/forms', '@angular/material/core', '@angular/material-moment-adapter', 'moment', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@angular/material/select', '@angular/material/button-toggle', '@ng-select/ng-select', '@angular/material/tooltip'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.forms, global.ng.material.core, global.ng.materialMomentAdapter, global.momentImported, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global.ng.material.select, global.ng.material.buttonToggle, global.ngSelect, global.ng.material.tooltip));
5
+ }(this, (function (exports, i0, forms, core, materialMomentAdapter, momentImported, animations, overlay, portal, common, rxjs, operators, datepicker, formField, input, select, buttonToggle, ngSelect, tooltip) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -1113,7 +1113,8 @@
1113
1113
  var utcOffsetInMilliseconds = moment().utcOffset() * 60 * 1000;
1114
1114
  this.dateObj.date = moment(moment().valueOf() + utcOffsetInMilliseconds);
1115
1115
  if (this.defaultValue) {
1116
- this.dateObj.date = moment(new Date(this.defaultValue * 1000)).utc().format("YYYY-MM-DD");
1116
+ this.dateObj.date = moment(new Date(this.defaultValue * 1000)).utc();
1117
+ this.date.setValue(this.dateObj.date);
1117
1118
  }
1118
1119
  };
1119
1120
  DayTagComponent.prototype.initName = function () {
@@ -1269,6 +1270,11 @@
1269
1270
  this.elementRef = elementRef;
1270
1271
  this.renderer = renderer;
1271
1272
  this.cdr = cdr;
1273
+ this.type = 'string';
1274
+ this.placeholder = '';
1275
+ this.readonly = false;
1276
+ this.clearable = false;
1277
+ this.blur = new i0.EventEmitter();
1272
1278
  this.value = null;
1273
1279
  this._disabled = null;
1274
1280
  this._elementClass = [];
@@ -1279,17 +1285,11 @@
1279
1285
  checkFocusOut: function (target, element) { return true; },
1280
1286
  text: 'Save'
1281
1287
  };
1282
- this.onChange = function () { };
1283
- this.onTouched = function () { };
1284
- this.type = 'string';
1285
- this.placeholder = '';
1286
- this.readonly = false;
1287
- this.clearable = false;
1288
- this.min = null;
1289
- this.max = null;
1290
1288
  this.searchHandler = new i0.EventEmitter();
1291
1289
  this.buttonHandler = new i0.EventEmitter();
1292
1290
  this.tabindex = -1;
1291
+ this.onChange = function () { };
1292
+ this.onTouched = function () { };
1293
1293
  }
1294
1294
  Object.defineProperty(DrInputComponent.prototype, "disabled", {
1295
1295
  set: function (value) {
@@ -1298,7 +1298,6 @@
1298
1298
  enumerable: false,
1299
1299
  configurable: true
1300
1300
  });
1301
- ;
1302
1301
  Object.defineProperty(DrInputComponent.prototype, "buttonOptions", {
1303
1302
  set: function (value) {
1304
1303
  var _this = this;
@@ -1327,7 +1326,6 @@
1327
1326
  enumerable: false,
1328
1327
  configurable: true
1329
1328
  });
1330
- ;
1331
1329
  Object.defineProperty(DrInputComponent.prototype, "elementClass", {
1332
1330
  get: function () {
1333
1331
  return this._elementClass.join(' ');
@@ -1395,14 +1393,14 @@
1395
1393
  DrInputComponent.decorators = [
1396
1394
  { type: i0.Component, args: [{
1397
1395
  selector: 'dr-input',
1398
- template: "<ng-content select=\"[prefixIcon]\"></ng-content>\r\n<input [(ngModel)]=\"value\"\r\n (ngModelChange)=\"updateChanges()\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"_disabled\"\r\n [readonly]=\"readonly\"\r\n [type]=\"type\"\r\n [placeholder]=\"placeholder\"\r\n [matDatepicker]=\"matDatePicker\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n>\r\n<span class=\"clear-icon\" (click)=\"writeValue(null)\"></span>\r\n<span *ngIf=\"type === 'search'\" class=\"search-icon\" (click)=\"onSearchClicked($event)\"></span>\r\n<ng-content select=\"[suffixIcon]\"></ng-content>\r\n<button *ngIf=\"_buttonOptions.show || (_buttonOptions.showOnFocus && _buttonOptions.focusSet)\"\r\n (click)=\"onButtonClicked($event)\">\r\n {{_buttonOptions.text}}\r\n</button>\r\n",
1396
+ template: "<ng-content select=\"[prefixIcon]\"></ng-content>\r\n<input [(ngModel)]=\"value\"\r\n (ngModelChange)=\"updateChanges()\"\r\n (blur)=\"blur.emit(value); onTouched()\"\r\n [disabled]=\"_disabled\"\r\n [readonly]=\"readonly\"\r\n [type]=\"type\"\r\n [placeholder]=\"placeholder\"\r\n [name]=\"name\"\r\n>\r\n<span class=\"clear-icon\" (click)=\"writeValue(null)\"></span>\r\n<span *ngIf=\"type === 'search'\" class=\"search-icon\" (click)=\"onSearchClicked($event)\"></span>\r\n<ng-content select=\"[suffixIcon]\"></ng-content>\r\n<button *ngIf=\"_buttonOptions.show || (_buttonOptions.showOnFocus && _buttonOptions.focusSet)\"\r\n (click)=\"onButtonClicked($event)\">\r\n {{_buttonOptions.text}}\r\n</button>\r\n",
1399
1397
  providers: [{
1400
1398
  provide: forms.NG_VALUE_ACCESSOR,
1401
1399
  useExisting: i0.forwardRef(function () { return DrInputComponent; }),
1402
1400
  multi: true
1403
1401
  }],
1404
1402
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1405
- styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Nunito Sans\",sans-serif;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;padding:0 8px;overflow:hidden}: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 input{display:flex;flex-grow:1;height:100%;border:none;padding:4px 0;text-align:left}: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}:host .clear-icon{visibility:hidden}:host.clearable .clear-icon,:host.ng-touched.ng-invalid .clear-icon{visibility:visible;content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.91783 5.00001L9.03353 1.88395C9.11924 1.79818 9.16651 1.68374 9.16665 1.56171C9.16665 1.43962 9.11937 1.32504 9.03353 1.2394L8.76047 0.966415C8.67463 0.880433 8.56023 0.833344 8.43808 0.833344C8.31612 0.833344 8.20166 0.880433 8.11582 0.966415L5.00013 4.08227L1.88428 0.966415C1.79858 0.880433 1.68404 0.833344 1.56196 0.833344C1.44001 0.833344 1.32556 0.880433 1.23985 0.966415L0.966646 1.2394C0.788869 1.41719 0.788869 1.70637 0.966646 1.88395L4.08242 5.00001L0.966646 8.11593C0.880873 8.20184 0.833677 8.31628 0.833677 8.43831C0.833677 8.56034 0.880873 8.67478 0.966646 8.76062L1.23978 9.03361C1.32548 9.11952 1.44 9.16668 1.56188 9.16668C1.68397 9.16668 1.7985 9.11952 1.88421 9.03361L5.00005 5.91769L8.11575 9.03361C8.20159 9.11952 8.31605 9.16668 8.438 9.16668H8.43815C8.56017 9.16668 8.67456 9.11952 8.7604 9.03361L9.03346 8.76062C9.11916 8.67484 9.16643 8.56034 9.16643 8.43831C9.16643 8.31628 9.11916 8.20184 9.03346 8.116L5.91783 5.00001Z\" fill=\"%2351566F\"/></svg> ');margin:auto 8px;cursor:pointer}:host span+span,:host span+img{margin-left:0}:host.search-type{padding:0 16px;border-radius:16px}:host.search-type.ng-valid{border-color:#c3c4ce}:host.search-type .search-icon{content:url('data:image/svg+xml; utf8, <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.5816 10.2097C11.4878 10.1157 11.3605 10.0629 11.2277 10.0629H10.8175C10.7473 10.0629 10.6799 10.035 10.6303 9.98534C10.5322 9.88724 10.527 9.73044 10.6132 9.62178C11.4154 8.6112 11.8925 7.33534 11.8925 5.94625C11.8925 2.66209 9.23042 0 5.94625 0C2.66209 0 0 2.66209 0 5.94625C0 9.23042 2.66209 11.8925 5.94625 11.8925C7.33523 11.8925 8.611 11.4155 9.62155 10.6172C9.7304 10.5312 9.88711 10.5366 9.9852 10.6347C10.0349 10.6845 10.0629 10.7519 10.0629 10.8223V11.2277C10.0629 11.3605 10.1157 11.4878 10.2097 11.5816L14.2834 15.6472C14.4787 15.8421 14.795 15.8419 14.9901 15.6468L15.6468 14.9901C15.8419 14.795 15.8421 14.4787 15.6472 14.2834L11.5816 10.2097ZM5.94625 10.0629C3.67296 10.0629 1.82962 8.21955 1.82962 5.94625C1.82962 3.67296 3.67296 1.82962 5.94625 1.82962C8.21955 1.82962 10.0629 3.67296 10.0629 5.94625C10.0629 8.21955 8.21955 10.0629 5.94625 10.0629Z\" fill=\"%23BCBCBC\"/></svg> ');margin:auto 0 auto 8px;cursor:pointer}:host.with-button{padding-right:0}:host.with-button button{color:#0061ff;background:#F6F7F8;height:100%;width:auto;padding:0 8px;display:flex;align-items:center;border:none;border-left:1px solid #C3C4CE}:host ::ng-deep img[prefixIcon],:host ::ng-deep img[suffixIcon],:host ::ng-deep i[prefixIcon],:host ::ng-deep i[suffixIcon]{position:relative;margin:auto 8px}:host ::ng-deep img[prefixIcon],:host ::ng-deep i[prefixIcon]{margin-left:0}:host ::ng-deep img[suffixIcon],:host ::ng-deep i[suffixIcon]{margin-right:0}\n"]
1403
+ styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Nunito Sans\",sans-serif;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;padding:0 8px;overflow:hidden;outline:none}: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 input{display:flex;flex-grow:1;height:100%;border:none;padding:4px 0;text-align:left}: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}:host .clear-icon{visibility:hidden}:host.clearable .clear-icon,:host.ng-touched.ng-invalid .clear-icon{visibility:visible;content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.91783 5.00001L9.03353 1.88395C9.11924 1.79818 9.16651 1.68374 9.16665 1.56171C9.16665 1.43962 9.11937 1.32504 9.03353 1.2394L8.76047 0.966415C8.67463 0.880433 8.56023 0.833344 8.43808 0.833344C8.31612 0.833344 8.20166 0.880433 8.11582 0.966415L5.00013 4.08227L1.88428 0.966415C1.79858 0.880433 1.68404 0.833344 1.56196 0.833344C1.44001 0.833344 1.32556 0.880433 1.23985 0.966415L0.966646 1.2394C0.788869 1.41719 0.788869 1.70637 0.966646 1.88395L4.08242 5.00001L0.966646 8.11593C0.880873 8.20184 0.833677 8.31628 0.833677 8.43831C0.833677 8.56034 0.880873 8.67478 0.966646 8.76062L1.23978 9.03361C1.32548 9.11952 1.44 9.16668 1.56188 9.16668C1.68397 9.16668 1.7985 9.11952 1.88421 9.03361L5.00005 5.91769L8.11575 9.03361C8.20159 9.11952 8.31605 9.16668 8.438 9.16668H8.43815C8.56017 9.16668 8.67456 9.11952 8.7604 9.03361L9.03346 8.76062C9.11916 8.67484 9.16643 8.56034 9.16643 8.43831C9.16643 8.31628 9.11916 8.20184 9.03346 8.116L5.91783 5.00001Z\" fill=\"%2351566F\"/></svg> ');margin:auto 8px;cursor:pointer}:host span+span,:host span+img{margin-left:0}:host.search-type{padding:0 16px;border-radius:16px}:host.search-type.ng-valid{border-color:#c3c4ce}:host.search-type .search-icon{content:url('data:image/svg+xml; utf8, <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.5816 10.2097C11.4878 10.1157 11.3605 10.0629 11.2277 10.0629H10.8175C10.7473 10.0629 10.6799 10.035 10.6303 9.98534C10.5322 9.88724 10.527 9.73044 10.6132 9.62178C11.4154 8.6112 11.8925 7.33534 11.8925 5.94625C11.8925 2.66209 9.23042 0 5.94625 0C2.66209 0 0 2.66209 0 5.94625C0 9.23042 2.66209 11.8925 5.94625 11.8925C7.33523 11.8925 8.611 11.4155 9.62155 10.6172C9.7304 10.5312 9.88711 10.5366 9.9852 10.6347C10.0349 10.6845 10.0629 10.7519 10.0629 10.8223V11.2277C10.0629 11.3605 10.1157 11.4878 10.2097 11.5816L14.2834 15.6472C14.4787 15.8421 14.795 15.8419 14.9901 15.6468L15.6468 14.9901C15.8419 14.795 15.8421 14.4787 15.6472 14.2834L11.5816 10.2097ZM5.94625 10.0629C3.67296 10.0629 1.82962 8.21955 1.82962 5.94625C1.82962 3.67296 3.67296 1.82962 5.94625 1.82962C8.21955 1.82962 10.0629 3.67296 10.0629 5.94625C10.0629 8.21955 8.21955 10.0629 5.94625 10.0629Z\" fill=\"%23BCBCBC\"/></svg> ');margin:auto 0 auto 8px;cursor:pointer}:host.with-button{padding-right:0}:host.with-button button{color:#0061ff;background:#F6F7F8;height:100%;width:auto;padding:0 8px;display:flex;align-items:center;border:none;border-left:1px solid #C3C4CE}:host ::ng-deep img[prefixIcon],:host ::ng-deep img[suffixIcon],:host ::ng-deep i[prefixIcon],:host ::ng-deep i[suffixIcon]{position:relative;margin:auto 8px}:host ::ng-deep img[prefixIcon],:host ::ng-deep i[prefixIcon]{margin-left:0}:host ::ng-deep img[suffixIcon],:host ::ng-deep i[suffixIcon]{margin-right:0}\n"]
1406
1404
  },] }
1407
1405
  ];
1408
1406
  DrInputComponent.ctorParameters = function () { return [
@@ -1411,21 +1409,20 @@
1411
1409
  { type: i0.ChangeDetectorRef }
1412
1410
  ]; };
1413
1411
  DrInputComponent.propDecorators = {
1412
+ disabled: [{ type: i0.Input }],
1413
+ buttonOptions: [{ type: i0.Input }],
1414
1414
  type: [{ type: i0.Input }],
1415
+ name: [{ type: i0.Input }],
1415
1416
  placeholder: [{ type: i0.Input }],
1416
1417
  readonly: [{ type: i0.Input }],
1417
1418
  clearable: [{ type: i0.Input }],
1418
- min: [{ type: i0.Input }],
1419
- max: [{ type: i0.Input }],
1420
- matDatePicker: [{ type: i0.Input }],
1421
- disabled: [{ type: i0.Input }],
1422
- buttonOptions: [{ type: i0.Input }],
1419
+ blur: [{ type: i0.Output }],
1420
+ elementClass: [{ type: i0.HostBinding, args: ['class',] }],
1423
1421
  searchHandler: [{ type: i0.Output }],
1424
1422
  buttonHandler: [{ type: i0.Output }],
1425
1423
  prefixIcon: [{ type: i0.ContentChild, args: ['prefix', { static: false },] }],
1426
1424
  suffixIcon: [{ type: i0.ContentChild, args: ['suffix', { static: false },] }],
1427
- tabindex: [{ type: i0.HostBinding, args: ['tabindex',] }],
1428
- elementClass: [{ type: i0.HostBinding, args: ['class',] }]
1425
+ tabindex: [{ type: i0.HostBinding, args: ['tabindex',] }]
1429
1426
  };
1430
1427
 
1431
1428
  var DrSelectComponent = /** @class */ (function () {
@@ -1493,23 +1490,34 @@
1493
1490
 
1494
1491
  var DrAvatarComponent = /** @class */ (function () {
1495
1492
  function DrAvatarComponent() {
1496
- this.users = [];
1497
1493
  this.userClicked = new i0.EventEmitter();
1494
+ this.parsedUsers = [];
1498
1495
  }
1496
+ Object.defineProperty(DrAvatarComponent.prototype, "users", {
1497
+ set: function (user) {
1498
+ if (user) {
1499
+ this.parsedUsers = this.parseUsers(user);
1500
+ }
1501
+ },
1502
+ enumerable: false,
1503
+ configurable: true
1504
+ });
1499
1505
  DrAvatarComponent.prototype.ngOnChanges = function (changes) {
1500
1506
  var _this = this;
1501
- var _a;
1502
- if (changes.users && ((_a = changes.users.currentValue) === null || _a === void 0 ? void 0 : _a.length)) {
1503
- this.getFirstUsers().forEach(function (user, index) { return user.class = "icon-" + index; });
1507
+ if (changes.users) {
1508
+ this.getFirstUsers().forEach(function (user) { return user.class = "icon-" + _this.getRandomValue(5); });
1504
1509
  this.getLastUsers().forEach(function (user) { return user.class = "icon-" + _this.getRandomValue(5); });
1505
1510
  }
1506
1511
  };
1512
+ DrAvatarComponent.prototype.parseUsers = function (value) {
1513
+ return Array.isArray(value) ? value : Array.of(value);
1514
+ };
1507
1515
  DrAvatarComponent.prototype.getFirstUsers = function () {
1508
- return this.users.slice(0, 2);
1516
+ return this.parsedUsers.slice(0, 2);
1509
1517
  };
1510
1518
  DrAvatarComponent.prototype.getLastUsers = function () {
1511
- if (this.users.length > 2) {
1512
- return this.users.slice(2, this.users.length - 1);
1519
+ if (this.parsedUsers.length > 2) {
1520
+ return this.parsedUsers.slice(2, this.parsedUsers.length - 1);
1513
1521
  }
1514
1522
  return [];
1515
1523
  };
@@ -1521,7 +1529,7 @@
1521
1529
  DrAvatarComponent.decorators = [
1522
1530
  { type: i0.Component, args: [{
1523
1531
  selector: 'dr-avatar',
1524
- template: "<div class=\"users-section\">\r\n <div class=\"users-section__user\"\r\n [class]=\"user.class\"\r\n *ngFor=\"let user of getFirstUsers()\"\r\n (click)=\"userClicked.emit()\"\r\n [matTooltip]=\"user.first_name + ' ' + user.last_name\"\r\n [matTooltipPosition]=\"'below'\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n\r\n <div class=\"users-section__user icon-2\" *ngIf=\"users.length > 2\"\r\n [drTooltip]=\"usersTemplate\"\r\n [drTooltipPosition]=\"'bottom'\">\r\n {{getLastUsers().length}}\r\n </div>\r\n</div>\r\n\r\n<ng-template #usersTemplate>\r\n <div *ngFor=\"let user of getLastUsers()\" class=\"users-popover-item\">\r\n <div class=\"users-section__user\"\r\n (click)=\"userClicked.emit()\"\r\n [class]=\"user.class\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n <span class=\"username\">\r\n {{user.first_name + ' ' + user.last_name}}\r\n </span>\r\n </div>\r\n</ng-template>\r\n",
1532
+ template: "<div class=\"users-section\">\r\n <div class=\"users-section__user\"\r\n [class]=\"user.class\"\r\n *ngFor=\"let user of getFirstUsers()\"\r\n (click)=\"userClicked.emit()\"\r\n [matTooltip]=\"user.first_name + ' ' + user.last_name\"\r\n [matTooltipPosition]=\"'below'\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n\r\n <div class=\"users-section__user icon-2\" *ngIf=\"parsedUsers.length > 2\"\r\n [drTooltip]=\"usersTemplate\"\r\n [drTooltipPosition]=\"'bottom'\">\r\n {{getLastUsers().length}}\r\n </div>\r\n</div>\r\n\r\n<ng-template #usersTemplate>\r\n <div *ngFor=\"let user of getLastUsers()\" class=\"users-popover-item\">\r\n <div class=\"users-section__user\"\r\n (click)=\"userClicked.emit()\"\r\n [class]=\"user.class\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n <span class=\"username\">\r\n {{user.first_name + ' ' + user.last_name}}\r\n </span>\r\n </div>\r\n</ng-template>\r\n",
1525
1533
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1526
1534
  styles: [":host{width:auto}.users-section{display:flex;position:absolute;height:28px;top:5px}.users-popover-item{display:flex;align-items:center;margin:12px}.users-popover-item .username{color:#51566f;font-size:14px}.users-popover-item .users-section__user{margin-right:8px}.users-section__user{display:flex;justify-content:center;align-items:center;height:28px;width:28px;border-radius:14px;background:red;color:#fff;font-size:12px}.users-section__user.icon-0{background-color:#7b61ff}.users-section__user.icon-1{background-color:#21b8f1}.users-section__user.icon-2{background-color:#2969b0}.users-section__user.icon-3{background-color:#51566f}.users-section__user.icon-4{background-color:#0061ff}.users-section__user:hover{cursor:pointer}.users-section__user:not(:first-child){margin-left:4px}\n"]
1527
1535
  },] }
@@ -1806,7 +1814,7 @@
1806
1814
  { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrToggleComponent, multi: true }
1807
1815
  ],
1808
1816
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1809
- styles: [":host{display:flex;justify-content:space-between;align-items:center}:host .toggle-container.disabled{pointer-events:none}:host .toggle-container.disabled .toggle-body{background-color:#8f9bb329!important}:host .toggle-container.disabled .toggle-body i{background:rgba(143,155,179,.24)!important}:host .toggle-container.success input:checked+span.toggle-body{background-color:#03a678}:host .toggle-container input{display:none}:host .toggle-container input:checked+span.toggle-body>i,:host .toggle-container input:checked+span.toggle-body:active>i{margin-left:16px}:host .toggle-container input:checked+span.toggle-body{background-color:#579bf2}:host .toggle-container .toggle-body{cursor:pointer;display:block;width:30px;height:16px;margin:7px auto;border-radius:15px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;background-color:#aeb5bb}:host .toggle-container .toggle-body:active{background-color:#a6b9cb}:host .toggle-container .toggle-body-wrapper{display:flex;flex-direction:column}:host .toggle-container .toggle-body i{height:12px;width:12px;background:#fff;display:inline-block;border-radius:100px;margin-top:2px;margin-left:1.5px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;pointer-events:none}\n"]
1817
+ styles: [":host{display:flex;justify-content:space-between;align-items:center}:host .toggle-container.disabled{pointer-events:none}:host .toggle-container.disabled .toggle-body{background-color:#8f9bb329!important}:host .toggle-container.disabled .toggle-body i{background:rgba(143,155,179,.24)!important}:host .toggle-container.success input:checked+span.toggle-body{background-color:#03a678}:host .toggle-container input{display:none}:host .toggle-container input:checked+span.toggle-body>i,:host .toggle-container input:checked+span.toggle-body:active>i{margin-left:16px}:host .toggle-container input:checked+span.toggle-body{background-color:#579bf2}:host .toggle-container .toggle-body{cursor:pointer;display:block;width:30px;height:16px;margin:7px auto;border-radius:15px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;background-color:#aeb5bb;line-height:1}:host .toggle-container .toggle-body:active{background-color:#a6b9cb}:host .toggle-container .toggle-body-wrapper{display:flex;flex-direction:column}:host .toggle-container .toggle-body i{height:12px;width:12px;background:#fff;display:inline-block;border-radius:100px;margin-top:2px;margin-left:1.5px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;pointer-events:none}\n"]
1810
1818
  },] }
1811
1819
  ];
1812
1820
  DrToggleComponent.ctorParameters = function () { return [
@@ -2112,7 +2120,7 @@
2112
2120
  DrDatePickerComponent.decorators = [
2113
2121
  { type: i0.Component, args: [{
2114
2122
  selector: 'new-dr-date-picker',
2115
- template: " <dr-input\r\n (click)=\"datePicker.open()\"\r\n [(ngModel)]=\"value\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n [placeholder]=\"placeholder\"\r\n [matDatePicker]=\"datePicker\"\r\n [drDatePickerFormat]=\"_format\"\r\n [readonly]=\"readonly\"\r\n ></dr-input>\r\n <mat-datepicker\r\n #datePicker startView=\"{{_lastView}}\"\r\n (yearSelected)=\"chosenYearHandler($event, datePicker)\"\r\n (monthSelected)=\"chosenMonthHandler($event, datePicker)\">\r\n </mat-datepicker>\r\n\r\n",
2123
+ template: " <dr-input\r\n (click)=\"datePicker.open()\"\r\n [(ngModel)]=\"value\"\r\n [placeholder]=\"placeholder\"\r\n [drDatePickerFormat]=\"_format\"\r\n [readonly]=\"readonly\"\r\n ></dr-input>\r\n <mat-datepicker\r\n #datePicker startView=\"{{_lastView}}\"\r\n (yearSelected)=\"chosenYearHandler($event, datePicker)\"\r\n (monthSelected)=\"chosenMonthHandler($event, datePicker)\">\r\n </mat-datepicker>\r\n\r\n",
2116
2124
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2117
2125
  providers: [
2118
2126
  { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true }
@@ -2179,11 +2187,28 @@
2179
2187
  datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
2180
2188
  };
2181
2189
 
2190
+ var DrPopoverRef = /** @class */ (function () {
2191
+ function DrPopoverRef(overlayRef) {
2192
+ this.overlayRef = overlayRef;
2193
+ this.onClose$ = new rxjs.Subject();
2194
+ this.onClose = this.onClose$.asObservable();
2195
+ }
2196
+ DrPopoverRef.prototype.close = function (res) {
2197
+ this.overlayRef.detach();
2198
+ this.overlayRef.dispose();
2199
+ this.onClose$.next(res);
2200
+ this.onClose$.complete();
2201
+ };
2202
+ return DrPopoverRef;
2203
+ }());
2204
+
2182
2205
  var DrPopoverComponent = /** @class */ (function () {
2183
- function DrPopoverComponent(cdr, componentFactoryResolver, elementRef) {
2206
+ function DrPopoverComponent(cdr, componentFactoryResolver, viewContainerRef, elementRef, popoverRef) {
2184
2207
  this.cdr = cdr;
2185
2208
  this.componentFactoryResolver = componentFactoryResolver;
2209
+ this.viewContainerRef = viewContainerRef;
2186
2210
  this.elementRef = elementRef;
2211
+ this.popoverRef = popoverRef;
2187
2212
  this.class = '';
2188
2213
  this.isContentTemplate = false;
2189
2214
  }
@@ -2191,28 +2216,28 @@
2191
2216
  set: function (template) {
2192
2217
  this.isContentTemplate = this.content instanceof i0.TemplateRef;
2193
2218
  if (!this.isContentTemplate) {
2194
- this.componentRef = template.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
2195
- this.componentRef.instance['closePopover'] = this.closePopover;
2196
- for (var key in this.contentContext) {
2197
- this.componentRef.instance[key] = this.contentContext[key];
2198
- }
2219
+ this.componentRef = this.viewContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
2220
+ Object.assign(this.componentRef.instance, this.contentContext);
2221
+ template.nativeElement.appendChild(this.componentRef.location.nativeElement);
2199
2222
  }
2200
2223
  else {
2201
- this.contentContext.closePopover = this.closePopover;
2224
+ this.contentContext.closePopover = this.popoverRef.close.bind(this.popoverRef);
2202
2225
  }
2203
2226
  this.cdr.detectChanges();
2204
2227
  },
2205
2228
  enumerable: false,
2206
2229
  configurable: true
2207
2230
  });
2208
- ;
2209
- DrPopoverComponent.prototype.removeOutside = function (e) {
2210
- var isTargetHost = this.hostRef.nativeElement === e.target;
2231
+ DrPopoverComponent.prototype.clickOutside = function (e) {
2232
+ var isTargetHost = this.hostRef.nativeElement === e.target || this.hostRef.nativeElement.contains(e.target);
2211
2233
  var isTargetInPopover = this.elementRef.nativeElement.contains(e.target);
2212
2234
  var isTargetInDatepicker = e.target.closest('mat-datepicker-popup');
2213
2235
  var isTargetInSelect = e.target.closest('ng-dropdown-panel');
2214
- if (!isTargetHost && !isTargetInPopover && !isTargetInDatepicker && !isTargetInSelect) {
2215
- this.closePopover();
2236
+ if (!isTargetHost
2237
+ && !isTargetInPopover
2238
+ && !isTargetInDatepicker
2239
+ && !isTargetInSelect) {
2240
+ this.popoverRef.close();
2216
2241
  }
2217
2242
  };
2218
2243
  return DrPopoverComponent;
@@ -2224,56 +2249,62 @@
2224
2249
  animations: [
2225
2250
  animations.trigger('popover', POPUP_ANIMATION),
2226
2251
  ],
2227
- styles: [".dr-popover{display:flex;background:#fff;border:1px solid #E5E5E5;border-radius:5px;box-sizing:border-box;box-shadow:0 4px 14px #0003;font-size:12px;color:#545a6b;max-height:100vh;max-width:100vw}\n"]
2252
+ styles: [".dr-popover{display:flex;background:#fff;border:1px solid #E5E5E5;border-radius:5px;box-sizing:border-box;box-shadow:0 4px 14px #0003;font-size:12px;color:#545a6b;max-height:100vh;max-width:100vw;overflow:auto}\n"]
2228
2253
  },] }
2229
2254
  ];
2230
2255
  DrPopoverComponent.ctorParameters = function () { return [
2231
2256
  { type: i0.ChangeDetectorRef },
2232
2257
  { type: i0.ComponentFactoryResolver },
2233
- { type: i0.ElementRef }
2258
+ { type: i0.ViewContainerRef },
2259
+ { type: i0.ElementRef },
2260
+ { type: DrPopoverRef }
2234
2261
  ]; };
2235
2262
  DrPopoverComponent.propDecorators = {
2236
2263
  content: [{ type: i0.Input }],
2237
2264
  contentContext: [{ type: i0.Input }],
2238
2265
  class: [{ type: i0.Input }],
2239
2266
  hostRef: [{ type: i0.Input }],
2240
- closePopover: [{ type: i0.Input }],
2241
- popoverContainer: [{ type: i0.ViewChild, args: ['popoverContainer', { read: i0.ViewContainerRef },] }],
2242
- removeOutside: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
2267
+ popoverContainer: [{ type: i0.ViewChild, args: ['popoverContainer', { read: i0.ElementRef },] }],
2268
+ clickOutside: [{ type: i0.HostListener, args: ['document:mouseup', ['$event'],] }]
2243
2269
  };
2244
2270
 
2245
2271
  var DrPopoverDirective = /** @class */ (function () {
2246
- function DrPopoverDirective(overlay, vcRef, resolver, overlayPositionBuilder, elementRef) {
2272
+ function DrPopoverDirective(overlay, overlayPositionBuilder, elementRef, injector) {
2247
2273
  this.overlay = overlay;
2248
- this.vcRef = vcRef;
2249
- this.resolver = resolver;
2250
2274
  this.overlayPositionBuilder = overlayPositionBuilder;
2251
2275
  this.elementRef = elementRef;
2276
+ this.injector = injector;
2252
2277
  this.contentContext = {};
2253
2278
  this.position = 'bottom';
2254
2279
  this.class = '';
2280
+ this.overlayConfig = {};
2281
+ this.popoverClose = new i0.EventEmitter();
2282
+ this.showStateChange = new i0.EventEmitter();
2255
2283
  }
2256
2284
  DrPopoverDirective.prototype.show = function () {
2285
+ var _a;
2257
2286
  if (this.overlayRef) {
2258
2287
  this.destroyPopover();
2259
2288
  }
2260
2289
  else {
2261
2290
  this.renderPopover();
2291
+ this.showStateChange.emit({ isShown: (_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached() });
2262
2292
  }
2263
2293
  };
2264
2294
  DrPopoverDirective.prototype.renderPopover = function () {
2295
+ var _this = this;
2265
2296
  var _a;
2266
- var positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef)
2267
- .withPositions([POPUP_POSITIONS[this.position]]);
2268
- this.overlayRef = this.overlay.create({ positionStrategy: positionStrategy });
2269
- if (!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) && this.content) {
2270
- this.contentRef = this.overlayRef.attach(new portal.ComponentPortal(DrPopoverComponent));
2271
- this.contentRef.instance.content = this.content;
2272
- this.contentRef.instance.contentContext = this.contentContext;
2273
- this.contentRef.instance.class = this.class + ' ' + this.position;
2274
- this.contentRef.instance.hostRef = this.elementRef;
2275
- this.contentRef.instance.closePopover = this.destroyPopover.bind(this);
2276
- }
2297
+ if (((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) || !this.content)
2298
+ return;
2299
+ this.overlayRef = this.createOverlay(this.overlayConfig || {});
2300
+ this.drPopoverRef = new DrPopoverRef(this.overlayRef);
2301
+ this.drPopoverRef.onClose.pipe(operators.first()).subscribe(function (res) {
2302
+ var _a;
2303
+ _this.destroyPopover();
2304
+ _this.popoverClose.emit(res);
2305
+ _this.showStateChange.emit({ isShown: !!((_a = _this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) });
2306
+ });
2307
+ this.attachOverlayContainer();
2277
2308
  };
2278
2309
  DrPopoverDirective.prototype.destroyPopover = function () {
2279
2310
  if (this.overlayRef) {
@@ -2284,6 +2315,41 @@
2284
2315
  this.contentRef.destroy();
2285
2316
  this.contentRef = null;
2286
2317
  }
2318
+ if (this.drPopoverRef) {
2319
+ this.drPopoverRef.close();
2320
+ this.drPopoverRef = null;
2321
+ }
2322
+ };
2323
+ DrPopoverDirective.prototype.attachOverlayContainer = function () {
2324
+ var componentPortal = new portal.ComponentPortal(DrPopoverComponent, null, this.createInjector(this.drPopoverRef));
2325
+ this.contentRef = this.overlayRef.attach(componentPortal);
2326
+ this.drPopoverRef.componentRef = this.contentRef;
2327
+ this.contentRef.instance.content = this.content;
2328
+ this.contentRef.instance.contentContext = this.contentContext;
2329
+ this.contentRef.instance.class = this.class + ' ' + this.position;
2330
+ this.contentRef.instance.hostRef = this.elementRef;
2331
+ };
2332
+ DrPopoverDirective.prototype.createOverlay = function (config) {
2333
+ var overlayConfig = this.getOverlayConfig(config);
2334
+ return this.overlay.create(overlayConfig);
2335
+ };
2336
+ DrPopoverDirective.prototype.getOverlayConfig = function (config) {
2337
+ var positionStrategy = this.overlayPositionBuilder
2338
+ .flexibleConnectedTo(this.elementRef)
2339
+ .withPositions([POPUP_POSITIONS[this.position]]);
2340
+ var overlayConfig = new overlay.OverlayConfig({
2341
+ hasBackdrop: false,
2342
+ panelClass: config === null || config === void 0 ? void 0 : config.panelClass,
2343
+ scrollStrategy: this.overlay.scrollStrategies.noop(),
2344
+ positionStrategy: positionStrategy,
2345
+ });
2346
+ return overlayConfig;
2347
+ };
2348
+ DrPopoverDirective.prototype.createInjector = function (previewOverlayRef) {
2349
+ var injectionTokens = [
2350
+ { provide: DrPopoverRef, useValue: previewOverlayRef },
2351
+ ];
2352
+ return i0.Injector.create({ providers: injectionTokens, parent: this.injector });
2287
2353
  };
2288
2354
  DrPopoverDirective.prototype.ngOnDestroy = function () {
2289
2355
  this.destroyPopover();
@@ -2297,16 +2363,18 @@
2297
2363
  ];
2298
2364
  DrPopoverDirective.ctorParameters = function () { return [
2299
2365
  { type: overlay.Overlay },
2300
- { type: i0.ViewContainerRef },
2301
- { type: i0.ComponentFactoryResolver },
2302
2366
  { type: overlay.OverlayPositionBuilder },
2303
- { type: i0.ElementRef }
2367
+ { type: i0.ElementRef },
2368
+ { type: i0.Injector }
2304
2369
  ]; };
2305
2370
  DrPopoverDirective.propDecorators = {
2306
2371
  content: [{ type: i0.Input, args: ['drPopover',] }],
2307
2372
  contentContext: [{ type: i0.Input, args: ['drPopoverContext',] }],
2308
2373
  position: [{ type: i0.Input, args: ['drPopoverPosition',] }],
2309
2374
  class: [{ type: i0.Input, args: ['drPopoverClass',] }],
2375
+ overlayConfig: [{ type: i0.Input, args: ['drPopoverOverlayConfig',] }],
2376
+ popoverClose: [{ type: i0.Output, args: ['drPopoverClose',] }],
2377
+ showStateChange: [{ type: i0.Output, args: ['drPopoverShowStateChange',] }],
2310
2378
  show: [{ type: i0.HostListener, args: ['click',] }]
2311
2379
  };
2312
2380
 
@@ -2386,8 +2454,10 @@
2386
2454
  }
2387
2455
  };
2388
2456
  DrDropdownComponent.prototype.tooltipToShow = function (act) {
2389
- return act.toolTipIfDisabled && this.disabled(act) && act.toolTip
2390
- || act.toolTip && !act.toolTipIfDisabled ? act.toolTip : act.title;
2457
+ if (act.toolTipIfDisabled || this.disabled(act) || !act.toolTip) {
2458
+ return '';
2459
+ }
2460
+ return act.toolTip ? act.toolTip : act.title;
2391
2461
  };
2392
2462
  DrDropdownComponent.prototype.action = function (act) {
2393
2463
  if (!this.disabled(act)) {
@@ -2833,6 +2903,7 @@
2833
2903
  exports.DrPopoverComponent = DrPopoverComponent;
2834
2904
  exports.DrPopoverDirective = DrPopoverDirective;
2835
2905
  exports.DrPopoverModule = DrPopoverModule;
2906
+ exports.DrPopoverRef = DrPopoverRef;
2836
2907
  exports.DrSelectComponent = DrSelectComponent;
2837
2908
  exports.DrSpinnerComponent = DrSpinnerComponent;
2838
2909
  exports.DrSpinnerDirective = DrSpinnerDirective;