@norwegian/core-components 6.21.2 → 6.22.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/esm2022/lib/components/index.mjs +2 -1
- package/esm2022/lib/components/input-text/index.mjs +3 -0
- package/esm2022/lib/components/input-text/input-text.component.mjs +231 -0
- package/esm2022/lib/components/input-text/input-text.module.mjs +21 -0
- package/fesm2022/norwegian-core-components.mjs +255 -17
- package/fesm2022/norwegian-core-components.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/input-text/index.d.ts +2 -0
- package/lib/components/input-text/input-text.component.d.ts +203 -0
- package/lib/components/input-text/input-text.module.d.ts +11 -0
- package/package.json +1 -1
- package/styles/3__base/_input.scss +0 -2
|
@@ -14,6 +14,7 @@ export * from './icon/index';
|
|
|
14
14
|
export * from './icon-list/index';
|
|
15
15
|
export * from './info/index';
|
|
16
16
|
export * from './input/index';
|
|
17
|
+
export * from './input-text/index';
|
|
17
18
|
export * from './simple-list/index';
|
|
18
19
|
export * from './modal/index';
|
|
19
20
|
export * from './number-field/index';
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Norwegian Air Shuttle. All Rights Reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { ElementRef, EventEmitter } from '@angular/core';
|
|
6
|
+
import { FormGroup } from '@angular/forms';
|
|
7
|
+
import { ClassModel } from '../../core';
|
|
8
|
+
import { NasComponentBase } from '../../core/base/nas-component.base';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* @description
|
|
12
|
+
* Norwegian Input-Text Component | Form Controls
|
|
13
|
+
*/
|
|
14
|
+
export declare class InputTextComponent extends NasComponentBase {
|
|
15
|
+
inputReactive: ElementRef<HTMLElement>;
|
|
16
|
+
inputNotReactive: ElementRef<HTMLElement>;
|
|
17
|
+
controls: ElementRef<HTMLElement>;
|
|
18
|
+
/**
|
|
19
|
+
* @property Input
|
|
20
|
+
* @description
|
|
21
|
+
* The ID of the native input element
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* @property Input
|
|
26
|
+
* @description
|
|
27
|
+
* The value of the native input element
|
|
28
|
+
*/
|
|
29
|
+
get model(): string;
|
|
30
|
+
set model(value: string);
|
|
31
|
+
modelChange: EventEmitter<string>;
|
|
32
|
+
blur: EventEmitter<string>;
|
|
33
|
+
/**
|
|
34
|
+
* @property Input
|
|
35
|
+
* @description
|
|
36
|
+
* Whether the control is in an error state.
|
|
37
|
+
*/
|
|
38
|
+
error: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @property Input
|
|
41
|
+
* @description
|
|
42
|
+
* Whether the native input element is disabled or no, with disabled styling.
|
|
43
|
+
*/
|
|
44
|
+
get disabled(): boolean;
|
|
45
|
+
set disabled(value: boolean);
|
|
46
|
+
/**
|
|
47
|
+
* @property Input
|
|
48
|
+
* @description
|
|
49
|
+
* Whether the control is in an active state.
|
|
50
|
+
*/
|
|
51
|
+
active: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @property Input
|
|
54
|
+
* @description
|
|
55
|
+
* Set spaceless styling (removing spacing)
|
|
56
|
+
*/
|
|
57
|
+
spaceless: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @property Input
|
|
60
|
+
* @description
|
|
61
|
+
* Sets the label of the input
|
|
62
|
+
*/
|
|
63
|
+
label: string;
|
|
64
|
+
/**
|
|
65
|
+
* @property Input
|
|
66
|
+
* @description
|
|
67
|
+
* Sets the label of the input inside the white area
|
|
68
|
+
*/
|
|
69
|
+
labelInside: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @property Input
|
|
72
|
+
* @description
|
|
73
|
+
* The error message to display when error occur. Error attribute need to be true.
|
|
74
|
+
*/
|
|
75
|
+
errorMessage: string;
|
|
76
|
+
/**
|
|
77
|
+
* @property Input
|
|
78
|
+
* @description
|
|
79
|
+
* Sets placeholder text in the native input element
|
|
80
|
+
*/
|
|
81
|
+
placeholder: string;
|
|
82
|
+
/**
|
|
83
|
+
* @property Input
|
|
84
|
+
* @description
|
|
85
|
+
* Sets min length on the native input element.
|
|
86
|
+
*/
|
|
87
|
+
minLength: number;
|
|
88
|
+
/**
|
|
89
|
+
* @property Input
|
|
90
|
+
* @description
|
|
91
|
+
* Sets max length on the native input element.
|
|
92
|
+
*/
|
|
93
|
+
maxLength: number;
|
|
94
|
+
/**
|
|
95
|
+
* @property Input
|
|
96
|
+
* @description
|
|
97
|
+
* Sets the info text related to the input
|
|
98
|
+
*/
|
|
99
|
+
info: string;
|
|
100
|
+
/**
|
|
101
|
+
* @property Input
|
|
102
|
+
* @description
|
|
103
|
+
* Sets the icon on the input
|
|
104
|
+
*/
|
|
105
|
+
icon: string;
|
|
106
|
+
/**
|
|
107
|
+
* @property Input
|
|
108
|
+
* @description
|
|
109
|
+
* Input type of the element.
|
|
110
|
+
*/
|
|
111
|
+
type: string;
|
|
112
|
+
/**
|
|
113
|
+
* @property Input
|
|
114
|
+
* @description
|
|
115
|
+
* Whether the element is readonly.
|
|
116
|
+
*/
|
|
117
|
+
readonly: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* @property Input
|
|
120
|
+
* @description
|
|
121
|
+
* String to set name on native input element.
|
|
122
|
+
*/
|
|
123
|
+
get name(): string;
|
|
124
|
+
set name(value: string);
|
|
125
|
+
/**
|
|
126
|
+
* @property Input
|
|
127
|
+
* @description
|
|
128
|
+
* Sets aria describedby for accessibility
|
|
129
|
+
*/
|
|
130
|
+
ariaDescribedby: string;
|
|
131
|
+
/**
|
|
132
|
+
* @property Input
|
|
133
|
+
* @description
|
|
134
|
+
* Sets the required attribute on the native input element.
|
|
135
|
+
*/
|
|
136
|
+
required: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* @property Input
|
|
139
|
+
* @description
|
|
140
|
+
* Sets a formControlName directive to the input.
|
|
141
|
+
* It requires that the consumer included ReactiveFormsModule in it's module.
|
|
142
|
+
* It requiers that the nasFormGroup input is filled.
|
|
143
|
+
* @example
|
|
144
|
+
* <nas-input-text [nasFormControlName]="'username'"></nas-input-text>
|
|
145
|
+
*/
|
|
146
|
+
nasFormControlName: string;
|
|
147
|
+
/**
|
|
148
|
+
* @property Input
|
|
149
|
+
* @description
|
|
150
|
+
* Adds the parent's form group.
|
|
151
|
+
* It requires that the consumer included ReactiveFormsModule in it's module.
|
|
152
|
+
* It is requiered to be filled if nasFormControlName added.
|
|
153
|
+
* @example
|
|
154
|
+
* <nas-input-text [nasFormGroup]="loginGroup"></nas-input-text>
|
|
155
|
+
*/
|
|
156
|
+
nasFormGroup: FormGroup;
|
|
157
|
+
/**
|
|
158
|
+
* @property Input
|
|
159
|
+
* @description
|
|
160
|
+
* The minimum value to accept for this input.
|
|
161
|
+
* @example
|
|
162
|
+
* <nas-input-text [type]="'number'" [min]="0"></nas-input-text>
|
|
163
|
+
*/
|
|
164
|
+
min: number;
|
|
165
|
+
/**
|
|
166
|
+
* @property Input
|
|
167
|
+
* @description
|
|
168
|
+
* The maximum value to accept for this input.
|
|
169
|
+
* @example
|
|
170
|
+
* <nas-input-text [type]="'number'" [max]="10"></nas-input-text>
|
|
171
|
+
*/
|
|
172
|
+
max: number;
|
|
173
|
+
/**
|
|
174
|
+
* @property Input
|
|
175
|
+
* @description
|
|
176
|
+
* Adds a line below the input element. Default value is true.
|
|
177
|
+
* @example
|
|
178
|
+
* <nas-input-text [line]="false"></nas-input-text>
|
|
179
|
+
*/
|
|
180
|
+
line: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* @property Input
|
|
183
|
+
* @description
|
|
184
|
+
* Specifies a regular expression that the input value is checked against on form submission
|
|
185
|
+
*/
|
|
186
|
+
pattern: string;
|
|
187
|
+
get inputId(): string;
|
|
188
|
+
get errorId(): string;
|
|
189
|
+
private componentId;
|
|
190
|
+
private modelValue;
|
|
191
|
+
private disabledValue;
|
|
192
|
+
private nameValue;
|
|
193
|
+
constructor();
|
|
194
|
+
ngAfterViewInit(): void;
|
|
195
|
+
mainClass(): ClassModel;
|
|
196
|
+
private setNameAttribute;
|
|
197
|
+
onBlur(value: string): void;
|
|
198
|
+
private setInputStyling;
|
|
199
|
+
private setLabelInsideStyling;
|
|
200
|
+
onInput(event: Event): void;
|
|
201
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputTextComponent, never>;
|
|
202
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputTextComponent, "nas-input-text", never, { "id": { "alias": "id"; "required": false; }; "model": { "alias": "model"; "required": false; }; "error": { "alias": "error"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "active": { "alias": "active"; "required": false; }; "spaceless": { "alias": "spaceless"; "required": false; }; "label": { "alias": "label"; "required": false; }; "labelInside": { "alias": "labelInside"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "info": { "alias": "info"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "type": { "alias": "type"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "name": { "alias": "name"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "required": { "alias": "required"; "required": false; }; "nasFormControlName": { "alias": "nasFormControlName"; "required": false; }; "nasFormGroup": { "alias": "nasFormGroup"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "line": { "alias": "line"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; }, { "modelChange": "modelChange"; "blur": "blur"; }, never, never, false, never>;
|
|
203
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./input-text.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "../icon/icon.module";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "../../core/directives/nas-class/nas-class.module";
|
|
7
|
+
export declare class InputTextModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputTextModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<InputTextModule, [typeof i1.InputTextComponent], [typeof i2.CommonModule, typeof i3.IconModule, typeof i4.FormsModule, typeof i5.NasClassModule, typeof i4.ReactiveFormsModule], [typeof i1.InputTextComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<InputTextModule>;
|
|
11
|
+
}
|
package/package.json
CHANGED