@energycap/components 0.26.9 → 0.26.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/energycap-components.umd.js +102 -47
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.d.ts +3 -2
- package/energycap-components.metadata.json +1 -1
- package/esm2015/energycap-components.js +4 -3
- package/esm2015/lib/controls/textbox/textbox.component.js +17 -4
- package/esm2015/lib/display/app-bar/app-bar.component.js +13 -3
- package/esm2015/lib/display/avatar/avatar.component.js +9 -41
- package/esm2015/lib/display/avatar/avatar.service.js +62 -0
- package/fesm2015/energycap-components.js +95 -46
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/controls/textbox/textbox.component.d.ts +12 -6
- package/lib/display/app-bar/app-bar.component.d.ts +7 -1
- package/lib/display/avatar/avatar.component.d.ts +5 -10
- package/lib/display/avatar/avatar.service.d.ts +21 -0
- package/package.json +1 -1
|
@@ -9,12 +9,12 @@ import { ValidatorFn } from '@angular/forms';
|
|
|
9
9
|
* textarea, email is input[type="email"], url is input[type="url"], and password
|
|
10
10
|
* is an input[type="password"]
|
|
11
11
|
*
|
|
12
|
-
* If the type is url a regex pattern is automatically added to the form validators. No other pattern validators
|
|
12
|
+
* If the type is url or tel a regex pattern is automatically added to the form validators. No other pattern validators
|
|
13
13
|
* may be used for this input, having more than one will cause issues.
|
|
14
14
|
*
|
|
15
15
|
* If the type is email an email validator is automatically added to the form validators.
|
|
16
16
|
* */
|
|
17
|
-
export declare type TextboxType = "text" | "multi_line" | "email" | "url" | "password";
|
|
17
|
+
export declare type TextboxType = "text" | "multi_line" | "email" | "url" | "password" | "tel";
|
|
18
18
|
/** Type for advanced validation of textbox form controls, if in the future
|
|
19
19
|
* we want more handling we will need to update this type.
|
|
20
20
|
*/
|
|
@@ -28,6 +28,8 @@ export declare type TextboxValidatorParameters = {
|
|
|
28
28
|
};
|
|
29
29
|
/** Advanced validation for textbox form controls */
|
|
30
30
|
export declare const textboxValidation: (validatorParams: TextboxValidatorParameters) => ValidatorFn;
|
|
31
|
+
export declare const phoneNumberValidationPattern: string;
|
|
32
|
+
export declare const urlValidationPattern: string;
|
|
31
33
|
export declare class TextboxComponent extends FormControlBase implements OnInit, AfterViewInit, OnChanges {
|
|
32
34
|
protected validationMessageService: ValidationMessageService;
|
|
33
35
|
protected formGroupHelper: FormGroupHelper;
|
|
@@ -49,7 +51,7 @@ export declare class TextboxComponent extends FormControlBase implements OnInit,
|
|
|
49
51
|
*
|
|
50
52
|
* This is for adding the attribute on the element to get the browser functionality
|
|
51
53
|
* from the input. If you need the form to be validated before submission, apply the
|
|
52
|
-
* maxLength validator to the form
|
|
54
|
+
* maxLength validator to the form control.
|
|
53
55
|
*/
|
|
54
56
|
maxlength?: number;
|
|
55
57
|
/**
|
|
@@ -57,11 +59,11 @@ export declare class TextboxComponent extends FormControlBase implements OnInit,
|
|
|
57
59
|
*
|
|
58
60
|
* This is for adding the attribute on the element to get the browser functionality
|
|
59
61
|
* from the input. If you need the form to be validated before submission, apply the
|
|
60
|
-
* minLength validator to the form
|
|
62
|
+
* minLength validator to the form control.
|
|
61
63
|
*/
|
|
62
64
|
minlength?: number;
|
|
63
65
|
/**
|
|
64
|
-
* The value of the rows
|
|
66
|
+
* The value of the rows attribute for a textarea. Only applies to multi-line type
|
|
65
67
|
*/
|
|
66
68
|
rows?: number;
|
|
67
69
|
/**
|
|
@@ -73,6 +75,10 @@ export declare class TextboxComponent extends FormControlBase implements OnInit,
|
|
|
73
75
|
* If set to true, we will upper case on focus out
|
|
74
76
|
*/
|
|
75
77
|
upperCase: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Validation pattern for the input. This is determined on the input type specified
|
|
80
|
+
*/
|
|
81
|
+
validationPattern: string;
|
|
76
82
|
protected inputElement: ElementRef;
|
|
77
83
|
constructor(validationMessageService: ValidationMessageService, formGroupHelper: FormGroupHelper, translate: TranslateService);
|
|
78
84
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -85,7 +91,7 @@ export declare class TextboxComponent extends FormControlBase implements OnInit,
|
|
|
85
91
|
*/
|
|
86
92
|
ngAfterViewInit(): void;
|
|
87
93
|
/**
|
|
88
|
-
* Function to set focus on an input
|
|
94
|
+
* Function to set focus on an input programmatically after the page
|
|
89
95
|
* had been rendered. The highlight text flag will select the text
|
|
90
96
|
* within the input if passed in and true
|
|
91
97
|
*/
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { OnChanges } from '@angular/core';
|
|
1
2
|
import { MenuItem } from '../../controls/menu/menu.component';
|
|
2
3
|
import { AvatarUser } from '../avatar/avatar.component';
|
|
3
|
-
|
|
4
|
+
import { AvatarService } from '../avatar/avatar.service';
|
|
5
|
+
export declare class AppBarComponent implements OnChanges {
|
|
6
|
+
private avatarService;
|
|
4
7
|
user: AvatarUser;
|
|
5
8
|
userMenuItems: MenuItem[];
|
|
6
9
|
userMenuWidth: number;
|
|
7
10
|
userMenuMinWidth: number;
|
|
8
11
|
userMenuTabindex: number;
|
|
9
12
|
iconPath: string;
|
|
13
|
+
userMenuTitle?: string;
|
|
14
|
+
constructor(avatarService: AvatarService);
|
|
15
|
+
ngOnChanges(): void;
|
|
10
16
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ElementRef, Renderer2, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { AvatarService } from './avatar.service';
|
|
2
3
|
export interface AvatarUser {
|
|
3
4
|
firstName?: string;
|
|
4
5
|
lastName?: string;
|
|
5
6
|
email?: string;
|
|
6
7
|
username?: string;
|
|
7
|
-
userMenuTitle?: string;
|
|
8
8
|
}
|
|
9
9
|
export declare class AvatarComponent implements OnChanges {
|
|
10
10
|
private el;
|
|
11
11
|
private renderer;
|
|
12
|
+
private avatarService;
|
|
12
13
|
/** Color map base on the first let of the label */
|
|
13
14
|
private colors;
|
|
14
15
|
user: AvatarUser;
|
|
@@ -16,19 +17,13 @@ export declare class AvatarComponent implements OnChanges {
|
|
|
16
17
|
label: string;
|
|
17
18
|
/** Track the current CSS class so we can remove it if the user changes before setting the next one */
|
|
18
19
|
private currentCSSClass;
|
|
19
|
-
constructor(el: ElementRef, renderer: Renderer2);
|
|
20
|
+
constructor(el: ElementRef, renderer: Renderer2, avatarService: AvatarService);
|
|
20
21
|
ngOnChanges(changes: SimpleChanges): void;
|
|
21
22
|
/**
|
|
22
|
-
* Update the Avatar label
|
|
23
|
-
*
|
|
24
|
-
* not have a first or last name, trying using the first two characters of the email, or the first two characters of the
|
|
25
|
-
* username as a last ditch effort.
|
|
23
|
+
* Update the Avatar label
|
|
24
|
+
*
|
|
26
25
|
*/
|
|
27
26
|
private updateLabel;
|
|
28
|
-
/** Return a new user object that has all of the properties of the existing user
|
|
29
|
-
* with any null, undefined, or whitespace values removed
|
|
30
|
-
*/
|
|
31
|
-
private trimUser;
|
|
32
27
|
/**
|
|
33
28
|
* Sets the color of the Avatar based on the first letter of the label. If the label is HI or is not
|
|
34
29
|
* a letter, default to gray.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AvatarUser } from './avatar.component';
|
|
2
|
+
export declare type AvatarLabels = {
|
|
3
|
+
abbreviation: string;
|
|
4
|
+
full: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare class AvatarService {
|
|
7
|
+
/**
|
|
8
|
+
* Return the full and abbreviated labels based on the users first name, email, or username. If the user has a first or last name use
|
|
9
|
+
* either a combination of the first and last name, or the first two characters of the name that is defined. If the user does
|
|
10
|
+
* not have a first or last name, trying using the first two characters of the email, or the first two characters of the
|
|
11
|
+
* username as a last ditch effort.
|
|
12
|
+
* @param user
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
getAvatarLabels(user: AvatarUser): AvatarLabels;
|
|
16
|
+
/**
|
|
17
|
+
* Return a new user object that has all of the properties of the existing user
|
|
18
|
+
* with any null, undefined, or whitespace values removed
|
|
19
|
+
*/
|
|
20
|
+
private trimUser;
|
|
21
|
+
}
|