@resolveio/client-lib-core 1.0.1 → 1.0.3

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.
@@ -3800,196 +3800,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
3800
3800
  args: ['allElements', { static: false }]
3801
3801
  }] } });
3802
3802
 
3803
- // tslint:disable-next-line:component-class-suffix
3804
- class DialogSelectUserContent {
3805
- constructor(_activeModal) {
3806
- this._activeModal = _activeModal;
3807
- this.title = '';
3808
- this.users = [];
3809
- this.selectedIndexes = [];
3810
- }
3811
- ngOnInit() {
3812
- for (let i = 0; i < this.users.length; i++) {
3813
- if (this.users[i]['selected']) {
3814
- this.selectedIndexes.push(i);
3815
- }
3816
- }
3817
- }
3818
- ngAfterViewInit() {
3819
- setTimeout(() => {
3820
- let foundElement = this.recursiveFindFirstElement(this.allElements.nativeElement);
3821
- if (foundElement) {
3822
- foundElement.focus();
3823
- }
3824
- else {
3825
- this.close.nativeElement.focus();
3826
- this.close.nativeElement.blur();
3827
- }
3828
- }, 100);
3829
- }
3830
- recursiveFindFirstElement(element) {
3831
- let foundElement = null;
3832
- let htmlCol = element.children;
3833
- for (let i = 0; i < Object.keys(htmlCol).length; i++) {
3834
- let key = Object.keys(htmlCol)[i];
3835
- let htmlElem = htmlCol[key];
3836
- if (htmlElem.children && htmlElem.children.length) {
3837
- foundElement = this.recursiveFindFirstElement(htmlElem);
3838
- }
3839
- else if (htmlElem.tagName === 'BUTTON' && htmlElem.classList.contains('close')) {
3840
- return null;
3841
- }
3842
- else if ((htmlElem.tagName === 'BUTTON' || htmlElem.tagName === 'INPUT' || htmlElem.tagName === 'SELECT' || htmlElem.tagName === 'TEXTAREA') && !htmlElem.hidden && !htmlElem.disabled) {
3843
- return htmlElem;
3844
- }
3845
- if (foundElement) {
3846
- break;
3847
- }
3848
- }
3849
- return foundElement;
3850
- }
3851
- isInSelectedIndex(index) {
3852
- if (this.selectedIndexes.includes(index)) {
3853
- return true;
3854
- }
3855
- return false;
3856
- }
3857
- onSelectUser(index) {
3858
- if (!this.multiple) {
3859
- if (this.selectedIndexes.includes(index)) {
3860
- this.selectedIndexes = [];
3861
- }
3862
- else {
3863
- this.selectedIndexes = [index];
3864
- }
3865
- }
3866
- else {
3867
- if (this.selectedIndexes.includes(index)) {
3868
- this.selectedIndexes.splice(this.selectedIndexes.indexOf(index), 1);
3869
- }
3870
- else {
3871
- this.selectedIndexes.push(index);
3872
- }
3873
- }
3874
- }
3875
- getUserArray() {
3876
- let res = [];
3877
- this.selectedIndexes.forEach(index => {
3878
- res.push(this.users[index]);
3879
- });
3880
- return res;
3881
- }
3882
- getUserCustomers(user) {
3883
- return user.other.customers.map(a => a.customer);
3884
- }
3885
- }
3886
- DialogSelectUserContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DialogSelectUserContent, deps: [{ token: i1$4.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component });
3887
- DialogSelectUserContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: DialogSelectUserContent, selector: "ng-component", inputs: { title: "title", users: "users", multiple: "multiple" }, viewQueries: [{ propertyName: "close", first: true, predicate: ["close"], descendants: true }, { propertyName: "allElements", first: true, predicate: ["allElements"], descendants: true }], ngImport: i0, template: `
3888
- <style>
3889
- collapse-table tr:hover {
3890
- background-color: lightblue;
3891
- cursor: pointer;
3892
- }
3893
-
3894
- .selected {
3895
- background-color: lightblue;
3896
- }
3897
-
3898
- collapse-table {
3899
- width: 100%;
3900
- }
3901
- </style>
3902
- <div #allElements>
3903
- <div class="modal-header">
3904
- <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>
3905
- <button type="button" class="close" aria-label="Close" (click)="_activeModal.dismiss()" #close>
3906
- <span aria-hidden="true">&times;</span>
3907
- </button>
3908
- </div>
3909
- <div class="modal-body">
3910
- <div style="height: 70vh; overflow-y: auto">
3911
- <collapse-table collapseSize="900">
3912
- <thead>
3913
- <tr>
3914
- <th>Name</th>
3915
- </tr>
3916
- </thead>
3917
- <tbody>
3918
- <tr *ngFor="let user of users; let i = index" (click)="onSelectUser(i)" [ngClass]="{'selected' : isInSelectedIndex(i)}">
3919
- <td>{{user.fullname}}{{user.customers && user.customers.length ? ' (Customers: ' + getUserCustomers(user) + ')' : '' }}</td>
3920
- </tr>
3921
- </tbody>
3922
- </collapse-table>
3923
- </div>
3924
- </div>
3925
- <div class="modal-footer">
3926
- <button type="button" [ngClass]="['btn', selectedIndexes.length ? 'btn-success' : 'btn-danger']" [disabled]="!selectedIndexes.length" (click)="_activeModal.close(this.multiple ? getUserArray() : users[selectedIndexes[0]])">Submit</button>
3927
- <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>
3928
- </div>
3929
- </div>
3930
- `, isInline: true, styles: ["\n\t\t\tcollapse-table tr:hover {\n\t\t\t\tbackground-color: lightblue;\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\t.selected {\n\t\t\t\tbackground-color: lightblue;\n\t\t\t}\n\n\t\t\tcollapse-table {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t"], components: [{ type: CollapseTableComponent, selector: "collapse-table", inputs: ["collapseSize", "tableFixed", "headerFixed", "secondaryColor", "tertiaryColor"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
3931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DialogSelectUserContent, decorators: [{
3932
- type: Component,
3933
- args: [{
3934
- template: `
3935
- <style>
3936
- collapse-table tr:hover {
3937
- background-color: lightblue;
3938
- cursor: pointer;
3939
- }
3940
-
3941
- .selected {
3942
- background-color: lightblue;
3943
- }
3944
-
3945
- collapse-table {
3946
- width: 100%;
3947
- }
3948
- </style>
3949
- <div #allElements>
3950
- <div class="modal-header">
3951
- <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>
3952
- <button type="button" class="close" aria-label="Close" (click)="_activeModal.dismiss()" #close>
3953
- <span aria-hidden="true">&times;</span>
3954
- </button>
3955
- </div>
3956
- <div class="modal-body">
3957
- <div style="height: 70vh; overflow-y: auto">
3958
- <collapse-table collapseSize="900">
3959
- <thead>
3960
- <tr>
3961
- <th>Name</th>
3962
- </tr>
3963
- </thead>
3964
- <tbody>
3965
- <tr *ngFor="let user of users; let i = index" (click)="onSelectUser(i)" [ngClass]="{'selected' : isInSelectedIndex(i)}">
3966
- <td>{{user.fullname}}{{user.customers && user.customers.length ? ' (Customers: ' + getUserCustomers(user) + ')' : '' }}</td>
3967
- </tr>
3968
- </tbody>
3969
- </collapse-table>
3970
- </div>
3971
- </div>
3972
- <div class="modal-footer">
3973
- <button type="button" [ngClass]="['btn', selectedIndexes.length ? 'btn-success' : 'btn-danger']" [disabled]="!selectedIndexes.length" (click)="_activeModal.close(this.multiple ? getUserArray() : users[selectedIndexes[0]])">Submit</button>
3974
- <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>
3975
- </div>
3976
- </div>
3977
- `
3978
- }]
3979
- }], ctorParameters: function () { return [{ type: i1$4.NgbActiveModal }]; }, propDecorators: { title: [{
3980
- type: Input
3981
- }], users: [{
3982
- type: Input
3983
- }], multiple: [{
3984
- type: Input
3985
- }], close: [{
3986
- type: ViewChild,
3987
- args: ['close', { static: false }]
3988
- }], allElements: [{
3989
- type: ViewChild,
3990
- args: ['allElements', { static: false }]
3991
- }] } });
3992
-
3993
3803
  class DialogService {
3994
3804
  constructor(modalService) {
3995
3805
  this.modalService = modalService;
@@ -4042,13 +3852,6 @@ class DialogService {
4042
3852
  const modalRef = this.openDialog(DialogRegisterContent);
4043
3853
  return modalRef.result;
4044
3854
  }
4045
- selectUser(title, users, multiple = false) {
4046
- const modalRef = this.openDialog(DialogSelectUserContent);
4047
- modalRef.componentInstance.title = title;
4048
- modalRef.componentInstance.users = users;
4049
- modalRef.componentInstance.multiple = multiple;
4050
- return modalRef.result;
4051
- }
4052
3855
  selectWithButtonsURL(url) {
4053
3856
  const modalRef = this.openDialog(DialogSelectWithButtonsURLContent);
4054
3857
  modalRef.componentInstance.url = url;
@@ -7298,7 +7101,6 @@ CoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13
7298
7101
  DialogSelectDataLabelsContent,
7299
7102
  DialogLoginContent,
7300
7103
  DialogRegisterContent,
7301
- DialogSelectUserContent,
7302
7104
  DialogSelectWithButtonsURLContent,
7303
7105
  DialogSelectArrayObjsContent], imports: [SharedModule,
7304
7106
  HttpClientModule,
@@ -7377,7 +7179,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
7377
7179
  DialogSelectDataLabelsContent,
7378
7180
  DialogLoginContent,
7379
7181
  DialogRegisterContent,
7380
- DialogSelectUserContent,
7381
7182
  DialogSelectWithButtonsURLContent,
7382
7183
  DialogSelectArrayObjsContent
7383
7184
  ],