@cleavelandprice/ngx-lib 3.14.5 → 4.0.0
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/README.md +5 -5
- package/active-directory/{public_api.d.ts → active-directory.api.d.ts} +2 -4
- package/active-directory/active-directory.module.d.ts +2 -2
- package/active-directory/index.d.ts +1 -1
- package/active-directory/{gui → material}/components/user-chooser/user-chooser.component.d.ts +11 -31
- package/active-directory/{gui → material}/components/user-form-field/user-form-field.component.d.ts +5 -8
- package/active-directory/{gui → material}/index.d.ts +2 -2
- package/active-directory/{gui/public_api.d.ts → material/mat-active-directory.api.d.ts} +1 -1
- package/active-directory/material/mat-active-directory.module.d.ts +25 -0
- package/active-directory/model/active-directory-service-options.d.ts +7 -0
- package/active-directory/services/active-directory.service.d.ts +7 -7
- package/authentication/{public_api.d.ts → authentication.api.d.ts} +1 -1
- package/authentication/authentication.base.module.d.ts +5 -1
- package/authentication/index.d.ts +1 -1
- package/authentication/{token/gui → material}/components/login/login.component.d.ts +6 -4
- package/authentication/{token/gui → material}/components/login-form/login-form.component.d.ts +9 -10
- package/authentication/material/index.d.ts +5 -0
- package/authentication/material/mat-authentication.api.d.ts +6 -0
- package/authentication/material/mat-authentication.module.d.ts +21 -0
- package/authentication/material/model/mat-authentication-service-options.d.ts +6 -0
- package/authentication/material/services/mat-authentication.service.d.ts +11 -0
- package/authentication/model/abstract-authentication-service.d.ts +4 -4
- package/authentication/model/authentication-service-options.d.ts +8 -0
- package/authentication/object/authentication-object.api.d.ts +2 -0
- package/authentication/object/authentication-object.module.d.ts +11 -0
- package/authentication/object/index.d.ts +1 -1
- package/authentication/object/services/authentication-object.service.d.ts +23 -0
- package/authentication/token/authentication-token.api.d.ts +4 -0
- package/authentication/token/authetiction-token.module.d.ts +11 -0
- package/authentication/token/index.d.ts +1 -1
- package/authentication/token/model/authentication-token-service-options.d.ts +6 -0
- package/authentication/token/services/authentication-token.service.d.ts +23 -0
- package/dialog/components/base/base.component.d.ts +3 -3
- package/dialog/components/choice/choice.component.d.ts +5 -3
- package/dialog/components/confirmation/confirmation.component.d.ts +5 -3
- package/dialog/components/input/input.component.d.ts +5 -3
- package/dialog/components/message/message.component.d.ts +5 -3
- package/dialog/dialog.module.d.ts +13 -13
- package/dialog/index.d.ts +1 -1
- package/esm2022/active-directory/active-directory.api.mjs +12 -0
- package/esm2022/active-directory/active-directory.module.mjs +20 -10
- package/esm2022/active-directory/cleavelandprice-ngx-lib-active-directory.mjs +2 -2
- package/esm2022/active-directory/material/cleavelandprice-ngx-lib-active-directory-material.mjs +5 -0
- package/esm2022/active-directory/material/components/user-chooser/user-chooser.component.mjs +406 -0
- package/esm2022/active-directory/material/components/user-form-field/user-form-field.component.mjs +136 -0
- package/esm2022/active-directory/material/mat-active-directory.api.mjs +9 -0
- package/esm2022/active-directory/material/mat-active-directory.module.mjs +109 -0
- package/esm2022/active-directory/material/model/selectable-group.mjs +2 -0
- package/esm2022/active-directory/material/model/selectable-user.mjs +2 -0
- package/esm2022/active-directory/material/model/user-chooser-data.mjs +33 -0
- package/esm2022/active-directory/material/model/user-chooser-filter-options.mjs +10 -0
- package/esm2022/active-directory/{gui → material}/model/user-chooser-mode.mjs +1 -1
- package/esm2022/active-directory/material/model/user-chooser-pre-processing-group.mjs +9 -0
- package/esm2022/active-directory/model/active-directory-service-options.mjs +3 -0
- package/esm2022/active-directory/services/active-directory.service.mjs +61 -41
- package/esm2022/authentication/authentication.api.mjs +6 -0
- package/esm2022/authentication/authentication.base.module.mjs +28 -7
- package/esm2022/authentication/cleavelandprice-ngx-lib-authentication.mjs +2 -2
- package/esm2022/authentication/material/cleavelandprice-ngx-lib-authentication-material.mjs +5 -0
- package/esm2022/authentication/material/components/login/login.component.mjs +49 -0
- package/esm2022/authentication/material/components/login-form/login-form.component.mjs +82 -0
- package/esm2022/authentication/material/mat-authentication.api.mjs +7 -0
- package/esm2022/authentication/material/mat-authentication.module.mjs +84 -0
- package/esm2022/authentication/material/model/login-form-data.mjs +2 -0
- package/esm2022/authentication/material/model/mat-authentication-service-options.mjs +3 -0
- package/esm2022/authentication/material/services/mat-authentication.service.mjs +67 -0
- package/esm2022/authentication/model/abstract-authentication-service.mjs +1 -1
- package/esm2022/authentication/model/authentication-service-options.mjs +3 -0
- package/esm2022/authentication/object/authentication-object.api.mjs +4 -0
- package/esm2022/authentication/object/authentication-object.module.mjs +40 -0
- package/esm2022/authentication/object/cleavelandprice-ngx-lib-authentication-object.mjs +2 -2
- package/esm2022/authentication/object/services/authentication-object.service.mjs +119 -0
- package/esm2022/authentication/token/authentication-token.api.mjs +5 -0
- package/esm2022/authentication/token/authetiction-token.module.mjs +40 -0
- package/esm2022/authentication/token/cleavelandprice-ngx-lib-authentication-token.mjs +2 -2
- package/esm2022/authentication/token/model/authentication-token-service-options.mjs +3 -0
- package/esm2022/authentication/token/services/authentication-token.service.mjs +128 -0
- package/esm2022/dialog/cleavelandprice-ngx-lib-dialog.mjs +2 -2
- package/esm2022/dialog/components/base/base.component.mjs +27 -16
- package/esm2022/dialog/components/choice/choice.component.mjs +11 -11
- package/esm2022/dialog/components/confirmation/confirmation.component.mjs +11 -11
- package/esm2022/dialog/components/input/input.component.mjs +11 -11
- package/esm2022/dialog/components/message/message.component.mjs +11 -11
- package/esm2022/dialog/dialog.api.mjs +20 -0
- package/esm2022/dialog/dialog.module.mjs +25 -20
- package/esm2022/lib/model/caching-config.mjs +2 -0
- package/esm2022/lib/model/credentials.mjs +2 -0
- package/esm2022/lib/model/logging-config.mjs +2 -0
- package/esm2022/lib/model/service-options.mjs +3 -0
- package/esm2022/lib/ngx-lib.module.mjs +20 -10
- package/esm2022/lib/services/app-path-config.service.mjs +31 -24
- package/esm2022/lib/services/service-base.mjs +26 -0
- package/esm2022/msgraph/cleavelandprice-ngx-lib-msgraph.mjs +2 -2
- package/esm2022/msgraph/msgraph.api.mjs +19 -0
- package/esm2022/msgraph/msgraph.module.mjs +6 -11
- package/esm2022/public_api.mjs +6 -2
- package/esm2022/quill/cleavelandprice-ngx-lib-quill.mjs +2 -2
- package/esm2022/quill/components/editor/editor.component.mjs +29 -39
- package/esm2022/quill/components/raw/raw.component.mjs +18 -11
- package/esm2022/quill/mention/cleavelandprice-ngx-lib-quill-mention.mjs +2 -2
- package/esm2022/quill/mention/components/editor/editor.component.mjs +20 -14
- package/esm2022/quill/mention/quill-mention.api.mjs +8 -0
- package/esm2022/quill/mention/quill-mention.module.mjs +12 -12
- package/esm2022/quill/quill.api.mjs +9 -0
- package/esm2022/quill/quill.module.mjs +20 -18
- package/esm2022/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs +2 -2
- package/esm2022/sharepoint/components/user-photo/user-photo.component.mjs +13 -9
- package/esm2022/sharepoint/model/sharepoint-service-options.mjs +3 -0
- package/esm2022/sharepoint/pipes/user-photo-url.pipe.mjs +8 -9
- package/esm2022/sharepoint/services/sharepoint.service.mjs +74 -65
- package/esm2022/sharepoint/sharepoint.api.mjs +17 -0
- package/esm2022/sharepoint/sharepoint.module.mjs +25 -15
- package/esm2022/table/cleavelandprice-ngx-lib-table.mjs +2 -2
- package/esm2022/table/components/table/table.component.mjs +76 -74
- package/esm2022/table/table.api.mjs +4 -0
- package/esm2022/table/table.module.mjs +16 -15
- package/esm2022/upload/cleavelandprice-ngx-lib-upload.mjs +2 -2
- package/esm2022/upload/components/upload/upload.component.mjs +16 -20
- package/esm2022/upload/components/upload-dialog/upload-dialog.component.mjs +49 -39
- package/esm2022/upload/model/upload-service-options.mjs +4 -0
- package/esm2022/upload/model/upload-status.mjs +2 -0
- package/esm2022/upload/services/upload.service.mjs +44 -29
- package/esm2022/upload/upload.api.mjs +9 -0
- package/esm2022/upload/upload.module.mjs +33 -20
- package/esm2022/url-utilities/cleavelandprice-ngx-lib-url-utilities.mjs +2 -2
- package/esm2022/url-utilities/pipes/safe-resource-url.pipe.mjs +8 -9
- package/esm2022/url-utilities/pipes/safe-url.pipe.mjs +8 -9
- package/esm2022/url-utilities/pipes/uri-scheme.pipe.mjs +9 -8
- package/esm2022/url-utilities/url-utilities.api.mjs +13 -0
- package/esm2022/url-utilities/url-utilities.module.mjs +11 -11
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs +683 -0
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs.map +1 -0
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs +79 -72
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs +268 -0
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs.map +1 -0
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs +54 -49
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs +50 -51
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs +28 -18
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs +87 -66
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs +5 -10
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs +29 -26
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs +61 -67
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs +115 -118
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs +85 -90
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs +134 -117
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs +38 -33
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib.mjs +66 -45
- package/fesm2022/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/lib/model/caching-config.d.ts +4 -0
- package/lib/model/credentials.d.ts +4 -0
- package/lib/model/logging-config.d.ts +6 -0
- package/lib/model/service-options.d.ts +6 -0
- package/lib/ngx-lib.module.d.ts +2 -2
- package/lib/services/app-path-config.service.d.ts +5 -4
- package/lib/services/service-base.d.ts +7 -0
- package/msgraph/index.d.ts +1 -1
- package/msgraph/msgraph.module.d.ts +0 -2
- package/package.json +28 -28
- package/public_api.d.ts +5 -1
- package/quill/components/editor/editor.component.d.ts +10 -10
- package/quill/components/raw/raw.component.d.ts +1 -1
- package/quill/index.d.ts +1 -1
- package/quill/mention/components/editor/editor.component.d.ts +3 -3
- package/quill/mention/index.d.ts +1 -1
- package/quill/mention/quill-mention.module.d.ts +9 -9
- package/quill/quill.module.d.ts +12 -14
- package/sharepoint/components/user-photo/user-photo.component.d.ts +2 -2
- package/sharepoint/index.d.ts +1 -1
- package/sharepoint/model/sharepoint-service-options.d.ts +19 -0
- package/sharepoint/pipes/user-photo-url.pipe.d.ts +2 -2
- package/sharepoint/services/sharepoint.service.d.ts +7 -10
- package/sharepoint/{public_api.d.ts → sharepoint.api.d.ts} +1 -1
- package/sharepoint/sharepoint.module.d.ts +6 -6
- package/table/components/table/table.component.d.ts +21 -22
- package/table/index.d.ts +1 -1
- package/table/table.module.d.ts +13 -13
- package/upload/components/upload/upload.component.d.ts +4 -8
- package/upload/components/upload-dialog/upload-dialog.component.d.ts +11 -9
- package/upload/index.d.ts +1 -1
- package/upload/model/upload-service-options.d.ts +16 -0
- package/upload/model/upload-status.d.ts +6 -0
- package/upload/services/upload.service.d.ts +9 -6
- package/upload/{public_api.d.ts → upload.api.d.ts} +2 -2
- package/upload/upload.module.d.ts +10 -10
- package/url-utilities/index.d.ts +1 -1
- package/url-utilities/pipes/safe-resource-url.pipe.d.ts +2 -2
- package/url-utilities/pipes/safe-url.pipe.d.ts +2 -2
- package/url-utilities/pipes/uri-scheme.pipe.d.ts +2 -3
- package/url-utilities/url-utilities.api.d.ts +8 -0
- package/url-utilities/url-utilities.module.d.ts +5 -5
- package/active-directory/gui/gui.module.d.ts +0 -25
- package/active-directory/model/caching-config.d.ts +0 -4
- package/active-directory/model/logging-config.d.ts +0 -6
- package/active-directory/model/service-config.d.ts +0 -8
- package/authentication/model/service-config.d.ts +0 -8
- package/authentication/object/model/service-config.d.ts +0 -4
- package/authentication/object/object.module.d.ts +0 -11
- package/authentication/object/public_api.d.ts +0 -3
- package/authentication/object/services/authentication.service.d.ts +0 -23
- package/authentication/token/gui/index.d.ts +0 -5
- package/authentication/token/gui/model/service-config.d.ts +0 -5
- package/authentication/token/gui/public_api.d.ts +0 -6
- package/authentication/token/gui/services/authentication.service.d.ts +0 -12
- package/authentication/token/gui/token-gui.module.d.ts +0 -21
- package/authentication/token/model/service-config.d.ts +0 -5
- package/authentication/token/public_api.d.ts +0 -4
- package/authentication/token/services/authentication.service.d.ts +0 -23
- package/authentication/token/token.module.d.ts +0 -11
- package/esm2022/active-directory/gui/cleavelandprice-ngx-lib-active-directory-gui.mjs +0 -5
- package/esm2022/active-directory/gui/components/user-chooser/user-chooser.component.mjs +0 -393
- package/esm2022/active-directory/gui/components/user-form-field/user-form-field.component.mjs +0 -132
- package/esm2022/active-directory/gui/gui.module.mjs +0 -96
- package/esm2022/active-directory/gui/model/selectable-group.mjs +0 -2
- package/esm2022/active-directory/gui/model/selectable-user.mjs +0 -2
- package/esm2022/active-directory/gui/model/user-chooser-data.mjs +0 -33
- package/esm2022/active-directory/gui/model/user-chooser-filter-options.mjs +0 -10
- package/esm2022/active-directory/gui/model/user-chooser-pre-processing-group.mjs +0 -9
- package/esm2022/active-directory/gui/public_api.mjs +0 -9
- package/esm2022/active-directory/model/caching-config.mjs +0 -7
- package/esm2022/active-directory/model/logging-config.mjs +0 -9
- package/esm2022/active-directory/model/service-config.mjs +0 -12
- package/esm2022/active-directory/public_api.mjs +0 -12
- package/esm2022/authentication/model/service-config.mjs +0 -12
- package/esm2022/authentication/object/model/service-config.mjs +0 -9
- package/esm2022/authentication/object/object.module.mjs +0 -39
- package/esm2022/authentication/object/public_api.mjs +0 -4
- package/esm2022/authentication/object/services/authentication.service.mjs +0 -110
- package/esm2022/authentication/public_api.mjs +0 -6
- package/esm2022/authentication/token/gui/cleavelandprice-ngx-lib-authentication-token-gui.mjs +0 -5
- package/esm2022/authentication/token/gui/components/login/login.component.mjs +0 -43
- package/esm2022/authentication/token/gui/components/login-form/login-form.component.mjs +0 -72
- package/esm2022/authentication/token/gui/model/login-form-data.mjs +0 -2
- package/esm2022/authentication/token/gui/model/service-config.mjs +0 -10
- package/esm2022/authentication/token/gui/public_api.mjs +0 -7
- package/esm2022/authentication/token/gui/services/authentication.service.mjs +0 -78
- package/esm2022/authentication/token/gui/token-gui.module.mjs +0 -81
- package/esm2022/authentication/token/model/service-config.mjs +0 -10
- package/esm2022/authentication/token/public_api.mjs +0 -5
- package/esm2022/authentication/token/services/authentication.service.mjs +0 -124
- package/esm2022/authentication/token/token.module.mjs +0 -39
- package/esm2022/dialog/public_api.mjs +0 -10
- package/esm2022/lib/model/service-config.mjs +0 -21
- package/esm2022/msgraph/public_api.mjs +0 -19
- package/esm2022/quill/mention/public_api.mjs +0 -8
- package/esm2022/quill/public_api.mjs +0 -9
- package/esm2022/sharepoint/model/service-config.mjs +0 -27
- package/esm2022/sharepoint/public_api.mjs +0 -17
- package/esm2022/table/public_api.mjs +0 -4
- package/esm2022/upload/model/service-config.mjs +0 -16
- package/esm2022/upload/public_api.mjs +0 -9
- package/esm2022/url-utilities/public_api.mjs +0 -5
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs +0 -660
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs.map +0 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs +0 -271
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs.map +0 -1
- package/lib/model/service-config.d.ts +0 -6
- package/sharepoint/model/service-config.d.ts +0 -23
- package/upload/model/service-config.d.ts +0 -15
- package/url-utilities/public_api.d.ts +0 -4
- /package/active-directory/{gui → material}/model/selectable-group.d.ts +0 -0
- /package/active-directory/{gui → material}/model/selectable-user.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-data.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-filter-options.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-mode.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-pre-processing-group.d.ts +0 -0
- /package/authentication/{token/gui → material}/model/login-form-data.d.ts +0 -0
- /package/dialog/{public_api.d.ts → dialog.api.d.ts} +0 -0
- /package/msgraph/{public_api.d.ts → msgraph.api.d.ts} +0 -0
- /package/quill/mention/{public_api.d.ts → quill-mention.api.d.ts} +0 -0
- /package/quill/{public_api.d.ts → quill.api.d.ts} +0 -0
- /package/table/{public_api.d.ts → table.api.d.ts} +0 -0
|
@@ -1,660 +0,0 @@
|
|
|
1
|
-
import { ActiveDirectoryService, ServiceConfig } from '@cleavelandprice/ngx-lib/active-directory';
|
|
2
|
-
export * from '@cleavelandprice/ngx-lib/active-directory';
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, Component, ViewChild, EventEmitter, input, Output, NgModule, Optional, SkipSelf } from '@angular/core';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import * as i3 from '@angular/material/dialog';
|
|
8
|
-
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
9
|
-
import * as i7 from '@angular/material/list';
|
|
10
|
-
import { MatSelectionList, MatListModule } from '@angular/material/list';
|
|
11
|
-
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
12
|
-
import { of, forkJoin, debounceTime } from 'rxjs';
|
|
13
|
-
import { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';
|
|
14
|
-
import * as i2 from '@angular/material/button';
|
|
15
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
16
|
-
import * as i4 from '@angular/material/form-field';
|
|
17
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
18
|
-
import * as i5 from '@angular/material/icon';
|
|
19
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
-
import * as i6 from '@angular/material/input';
|
|
21
|
-
import { MatInputModule } from '@angular/material/input';
|
|
22
|
-
import * as i8 from '@angular/material/progress-spinner';
|
|
23
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
24
|
-
import * as i9 from '@angular/material/slide-toggle';
|
|
25
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
26
|
-
import * as i10 from '@angular/material/tooltip';
|
|
27
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
28
|
-
import * as i6$1 from '@angular/material/progress-bar';
|
|
29
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
30
|
-
import { CommonModule } from '@angular/common';
|
|
31
|
-
|
|
32
|
-
class UserChooserFilterOptions {
|
|
33
|
-
constructor() {
|
|
34
|
-
this.accountName = true;
|
|
35
|
-
this.department = true;
|
|
36
|
-
this.groupMembership = false;
|
|
37
|
-
this.phoneNumber = true;
|
|
38
|
-
this.title = true;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var UserChooserMode;
|
|
43
|
-
(function (UserChooserMode) {
|
|
44
|
-
UserChooserMode[UserChooserMode["Single"] = 0] = "Single";
|
|
45
|
-
UserChooserMode[UserChooserMode["Multiple"] = 1] = "Multiple";
|
|
46
|
-
})(UserChooserMode || (UserChooserMode = {}));
|
|
47
|
-
|
|
48
|
-
class UserChooserPreProcessingGroup {
|
|
49
|
-
constructor() {
|
|
50
|
-
this.accountNames = [];
|
|
51
|
-
this.departments = [];
|
|
52
|
-
this.groups = [];
|
|
53
|
-
this.titles = [];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
class UserChooserData {
|
|
58
|
-
constructor() {
|
|
59
|
-
// Should the dialog close automatically when the user chooses an item?
|
|
60
|
-
// Applies to single-user mode only
|
|
61
|
-
this.closeWhenSelectionMade = false;
|
|
62
|
-
// If the component is tasked with pulling Active Directory users (default setting),
|
|
63
|
-
// should that include disabled users?
|
|
64
|
-
this.includeDisabledUsers = false;
|
|
65
|
-
// If true, the component will return an array of Active Directory User objects.
|
|
66
|
-
// If false (default), the component will return an array of user account names.
|
|
67
|
-
this.returnUserObjects = false;
|
|
68
|
-
// Should the dialog include hover tooptips for each user that displays their group membership
|
|
69
|
-
// You probably don't want this, which is why the default is false
|
|
70
|
-
this.showGroupMembershipTooltips = false;
|
|
71
|
-
// Should the user phone number be displayed next to their name in the dialog
|
|
72
|
-
this.showPhone = true;
|
|
73
|
-
// Title displayed in the dialog
|
|
74
|
-
this.title = 'Select User(s)';
|
|
75
|
-
// Single or Multi mode
|
|
76
|
-
this.mode = UserChooserMode.Single;
|
|
77
|
-
// As the user types into the filter field, the list of users is filtered.
|
|
78
|
-
// The filterOptions determine which user properties are taken into consideration for that filter.
|
|
79
|
-
// Note, displayName is always included (hard-coded), and is therefore not a filter option.
|
|
80
|
-
this.filterOptions = new UserChooserFilterOptions();
|
|
81
|
-
this.exclusions = new UserChooserPreProcessingGroup();
|
|
82
|
-
this.inclusions = new UserChooserPreProcessingGroup();
|
|
83
|
-
this.preSelections = new UserChooserPreProcessingGroup();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
class UserChooserComponent {
|
|
88
|
-
constructor() {
|
|
89
|
-
//#region Services
|
|
90
|
-
this.dialogRef = inject((MatDialogRef));
|
|
91
|
-
this.activeDirectoryService = inject(ActiveDirectoryService);
|
|
92
|
-
this.sharePointService = inject(SharePointService);
|
|
93
|
-
this.data = inject(MAT_DIALOG_DATA);
|
|
94
|
-
this._data = { ...new UserChooserData(), ...this.data };
|
|
95
|
-
////filterInputFocused = false;
|
|
96
|
-
this.filterForm = new FormGroup({
|
|
97
|
-
filter: new FormControl()
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region Properties
|
|
102
|
-
get isMultiMode() {
|
|
103
|
-
return this._data.mode === UserChooserMode.Multiple;
|
|
104
|
-
}
|
|
105
|
-
get selectedOptions() {
|
|
106
|
-
return this.selectionList?.options.filter(o => o.selected) ?? [];
|
|
107
|
-
}
|
|
108
|
-
get selectedUsers() {
|
|
109
|
-
return this.dataSource?.data?.filter(d => d.selected) ?? [];
|
|
110
|
-
}
|
|
111
|
-
get filterValue() {
|
|
112
|
-
return this.filterForm.value.filter;
|
|
113
|
-
}
|
|
114
|
-
get adGroupsNeeded() {
|
|
115
|
-
// If any are these are true, then we need to pull AD groups for use later
|
|
116
|
-
return this._data.showGroupMembershipTooltips ||
|
|
117
|
-
this._data.exclusions.groups.length > 0 ||
|
|
118
|
-
this._data.inclusions.groups.length > 0 ||
|
|
119
|
-
this._data.preSelections.groups.length > 0 ||
|
|
120
|
-
this._data.filterOptions.groupMembership ||
|
|
121
|
-
(this._data.selectableGroupNames?.length ?? 0) > 0; // debug
|
|
122
|
-
}
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region Lifecycle
|
|
125
|
-
ngOnInit() {
|
|
126
|
-
this.getData();
|
|
127
|
-
this.listenForFilterChanges();
|
|
128
|
-
}
|
|
129
|
-
ngAfterViewChecked() {
|
|
130
|
-
if ( /*this.filterInputFocused || */!this.filterInput) {
|
|
131
|
-
// Control not ready yet, or it has already been given focus
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
////this.filterInputFocused = true;
|
|
135
|
-
this.filterInput?.nativeElement.focus();
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region Events
|
|
139
|
-
listSelectionChanged(options) {
|
|
140
|
-
if (this._data.mode === UserChooserMode.Single &&
|
|
141
|
-
this.selectedOptions.length &&
|
|
142
|
-
this._data.closeWhenSelectionMade) {
|
|
143
|
-
this.close();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
optionSelectionChanged(option) {
|
|
147
|
-
const user = this.dataSource?.data
|
|
148
|
-
.find(u => u.sAMAccountName.toLocaleLowerCase() === option.value.sAMAccountName.toLowerCase());
|
|
149
|
-
if (user) {
|
|
150
|
-
user.selected = option.selected;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
hideUnselectedChanged(selected) {
|
|
154
|
-
this.filterForm.get('filter')?.setValue(selected ? '{selected:true}' : null);
|
|
155
|
-
}
|
|
156
|
-
selectAll() {
|
|
157
|
-
this.selectionList?.selectAll();
|
|
158
|
-
if (this.selectionList?.options) {
|
|
159
|
-
this.listSelectionChanged(this.selectionList?.options.toArray());
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
deselectAll() {
|
|
163
|
-
this.selectionList?.deselectAll();
|
|
164
|
-
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region Utilities
|
|
167
|
-
isUser(userOrGroup) {
|
|
168
|
-
return 'title' in userOrGroup;
|
|
169
|
-
}
|
|
170
|
-
castUser(userOrGroup) {
|
|
171
|
-
return userOrGroup;
|
|
172
|
-
}
|
|
173
|
-
getData() {
|
|
174
|
-
const dataObservables = [
|
|
175
|
-
this._data.users ?
|
|
176
|
-
// Users were passed in
|
|
177
|
-
of(this._data.users) :
|
|
178
|
-
// Users need to be retrieved
|
|
179
|
-
this.activeDirectoryService.getUsers(false, this._data.includeDisabledUsers, this._data.parentOu),
|
|
180
|
-
this._data.photos ?
|
|
181
|
-
// Photos were passed in
|
|
182
|
-
of(this._data.photos) :
|
|
183
|
-
// Photos need to be retrieved
|
|
184
|
-
this.sharePointService.getPhotos()
|
|
185
|
-
];
|
|
186
|
-
// Do we need AD groups?
|
|
187
|
-
if (this.adGroupsNeeded) {
|
|
188
|
-
this._data.groups ?
|
|
189
|
-
// Groups were passed in
|
|
190
|
-
of(this._data.groups) :
|
|
191
|
-
// Groups need to be retrieved
|
|
192
|
-
dataObservables.push(this.activeDirectoryService.getGroups());
|
|
193
|
-
}
|
|
194
|
-
forkJoin(dataObservables)
|
|
195
|
-
//.subscribe(([users, photos]) => {
|
|
196
|
-
.subscribe(data => {
|
|
197
|
-
// Need groups in place before we handle exclusions/inclusions/pre-selections
|
|
198
|
-
this.groups = this.adGroupsNeeded ? data[2] : null;
|
|
199
|
-
let users = data[0];
|
|
200
|
-
users.forEach(u => u.selected = false); // In case existing data was re-used
|
|
201
|
-
users = this.includeUsersByAccountName(users);
|
|
202
|
-
users = this.includeUsersByGroupName(users);
|
|
203
|
-
users = this.includeUsersByDepartment(users);
|
|
204
|
-
users = this.includeUsersByTitle(users);
|
|
205
|
-
users = this.excludeUsersByAccountName(users);
|
|
206
|
-
users = this.excludeUsersByGroupName(users);
|
|
207
|
-
users = this.excludeUsersByDepartment(users);
|
|
208
|
-
users = this.excludeUsersByTitle(users);
|
|
209
|
-
users = this.preSelectUsersByAccountName(users);
|
|
210
|
-
users = this.preSelectUsersByGroupName(users);
|
|
211
|
-
users = this.preSelectUsersByDepartment(users);
|
|
212
|
-
users = this.preSelectUsersByTitle(users);
|
|
213
|
-
// debug
|
|
214
|
-
const usersAndGroups = [
|
|
215
|
-
...users
|
|
216
|
-
];
|
|
217
|
-
if (this._data.selectableGroupNames?.length) {
|
|
218
|
-
this._data.selectableGroupNames
|
|
219
|
-
.forEach(groupName => {
|
|
220
|
-
const group = this.groups.find(g => g.displayName === groupName);
|
|
221
|
-
if (group) {
|
|
222
|
-
usersAndGroups.push({
|
|
223
|
-
...group,
|
|
224
|
-
selected: false
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
this.dataSource = new MatTableDataSource(usersAndGroups);
|
|
230
|
-
this.photos = data[1];
|
|
231
|
-
this.setFilterPredicate();
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
close() {
|
|
235
|
-
if (!this.selectedUsers) {
|
|
236
|
-
this.dialogRef.close();
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const value = this.selectedUsers
|
|
240
|
-
.map(u => this._data.returnUserObjects ? u : u.sAMAccountName);
|
|
241
|
-
this.dialogRef.close(this._data.mode === UserChooserMode.Multiple ?
|
|
242
|
-
value :
|
|
243
|
-
value[0]);
|
|
244
|
-
}
|
|
245
|
-
getPhoto(user) {
|
|
246
|
-
if (!this.isUser(user)) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
return this.photos?.find(p => (p.employeeNumber && p.employeeNumber.toString() === user.employeeNumber) ||
|
|
250
|
-
p.accountName?.toLowerCase() === user.sAMAccountName.toLowerCase() ||
|
|
251
|
-
p.displayName?.toLowerCase() === user.displayName.toLowerCase() ||
|
|
252
|
-
p.title?.toLowerCase() === user.displayName.toLowerCase())?.encodedAbsUrl;
|
|
253
|
-
}
|
|
254
|
-
//#region Exclusions - won't be included in the dataSource at all
|
|
255
|
-
excludeUsersByAccountName(users) {
|
|
256
|
-
this._data.exclusions.accountNames
|
|
257
|
-
.forEach(accountName => {
|
|
258
|
-
const index = users.findIndex(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
259
|
-
if (index === -1) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
users.splice(index, 1);
|
|
263
|
-
});
|
|
264
|
-
return users;
|
|
265
|
-
}
|
|
266
|
-
excludeUsersByGroupName(users) {
|
|
267
|
-
this._data.exclusions.groups
|
|
268
|
-
.forEach(groupName => {
|
|
269
|
-
const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
|
|
270
|
-
if (!group) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
group.member.forEach(groupMemberDn => {
|
|
274
|
-
const index = users.findIndex(u => u.distinguishedName === groupMemberDn);
|
|
275
|
-
if (index === -1) {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
users.splice(index, 1);
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
return users;
|
|
282
|
-
}
|
|
283
|
-
excludeUsersByDepartment(users) {
|
|
284
|
-
this._data.exclusions.departments
|
|
285
|
-
.forEach(department => {
|
|
286
|
-
const excludedUsers = users.filter(u => u.department?.toLowerCase() === department.toLowerCase());
|
|
287
|
-
excludedUsers.forEach(user => {
|
|
288
|
-
const index = users.indexOf(user);
|
|
289
|
-
users.splice(index, 1);
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
return users;
|
|
293
|
-
}
|
|
294
|
-
excludeUsersByTitle(users) {
|
|
295
|
-
this._data.exclusions.titles
|
|
296
|
-
.forEach(title => {
|
|
297
|
-
const excludedUsers = users.filter(u => u.title?.toLowerCase() === title.toLowerCase());
|
|
298
|
-
excludedUsers.forEach(user => {
|
|
299
|
-
const index = users.indexOf(user);
|
|
300
|
-
users.splice(index, 1);
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
return users;
|
|
304
|
-
}
|
|
305
|
-
//#endregion
|
|
306
|
-
//#region Inclusions - only these will be included in the dataSource
|
|
307
|
-
includeUsersByAccountName(users) {
|
|
308
|
-
return users.filter(user => this._data.inclusions.accountNames.length === 0 || // No account inclusions specified
|
|
309
|
-
this._data.inclusions.accountNames.find(accountName => accountName.toLowerCase() === user.sAMAccountName.toLowerCase()));
|
|
310
|
-
}
|
|
311
|
-
includeUsersByDepartment(users) {
|
|
312
|
-
return users.filter(user => this._data.inclusions.departments.length === 0 || // No department inclusions specified
|
|
313
|
-
this._data.inclusions.departments.find(department => department.toLowerCase() === user.department?.toLowerCase()));
|
|
314
|
-
}
|
|
315
|
-
includeUsersByTitle(users) {
|
|
316
|
-
return users.filter(user => this._data.inclusions.titles.length === 0 || // No title inclusions specified
|
|
317
|
-
this._data.inclusions.titles.find(title => title.toLowerCase() === user.title?.toLowerCase()));
|
|
318
|
-
}
|
|
319
|
-
includeUsersByGroupName(users) {
|
|
320
|
-
if (!this._data.inclusions.groups.length) {
|
|
321
|
-
return users; // No group inclusions specified
|
|
322
|
-
}
|
|
323
|
-
// Cheating a bit and leveraging the 'selected' property to keep track of who should be included
|
|
324
|
-
// Since inclusions happen befor pre-selections, we can do that, as long as we set 'selected' back to false when we're done
|
|
325
|
-
this._data.inclusions.groups
|
|
326
|
-
.forEach(groupName => {
|
|
327
|
-
const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
|
|
328
|
-
if (!group) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
users
|
|
332
|
-
.filter(user => group.member.find(groupMemberDn => groupMemberDn === user.distinguishedName))
|
|
333
|
-
.forEach(user => user.selected = true);
|
|
334
|
-
});
|
|
335
|
-
// At this point, all of the appropriate users should have 'selected' set to true
|
|
336
|
-
const selectedUsers = users.filter(user => user.selected); // Subset of the original list
|
|
337
|
-
// Reset 'selected' to false, and return
|
|
338
|
-
selectedUsers.forEach(user => user.selected = false);
|
|
339
|
-
return selectedUsers;
|
|
340
|
-
}
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region Pre-Selections
|
|
343
|
-
preSelectUsersByAccountName(users) {
|
|
344
|
-
this._data.preSelections.accountNames
|
|
345
|
-
.forEach(accountName => {
|
|
346
|
-
const user = users.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
347
|
-
if (!user) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
user.selected = true;
|
|
351
|
-
});
|
|
352
|
-
return users;
|
|
353
|
-
}
|
|
354
|
-
preSelectUsersByDepartment(users) {
|
|
355
|
-
this._data.preSelections.departments
|
|
356
|
-
.forEach(department => users
|
|
357
|
-
.filter(u => u.department?.toLowerCase() === department.toLowerCase())
|
|
358
|
-
.forEach(user => user.selected = true));
|
|
359
|
-
return users;
|
|
360
|
-
}
|
|
361
|
-
preSelectUsersByTitle(users) {
|
|
362
|
-
this._data.preSelections.titles
|
|
363
|
-
.forEach(title => users
|
|
364
|
-
.filter(u => u.title?.toLowerCase() === title.toLowerCase())
|
|
365
|
-
.forEach(user => user.selected = true));
|
|
366
|
-
return users;
|
|
367
|
-
}
|
|
368
|
-
preSelectUsersByGroupName(users) {
|
|
369
|
-
this._data.preSelections.groups
|
|
370
|
-
.forEach(groupName => {
|
|
371
|
-
const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
|
|
372
|
-
if (!group) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
group.member.forEach(groupMemberDn => {
|
|
376
|
-
const user = users.find(u => u.distinguishedName === groupMemberDn);
|
|
377
|
-
if (!user) {
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
user.selected = true;
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
return users;
|
|
384
|
-
}
|
|
385
|
-
//#endregion
|
|
386
|
-
setFilterPredicate() {
|
|
387
|
-
if (!this.dataSource) {
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
this.dataSource.filterPredicate = (user, filter) => {
|
|
391
|
-
if (filter === '{selected:true}') {
|
|
392
|
-
return user.selected;
|
|
393
|
-
}
|
|
394
|
-
else {
|
|
395
|
-
const regex = new RegExp(filter, 'i'); // Case-insensitive
|
|
396
|
-
let match = false; // The end result - whether or not a employee matches the filter
|
|
397
|
-
const filterProperties = ['displayName'];
|
|
398
|
-
if (this._data.filterOptions.accountName) {
|
|
399
|
-
filterProperties.push('sAMAccountName');
|
|
400
|
-
}
|
|
401
|
-
if (this._data.filterOptions.title) {
|
|
402
|
-
filterProperties.push('title');
|
|
403
|
-
}
|
|
404
|
-
if (this._data.filterOptions.department) {
|
|
405
|
-
filterProperties.push('department');
|
|
406
|
-
}
|
|
407
|
-
if (this._data.filterOptions.phoneNumber) {
|
|
408
|
-
filterProperties.push('telephoneNumber');
|
|
409
|
-
}
|
|
410
|
-
// Match on the properties configured above
|
|
411
|
-
filterProperties
|
|
412
|
-
.forEach(field => {
|
|
413
|
-
// @ts-ignore
|
|
414
|
-
if (user[field] && user[field].match(regex)) {
|
|
415
|
-
match = true;
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
// Match on group membership (group name)
|
|
419
|
-
if (this._data.filterOptions.groupMembership) {
|
|
420
|
-
user.memberOf.forEach(groupDn => {
|
|
421
|
-
const group = this.groups?.find(group => group.distinguishedName === groupDn && group.name.match(regex));
|
|
422
|
-
if (group) {
|
|
423
|
-
match = true;
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
return match;
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
listenForFilterChanges() {
|
|
432
|
-
this.filterForm.get('filter')?.valueChanges
|
|
433
|
-
.pipe(debounceTime(250))
|
|
434
|
-
.subscribe(() => this.dataSource.filter = this.filterForm.value.filter?.trim().toLowerCase());
|
|
435
|
-
}
|
|
436
|
-
tooltip(user) {
|
|
437
|
-
return this._data.showGroupMembershipTooltips ?
|
|
438
|
-
user.memberOf
|
|
439
|
-
.map(groupDn => this.groups
|
|
440
|
-
?.find(group => group.distinguishedName === groupDn)?.name)
|
|
441
|
-
.sort((a, b) => a > b ? 1 : -1)
|
|
442
|
-
.join('\n') :
|
|
443
|
-
'';
|
|
444
|
-
}
|
|
445
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: UserChooserComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
446
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: UserChooserComponent, selector: "ng-component", viewQueries: [{ propertyName: "selectionList", first: true, predicate: MatSelectionList, descendants: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true }], ngImport: i0, template: "<div id=\"dialog-title\">\r\n <h2 mat-dialog-title>{{ _data.title }}</h2>\r\n\r\n <div id=\"num-selected\">\r\n {{ selectedOptions.length }} selected\r\n </div>\r\n</div>\r\n\r\n<mat-dialog-content>\r\n @if (dataSource && photos) {\r\n <form [formGroup]=\"filterForm\">\r\n @if (dataSource) {\r\n <mat-form-field>\r\n <input matInput placeholder=\"Search\" formControlName=\"filter\" #filterInput>\r\n @if (filterForm.value.filter) {\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"filterForm.get('filter')?.setValue('')\">\r\n <mat-icon fontIcon=\"close\"/>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }\r\n </form>\r\n <mat-selection-list [multiple]=\"isMultiMode\"\r\n (selectionChange)=\"listSelectionChanged($event.options)\">\r\n @for (user of dataSource?.filteredData; track user) {\r\n <mat-list-option [value]=\"user\" [selected]=\"user.selected\"\r\n (selectedChange)=\"optionSelectionChanged(option)\" #option>\r\n @if (getPhoto(user)) {\r\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(user)\">\r\n } @else {\r\n <mat-icon matListItemAvatar class=\"no-photo\"\r\n [fontIcon]=\"isUser(user) ? 'account_circle' : 'group'\"/>\r\n }\r\n <div class=\"user\">\r\n <div [matTooltip]=\"tooltip(user)\" class=\"user-name\">\r\n {{ user.displayName }}\r\n @if (isUser(user) && _data.showPhone && castUser(user).telephoneNumber) {\r\n <div>{{ castUser(user).telephoneNumber }}</div>\r\n }\r\n </div>\r\n @if (isUser(user)) {\r\n <div>{{ castUser(user).department }}</div>\r\n <div class=\"title\">{{ castUser(user).title }}</div>\r\n }\r\n </div>\r\n </mat-list-option>\r\n }\r\n </mat-selection-list>\r\n } @else {\r\n <div>\r\n <mat-spinner [diameter]=\"50\"/>\r\n <h2 id=\"spinner-message\">Getting users and photos...</h2>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dataSource && photos) {\r\n @if (selectedOptions.length) {\r\n <mat-slide-toggle (change)=\"hideUnselectedChanged($event.checked)\">\r\n Hide Unselected\r\n </mat-slide-toggle>\r\n }\r\n @if (isMultiMode) {\r\n <button mat-raised-button color=\"primary\" (click)=\"selectAll()\"\r\n >\r\n <mat-icon fontIcon=\"select_all\"/>\r\n <span class=\"hide-mobile\">Select All</span>\r\n </button>\r\n }\r\n @if (isMultiMode && selectedOptions.length) {\r\n <button mat-raised-button color=\"primary\" (click)=\"deselectAll()\"\r\n >\r\n <mat-icon fontIcon=\"clear_all\"/>\r\n <span class=\"hide-mobile\">Clear All</span>\r\n </button>\r\n }\r\n @if (isMultiMode || !_data.closeWhenSelectionMade) {\r\n <button mat-raised-button color=\"primary\" (click)=\"close()\" matTooltip=\"Accept your selection\"\r\n [disabled]=\"!selectedOptions.length\">\r\n <mat-icon fontIcon=\"check\"/>\r\n <span class=\"hide-mobile\">Ok</span>\r\n </button>\r\n }\r\n }\r\n\r\n <button mat-raised-button color=\"warn\" mat-dialog-close matTooltip=\"Close this window\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span class=\"hide-mobile\">Cancel</span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["::ng-deep .mat-tooltip{font-size:1em!important;white-space:pre-line}mat-dialog-content{min-width:50vw}#dialog-title{display:flex;justify-content:space-between}#num-selected{margin:1em 1em 0 0}mat-spinner{margin:0 auto}#spinner-message{text-align:center;padding:.5em}mat-form-field{width:100%}.title{font-style:italic;color:#757575}img,.no-photo{width:2rem;height:2rem;font-size:2.3rem!important;border-radius:100%}.hide-mobile{display:none}mat-dialog-actions{display:grid;grid-auto-flow:column;grid-gap:1em;justify-content:center}.user-name{display:flex;justify-content:space-between}.user-name>div:last-child{margin-right:10rem;font-weight:400;font-style:italic;color:#757575}@media (min-width:801px){.user{display:grid;grid-template-columns:1fr 1fr 1fr}.user>div:first-child{font-weight:700}.hide-mobile{display:initial}}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i7.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }, { kind: "directive", type: i7.MatListItemAvatar, selector: "[matListItemAvatar]" }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i9.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i10.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] }); }
|
|
447
|
-
}
|
|
448
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: UserChooserComponent, decorators: [{
|
|
449
|
-
type: Component,
|
|
450
|
-
args: [{ template: "<div id=\"dialog-title\">\r\n <h2 mat-dialog-title>{{ _data.title }}</h2>\r\n\r\n <div id=\"num-selected\">\r\n {{ selectedOptions.length }} selected\r\n </div>\r\n</div>\r\n\r\n<mat-dialog-content>\r\n @if (dataSource && photos) {\r\n <form [formGroup]=\"filterForm\">\r\n @if (dataSource) {\r\n <mat-form-field>\r\n <input matInput placeholder=\"Search\" formControlName=\"filter\" #filterInput>\r\n @if (filterForm.value.filter) {\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"filterForm.get('filter')?.setValue('')\">\r\n <mat-icon fontIcon=\"close\"/>\r\n </button>\r\n }\r\n </mat-form-field>\r\n }\r\n </form>\r\n <mat-selection-list [multiple]=\"isMultiMode\"\r\n (selectionChange)=\"listSelectionChanged($event.options)\">\r\n @for (user of dataSource?.filteredData; track user) {\r\n <mat-list-option [value]=\"user\" [selected]=\"user.selected\"\r\n (selectedChange)=\"optionSelectionChanged(option)\" #option>\r\n @if (getPhoto(user)) {\r\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(user)\">\r\n } @else {\r\n <mat-icon matListItemAvatar class=\"no-photo\"\r\n [fontIcon]=\"isUser(user) ? 'account_circle' : 'group'\"/>\r\n }\r\n <div class=\"user\">\r\n <div [matTooltip]=\"tooltip(user)\" class=\"user-name\">\r\n {{ user.displayName }}\r\n @if (isUser(user) && _data.showPhone && castUser(user).telephoneNumber) {\r\n <div>{{ castUser(user).telephoneNumber }}</div>\r\n }\r\n </div>\r\n @if (isUser(user)) {\r\n <div>{{ castUser(user).department }}</div>\r\n <div class=\"title\">{{ castUser(user).title }}</div>\r\n }\r\n </div>\r\n </mat-list-option>\r\n }\r\n </mat-selection-list>\r\n } @else {\r\n <div>\r\n <mat-spinner [diameter]=\"50\"/>\r\n <h2 id=\"spinner-message\">Getting users and photos...</h2>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dataSource && photos) {\r\n @if (selectedOptions.length) {\r\n <mat-slide-toggle (change)=\"hideUnselectedChanged($event.checked)\">\r\n Hide Unselected\r\n </mat-slide-toggle>\r\n }\r\n @if (isMultiMode) {\r\n <button mat-raised-button color=\"primary\" (click)=\"selectAll()\"\r\n >\r\n <mat-icon fontIcon=\"select_all\"/>\r\n <span class=\"hide-mobile\">Select All</span>\r\n </button>\r\n }\r\n @if (isMultiMode && selectedOptions.length) {\r\n <button mat-raised-button color=\"primary\" (click)=\"deselectAll()\"\r\n >\r\n <mat-icon fontIcon=\"clear_all\"/>\r\n <span class=\"hide-mobile\">Clear All</span>\r\n </button>\r\n }\r\n @if (isMultiMode || !_data.closeWhenSelectionMade) {\r\n <button mat-raised-button color=\"primary\" (click)=\"close()\" matTooltip=\"Accept your selection\"\r\n [disabled]=\"!selectedOptions.length\">\r\n <mat-icon fontIcon=\"check\"/>\r\n <span class=\"hide-mobile\">Ok</span>\r\n </button>\r\n }\r\n }\r\n\r\n <button mat-raised-button color=\"warn\" mat-dialog-close matTooltip=\"Close this window\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span class=\"hide-mobile\">Cancel</span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["::ng-deep .mat-tooltip{font-size:1em!important;white-space:pre-line}mat-dialog-content{min-width:50vw}#dialog-title{display:flex;justify-content:space-between}#num-selected{margin:1em 1em 0 0}mat-spinner{margin:0 auto}#spinner-message{text-align:center;padding:.5em}mat-form-field{width:100%}.title{font-style:italic;color:#757575}img,.no-photo{width:2rem;height:2rem;font-size:2.3rem!important;border-radius:100%}.hide-mobile{display:none}mat-dialog-actions{display:grid;grid-auto-flow:column;grid-gap:1em;justify-content:center}.user-name{display:flex;justify-content:space-between}.user-name>div:last-child{margin-right:10rem;font-weight:400;font-style:italic;color:#757575}@media (min-width:801px){.user{display:grid;grid-template-columns:1fr 1fr 1fr}.user>div:first-child{font-weight:700}.hide-mobile{display:initial}}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
|
|
451
|
-
}], propDecorators: { selectionList: [{
|
|
452
|
-
type: ViewChild,
|
|
453
|
-
args: [MatSelectionList]
|
|
454
|
-
}], filterInput: [{
|
|
455
|
-
type: ViewChild,
|
|
456
|
-
args: ['filterInput']
|
|
457
|
-
}] } });
|
|
458
|
-
|
|
459
|
-
class UserFormFieldComponent {
|
|
460
|
-
constructor() {
|
|
461
|
-
//#region Fields
|
|
462
|
-
//#region Services
|
|
463
|
-
this.dialog = inject(MatDialog);
|
|
464
|
-
this.activeDirectoryService = inject(ActiveDirectoryService);
|
|
465
|
-
this.sharePointService = inject(SharePointService);
|
|
466
|
-
//#endregion
|
|
467
|
-
this.usersSelected = new EventEmitter(); // string for Single mode, string[] for multi
|
|
468
|
-
this.userUnSelected = new EventEmitter();
|
|
469
|
-
this.placeholder = input('Select User(s)');
|
|
470
|
-
this.clickable = input(true);
|
|
471
|
-
this.userChooserData = input.required();
|
|
472
|
-
this.accountNames = [];
|
|
473
|
-
}
|
|
474
|
-
//#endregion
|
|
475
|
-
//#region Properties
|
|
476
|
-
/*get isEdge(): boolean {
|
|
477
|
-
return window.navigator.userAgent.indexOf('Edge') > -1;
|
|
478
|
-
}*/
|
|
479
|
-
//#endregion
|
|
480
|
-
//#region Lifecycle
|
|
481
|
-
ngOnInit() {
|
|
482
|
-
this._userChooserData = {
|
|
483
|
-
...new UserChooserData(),
|
|
484
|
-
...this.userChooserData()
|
|
485
|
-
};
|
|
486
|
-
// If users have been pre-selected in the config, store those in accountNames, which drives the UI of this component
|
|
487
|
-
this.accountNames = this._userChooserData.preSelections.accountNames;
|
|
488
|
-
this.getData();
|
|
489
|
-
}
|
|
490
|
-
//#endregion
|
|
491
|
-
//#region Events
|
|
492
|
-
selectUser() {
|
|
493
|
-
if (!this.clickable()) {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
const data = {
|
|
497
|
-
...this._userChooserData,
|
|
498
|
-
users: this.users,
|
|
499
|
-
photos: this.photos,
|
|
500
|
-
};
|
|
501
|
-
this.dialog.open(UserChooserComponent, {
|
|
502
|
-
data: data
|
|
503
|
-
})
|
|
504
|
-
.afterClosed()
|
|
505
|
-
.subscribe((selected) => {
|
|
506
|
-
if (!selected) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
this.accountNames = Array.isArray(selected) ?
|
|
510
|
-
selected :
|
|
511
|
-
[selected];
|
|
512
|
-
// Overwrite what may have been passed in, for subsequent launches of UserChooserComponent - otherwise it just keeps getting fed stale data
|
|
513
|
-
this._userChooserData.preSelections.accountNames = this.accountNames;
|
|
514
|
-
this.usersSelected.emit(selected);
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
unSelectUser(accountName) {
|
|
518
|
-
const index = this.accountNames.findIndex(a => a === accountName);
|
|
519
|
-
this.accountNames.splice(index, 1);
|
|
520
|
-
this._userChooserData.preSelections.accountNames = this.accountNames;
|
|
521
|
-
this.userUnSelected.emit(accountName);
|
|
522
|
-
}
|
|
523
|
-
//#endregion
|
|
524
|
-
//#region Utilities
|
|
525
|
-
getData() {
|
|
526
|
-
forkJoin([
|
|
527
|
-
this._userChooserData.users ?
|
|
528
|
-
// Users were passed in
|
|
529
|
-
of(this._userChooserData.users) :
|
|
530
|
-
// Users need to be retrieved
|
|
531
|
-
this.activeDirectoryService.getUsers(false, this._userChooserData.includeDisabledUsers, this._userChooserData.parentOu),
|
|
532
|
-
this._userChooserData.groups ?
|
|
533
|
-
// Groups were passed in
|
|
534
|
-
of(this._userChooserData.groups) :
|
|
535
|
-
// Groups need to be retrieved
|
|
536
|
-
this.activeDirectoryService.getGroups(this._userChooserData.parentOu),
|
|
537
|
-
this._userChooserData.photos ?
|
|
538
|
-
// Photos were passed in
|
|
539
|
-
of(this._userChooserData.photos) :
|
|
540
|
-
// Photos need to be retrieved
|
|
541
|
-
this.sharePointService.getPhotos()
|
|
542
|
-
])
|
|
543
|
-
.subscribe(([users, groups, photos]) => {
|
|
544
|
-
this.users = users;
|
|
545
|
-
this.groups = groups;
|
|
546
|
-
this.photos = photos;
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
getUser(accountName) {
|
|
550
|
-
return this.users?.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
551
|
-
}
|
|
552
|
-
getGroup(accountName) {
|
|
553
|
-
return this.groups?.find(g => g.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
554
|
-
}
|
|
555
|
-
getPhoto(accountName) {
|
|
556
|
-
const user = this.getUser(accountName);
|
|
557
|
-
if (!user) {
|
|
558
|
-
return undefined;
|
|
559
|
-
}
|
|
560
|
-
return this.photos?.find(p => (p.employeeNumber && p.employeeNumber.toString() === user.employeeNumber) ||
|
|
561
|
-
p.accountName?.toLowerCase() === user.sAMAccountName.toLowerCase() ||
|
|
562
|
-
p.displayName?.toLowerCase() === user.displayName.toLowerCase() ||
|
|
563
|
-
p.title?.toLowerCase() === user.displayName.toLowerCase())?.encodedAbsUrl;
|
|
564
|
-
}
|
|
565
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: UserFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
566
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: UserFormFieldComponent, selector: "cp-user-field", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, userChooserData: { classPropertyName: "userChooserData", publicName: "userChooserData", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { usersSelected: "usersSelected", userUnSelected: "userUnSelected" }, ngImport: i0, template: "\r\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\r\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\r\nIt's definitely a better experience if the field IS disabled.\r\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\r\n-->\r\n<!-- Update 8/24/2023:\r\nThe above problem also exists in Chrome now.\r\nSo instead of dynamically setting [disabled] based on browser type,\r\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\r\n-->\r\n\r\n@if (users && photos) {\r\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\r\n @if (accountNames.length) {\r\n <div\r\n [class.grid]=\"accountNames.length > 1\"\r\n [class.three]=\"accountNames.length > 2\"\r\n [class.four]=\"accountNames.length > 3\"\r\n [class.five]=\"accountNames.length > 4\">\r\n @for (accountName of accountNames; track accountName; let i = $index) {\r\n <div class=\"user\">\r\n <!--<img *ngIf=\"accountName && empUtils.getEmployee(accountName)\" alt=\"\" [src]=\"empUtils.getEmployee(accountName) | employeePhotoUrl:cacheService.photos\">-->\r\n @if (getPhoto(accountName)) {\r\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(accountName)\">\r\n }\r\n @if (getGroup(accountName)) {\r\n <mat-icon>group</mat-icon>\r\n }\r\n <mat-form-field>\r\n <!-- [disabled]=\"!isEdge\" -->\r\n <input matInput disabled [placeholder]=\"i === 0 ? placeholder() : ''\"\r\n [value]=\"getUser(accountName) ? getUser(accountName)?.displayName : getGroup(accountName) ? getGroup(accountName)?.displayName : accountName\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"$event.stopPropagation(); unSelectUser(accountName)\">\r\n <mat-icon fontIcon=\"close\"/>\r\n </button>\r\n </mat-form-field>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mat-form-field>\r\n <input matInput disabled [placeholder]=\"placeholder()\"> <!-- [disabled]=\"!isEdge\" -->\r\n </mat-form-field>\r\n }\r\n </div>\r\n} @else {\r\n <mat-progress-bar mode=\"indeterminate\"/>\r\n}", styles: [".user{display:grid;grid-template-columns:auto 1fr;grid-gap:.5em;align-items:center}.clickable,.clickable input{cursor:pointer!important}img{width:2em;height:2em;border-radius:100%}@media (min-width:801px){.grid{display:grid;grid-template-columns:repeat(2,1fr);grid-gap:1em}.three{grid-template-columns:repeat(3,1fr)}.four{grid-template-columns:repeat(4,1fr)}.five{grid-template-columns:repeat(5,1fr)}::ng-deep .grid mat-form-field{width:15vw}}input[disabled]{pointer-events:none}\n"], dependencies: [{ kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i7.MatListItemAvatar, selector: "[matListItemAvatar]" }, { kind: "component", type: i6$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] }); }
|
|
567
|
-
}
|
|
568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: UserFormFieldComponent, decorators: [{
|
|
569
|
-
type: Component,
|
|
570
|
-
args: [{ selector: 'cp-user-field', template: "\r\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\r\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\r\nIt's definitely a better experience if the field IS disabled.\r\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\r\n-->\r\n<!-- Update 8/24/2023:\r\nThe above problem also exists in Chrome now.\r\nSo instead of dynamically setting [disabled] based on browser type,\r\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\r\n-->\r\n\r\n@if (users && photos) {\r\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\r\n @if (accountNames.length) {\r\n <div\r\n [class.grid]=\"accountNames.length > 1\"\r\n [class.three]=\"accountNames.length > 2\"\r\n [class.four]=\"accountNames.length > 3\"\r\n [class.five]=\"accountNames.length > 4\">\r\n @for (accountName of accountNames; track accountName; let i = $index) {\r\n <div class=\"user\">\r\n <!--<img *ngIf=\"accountName && empUtils.getEmployee(accountName)\" alt=\"\" [src]=\"empUtils.getEmployee(accountName) | employeePhotoUrl:cacheService.photos\">-->\r\n @if (getPhoto(accountName)) {\r\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(accountName)\">\r\n }\r\n @if (getGroup(accountName)) {\r\n <mat-icon>group</mat-icon>\r\n }\r\n <mat-form-field>\r\n <!-- [disabled]=\"!isEdge\" -->\r\n <input matInput disabled [placeholder]=\"i === 0 ? placeholder() : ''\"\r\n [value]=\"getUser(accountName) ? getUser(accountName)?.displayName : getGroup(accountName) ? getGroup(accountName)?.displayName : accountName\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"$event.stopPropagation(); unSelectUser(accountName)\">\r\n <mat-icon fontIcon=\"close\"/>\r\n </button>\r\n </mat-form-field>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mat-form-field>\r\n <input matInput disabled [placeholder]=\"placeholder()\"> <!-- [disabled]=\"!isEdge\" -->\r\n </mat-form-field>\r\n }\r\n </div>\r\n} @else {\r\n <mat-progress-bar mode=\"indeterminate\"/>\r\n}", styles: [".user{display:grid;grid-template-columns:auto 1fr;grid-gap:.5em;align-items:center}.clickable,.clickable input{cursor:pointer!important}img{width:2em;height:2em;border-radius:100%}@media (min-width:801px){.grid{display:grid;grid-template-columns:repeat(2,1fr);grid-gap:1em}.three{grid-template-columns:repeat(3,1fr)}.four{grid-template-columns:repeat(4,1fr)}.five{grid-template-columns:repeat(5,1fr)}::ng-deep .grid mat-form-field{width:15vw}}input[disabled]{pointer-events:none}\n"] }]
|
|
571
|
-
}], propDecorators: { usersSelected: [{
|
|
572
|
-
type: Output
|
|
573
|
-
}], userUnSelected: [{
|
|
574
|
-
type: Output
|
|
575
|
-
}] } });
|
|
576
|
-
|
|
577
|
-
class GuiModule {
|
|
578
|
-
static forRoot(config) {
|
|
579
|
-
return {
|
|
580
|
-
ngModule: GuiModule,
|
|
581
|
-
providers: [
|
|
582
|
-
ActiveDirectoryService,
|
|
583
|
-
{ provide: ServiceConfig, useValue: config }
|
|
584
|
-
]
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
constructor(parentModule) {
|
|
588
|
-
if (parentModule) {
|
|
589
|
-
throw new Error('ActiveDirectoryGuiModule is already loaded. Import it in the AppModule only');
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: GuiModule, deps: [{ token: GuiModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
593
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.0", ngImport: i0, type: GuiModule, declarations: [UserChooserComponent,
|
|
594
|
-
UserFormFieldComponent], imports: [CommonModule,
|
|
595
|
-
ReactiveFormsModule,
|
|
596
|
-
MatButtonModule,
|
|
597
|
-
MatDialogModule,
|
|
598
|
-
MatFormFieldModule,
|
|
599
|
-
MatIconModule,
|
|
600
|
-
MatInputModule,
|
|
601
|
-
MatListModule,
|
|
602
|
-
MatProgressBarModule,
|
|
603
|
-
MatProgressSpinnerModule,
|
|
604
|
-
MatSlideToggleModule,
|
|
605
|
-
MatTableModule,
|
|
606
|
-
MatTooltipModule], exports: [UserChooserComponent,
|
|
607
|
-
UserFormFieldComponent] }); }
|
|
608
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: GuiModule, imports: [CommonModule,
|
|
609
|
-
ReactiveFormsModule,
|
|
610
|
-
MatButtonModule,
|
|
611
|
-
MatDialogModule,
|
|
612
|
-
MatFormFieldModule,
|
|
613
|
-
MatIconModule,
|
|
614
|
-
MatInputModule,
|
|
615
|
-
MatListModule,
|
|
616
|
-
MatProgressBarModule,
|
|
617
|
-
MatProgressSpinnerModule,
|
|
618
|
-
MatSlideToggleModule,
|
|
619
|
-
MatTableModule,
|
|
620
|
-
MatTooltipModule] }); }
|
|
621
|
-
}
|
|
622
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: GuiModule, decorators: [{
|
|
623
|
-
type: NgModule,
|
|
624
|
-
args: [{
|
|
625
|
-
declarations: [
|
|
626
|
-
UserChooserComponent,
|
|
627
|
-
UserFormFieldComponent
|
|
628
|
-
],
|
|
629
|
-
imports: [
|
|
630
|
-
CommonModule,
|
|
631
|
-
ReactiveFormsModule,
|
|
632
|
-
MatButtonModule,
|
|
633
|
-
MatDialogModule,
|
|
634
|
-
MatFormFieldModule,
|
|
635
|
-
MatIconModule,
|
|
636
|
-
MatInputModule,
|
|
637
|
-
MatListModule,
|
|
638
|
-
MatProgressBarModule,
|
|
639
|
-
MatProgressSpinnerModule,
|
|
640
|
-
MatSlideToggleModule,
|
|
641
|
-
MatTableModule,
|
|
642
|
-
MatTooltipModule
|
|
643
|
-
],
|
|
644
|
-
exports: [
|
|
645
|
-
UserChooserComponent,
|
|
646
|
-
UserFormFieldComponent
|
|
647
|
-
]
|
|
648
|
-
}]
|
|
649
|
-
}], ctorParameters: () => [{ type: GuiModule, decorators: [{
|
|
650
|
-
type: Optional
|
|
651
|
-
}, {
|
|
652
|
-
type: SkipSelf
|
|
653
|
-
}] }] });
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Generated bundle index. Do not edit.
|
|
657
|
-
*/
|
|
658
|
-
|
|
659
|
-
export { GuiModule, UserChooserComponent, UserChooserData, UserChooserFilterOptions, UserChooserMode, UserChooserPreProcessingGroup, UserFormFieldComponent };
|
|
660
|
-
//# sourceMappingURL=cleavelandprice-ngx-lib-active-directory-gui.mjs.map
|