@sassoftware/vi-api 1.42.0 → 1.46.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.
Files changed (48) hide show
  1. package/alert-reps/index.d.ts +18 -5
  2. package/alert-reps/package.json +1 -1
  3. package/component/bindings.d.ts +109 -2
  4. package/component/bindings.js +7 -1
  5. package/component/index.d.ts +2 -2
  6. package/config/config-api.d.ts +21 -16
  7. package/config/config-api.js +10 -0
  8. package/config/control-attribute-types.d.ts +168 -0
  9. package/config/control-attribute-types.js +1 -0
  10. package/config/index.d.ts +3 -0
  11. package/config/index.js +3 -0
  12. package/config/standardPropertyTypes.d.ts +50 -0
  13. package/config/standardPropertyTypes.js +52 -0
  14. package/config/status.d.ts +7 -0
  15. package/config/status.js +8 -0
  16. package/control/control-api.d.ts +41 -6
  17. package/control/events.d.ts +1 -1
  18. package/control/masking-api.d.ts +187 -0
  19. package/control/masking-api.js +3 -0
  20. package/control/page.d.ts +1 -1
  21. package/control/page.js +8 -1
  22. package/control/restrictions.d.ts +7 -1
  23. package/current-user/currentUser-api.d.ts +10 -1
  24. package/current-user/currentUser-api.js +2 -0
  25. package/elements/bindings.d.ts +25 -0
  26. package/elements/identity-select.d.ts +274 -0
  27. package/elements/identity-select.js +24 -0
  28. package/elements/index.d.ts +24 -5
  29. package/elements/index.js +23 -4
  30. package/elements/labelled-control.d.ts +47 -0
  31. package/elements/labelled-control.js +1 -0
  32. package/elements/mask-toggle-button.d.ts +37 -0
  33. package/elements/mask-toggle-button.js +1 -0
  34. package/event/event-api.d.ts +3 -2
  35. package/event/event-api.js +3 -2
  36. package/object/object-api.d.ts +6 -4
  37. package/package.json +1 -1
  38. package/page-model/page-model-api.d.ts +1 -1
  39. package/page-model/page-model-api.js +10 -0
  40. package/property/property-api.d.ts +2 -15
  41. package/score-reps/index.d.ts +11 -2
  42. package/score-reps/package.json +1 -1
  43. package/svi-datahub/index.d.ts +248 -216
  44. package/svi-datahub/package.json +1 -1
  45. package/svi-sand/index.d.ts +44 -8
  46. package/svi-sand/package.json +1 -1
  47. package/elements/properties.d.ts +0 -89
  48. /package/elements/{properties.js → bindings.js} +0 -0
@@ -5,6 +5,8 @@ import { PageDataChange, PageModeChange, StateChange } from "./events";
5
5
  import { Control, RefreshablePageControlOptions, SlidingPanelContent, SlidingPanelProperties, TypeAttributes } from "./page";
6
6
  import { FieldTypeToRestrictions, FileRestrictions } from "./restrictions";
7
7
  import { AttachmentFormData } from "./file";
8
+ import { MaskingControlApi, MaskingPageApi } from "./masking-api";
9
+ import { IControlClientStates } from "../../spb/page-viewer/control-member/api/control-state-api";
8
10
  /**
9
11
  * The minimum API that should be supported on control members across solutions.
10
12
  */
@@ -47,9 +49,14 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
47
49
  readonly state: ControlStateApi;
48
50
  /** Control type. */
49
51
  readonly type: string;
50
- /** Control Mask */
52
+ /**
53
+ * Control Mask
54
+ * @deprecated use `api.control.masking.isConfiguredForMasking` instead.
55
+ **/
51
56
  isMaskedControl(): boolean;
52
- /** Control Mask Authorization */
57
+ /** Control Mask Authorization
58
+ * @deprecated use `api.control.masking.isAuthorizedToUnmask`
59
+ **/
53
60
  isAuthorizedToUnmask(): boolean;
54
61
  /**
55
62
  * Sets the value of the control's field.
@@ -85,6 +92,10 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
85
92
  * @returns Object representing the calling control.
86
93
  */
87
94
  getControl(): Control<ControlTypeAttributes>;
95
+ /**
96
+ * Access the Control Data Masking API
97
+ */
98
+ masking: MaskingControlApi;
88
99
  }
89
100
  /**
90
101
  * This API pertains to administration functionality for controls, for example registering resources.
@@ -176,16 +187,24 @@ export interface ControlStateApi {
176
187
  * True if the control is hidden, otherwise false.
177
188
  */
178
189
  readonly hidden: boolean;
190
+ /**
191
+ * Returns the disabled state of the calling control.
192
+ * True if the control is disabled, otherwise false.
193
+ */
194
+ readonly disabled: boolean;
179
195
  /**
180
196
  * Returns the masked state of the calling control.
181
197
  * True if the control is masked, otherwise false.
198
+ * @deprecated use `api.control.masking.isMasked`
182
199
  */
183
200
  readonly maskActive: boolean;
184
201
  /**
185
- * Returns the disabled state of the calling control.
186
- * True if the control is disabled, otherwise false.
202
+ * Returns the state with a specified key.
203
+ * @method
204
+ * @param state {string} The key of the state to be returned.
205
+ * @returns The specified state of the calling control, or undefined if no match.
187
206
  */
188
- readonly disabled: boolean;
207
+ get<T extends keyof IControlClientStates>(state: T): boolean | undefined;
189
208
  /**
190
209
  * Registers a function to be invoked whenever a state change event occurs.
191
210
  * This function receives an object that contains information about the change event.
@@ -380,8 +399,9 @@ export interface ControlPageApi extends ControlPageApiBase {
380
399
  * When providing a url for content: the panel properties will be available on the controller's "slidingPanel" object.
381
400
  * When providing a selector for content: the properties will be set on the element to be created.
382
401
  * @param [onClose] {function} A callback function invoked when the panel is dismissed. There are no parameters. Returns void.
402
+ * @param [focusPreviousActiveElementOnClose] {boolean} Toggle for whether the app should apply focus to the last active element before the panel was opened.
383
403
  */
384
- toggleSlidingPanel<T>(sectionLabel?: string, content?: SlidingPanelContent<T>, panelProperties?: SlidingPanelProperties, onClose?: () => void): void;
404
+ toggleSlidingPanel<T>(sectionLabel?: string, content?: SlidingPanelContent<T>, panelProperties?: SlidingPanelProperties, onClose?: () => void, focusPreviousActiveElementOnClose?: boolean): void;
385
405
  /**
386
406
  * Checks if a page is in edit mode.
387
407
  * @method
@@ -423,6 +443,16 @@ export interface ControlPageApi extends ControlPageApiBase {
423
443
  * @returns A Promise which resolves when the page has been saved.
424
444
  */
425
445
  save(stopEditing: boolean, closeObject: boolean): Promise<void>;
446
+ /**
447
+ * Access the Page Data Masking API
448
+ */
449
+ masking: MaskingPageApi;
450
+ onNavigationStart(callback: () => void): void;
451
+ /**
452
+ * Checks if the sliding panel is pinned
453
+ * @returns A boolean value that checks whether the sliding panel is pinned.
454
+ */
455
+ isSlidingPanelPinned(): boolean | undefined;
426
456
  }
427
457
  /**
428
458
  * Methods related to files.
@@ -506,3 +536,8 @@ export interface ControlFileApi extends ControlFileApiBase {
506
536
  */
507
537
  export interface ControlPageEventsApi extends PageEventsApiBase {
508
538
  }
539
+ export interface FieldNotOnPageError {
540
+ name: "FieldNotOnPageError";
541
+ message: string;
542
+ fields: string[];
543
+ }
@@ -72,5 +72,5 @@ export interface StateChange {
72
72
  allowInput?: boolean;
73
73
  couldBeReadOnly?: boolean;
74
74
  couldBeRequired?: boolean;
75
- maskActive?: boolean;
75
+ masked?: boolean;
76
76
  }
@@ -0,0 +1,187 @@
1
+ import { FieldValue } from "./data-types";
2
+ export interface UnmaskEventData {
3
+ data: {
4
+ [fieldName: string]: FieldValue;
5
+ };
6
+ fieldNames: string[];
7
+ documentId: string;
8
+ documentType: string;
9
+ scopeId: string;
10
+ nodeId?: string;
11
+ }
12
+ export interface MaskEventData {
13
+ fieldNames: string[];
14
+ documentId: string;
15
+ documentType: string;
16
+ scopeId: string;
17
+ nodeId?: string;
18
+ }
19
+ export interface MaskResetEventData {
20
+ scopeId: string;
21
+ documentId: string;
22
+ fieldNames: string[];
23
+ }
24
+ export declare const MASKED_FIELD_CHAR = "\u2022";
25
+ export declare const MASKED_FIELD_PLACEHOLDER: string;
26
+ export declare const MASKED_FIELD_ISO_CODE_PLACEHOLDER: string;
27
+ export interface MaskingPageApi {
28
+ /**
29
+ * Determines whether a field is masked.
30
+ * @throws {FieldNotOnPageError}
31
+ * @param fieldName The field name.
32
+ * @returns A boolean.
33
+ */
34
+ isMasked(fieldName: string): boolean;
35
+ /**
36
+ * Masks a field.
37
+ * @throws {NotConfiguredForMaskingError}
38
+ * @throws {FieldNotOnPageError}
39
+ * @param fieldName The field name.
40
+ */
41
+ mask(fieldName: string): void;
42
+ /**
43
+ * Masks the fields.
44
+ * If no fields array is passed in then all fields that are configured for masking on the page will be masked.
45
+ * @throws {NotConfiguredForMaskingError} If one or more of the fields are not configured for masking.
46
+ * @throws {FieldNotOnPageError} If one or more of the fields are not available on the page.
47
+ * @param fieldNames The field names.
48
+ */
49
+ maskAll(fieldNames?: string[]): void;
50
+ /**
51
+ * Unmasks the field via a fetch.
52
+ * Subsequent get field value calls return the unmasked value.
53
+ * If the field is unmasked or has been unmasked in the current page mode, no fetch is made.
54
+ * If the field is not on the page the promise will reject with a {@link FieldNotOnPageError}.
55
+ * If the field is not configured for masking the promise will reject with a {@link NotConfiguredForMaskingError}.
56
+ * If the user is not authorized to reveal the field, the returned promise will reject with an {@link UnmaskAuthError}.
57
+ * @param fieldName The field name.
58
+ * @returns A promise that resolves when the unmask is successful.
59
+ */
60
+ unmask(fieldName: string): Promise<void>;
61
+ /**
62
+ * Unmasks the fields via a fetch.
63
+ * Subsequent get field value calls return the unmasked value.
64
+ * If no fields array is passed in then all fields on the page configured for masking will be unmasked.
65
+ * For each field, if the field is unmasked or has been unmasked in the current page mode, no fetch for it is made.
66
+ * If one or more of the fields are not on the page the promise will reject with a {@link FieldNotOnPageError}.
67
+ * If one or more of the fields are not configured for masking the promise will reject with a {@link NotConfiguredForMaskingError}.
68
+ * If the user is not authorized to reveal one or more of the fields, the returned promise will reject with an {@link UnmaskAuthError}.
69
+ * @param fieldNames The field names.
70
+ * @returns A promise that resolves when the unmasks are successful.
71
+ */
72
+ unmaskAll(fieldNames?: string[]): Promise<void>;
73
+ /**
74
+ * Invokes the callback whenever any field value is masked.
75
+ * When an individual field is masked via a mask call, the callback will be invoked once.
76
+ * When multiple fields are masked via a single mask/mask all call, the callback will be invoked once.
77
+ * @param callback The callback function.
78
+ * @returns A function that removes the callback.
79
+ */
80
+ onEveryMask(callback: (mask: {
81
+ fieldNames: string[];
82
+ }) => void): () => void;
83
+ /**
84
+ * Invokes the callback whenever the specified field is masked.
85
+ * @throws {FieldNotOnPageError}
86
+ * @param fieldName The field name.
87
+ * @param callback The callback function.
88
+ * @returns A function that removes the callback.
89
+ */
90
+ onMask(fieldName: string, callback: () => void): () => void;
91
+ /**
92
+ * Invokes the callback whenever any field value is unmasked.
93
+ * When an individual field is unmasked via an unmask call, the callback will be invoked once.
94
+ * When multiple fields are unmasked via a single unmask/unmask all call, the callback will be invoked once.
95
+ * @param callback The callback function.
96
+ * @returns A function that removes the callback.
97
+ */
98
+ onEveryUnmask(callback: (unmask: {
99
+ fieldNames: string[];
100
+ }) => void): () => void;
101
+ /**
102
+ * Invokes the callback whenever the specified field is unmasked.
103
+ * @throws {FieldNotOnPageError}
104
+ * @param fieldName The field name.
105
+ * @param callback The callback function.
106
+ * @returns A function that removes the callback.
107
+ */
108
+ onUnmask(fieldName: string, callback: () => void): () => void;
109
+ /**
110
+ * Determines whether the field is configured for masking via the field's restrictions.
111
+ * @throws {FieldNotOnPageError}
112
+ * @param fieldName The field name.
113
+ * @returns Whether the field is configured for masking.
114
+ */
115
+ isConfiguredForMasking(fieldName: string): boolean;
116
+ /**
117
+ * Determines whether the current user can unmask the field.
118
+ * @throws {FieldNotOnPageError}
119
+ * @throws {NotConfiguredForMaskingError}
120
+ * @param fieldName The field name.
121
+ * @returns Whether the current can unmask the field.
122
+ */
123
+ isAuthorizedToUnmask(fieldName: string): boolean;
124
+ }
125
+ export interface MaskingControlApi {
126
+ /**
127
+ * In the case of a single field control, determines whether the control's field is masked.
128
+ * In the case of a multiple field control, determines whether one or more of the control's fields are masked.
129
+ * @returns A boolean.
130
+ */
131
+ isMasked(): boolean;
132
+ /**
133
+ * Masks the control's field(s) that are configured for masking.
134
+ * @throws {NotConfiguredForMaskingError} If a single field control's field is not configured for masking or if
135
+ * all of a multiple field control's fields are not configured for masking.
136
+ */
137
+ mask(): void;
138
+ /**
139
+ * Unmasks the controls field(s) via a fetch.
140
+ * Subsequent get field value calls return the unmasked value.
141
+ * For each field, if the field is unmasked or has been unmasked in the current page mode, no fetch for it is made.
142
+ * If a single field control's field is not configured for masking or if all of a multiple field control's fields are not configured for masking the returned
143
+ * promise will reject with a {@link NotConfiguredForMaskingError}.
144
+ * If the user is not authorized to reveal one or more of the control's fields, the returned promise will reject with an {@link UnmaskAuthError}.
145
+ * @returns A promise that resolves when the unmask is successful.
146
+ */
147
+ unmask(): Promise<void>;
148
+ /**
149
+ * Invokes the callback whenever the control's field is (or, in the case of a multiple field control, fields are) masked.
150
+ * @param callback The callback function.
151
+ * @returns A function that removes the callback.
152
+ */
153
+ onMask(callback: (mask: {
154
+ fieldNames: string[];
155
+ }) => void): () => void;
156
+ /**
157
+ * Invokes the callback whenever the control's field is (or, in the case of a multiple field control, fields are) unmasked.
158
+ * @param callback The callback function.
159
+ * @returns A function that removes the callback.
160
+ */
161
+ onUnmask(callback: (unmask: {
162
+ fieldNames: string[];
163
+ }) => void): () => void;
164
+ /**
165
+ * In the case of a single field control, determines (via the field restrictions) whether the control's field is configured for masking.
166
+ * In the case of a multiple field control, determines (via the field restrictions) whether one or more of the control's fields are configured for masking.
167
+ * @returns Whether the control is configured for masking.
168
+ */
169
+ isConfiguredForMasking(): boolean;
170
+ /**
171
+ * In the case of a single field control, determines whether the current user is able to unmask the control's field.
172
+ * In the case of a multiple field control, determines whether the current user is able to unmask all of the control's fields.
173
+ * @throws {NotConfiguredForMaskingError}
174
+ * @returns Whether the current user is able to unmask the control.
175
+ */
176
+ isAuthorizedToUnmask(): boolean;
177
+ }
178
+ export interface UnmaskAuthError {
179
+ name: "UnmaskAuthError";
180
+ message: string;
181
+ fields: string[];
182
+ }
183
+ export interface NotConfiguredForMaskingError {
184
+ name: "NotConfiguredForMaskingError";
185
+ message: string;
186
+ fields: string[];
187
+ }
@@ -0,0 +1,3 @@
1
+ export const MASKED_FIELD_CHAR = "\u2022";
2
+ export const MASKED_FIELD_PLACEHOLDER = MASKED_FIELD_CHAR.repeat(9);
3
+ export const MASKED_FIELD_ISO_CODE_PLACEHOLDER = MASKED_FIELD_CHAR.repeat(3);
package/control/page.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Type } from "@angular/core";
2
2
  import { ActionState } from "../object/object-api";
3
- export declare const enum PageModeEvent {
3
+ export declare enum PageModeEvent {
4
4
  CREATE = "create",
5
5
  EDIT = "edit",
6
6
  OPEN = "open",
package/control/page.js CHANGED
@@ -1 +1,8 @@
1
- export {};
1
+ export var PageModeEvent;
2
+ (function (PageModeEvent) {
3
+ PageModeEvent["CREATE"] = "create";
4
+ PageModeEvent["EDIT"] = "edit";
5
+ PageModeEvent["OPEN"] = "open";
6
+ PageModeEvent["INSPECT"] = "inspect";
7
+ PageModeEvent["SUMMARY"] = "summary";
8
+ })(PageModeEvent || (PageModeEvent = {}));
@@ -1,5 +1,11 @@
1
1
  import { FieldType, NumberDataType } from "./data-types";
2
- export interface RequirableRestriction {
2
+ export interface MaskedFieldRestriction {
3
+ masked?: {
4
+ currentUserIsAuthorizedToReveal: boolean;
5
+ revealUrl?: string;
6
+ };
7
+ }
8
+ export interface RequirableRestriction extends MaskedFieldRestriction {
3
9
  required: boolean;
4
10
  }
5
11
  export interface FieldRestrictions extends RequirableRestriction {
@@ -17,6 +17,14 @@ export interface IdentitySummary {
17
17
  state?: IdentityState;
18
18
  type: IdentityType;
19
19
  }
20
+ export interface IdentityFlatMembership {
21
+ id: string;
22
+ name: string;
23
+ providerId: string;
24
+ implicit: boolean;
25
+ parentsIds?: string[];
26
+ topLevel: boolean;
27
+ }
20
28
  export interface UserSummary extends IdentitySummary {
21
29
  readonly type: IdentityType.User;
22
30
  }
@@ -50,9 +58,10 @@ export interface CurrentUserApi {
50
58
  /**
51
59
  * @method
52
60
  * @description Gets the list of groups to which the current user belongs.
61
+ * @param limit Maximum number of groups to be returned. Default: 1000.
53
62
  * @returns A list of group details.
54
63
  */
55
- getUserMemberships(): Promise<IdentitySummary[]>;
64
+ getUserMemberships(limit?: number): Promise<IdentityFlatMembership[]>;
56
65
  /**
57
66
  * @method
58
67
  * @description Verifies if the current user has administration features.
@@ -1,3 +1,4 @@
1
+ import { expectType } from "../../shared/util/helper-functions";
1
2
  export var IdentityState;
2
3
  (function (IdentityState) {
3
4
  IdentityState["Active"] = "active";
@@ -9,3 +10,4 @@ export var IdentityType;
9
10
  IdentityType["User"] = "user";
10
11
  IdentityType["Group"] = "group";
11
12
  })(IdentityType || (IdentityType = {}));
13
+ expectType(true);
@@ -0,0 +1,25 @@
1
+ import { PageModel } from "../page-model";
2
+ import { Control } from "../control";
3
+ /**
4
+ * @category Properties
5
+ */
6
+ export interface SASInputBindings<T = any> {
7
+ id?: string;
8
+ readOnly?: boolean;
9
+ placeholder?: string;
10
+ autocomplete?: string;
11
+ isDisabled?: boolean;
12
+ model?: T;
13
+ inputFocus?: (event: FocusEvent) => void;
14
+ inputBlur?: (event: FocusEvent) => void;
15
+ modelChanged?: (modelValue: T) => void;
16
+ }
17
+ /**
18
+ * Page Controls require a valid {@link Control | childNode} and {@link PageModel | pageModel}.</strong>
19
+ *
20
+ * @category Properties
21
+ **/
22
+ export interface PageControlBindings {
23
+ childNode: Control;
24
+ pageModel: PageModel;
25
+ }
@@ -0,0 +1,274 @@
1
+ import { SASInputBindings } from ".";
2
+ import { IdentitySummary } from "../current-user";
3
+ /**
4
+ * Properties for {@link SVICustomElement.IdentitySelect}.
5
+ *
6
+ * @category Properties
7
+ *
8
+ * @example HTML Example #1 - Provide a custom set of User/Group identities to display in dialog
9
+ * ```html
10
+ * <svi-identity-select
11
+ * [model]="selectedIdentities"
12
+ * [identities]="myIdentitiesList"
13
+ * [selectionMode]="SelectionMode.UsersAndGroups"
14
+ * [selfSelectBtn]="true"
15
+ * [filter]="{ byGroups: ['alpha', 'bravo'] }"
16
+ * (modelChanged)="onSelectionChange($event)"
17
+ * ></svi-identity-select>
18
+ * ```
19
+ *
20
+ * @example HTML Example #2 - Retrieve a list of users from the identities service in dialog
21
+ * ```html
22
+ * <svi-identity-select
23
+ * [model]="selectedIdentities"
24
+ * [ariaLabel]="'Select Users'"
25
+ * [selectionMode]="SelectionMode.Users"
26
+ * [selfSelectBtn]="true"
27
+ * (modelChanged)="onSelectionChange($event)"
28
+ * ></svi-identity-select>
29
+ * ```
30
+ *
31
+ * @example Create element via document.createElement:
32
+ * ```ts
33
+ * const identitySelect = document.createElement(SVICustomElement.IdentitySelect);
34
+ * identitySelect.identities = this.myIdentitiesList;
35
+ * identitySelect.ariaLabel = "My label";
36
+ * ```
37
+ */
38
+ export interface IdentitySelectProperties extends SASInputBindings {
39
+ /** ARIA label for identifying the list. */
40
+ ariaLabel?: string;
41
+ /** The available users and groups to select from. If not provided, the identities are retrieved from the identities microservice. */
42
+ identities?: IIdentityOption[];
43
+ /** Does the input allow the selection of only a user, users, a group, groups, or both? (default: {@link SelectionMode.UsersAndGroups}) */
44
+ selectionMode?: SelectionMode;
45
+ /** Determines whether the select current user button is displayed. (default: false) */
46
+ selfSelectBtn?: boolean;
47
+ /** Determines if the current user button is displayed above or to the left/right of the identity-select control. (default: false) */
48
+ inlineSelectCurrentUserBtn?: boolean;
49
+ /** The filtering options used when the available identities are retrieved from the identities microservice. (default: false) */
50
+ filter?: IIdentitySelectFilterOptions;
51
+ /**
52
+ * Only members of the given group will be valid and selectable. If inclusive if true,
53
+ * the group itself is treated as a valid selection.
54
+ *
55
+ * Accepts the group id as a string, or as part of configuration object.
56
+ */
57
+ limitSelectionToMembersOf?: string | ILimitSelectionToConfig;
58
+ /** Optional title that can be used to override the default dialog title. */
59
+ title?: string;
60
+ }
61
+ /**
62
+ * Properties for {@link SVICustomElement.IdentitySelectAction}.
63
+ *
64
+ * @category Properties
65
+ *
66
+ * @example HTML Example #1 - Select Users and Groups
67
+ * ```html
68
+ * <svi-identity-select-action
69
+ * [model]="selectedIdentities"
70
+ * [title]="'Multiple Users and Groups from Button'"
71
+ * [hideLabel]="true"
72
+ * (selectionDialogClose)="onDialogClose($event)"
73
+ * (modelChanged)="onSelectionChange($event)"
74
+ * ></svi-identity-select-action>
75
+ * ```
76
+ *
77
+ * @example HTML Example #1 - Select Users Only
78
+ * ```html
79
+ * <svi-identity-select-action
80
+ * [model]="selectedIdentities"
81
+ * [title]="'Multiple Users from Button'"
82
+ * [hideLabel]="true"
83
+ * [selectionMode]="selectionMode.Users"
84
+ * (selectionDialogClose)="onDialogClose($event)"
85
+ * (modelChanged)="onSelectionChange($event)"
86
+ * ></svi-identity-select-action>
87
+ * ```
88
+ *
89
+ * @example Create element via document.createElement:
90
+ * ```ts
91
+ * const identityAvatar = document.createElement(SVICustomElement.IdentitySelectAction);
92
+ * identitySelect.title = this.title;
93
+ * identitySelect.actionMode = this.actionMode;
94
+ * ```
95
+ */
96
+ export interface IdentitySelectActionProperties {
97
+ /** Determines if the action is rendered as a Button or MenuItem (default: {@link ActionMode.Button}). */
98
+ actionMode?: ActionMode;
99
+ /** The tabIndex for the button (default: {@link TabIndex.Tabbable}). */
100
+ tabIndex?: string;
101
+ /** Optional title that can be used to override the default dialog title. */
102
+ title?: string;
103
+ /** Optional label that can be used to override the default button label. */
104
+ label?: string;
105
+ /** Defines if the label will be hidden. (default: false). */
106
+ hideLabel?: boolean;
107
+ /** Label for the identity select dialog "ok" button. (default: "ok") */
108
+ okButtonLabel?: string;
109
+ /** Optional icon class that can be used to override the default button icon. */
110
+ iconClass?: string;
111
+ /** Disables the component's controls. (default: false) */
112
+ disabled?: boolean;
113
+ /** The available users and groups to select from. If not provided, the identities are retrieved from the identities microservice. */
114
+ identities?: IIdentityOption[];
115
+ /** Does the input allow the selection of only a user, users, a group, groups, or both? (default: {@link SelectionMode.UsersAndGroups}) */
116
+ selectionMode?: SelectionMode;
117
+ /** Pre-select Identities. */
118
+ selectedIdentities?: IIdentityOption[];
119
+ /** The filtering options used when the available identities are retrieved from the identities microservice. */
120
+ filter?: IIdentitySelectFilterOptions;
121
+ /**
122
+ * Only members of the given group will be valid and selectable. If inclusive if true,
123
+ * the group itself is treated as a valid selection.
124
+ *
125
+ * Accepts the group id as a string, or as part of configuration object.
126
+ */
127
+ limitSelectionToMembersOf?: string | ILimitSelectionToConfig;
128
+ /** Emits the selected identities when the dialog's ok button is clicked. */
129
+ selectionDialogClose?: (event: CustomEvent) => void;
130
+ }
131
+ /**
132
+ * Properties for {@link SVICustomElement.Avatar}.
133
+ *
134
+ * @category Properties
135
+ *
136
+ * @example HTML Example
137
+ * ```html
138
+ * <svi-avatar
139
+ * [identity]="identity"
140
+ * [size]="SizeType.XLarge"
141
+ * [isIcon]="true"
142
+ * [isButton]="true"
143
+ * ></svi-avatar>
144
+ * ```
145
+ *
146
+ * @example Create element via document.createElement:
147
+ * ```ts
148
+ * const identityAvatar = document.createElement(SVICustomElement.IdentityAvatar);
149
+ * identitySelect.identity = this.identity;
150
+ * identitySelect.size = SizeType.XLarge;
151
+ * identitySelect.isButton = true;
152
+ * ```
153
+ */
154
+ export interface AvatarProperties {
155
+ /** The identity of the user, including name, userID, user type, and any tooltips. (required) */
156
+ identity: AvatarData;
157
+ /** Specifies the size styling the avatar should use. */
158
+ size?: SizeType;
159
+ /** Specifies if the avatar is a clickable button. */
160
+ isButton?: boolean;
161
+ /** The user's photo, if provided. */
162
+ imgSrcUrl?: string;
163
+ /** Specifies whether the avatar displays an icon (user or group) or a non-icon (initial or image). */
164
+ isIcon?: boolean;
165
+ }
166
+ /** @category Identities Types */
167
+ export declare enum SizeType {
168
+ Small = "small",
169
+ Medium = "medium",
170
+ XLarge = "x-large"
171
+ }
172
+ /** @category Identities Types */
173
+ export declare enum TabIndex {
174
+ Tabbable = "0",
175
+ NotTabbable = "-1"
176
+ }
177
+ /** @category Identities Types */
178
+ export declare enum IdentityType {
179
+ User = "user",
180
+ Group = "group"
181
+ }
182
+ /** @category Identities Types */
183
+ export declare enum IdentityState {
184
+ Active = "active",
185
+ Inactive = "inactive",
186
+ Locked = "locked"
187
+ }
188
+ /** @category Identities Types */
189
+ export interface GroupSummary extends IdentitySummary {
190
+ /** The value of "group" */
191
+ readonly type: IdentityType.Group;
192
+ }
193
+ /** @category Identities Types */
194
+ export interface UserSummary extends IdentitySummary {
195
+ /** The value of "user" */
196
+ readonly type: IdentityType.User;
197
+ }
198
+ /** @category Identities Types */
199
+ export interface AvatarData {
200
+ /** The name of the avatar file */
201
+ name?: string;
202
+ /** The content-type of the avatar file. */
203
+ type?: string;
204
+ /** Describes whether or not the avatar file for this identity is a default image. */
205
+ default?: boolean;
206
+ /** The uri location of the avatar file only if stored externally. */
207
+ uri?: string;
208
+ /** Timestamp of avatar data creation */
209
+ creationTimeStamp?: Date;
210
+ /** Timestamp of last avatar data modification */
211
+ modifiedTimeStamp?: Date;
212
+ }
213
+ /** @category Identities Types */
214
+ export declare enum ActionMode {
215
+ Button = "button",
216
+ MenuItem = "menuItem"
217
+ }
218
+ /** @category Identities Types */
219
+ export declare enum SelectionMode {
220
+ User = "user",
221
+ Group = "group",
222
+ Users = "users",
223
+ Groups = "groups",
224
+ UserOrGroup = "userOrGroup",
225
+ UsersAndGroups = "usersAndGroups"
226
+ }
227
+ /** @category Identities Types */
228
+ export type IdentitySelection = Array<{
229
+ id: string;
230
+ type: IdentityType;
231
+ }>;
232
+ /** @category Identities Types */
233
+ export interface IIdentitySelectDialogData {
234
+ identities?: IIdentityOption[];
235
+ selection?: IdentitySelection;
236
+ selectionMode: SelectionMode;
237
+ filter?: IIdentitySelectFilterOptions;
238
+ limitSelectionToMembersOf?: string | ILimitSelectionToConfig;
239
+ title?: string;
240
+ okButtonLabel?: string;
241
+ showSelectCurrentUserButton?: boolean;
242
+ }
243
+ /** @category Identities Types */
244
+ export interface IIdentityOption {
245
+ label?: string;
246
+ icon?: string;
247
+ }
248
+ /** @category Identities Types */
249
+ export declare const enum IdentityTypeIcon {
250
+ User = "userIcon",
251
+ Group = "userGroupIcon",
252
+ UserAndGroup = "userGroupLimitIcon"
253
+ }
254
+ /** @category Identities Types */
255
+ export interface IIdentitySelectFilterOptions {
256
+ byGroups: string[];
257
+ includeNestedMembers?: boolean;
258
+ includeFilteredGroups?: boolean;
259
+ term?: string;
260
+ start?: number;
261
+ limit?: number;
262
+ cache?: number;
263
+ }
264
+ /** @category Identities Types */
265
+ export interface IFilterGroup {
266
+ id: string;
267
+ name?: string;
268
+ members: IdentitySummary[];
269
+ }
270
+ /** @category Identities Types */
271
+ export interface ILimitSelectionToConfig {
272
+ id: string;
273
+ inclusive?: boolean;
274
+ }