@norwegian/core-components 7.16.5 → 7.17.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/assets/documentation/select-new/select-new.md +0 -0
- package/assets/icons/small/click-to-pay--light.svg +8 -0
- package/assets/icons/small/click-to-pay.svg +8 -0
- package/assets/icons/small/swap.svg +6 -0
- package/esm2022/lib/components/icon/icon.component.mjs +2 -2
- package/esm2022/lib/components/index.mjs +2 -1
- package/esm2022/lib/components/page-header/page-header.component.mjs +2 -2
- package/esm2022/lib/components/select/select.component.mjs +2 -2
- package/esm2022/lib/components/select-new/index.mjs +5 -0
- package/esm2022/lib/components/select-new/models/select-option.model.mjs +2 -0
- package/esm2022/lib/components/select-new/optgroup/optgroup-new.component.mjs +23 -0
- package/esm2022/lib/components/select-new/option/option-new.component.mjs +41 -0
- package/esm2022/lib/components/select-new/select-new.component.mjs +271 -0
- package/esm2022/lib/components/select-new/select-new.module.mjs +26 -0
- package/esm2022/lib/components/select-new/services/select-new.service.mjs +40 -0
- package/fesm2022/norwegian-core-components.mjs +769 -405
- package/fesm2022/norwegian-core-components.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/select/select.component.d.ts +1 -1
- package/lib/components/select-new/index.d.ts +4 -0
- package/lib/components/select-new/models/select-option.model.d.ts +6 -0
- package/lib/components/select-new/optgroup/optgroup-new.component.d.ts +8 -0
- package/lib/components/select-new/option/option-new.component.d.ts +16 -0
- package/lib/components/select-new/select-new.component.d.ts +173 -0
- package/lib/components/select-new/select-new.module.d.ts +14 -0
- package/lib/components/select-new/services/select-new.service.d.ts +10 -0
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ export * from './passenger-select/index';
|
|
|
26
26
|
export * from './premium-toggle/index';
|
|
27
27
|
export * from './radio/index';
|
|
28
28
|
export * from './select/index';
|
|
29
|
+
export * from './select-new/index';
|
|
29
30
|
export * from './spinner/index';
|
|
30
31
|
export * from './status-box/index';
|
|
31
32
|
export * from './toggle/index';
|
|
@@ -12,7 +12,7 @@ import { OptgroupComponent } from './optgroup/optgroup.component';
|
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
|
-
* Norwegian Select Component | Form Controls |
|
|
15
|
+
* Norwegian Select Component | Form Controls | Deprecated
|
|
16
16
|
*/
|
|
17
17
|
export declare class SelectComponent extends NasComponentBase implements OnChanges, AfterViewChecked, AfterContentInit, OnInit {
|
|
18
18
|
private change;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NasComponentBase } from '../../../core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class OptGroupNewComponent extends NasComponentBase {
|
|
4
|
+
label: string;
|
|
5
|
+
constructor();
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OptGroupNewComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OptGroupNewComponent, "nas-optgroup-new", never, { "label": { "alias": "label"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NasComponentBase } from '../../../core';
|
|
2
|
+
import { SelectNewService } from '../services/select-new.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class OptionNewComponent extends NasComponentBase {
|
|
5
|
+
private selectService;
|
|
6
|
+
displayValue: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
constructor(selectService: SelectNewService);
|
|
11
|
+
onSelect(value: string): void;
|
|
12
|
+
getIconName(value: string): string;
|
|
13
|
+
getIconType(value: string): string;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OptionNewComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OptionNewComponent, "nas-option-new", never, { "displayValue": { "alias": "displayValue"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "label": { "alias": "label"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Norwegian Air Shuttle. All Rights Reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnInit, QueryList } from '@angular/core';
|
|
6
|
+
import { NasComponentBase } from '../../core/base/nas-component.base';
|
|
7
|
+
import { SelectOptionNewModel } from './models/select-option.model';
|
|
8
|
+
import { OptionNewComponent } from './option/option-new.component';
|
|
9
|
+
import { SelectNewService } from './services/select-new.service';
|
|
10
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* Norwegian Select Component | Form Controls | New design
|
|
15
|
+
*/
|
|
16
|
+
export declare class SelectNewComponent extends NasComponentBase implements OnInit, AfterViewInit {
|
|
17
|
+
private selectService;
|
|
18
|
+
selectBoxElement: ElementRef;
|
|
19
|
+
optionsComponent: QueryList<OptionNewComponent>;
|
|
20
|
+
/**
|
|
21
|
+
* @property Input
|
|
22
|
+
*
|
|
23
|
+
* @description
|
|
24
|
+
* Makes the select component autogrow.
|
|
25
|
+
*/
|
|
26
|
+
autogrow?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @property Input
|
|
29
|
+
*
|
|
30
|
+
* @description
|
|
31
|
+
* Sets compact styling. Slighty smaller then regular select box.
|
|
32
|
+
*/
|
|
33
|
+
compact?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @property Input
|
|
36
|
+
*
|
|
37
|
+
* @description
|
|
38
|
+
* Sets disabled styling.
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @property Input
|
|
43
|
+
*
|
|
44
|
+
* @description
|
|
45
|
+
* Sets error styling.
|
|
46
|
+
*/
|
|
47
|
+
error?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @property Input
|
|
50
|
+
*
|
|
51
|
+
* @description
|
|
52
|
+
* The error message to display when error occur. Error attribute need to be true.
|
|
53
|
+
*/
|
|
54
|
+
errorMessage?: string;
|
|
55
|
+
/**
|
|
56
|
+
* @property Input
|
|
57
|
+
*
|
|
58
|
+
* @description
|
|
59
|
+
* The ID of the native input element
|
|
60
|
+
*/
|
|
61
|
+
id: string;
|
|
62
|
+
/**
|
|
63
|
+
* @property Input
|
|
64
|
+
*
|
|
65
|
+
* @description
|
|
66
|
+
* Sets information text to the tooltip. Info icon will be displayed between label text.
|
|
67
|
+
*/
|
|
68
|
+
infoText?: string;
|
|
69
|
+
/**
|
|
70
|
+
* @property Input
|
|
71
|
+
*
|
|
72
|
+
* @description
|
|
73
|
+
* Sets inline styling. Possible to be used in sentences.
|
|
74
|
+
*/
|
|
75
|
+
inline?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @property Input
|
|
78
|
+
*
|
|
79
|
+
* @description
|
|
80
|
+
* Sets the label to the select box.
|
|
81
|
+
*/
|
|
82
|
+
label?: string;
|
|
83
|
+
/**
|
|
84
|
+
* @property Input
|
|
85
|
+
*
|
|
86
|
+
* @description
|
|
87
|
+
* Sets a formControlName directive to the select.
|
|
88
|
+
*/
|
|
89
|
+
nasFormControlName: string;
|
|
90
|
+
/**
|
|
91
|
+
* @property Input
|
|
92
|
+
*
|
|
93
|
+
* @description
|
|
94
|
+
* Adds the parent's form group.
|
|
95
|
+
*/
|
|
96
|
+
nasFormGroup: FormGroup;
|
|
97
|
+
/**
|
|
98
|
+
* @property Input
|
|
99
|
+
*
|
|
100
|
+
* @description
|
|
101
|
+
* Add options to the selector.
|
|
102
|
+
*/
|
|
103
|
+
get options(): Array<SelectOptionNewModel>;
|
|
104
|
+
set options(value: Array<SelectOptionNewModel>);
|
|
105
|
+
/**
|
|
106
|
+
* @property Input
|
|
107
|
+
*
|
|
108
|
+
* @description
|
|
109
|
+
* Presenting value instead of title in the select box.
|
|
110
|
+
*/
|
|
111
|
+
presentValue?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* @property Input
|
|
114
|
+
*
|
|
115
|
+
* @description
|
|
116
|
+
* Set selected value from option.
|
|
117
|
+
*/
|
|
118
|
+
get selected(): SelectOptionNewModel;
|
|
119
|
+
set selected(option: SelectOptionNewModel);
|
|
120
|
+
/**
|
|
121
|
+
* @property Input
|
|
122
|
+
*
|
|
123
|
+
* @description
|
|
124
|
+
* Sets simple styling. Border and background color stylings are removed.
|
|
125
|
+
*/
|
|
126
|
+
simple?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* @property Input
|
|
129
|
+
*
|
|
130
|
+
* @description
|
|
131
|
+
* Sets spaceless styling. Removes margins for the select box.
|
|
132
|
+
*/
|
|
133
|
+
spaceless?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* @property Input
|
|
136
|
+
*
|
|
137
|
+
* @description
|
|
138
|
+
* Sets stretched styling.
|
|
139
|
+
*/
|
|
140
|
+
stretched?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* @property Output
|
|
143
|
+
*
|
|
144
|
+
* @description
|
|
145
|
+
* An event that is fired every time a selection is done.
|
|
146
|
+
*/
|
|
147
|
+
selectedChange: EventEmitter<SelectOptionNewModel>;
|
|
148
|
+
get modifiers(): Array<string>;
|
|
149
|
+
get selectControl(): AbstractControl;
|
|
150
|
+
get selectId(): string;
|
|
151
|
+
get selectedLabel(): string;
|
|
152
|
+
open: boolean;
|
|
153
|
+
hasContent: boolean;
|
|
154
|
+
optionsValue: Array<SelectOptionNewModel>;
|
|
155
|
+
selectedValue: SelectOptionNewModel;
|
|
156
|
+
private componentId;
|
|
157
|
+
private activeIndex;
|
|
158
|
+
private NAS_OPTION_TAG;
|
|
159
|
+
constructor(selectService: SelectNewService);
|
|
160
|
+
clickOutside(event: MouseEvent): void;
|
|
161
|
+
onKeydown(event: KeyboardEvent): void;
|
|
162
|
+
ngOnInit(): void;
|
|
163
|
+
ngAfterViewInit(): void;
|
|
164
|
+
onOpen(): void;
|
|
165
|
+
getIconName(value: string): string;
|
|
166
|
+
getIconType(value: string): string;
|
|
167
|
+
private setSelected;
|
|
168
|
+
private setOptionsFromContent;
|
|
169
|
+
private selectKeyDown;
|
|
170
|
+
private updateActiveOption;
|
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectNewComponent, never>;
|
|
172
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectNewComponent, "nas-select-new", never, { "autogrow": { "alias": "autogrow"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "error": { "alias": "error"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "id": { "alias": "id"; "required": false; }; "infoText": { "alias": "infoText"; "required": false; }; "inline": { "alias": "inline"; "required": false; }; "label": { "alias": "label"; "required": false; }; "nasFormControlName": { "alias": "nasFormControlName"; "required": false; }; "nasFormGroup": { "alias": "nasFormGroup"; "required": false; }; "options": { "alias": "options"; "required": false; }; "presentValue": { "alias": "presentValue"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "simple": { "alias": "simple"; "required": false; }; "spaceless": { "alias": "spaceless"; "required": false; }; "stretched": { "alias": "stretched"; "required": false; }; }, { "selectedChange": "selectedChange"; }, ["optionsComponent"], ["*"], false, never>;
|
|
173
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./select-new.component";
|
|
3
|
+
import * as i2 from "./option/option-new.component";
|
|
4
|
+
import * as i3 from "./optgroup/optgroup-new.component";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "../../core/directives/nas-class/nas-class.module";
|
|
8
|
+
import * as i7 from "../icon/icon.module";
|
|
9
|
+
import * as i8 from "../tooltip/tooltip.module";
|
|
10
|
+
export declare class SelectNewModule {
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectNewModule, never>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SelectNewModule, [typeof i1.SelectNewComponent, typeof i2.OptionNewComponent, typeof i3.OptGroupNewComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.NasClassModule, typeof i7.IconModule, typeof i8.TooltipModule], [typeof i1.SelectNewComponent, typeof i2.OptionNewComponent, typeof i3.OptGroupNewComponent]>;
|
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<SelectNewModule>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class SelectNewService {
|
|
3
|
+
private _selected$;
|
|
4
|
+
selected$: import("rxjs").Observable<string>;
|
|
5
|
+
select(value: string): void;
|
|
6
|
+
getIconName(value: string): string;
|
|
7
|
+
getIconType(value: string): string;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectNewService, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SelectNewService>;
|
|
10
|
+
}
|