@sebgroup/green-angular 1.0.0-alpha.1 → 1.0.0-beta.4
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 +27 -0
- package/esm2020/index.mjs +6 -0
- package/esm2020/lib/dropdown/dropdown.component.mjs +196 -0
- package/esm2020/lib/dropdown/dropdown.module.mjs +18 -0
- package/esm2020/lib/green-angular.module.mjs +19 -0
- package/esm2020/lib/segmented-control/segmented-control.component.mjs +40 -0
- package/esm2020/lib/segmented-control/segmented-control.module.mjs +19 -0
- package/esm2020/sebgroup-green-angular.mjs +5 -0
- package/fesm2015/sebgroup-green-angular.mjs +288 -0
- package/fesm2015/sebgroup-green-angular.mjs.map +1 -0
- package/fesm2020/sebgroup-green-angular.mjs +284 -0
- package/fesm2020/sebgroup-green-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/dropdown/dropdown.component.d.ts +33 -0
- package/lib/dropdown/dropdown.module.d.ts +8 -0
- package/lib/green-angular.module.d.ts +9 -0
- package/lib/segmented-control/segmented-control.component.d.ts +11 -0
- package/lib/segmented-control/segmented-control.module.d.ts +9 -0
- package/package.json +31 -6
- package/sebgroup-green-angular.d.ts +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# GreenAngular
|
|
2
|
+
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
+
|
|
9
|
+
## Code scaffolding
|
|
10
|
+
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
16
|
+
|
|
17
|
+
## Running unit tests
|
|
18
|
+
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
+
|
|
21
|
+
## Running end-to-end tests
|
|
22
|
+
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
24
|
+
|
|
25
|
+
## Further help
|
|
26
|
+
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './lib/green-angular.module';
|
|
2
|
+
export * from './lib/dropdown/dropdown.module';
|
|
3
|
+
export * from './lib/dropdown/dropdown.component';
|
|
4
|
+
export * from './lib/segmented-control/segmented-control.module';
|
|
5
|
+
export * from './lib/segmented-control/segmented-control.component';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXIvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNEJBQTRCLENBQUE7QUFDMUMsY0FBYyxnQ0FBZ0MsQ0FBQTtBQUM5QyxjQUFjLG1DQUFtQyxDQUFBO0FBQ2pELGNBQWMsa0RBQWtELENBQUE7QUFDaEUsY0FBYyxxREFBcUQsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2dyZWVuLWFuZ3VsYXIubW9kdWxlJ1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZHJvcGRvd24vZHJvcGRvd24ubW9kdWxlJ1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZHJvcGRvd24vZHJvcGRvd24uY29tcG9uZW50J1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VnbWVudGVkLWNvbnRyb2wvc2VnbWVudGVkLWNvbnRyb2wubW9kdWxlJ1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VnbWVudGVkLWNvbnRyb2wvc2VnbWVudGVkLWNvbnRyb2wuY29tcG9uZW50J1xuIl19
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, ViewChild, } from '@angular/core';
|
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { createDropdown, } from '@sebgroup/extract';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
export class NggDropdownComponent {
|
|
7
|
+
constructor(cd) {
|
|
8
|
+
this.cd = cd;
|
|
9
|
+
this.options = [];
|
|
10
|
+
this.value = undefined;
|
|
11
|
+
this.trackByKey = (index, option) => {
|
|
12
|
+
return option.key;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
ngAfterViewInit() {
|
|
16
|
+
if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {
|
|
17
|
+
this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
|
|
18
|
+
this.dropdown = dropdown;
|
|
19
|
+
this.toggler = dropdown.elements.toggler;
|
|
20
|
+
this.listbox = dropdown.elements.listbox;
|
|
21
|
+
this.cd.detectChanges();
|
|
22
|
+
});
|
|
23
|
+
this.selectFromValue(this.value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.handler?.destroy();
|
|
28
|
+
}
|
|
29
|
+
ngOnChanges() {
|
|
30
|
+
if (this.handler && this.dropdown) {
|
|
31
|
+
this.handler.update(this.props);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
writeValue(obj) {
|
|
35
|
+
this.value = obj;
|
|
36
|
+
this.selectFromValue(this.value);
|
|
37
|
+
}
|
|
38
|
+
registerOnChange(fn) {
|
|
39
|
+
this.onChangeFn = fn;
|
|
40
|
+
}
|
|
41
|
+
registerOnTouched(fn) {
|
|
42
|
+
this.onTouchedFn = fn;
|
|
43
|
+
}
|
|
44
|
+
select(option) {
|
|
45
|
+
this.handler?.select(option);
|
|
46
|
+
this.onChangeFn && this.onChangeFn(option.value);
|
|
47
|
+
this.onTouchedFn && this.onTouchedFn();
|
|
48
|
+
}
|
|
49
|
+
get props() {
|
|
50
|
+
return {
|
|
51
|
+
id: this.id,
|
|
52
|
+
text: this.text,
|
|
53
|
+
options: this.options,
|
|
54
|
+
loop: this.loop,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
selectFromValue(value) {
|
|
58
|
+
if (this.handler && value !== undefined) {
|
|
59
|
+
const option = this.handler.dropdown.options.find((option) => option.value === value);
|
|
60
|
+
if (option)
|
|
61
|
+
this.handler?.select(option);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", options: "options" }, providers: [
|
|
67
|
+
{
|
|
68
|
+
provide: NG_VALUE_ACCESSOR,
|
|
69
|
+
useExisting: NggDropdownComponent,
|
|
70
|
+
multi: true,
|
|
71
|
+
},
|
|
72
|
+
], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
73
|
+
<div>
|
|
74
|
+
<button
|
|
75
|
+
#togglerRef
|
|
76
|
+
[id]="toggler?.attributes?.id"
|
|
77
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
78
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
79
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
80
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
81
|
+
[style]="toggler?.attributes?.style"
|
|
82
|
+
[class]="toggler?.classes"
|
|
83
|
+
(click)="handler?.toggle()"
|
|
84
|
+
>
|
|
85
|
+
{{ dropdown?.text }}
|
|
86
|
+
</button>
|
|
87
|
+
<div
|
|
88
|
+
#listboxRef
|
|
89
|
+
[id]="listbox?.attributes?.id"
|
|
90
|
+
[attr.role]="listbox?.attributes?.role"
|
|
91
|
+
[attr.aria-activedescendant]="
|
|
92
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
93
|
+
"
|
|
94
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
95
|
+
[style]="listbox?.attributes?.style"
|
|
96
|
+
[class]="listbox?.classes"
|
|
97
|
+
>
|
|
98
|
+
<button
|
|
99
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
100
|
+
(click)="handler?.close()"
|
|
101
|
+
>
|
|
102
|
+
<span class="sr-only">Close</span>
|
|
103
|
+
</button>
|
|
104
|
+
<ul role="listbox">
|
|
105
|
+
<li
|
|
106
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
107
|
+
[id]="option.attributes.id"
|
|
108
|
+
[attr.role]="option.attributes.role"
|
|
109
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
110
|
+
[style]="option.attributes.style"
|
|
111
|
+
[class]="option.classes"
|
|
112
|
+
(click)="select(option)"
|
|
113
|
+
>
|
|
114
|
+
{{ option.key }}
|
|
115
|
+
</li>
|
|
116
|
+
</ul>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
|
|
121
|
+
type: Component,
|
|
122
|
+
args: [{
|
|
123
|
+
selector: 'ngg-dropdown',
|
|
124
|
+
template: `
|
|
125
|
+
<div>
|
|
126
|
+
<button
|
|
127
|
+
#togglerRef
|
|
128
|
+
[id]="toggler?.attributes?.id"
|
|
129
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
130
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
131
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
132
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
133
|
+
[style]="toggler?.attributes?.style"
|
|
134
|
+
[class]="toggler?.classes"
|
|
135
|
+
(click)="handler?.toggle()"
|
|
136
|
+
>
|
|
137
|
+
{{ dropdown?.text }}
|
|
138
|
+
</button>
|
|
139
|
+
<div
|
|
140
|
+
#listboxRef
|
|
141
|
+
[id]="listbox?.attributes?.id"
|
|
142
|
+
[attr.role]="listbox?.attributes?.role"
|
|
143
|
+
[attr.aria-activedescendant]="
|
|
144
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
145
|
+
"
|
|
146
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
147
|
+
[style]="listbox?.attributes?.style"
|
|
148
|
+
[class]="listbox?.classes"
|
|
149
|
+
>
|
|
150
|
+
<button
|
|
151
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
152
|
+
(click)="handler?.close()"
|
|
153
|
+
>
|
|
154
|
+
<span class="sr-only">Close</span>
|
|
155
|
+
</button>
|
|
156
|
+
<ul role="listbox">
|
|
157
|
+
<li
|
|
158
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
159
|
+
[id]="option.attributes.id"
|
|
160
|
+
[attr.role]="option.attributes.role"
|
|
161
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
162
|
+
[style]="option.attributes.style"
|
|
163
|
+
[class]="option.classes"
|
|
164
|
+
(click)="select(option)"
|
|
165
|
+
>
|
|
166
|
+
{{ option.key }}
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
`,
|
|
172
|
+
providers: [
|
|
173
|
+
{
|
|
174
|
+
provide: NG_VALUE_ACCESSOR,
|
|
175
|
+
useExisting: NggDropdownComponent,
|
|
176
|
+
multi: true,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
180
|
+
}]
|
|
181
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
|
|
182
|
+
type: Input
|
|
183
|
+
}], text: [{
|
|
184
|
+
type: Input
|
|
185
|
+
}], loop: [{
|
|
186
|
+
type: Input
|
|
187
|
+
}], options: [{
|
|
188
|
+
type: Input
|
|
189
|
+
}], togglerRef: [{
|
|
190
|
+
type: ViewChild,
|
|
191
|
+
args: ['togglerRef']
|
|
192
|
+
}], listboxRef: [{
|
|
193
|
+
type: ViewChild,
|
|
194
|
+
args: ['listboxRef']
|
|
195
|
+
}] } });
|
|
196
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyL3NyYy9saWIvZHJvcGRvd24vZHJvcGRvd24uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCx1QkFBdUIsRUFDdkIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFFVCxLQUFLL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XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NggDropdownComponent } from './dropdown.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class NggDropdownModule {
|
|
6
|
+
}
|
|
7
|
+
NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8
|
+
NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
|
|
9
|
+
NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, decorators: [{
|
|
11
|
+
type: NgModule,
|
|
12
|
+
args: [{
|
|
13
|
+
declarations: [NggDropdownComponent],
|
|
14
|
+
imports: [CommonModule],
|
|
15
|
+
exports: [NggDropdownComponent],
|
|
16
|
+
}]
|
|
17
|
+
}] });
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24ubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyL3NyYy9saWIvZHJvcGRvd24vZHJvcGRvd24ubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDeEMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBQzlDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHNCQUFzQixDQUFBOztBQU8zRCxNQUFNLE9BQU8saUJBQWlCOzs4R0FBakIsaUJBQWlCOytHQUFqQixpQkFBaUIsaUJBSmIsb0JBQW9CLGFBQ3pCLFlBQVksYUFDWixvQkFBb0I7K0dBRW5CLGlCQUFpQixZQUhuQixDQUFDLFlBQVksQ0FBQzsyRkFHWixpQkFBaUI7a0JBTDdCLFFBQVE7bUJBQUM7b0JBQ1IsWUFBWSxFQUFFLENBQUMsb0JBQW9CLENBQUM7b0JBQ3BDLE9BQU8sRUFBRSxDQUFDLFlBQVksQ0FBQztvQkFDdkIsT0FBTyxFQUFFLENBQUMsb0JBQW9CLENBQUM7aUJBQ2hDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJ1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJ1xuaW1wb3J0IHsgTmdnRHJvcGRvd25Db21wb25lbnQgfSBmcm9tICcuL2Ryb3Bkb3duLmNvbXBvbmVudCdcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbTmdnRHJvcGRvd25Db21wb25lbnRdLFxuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlXSxcbiAgZXhwb3J0czogW05nZ0Ryb3Bkb3duQ29tcG9uZW50XSxcbn0pXG5leHBvcnQgY2xhc3MgTmdnRHJvcGRvd25Nb2R1bGUge31cbiJdfQ==
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NggSegmentedControlModule } from './segmented-control/segmented-control.module';
|
|
4
|
+
import { NggDropdownModule } from './dropdown/dropdown.module';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class NggModule {
|
|
7
|
+
}
|
|
8
|
+
NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
|
|
10
|
+
NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule] });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, decorators: [{
|
|
12
|
+
type: NgModule,
|
|
13
|
+
args: [{
|
|
14
|
+
declarations: [],
|
|
15
|
+
imports: [CommonModule],
|
|
16
|
+
exports: [NggSegmentedControlModule, NggDropdownModule],
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JlZW4tYW5ndWxhci5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXIvc3JjL2xpYi9ncmVlbi1hbmd1bGFyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3hDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQTtBQUM5QyxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSw4Q0FBOEMsQ0FBQTtBQUN4RixPQUFPLEVBQUUsaU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
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
import * as i2 from "@angular/router";
|
|
5
|
+
export class NggSegmentedControlComponent {
|
|
6
|
+
}
|
|
7
|
+
NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
+
NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
|
|
9
|
+
<div class="group">
|
|
10
|
+
<a
|
|
11
|
+
*ngFor="let control of $controls | async"
|
|
12
|
+
[routerLink]="control.url"
|
|
13
|
+
routerLinkActive="active"
|
|
14
|
+
class="button"
|
|
15
|
+
>{{ control.text }}</a
|
|
16
|
+
>
|
|
17
|
+
</div>
|
|
18
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
|
|
20
|
+
type: Component,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: 'ngg-segmented-control',
|
|
23
|
+
template: `
|
|
24
|
+
<div class="group">
|
|
25
|
+
<a
|
|
26
|
+
*ngFor="let control of $controls | async"
|
|
27
|
+
[routerLink]="control.url"
|
|
28
|
+
routerLinkActive="active"
|
|
29
|
+
class="button"
|
|
30
|
+
>{{ control.text }}</a
|
|
31
|
+
>
|
|
32
|
+
</div>
|
|
33
|
+
`,
|
|
34
|
+
styles: [],
|
|
35
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36
|
+
}]
|
|
37
|
+
}], propDecorators: { $controls: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}] } });
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VnbWVudGVkLWNvbnRyb2wuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyL3NyYy9saWIvc2VnbWVudGVkLWNvbnRyb2wvc2VnbWVudGVkLWNvbnRyb2wuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsdUJBQXVCLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFBOzs7O0FBc0J6RSxNQUFNLE9BQU8sNEJBQTRCOzt5SEFBNUIsNEJBQTRCOzZHQUE1Qiw0QkFBNEIsaUdBZDdCOzs7Ozs7Ozs7O0dBVVQ7MkZBSVUsNEJBQTRCO2tCQWhCeEMsU0FBUzttQkFBQztvQkFDVCxRQUFRLEVBQUUsdUJBQXVCO29CQUNqQyxRQUFRLEVBQUU7Ozs7Ozs7Ozs7R0FVVDtvQkFDRCxNQUFNLEVBQUUsRUFBRTtvQkFDVixlQUFlLEVBQUUsdUJBQXVCLENBQUMsTUFBTTtpQkFDaEQ7OEJBRVUsU0FBUztzQkFBakIsS0FBSyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3ksIElucHV0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSdcbmltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzJ1xuZXhwb3J0IGludGVyZmFjZSBTZWdtZW50ZWRDb250cm9sIHtcbiAgdXJsOiBzdHJpbmdcbiAgdGV4dDogT2JzZXJ2YWJsZTxzdHJpbmc+IHwgc3RyaW5nXG59XG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICduZ2ctc2VnbWVudGVkLWNvbnRyb2wnLFxuICB0ZW1wbGF0ZTogYFxuICAgIDxkaXYgY2xhc3M9XCJncm91cFwiPlxuICAgICAgPGFcbiAgICAgICAgKm5nRm9yPVwibGV0IGNvbnRyb2wgb2YgJGNvbnRyb2xzIHwgYXN5bmNcIlxuICAgICAgICBbcm91dGVyTGlua109XCJjb250cm9sLnVybFwiXG4gICAgICAgIHJvdXRlckxpbmtBY3RpdmU9XCJhY3RpdmVcIlxuICAgICAgICBjbGFzcz1cImJ1dHRvblwiXG4gICAgICAgID57eyBjb250cm9sLnRleHQgfX08L2FcbiAgICAgID5cbiAgICA8L2Rpdj5cbiAgYCxcbiAgc3R5bGVzOiBbXSxcbiAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXG59KVxuZXhwb3J0IGNsYXNzIE5nZ1NlZ21lbnRlZENvbnRyb2xDb21wb25lbnQge1xuICBASW5wdXQoKSAkY29udHJvbHM6IE9ic2VydmFibGU8QXJyYXk8U2VnbWVudGVkQ29udHJvbD4+IHwgdW5kZWZpbmVkXG59XG4iXX0=
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NggSegmentedControlComponent } from './segmented-control.component';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class NggSegmentedControlModule {
|
|
7
|
+
}
|
|
8
|
+
NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
|
|
10
|
+
NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
|
|
12
|
+
type: NgModule,
|
|
13
|
+
args: [{
|
|
14
|
+
declarations: [NggSegmentedControlComponent],
|
|
15
|
+
imports: [RouterModule, CommonModule],
|
|
16
|
+
exports: [NggSegmentedControlComponent],
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VnbWVudGVkLWNvbnRyb2wubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9hbmd1bGFyL3NyYy9saWIvc2VnbWVudGVkLWNvbnRyb2wvc2VnbWVudGVkLWNvbnRyb2wubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUE7QUFDeEMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBQzlDLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLCtCQUEr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@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2ViZ3JvdXAtZ3JlZW4tYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci9zcmMvc2ViZ3JvdXAtZ3JlZW4tYW5ndWxhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, NgModule, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { RouterModule } from '@angular/router';
|
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { createDropdown } from '@sebgroup/extract';
|
|
9
|
+
|
|
10
|
+
class NggSegmentedControlComponent {
|
|
11
|
+
}
|
|
12
|
+
NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
|
|
14
|
+
<div class="group">
|
|
15
|
+
<a
|
|
16
|
+
*ngFor="let control of $controls | async"
|
|
17
|
+
[routerLink]="control.url"
|
|
18
|
+
routerLinkActive="active"
|
|
19
|
+
class="button"
|
|
20
|
+
>{{ control.text }}</a
|
|
21
|
+
>
|
|
22
|
+
</div>
|
|
23
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{
|
|
27
|
+
selector: 'ngg-segmented-control',
|
|
28
|
+
template: `
|
|
29
|
+
<div class="group">
|
|
30
|
+
<a
|
|
31
|
+
*ngFor="let control of $controls | async"
|
|
32
|
+
[routerLink]="control.url"
|
|
33
|
+
routerLinkActive="active"
|
|
34
|
+
class="button"
|
|
35
|
+
>{{ control.text }}</a
|
|
36
|
+
>
|
|
37
|
+
</div>
|
|
38
|
+
`,
|
|
39
|
+
styles: [],
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
}]
|
|
42
|
+
}], propDecorators: { $controls: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}] } });
|
|
45
|
+
|
|
46
|
+
class NggSegmentedControlModule {
|
|
47
|
+
}
|
|
48
|
+
NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
49
|
+
NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
|
|
50
|
+
NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
|
|
52
|
+
type: NgModule,
|
|
53
|
+
args: [{
|
|
54
|
+
declarations: [NggSegmentedControlComponent],
|
|
55
|
+
imports: [RouterModule, CommonModule],
|
|
56
|
+
exports: [NggSegmentedControlComponent],
|
|
57
|
+
}]
|
|
58
|
+
}] });
|
|
59
|
+
|
|
60
|
+
class NggDropdownComponent {
|
|
61
|
+
constructor(cd) {
|
|
62
|
+
this.cd = cd;
|
|
63
|
+
this.options = [];
|
|
64
|
+
this.value = undefined;
|
|
65
|
+
this.trackByKey = (index, option) => {
|
|
66
|
+
return option.key;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
ngAfterViewInit() {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
if (((_a = this.togglerRef) === null || _a === void 0 ? void 0 : _a.nativeElement) && ((_b = this.listboxRef) === null || _b === void 0 ? void 0 : _b.nativeElement)) {
|
|
72
|
+
this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
|
|
73
|
+
this.dropdown = dropdown;
|
|
74
|
+
this.toggler = dropdown.elements.toggler;
|
|
75
|
+
this.listbox = dropdown.elements.listbox;
|
|
76
|
+
this.cd.detectChanges();
|
|
77
|
+
});
|
|
78
|
+
this.selectFromValue(this.value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
ngOnDestroy() {
|
|
82
|
+
var _a;
|
|
83
|
+
(_a = this.handler) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
84
|
+
}
|
|
85
|
+
ngOnChanges() {
|
|
86
|
+
if (this.handler && this.dropdown) {
|
|
87
|
+
this.handler.update(this.props);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
writeValue(obj) {
|
|
91
|
+
this.value = obj;
|
|
92
|
+
this.selectFromValue(this.value);
|
|
93
|
+
}
|
|
94
|
+
registerOnChange(fn) {
|
|
95
|
+
this.onChangeFn = fn;
|
|
96
|
+
}
|
|
97
|
+
registerOnTouched(fn) {
|
|
98
|
+
this.onTouchedFn = fn;
|
|
99
|
+
}
|
|
100
|
+
select(option) {
|
|
101
|
+
var _a;
|
|
102
|
+
(_a = this.handler) === null || _a === void 0 ? void 0 : _a.select(option);
|
|
103
|
+
this.onChangeFn && this.onChangeFn(option.value);
|
|
104
|
+
this.onTouchedFn && this.onTouchedFn();
|
|
105
|
+
}
|
|
106
|
+
get props() {
|
|
107
|
+
return {
|
|
108
|
+
id: this.id,
|
|
109
|
+
text: this.text,
|
|
110
|
+
options: this.options,
|
|
111
|
+
loop: this.loop,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
selectFromValue(value) {
|
|
115
|
+
var _a;
|
|
116
|
+
if (this.handler && value !== undefined) {
|
|
117
|
+
const option = this.handler.dropdown.options.find((option) => option.value === value);
|
|
118
|
+
if (option)
|
|
119
|
+
(_a = this.handler) === null || _a === void 0 ? void 0 : _a.select(option);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
+
NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", options: "options" }, providers: [
|
|
125
|
+
{
|
|
126
|
+
provide: NG_VALUE_ACCESSOR,
|
|
127
|
+
useExisting: NggDropdownComponent,
|
|
128
|
+
multi: true,
|
|
129
|
+
},
|
|
130
|
+
], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
131
|
+
<div>
|
|
132
|
+
<button
|
|
133
|
+
#togglerRef
|
|
134
|
+
[id]="toggler?.attributes?.id"
|
|
135
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
136
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
137
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
138
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
139
|
+
[style]="toggler?.attributes?.style"
|
|
140
|
+
[class]="toggler?.classes"
|
|
141
|
+
(click)="handler?.toggle()"
|
|
142
|
+
>
|
|
143
|
+
{{ dropdown?.text }}
|
|
144
|
+
</button>
|
|
145
|
+
<div
|
|
146
|
+
#listboxRef
|
|
147
|
+
[id]="listbox?.attributes?.id"
|
|
148
|
+
[attr.role]="listbox?.attributes?.role"
|
|
149
|
+
[attr.aria-activedescendant]="
|
|
150
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
151
|
+
"
|
|
152
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
153
|
+
[style]="listbox?.attributes?.style"
|
|
154
|
+
[class]="listbox?.classes"
|
|
155
|
+
>
|
|
156
|
+
<button
|
|
157
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
158
|
+
(click)="handler?.close()"
|
|
159
|
+
>
|
|
160
|
+
<span class="sr-only">Close</span>
|
|
161
|
+
</button>
|
|
162
|
+
<ul role="listbox">
|
|
163
|
+
<li
|
|
164
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
165
|
+
[id]="option.attributes.id"
|
|
166
|
+
[attr.role]="option.attributes.role"
|
|
167
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
168
|
+
[style]="option.attributes.style"
|
|
169
|
+
[class]="option.classes"
|
|
170
|
+
(click)="select(option)"
|
|
171
|
+
>
|
|
172
|
+
{{ option.key }}
|
|
173
|
+
</li>
|
|
174
|
+
</ul>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
|
|
179
|
+
type: Component,
|
|
180
|
+
args: [{
|
|
181
|
+
selector: 'ngg-dropdown',
|
|
182
|
+
template: `
|
|
183
|
+
<div>
|
|
184
|
+
<button
|
|
185
|
+
#togglerRef
|
|
186
|
+
[id]="toggler?.attributes?.id"
|
|
187
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
188
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
189
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
190
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
191
|
+
[style]="toggler?.attributes?.style"
|
|
192
|
+
[class]="toggler?.classes"
|
|
193
|
+
(click)="handler?.toggle()"
|
|
194
|
+
>
|
|
195
|
+
{{ dropdown?.text }}
|
|
196
|
+
</button>
|
|
197
|
+
<div
|
|
198
|
+
#listboxRef
|
|
199
|
+
[id]="listbox?.attributes?.id"
|
|
200
|
+
[attr.role]="listbox?.attributes?.role"
|
|
201
|
+
[attr.aria-activedescendant]="
|
|
202
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
203
|
+
"
|
|
204
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
205
|
+
[style]="listbox?.attributes?.style"
|
|
206
|
+
[class]="listbox?.classes"
|
|
207
|
+
>
|
|
208
|
+
<button
|
|
209
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
210
|
+
(click)="handler?.close()"
|
|
211
|
+
>
|
|
212
|
+
<span class="sr-only">Close</span>
|
|
213
|
+
</button>
|
|
214
|
+
<ul role="listbox">
|
|
215
|
+
<li
|
|
216
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
217
|
+
[id]="option.attributes.id"
|
|
218
|
+
[attr.role]="option.attributes.role"
|
|
219
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
220
|
+
[style]="option.attributes.style"
|
|
221
|
+
[class]="option.classes"
|
|
222
|
+
(click)="select(option)"
|
|
223
|
+
>
|
|
224
|
+
{{ option.key }}
|
|
225
|
+
</li>
|
|
226
|
+
</ul>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
`,
|
|
230
|
+
providers: [
|
|
231
|
+
{
|
|
232
|
+
provide: NG_VALUE_ACCESSOR,
|
|
233
|
+
useExisting: NggDropdownComponent,
|
|
234
|
+
multi: true,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
238
|
+
}]
|
|
239
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], text: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], loop: [{
|
|
244
|
+
type: Input
|
|
245
|
+
}], options: [{
|
|
246
|
+
type: Input
|
|
247
|
+
}], togglerRef: [{
|
|
248
|
+
type: ViewChild,
|
|
249
|
+
args: ['togglerRef']
|
|
250
|
+
}], listboxRef: [{
|
|
251
|
+
type: ViewChild,
|
|
252
|
+
args: ['listboxRef']
|
|
253
|
+
}] } });
|
|
254
|
+
|
|
255
|
+
class NggDropdownModule {
|
|
256
|
+
}
|
|
257
|
+
NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
258
|
+
NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
|
|
259
|
+
NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
|
|
260
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, decorators: [{
|
|
261
|
+
type: NgModule,
|
|
262
|
+
args: [{
|
|
263
|
+
declarations: [NggDropdownComponent],
|
|
264
|
+
imports: [CommonModule],
|
|
265
|
+
exports: [NggDropdownComponent],
|
|
266
|
+
}]
|
|
267
|
+
}] });
|
|
268
|
+
|
|
269
|
+
class NggModule {
|
|
270
|
+
}
|
|
271
|
+
NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
272
|
+
NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
|
|
273
|
+
NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule] });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, decorators: [{
|
|
275
|
+
type: NgModule,
|
|
276
|
+
args: [{
|
|
277
|
+
declarations: [],
|
|
278
|
+
imports: [CommonModule],
|
|
279
|
+
exports: [NggSegmentedControlModule, NggDropdownModule],
|
|
280
|
+
}]
|
|
281
|
+
}] });
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Generated bundle index. Do not edit.
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
export { NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule };
|
|
288
|
+
//# sourceMappingURL=sebgroup-green-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sebgroup-green-angular.mjs","sources":["../../../../libs/angular/src/lib/segmented-control/segmented-control.component.ts","../../../../libs/angular/src/lib/segmented-control/segmented-control.module.ts","../../../../libs/angular/src/lib/dropdown/dropdown.component.ts","../../../../libs/angular/src/lib/dropdown/dropdown.module.ts","../../../../libs/angular/src/lib/green-angular.module.ts","../../../../libs/angular/src/sebgroup-green-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Input } from '@angular/core'\nimport { Observable } from 'rxjs'\nexport interface SegmentedControl {\n url: string\n text: Observable<string> | string\n}\n@Component({\n selector: 'ngg-segmented-control',\n template: `\n <div class=\"group\">\n <a\n *ngFor=\"let control of $controls | async\"\n [routerLink]=\"control.url\"\n routerLinkActive=\"active\"\n class=\"button\"\n >{{ control.text }}</a\n >\n </div>\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggSegmentedControlComponent {\n @Input() $controls: Observable<Array<SegmentedControl>> | undefined\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlComponent } from './segmented-control.component'\nimport { RouterModule } from '@angular/router'\n\n@NgModule({\n declarations: [NggSegmentedControlComponent],\n imports: [RouterModule, CommonModule],\n exports: [NggSegmentedControlComponent],\n})\nexport class NggSegmentedControlModule {}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n createDropdown,\n AbstractDropdown,\n DropdownHandler,\n DropdownOption,\n ExtendedDropdownOption,\n ElementProps,\n DropdownArgs,\n} from '@sebgroup/extract'\n\n@Component({\n selector: 'ngg-dropdown',\n template: `\n <div>\n <button\n #togglerRef\n [id]=\"toggler?.attributes?.id\"\n [attr.aria-haspopup]=\"toggler?.attributes?.['aria-haspopup']\"\n [attr.aria-expanded]=\"toggler?.attributes?.['aria-expanded']\"\n [attr.aria-owns]=\"toggler?.attributes?.['aria-owns']\"\n [tabindex]=\"toggler?.attributes?.tabIndex\"\n [style]=\"toggler?.attributes?.style\"\n [class]=\"toggler?.classes\"\n (click)=\"handler?.toggle()\"\n >\n {{ dropdown?.text }}\n </button>\n <div\n #listboxRef\n [id]=\"listbox?.attributes?.id\"\n [attr.role]=\"listbox?.attributes?.role\"\n [attr.aria-activedescendant]=\"\n listbox?.attributes?.['aria-activedescendant']\n \"\n [tabindex]=\"listbox?.attributes?.tabIndex\"\n [style]=\"listbox?.attributes?.style\"\n [class]=\"listbox?.classes\"\n >\n <button\n class=\"close m-4 m-sm-2 d-block d-sm-none\"\n (click)=\"handler?.close()\"\n >\n <span class=\"sr-only\">Close</span>\n </button>\n <ul role=\"listbox\">\n <li\n *ngFor=\"let option of dropdown?.options; trackBy: trackByKey\"\n [id]=\"option.attributes.id\"\n [attr.role]=\"option.attributes.role\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [style]=\"option.attributes.style\"\n [class]=\"option.classes\"\n (click)=\"select(option)\"\n >\n {{ option.key }}\n </li>\n </ul>\n </div>\n </div>\n `,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NggDropdownComponent,\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggDropdownComponent\n implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges\n{\n @Input() id?: string\n @Input() text?: string\n @Input() loop?: boolean\n @Input() options: DropdownOption[] = []\n\n @ViewChild('togglerRef') public togglerRef:\n | ElementRef<HTMLElement>\n | undefined\n\n @ViewChild('listboxRef') public listboxRef:\n | ElementRef<HTMLElement>\n | undefined\n\n value: any = undefined\n onChangeFn?: any\n onTouchedFn?: any\n\n dropdown?: AbstractDropdown\n handler?: DropdownHandler\n toggler?: Partial<ElementProps>\n listbox?: Partial<ElementProps>\n\n constructor(private cd: ChangeDetectorRef) {}\n\n ngAfterViewInit(): void {\n if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {\n this.handler = createDropdown(\n this.props,\n this.togglerRef.nativeElement,\n this.listboxRef.nativeElement,\n (dropdown) => {\n this.dropdown = dropdown\n this.toggler = dropdown.elements.toggler\n this.listbox = dropdown.elements.listbox\n this.cd.detectChanges()\n }\n )\n\n this.selectFromValue(this.value)\n }\n }\n\n ngOnDestroy(): void {\n this.handler?.destroy()\n }\n\n ngOnChanges(): void {\n if (this.handler && this.dropdown) {\n this.handler.update(this.props)\n }\n }\n\n writeValue(obj: any): void {\n this.value = obj\n this.selectFromValue(this.value)\n }\n\n registerOnChange(fn: any): void {\n this.onChangeFn = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedFn = fn\n }\n\n select(option: ExtendedDropdownOption) {\n this.handler?.select(option)\n this.onChangeFn && this.onChangeFn(option.value)\n this.onTouchedFn && this.onTouchedFn()\n }\n\n trackByKey = (index: number, option: ExtendedDropdownOption): string => {\n return option.key\n }\n\n private get props(): DropdownArgs {\n return {\n id: this.id,\n text: this.text,\n options: this.options,\n loop: this.loop,\n }\n }\n\n private selectFromValue(value: any) {\n if (this.handler && value !== undefined) {\n const option = this.handler.dropdown.options.find(\n (option) => option.value === value\n )\n if (option) this.handler?.select(option)\n }\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggDropdownComponent } from './dropdown.component'\n\n@NgModule({\n declarations: [NggDropdownComponent],\n imports: [CommonModule],\n exports: [NggDropdownComponent],\n})\nexport class NggDropdownModule {}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlModule } from './segmented-control/segmented-control.module'\nimport { NggDropdownModule } from './dropdown/dropdown.module'\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n exports: [NggSegmentedControlModule, NggDropdownModule],\n})\nexport class NggModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsBa,4BAA4B;;yHAA5B,4BAA4B;6GAA5B,4BAA4B,iGAd7B;;;;;;;;;;GAUT;2FAIU,4BAA4B;kBAhBxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;;;;;;;;;GAUT;oBACD,MAAM,EAAE,EAAE;oBACV,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAEU,SAAS;sBAAjB,KAAK;;;MCbK,yBAAyB;;sHAAzB,yBAAyB;uHAAzB,yBAAyB,iBAJrB,4BAA4B,aACjC,YAAY,EAAE,YAAY,aAC1B,4BAA4B;uHAE3B,yBAAyB,YAH3B,CAAC,YAAY,EAAE,YAAY,CAAC;2FAG1B,yBAAyB;kBALrC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,4BAA4B,CAAC;oBAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,OAAO,EAAE,CAAC,4BAA4B,CAAC;iBACxC;;;MCwEY,oBAAoB;IAyB/B,YAAoB,EAAqB;QAArB,OAAE,GAAF,EAAE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4BACjC,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAIU,EAAE;sBAAV,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,OAAO;sBAAf,KAAK;gBAE0B,UAAU;sBAAzC,SAAS;uBAAC,YAAY;gBAIS,UAAU;sBAAzC,SAAS;uBAAC,YAAY;;;MCpFZ,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAJb,oBAAoB,aACzB,YAAY,aACZ,oBAAoB;+GAEnB,iBAAiB,YAHnB,CAAC,YAAY,CAAC;2FAGZ,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,oBAAoB,CAAC;iBAChC;;;MCEY,SAAS;;sGAAT,SAAS;uGAAT,SAAS,YAHV,YAAY,aACZ,yBAAyB,EAAE,iBAAiB;uGAE3C,SAAS,YAHX,CAAC,YAAY,CAAC,EACb,yBAAyB,EAAE,iBAAiB;2FAE3C,SAAS;kBALrB,QAAQ;mBAAC;oBACR,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;iBACxD;;;ACTD;;;;;;"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, NgModule, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { RouterModule } from '@angular/router';
|
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { createDropdown } from '@sebgroup/extract';
|
|
9
|
+
|
|
10
|
+
class NggSegmentedControlComponent {
|
|
11
|
+
}
|
|
12
|
+
NggSegmentedControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
NggSegmentedControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggSegmentedControlComponent, selector: "ngg-segmented-control", inputs: { $controls: "$controls" }, ngImport: i0, template: `
|
|
14
|
+
<div class="group">
|
|
15
|
+
<a
|
|
16
|
+
*ngFor="let control of $controls | async"
|
|
17
|
+
[routerLink]="control.url"
|
|
18
|
+
routerLinkActive="active"
|
|
19
|
+
class="button"
|
|
20
|
+
>{{ control.text }}</a
|
|
21
|
+
>
|
|
22
|
+
</div>
|
|
23
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlComponent, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{
|
|
27
|
+
selector: 'ngg-segmented-control',
|
|
28
|
+
template: `
|
|
29
|
+
<div class="group">
|
|
30
|
+
<a
|
|
31
|
+
*ngFor="let control of $controls | async"
|
|
32
|
+
[routerLink]="control.url"
|
|
33
|
+
routerLinkActive="active"
|
|
34
|
+
class="button"
|
|
35
|
+
>{{ control.text }}</a
|
|
36
|
+
>
|
|
37
|
+
</div>
|
|
38
|
+
`,
|
|
39
|
+
styles: [],
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
}]
|
|
42
|
+
}], propDecorators: { $controls: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}] } });
|
|
45
|
+
|
|
46
|
+
class NggSegmentedControlModule {
|
|
47
|
+
}
|
|
48
|
+
NggSegmentedControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
49
|
+
NggSegmentedControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, declarations: [NggSegmentedControlComponent], imports: [RouterModule, CommonModule], exports: [NggSegmentedControlComponent] });
|
|
50
|
+
NggSegmentedControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, imports: [[RouterModule, CommonModule]] });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggSegmentedControlModule, decorators: [{
|
|
52
|
+
type: NgModule,
|
|
53
|
+
args: [{
|
|
54
|
+
declarations: [NggSegmentedControlComponent],
|
|
55
|
+
imports: [RouterModule, CommonModule],
|
|
56
|
+
exports: [NggSegmentedControlComponent],
|
|
57
|
+
}]
|
|
58
|
+
}] });
|
|
59
|
+
|
|
60
|
+
class NggDropdownComponent {
|
|
61
|
+
constructor(cd) {
|
|
62
|
+
this.cd = cd;
|
|
63
|
+
this.options = [];
|
|
64
|
+
this.value = undefined;
|
|
65
|
+
this.trackByKey = (index, option) => {
|
|
66
|
+
return option.key;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
ngAfterViewInit() {
|
|
70
|
+
if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {
|
|
71
|
+
this.handler = createDropdown(this.props, this.togglerRef.nativeElement, this.listboxRef.nativeElement, (dropdown) => {
|
|
72
|
+
this.dropdown = dropdown;
|
|
73
|
+
this.toggler = dropdown.elements.toggler;
|
|
74
|
+
this.listbox = dropdown.elements.listbox;
|
|
75
|
+
this.cd.detectChanges();
|
|
76
|
+
});
|
|
77
|
+
this.selectFromValue(this.value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
ngOnDestroy() {
|
|
81
|
+
this.handler?.destroy();
|
|
82
|
+
}
|
|
83
|
+
ngOnChanges() {
|
|
84
|
+
if (this.handler && this.dropdown) {
|
|
85
|
+
this.handler.update(this.props);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
writeValue(obj) {
|
|
89
|
+
this.value = obj;
|
|
90
|
+
this.selectFromValue(this.value);
|
|
91
|
+
}
|
|
92
|
+
registerOnChange(fn) {
|
|
93
|
+
this.onChangeFn = fn;
|
|
94
|
+
}
|
|
95
|
+
registerOnTouched(fn) {
|
|
96
|
+
this.onTouchedFn = fn;
|
|
97
|
+
}
|
|
98
|
+
select(option) {
|
|
99
|
+
this.handler?.select(option);
|
|
100
|
+
this.onChangeFn && this.onChangeFn(option.value);
|
|
101
|
+
this.onTouchedFn && this.onTouchedFn();
|
|
102
|
+
}
|
|
103
|
+
get props() {
|
|
104
|
+
return {
|
|
105
|
+
id: this.id,
|
|
106
|
+
text: this.text,
|
|
107
|
+
options: this.options,
|
|
108
|
+
loop: this.loop,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
selectFromValue(value) {
|
|
112
|
+
if (this.handler && value !== undefined) {
|
|
113
|
+
const option = this.handler.dropdown.options.find((option) => option.value === value);
|
|
114
|
+
if (option)
|
|
115
|
+
this.handler?.select(option);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
NggDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
+
NggDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.2", type: NggDropdownComponent, selector: "ngg-dropdown", inputs: { id: "id", text: "text", loop: "loop", options: "options" }, providers: [
|
|
121
|
+
{
|
|
122
|
+
provide: NG_VALUE_ACCESSOR,
|
|
123
|
+
useExisting: NggDropdownComponent,
|
|
124
|
+
multi: true,
|
|
125
|
+
},
|
|
126
|
+
], viewQueries: [{ propertyName: "togglerRef", first: true, predicate: ["togglerRef"], descendants: true }, { propertyName: "listboxRef", first: true, predicate: ["listboxRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
127
|
+
<div>
|
|
128
|
+
<button
|
|
129
|
+
#togglerRef
|
|
130
|
+
[id]="toggler?.attributes?.id"
|
|
131
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
132
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
133
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
134
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
135
|
+
[style]="toggler?.attributes?.style"
|
|
136
|
+
[class]="toggler?.classes"
|
|
137
|
+
(click)="handler?.toggle()"
|
|
138
|
+
>
|
|
139
|
+
{{ dropdown?.text }}
|
|
140
|
+
</button>
|
|
141
|
+
<div
|
|
142
|
+
#listboxRef
|
|
143
|
+
[id]="listbox?.attributes?.id"
|
|
144
|
+
[attr.role]="listbox?.attributes?.role"
|
|
145
|
+
[attr.aria-activedescendant]="
|
|
146
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
147
|
+
"
|
|
148
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
149
|
+
[style]="listbox?.attributes?.style"
|
|
150
|
+
[class]="listbox?.classes"
|
|
151
|
+
>
|
|
152
|
+
<button
|
|
153
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
154
|
+
(click)="handler?.close()"
|
|
155
|
+
>
|
|
156
|
+
<span class="sr-only">Close</span>
|
|
157
|
+
</button>
|
|
158
|
+
<ul role="listbox">
|
|
159
|
+
<li
|
|
160
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
161
|
+
[id]="option.attributes.id"
|
|
162
|
+
[attr.role]="option.attributes.role"
|
|
163
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
164
|
+
[style]="option.attributes.style"
|
|
165
|
+
[class]="option.classes"
|
|
166
|
+
(click)="select(option)"
|
|
167
|
+
>
|
|
168
|
+
{{ option.key }}
|
|
169
|
+
</li>
|
|
170
|
+
</ul>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownComponent, decorators: [{
|
|
175
|
+
type: Component,
|
|
176
|
+
args: [{
|
|
177
|
+
selector: 'ngg-dropdown',
|
|
178
|
+
template: `
|
|
179
|
+
<div>
|
|
180
|
+
<button
|
|
181
|
+
#togglerRef
|
|
182
|
+
[id]="toggler?.attributes?.id"
|
|
183
|
+
[attr.aria-haspopup]="toggler?.attributes?.['aria-haspopup']"
|
|
184
|
+
[attr.aria-expanded]="toggler?.attributes?.['aria-expanded']"
|
|
185
|
+
[attr.aria-owns]="toggler?.attributes?.['aria-owns']"
|
|
186
|
+
[tabindex]="toggler?.attributes?.tabIndex"
|
|
187
|
+
[style]="toggler?.attributes?.style"
|
|
188
|
+
[class]="toggler?.classes"
|
|
189
|
+
(click)="handler?.toggle()"
|
|
190
|
+
>
|
|
191
|
+
{{ dropdown?.text }}
|
|
192
|
+
</button>
|
|
193
|
+
<div
|
|
194
|
+
#listboxRef
|
|
195
|
+
[id]="listbox?.attributes?.id"
|
|
196
|
+
[attr.role]="listbox?.attributes?.role"
|
|
197
|
+
[attr.aria-activedescendant]="
|
|
198
|
+
listbox?.attributes?.['aria-activedescendant']
|
|
199
|
+
"
|
|
200
|
+
[tabindex]="listbox?.attributes?.tabIndex"
|
|
201
|
+
[style]="listbox?.attributes?.style"
|
|
202
|
+
[class]="listbox?.classes"
|
|
203
|
+
>
|
|
204
|
+
<button
|
|
205
|
+
class="close m-4 m-sm-2 d-block d-sm-none"
|
|
206
|
+
(click)="handler?.close()"
|
|
207
|
+
>
|
|
208
|
+
<span class="sr-only">Close</span>
|
|
209
|
+
</button>
|
|
210
|
+
<ul role="listbox">
|
|
211
|
+
<li
|
|
212
|
+
*ngFor="let option of dropdown?.options; trackBy: trackByKey"
|
|
213
|
+
[id]="option.attributes.id"
|
|
214
|
+
[attr.role]="option.attributes.role"
|
|
215
|
+
[attr.aria-selected]="option.attributes['aria-selected']"
|
|
216
|
+
[style]="option.attributes.style"
|
|
217
|
+
[class]="option.classes"
|
|
218
|
+
(click)="select(option)"
|
|
219
|
+
>
|
|
220
|
+
{{ option.key }}
|
|
221
|
+
</li>
|
|
222
|
+
</ul>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
`,
|
|
226
|
+
providers: [
|
|
227
|
+
{
|
|
228
|
+
provide: NG_VALUE_ACCESSOR,
|
|
229
|
+
useExisting: NggDropdownComponent,
|
|
230
|
+
multi: true,
|
|
231
|
+
},
|
|
232
|
+
],
|
|
233
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
234
|
+
}]
|
|
235
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { id: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], text: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], loop: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], options: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], togglerRef: [{
|
|
244
|
+
type: ViewChild,
|
|
245
|
+
args: ['togglerRef']
|
|
246
|
+
}], listboxRef: [{
|
|
247
|
+
type: ViewChild,
|
|
248
|
+
args: ['listboxRef']
|
|
249
|
+
}] } });
|
|
250
|
+
|
|
251
|
+
class NggDropdownModule {
|
|
252
|
+
}
|
|
253
|
+
NggDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
254
|
+
NggDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, declarations: [NggDropdownComponent], imports: [CommonModule], exports: [NggDropdownComponent] });
|
|
255
|
+
NggDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, imports: [[CommonModule]] });
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggDropdownModule, decorators: [{
|
|
257
|
+
type: NgModule,
|
|
258
|
+
args: [{
|
|
259
|
+
declarations: [NggDropdownComponent],
|
|
260
|
+
imports: [CommonModule],
|
|
261
|
+
exports: [NggDropdownComponent],
|
|
262
|
+
}]
|
|
263
|
+
}] });
|
|
264
|
+
|
|
265
|
+
class NggModule {
|
|
266
|
+
}
|
|
267
|
+
NggModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
268
|
+
NggModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [CommonModule], exports: [NggSegmentedControlModule, NggDropdownModule] });
|
|
269
|
+
NggModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, imports: [[CommonModule], NggSegmentedControlModule, NggDropdownModule] });
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NggModule, decorators: [{
|
|
271
|
+
type: NgModule,
|
|
272
|
+
args: [{
|
|
273
|
+
declarations: [],
|
|
274
|
+
imports: [CommonModule],
|
|
275
|
+
exports: [NggSegmentedControlModule, NggDropdownModule],
|
|
276
|
+
}]
|
|
277
|
+
}] });
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Generated bundle index. Do not edit.
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
export { NggDropdownComponent, NggDropdownModule, NggModule, NggSegmentedControlComponent, NggSegmentedControlModule };
|
|
284
|
+
//# sourceMappingURL=sebgroup-green-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sebgroup-green-angular.mjs","sources":["../../../../libs/angular/src/lib/segmented-control/segmented-control.component.ts","../../../../libs/angular/src/lib/segmented-control/segmented-control.module.ts","../../../../libs/angular/src/lib/dropdown/dropdown.component.ts","../../../../libs/angular/src/lib/dropdown/dropdown.module.ts","../../../../libs/angular/src/lib/green-angular.module.ts","../../../../libs/angular/src/sebgroup-green-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Input } from '@angular/core'\nimport { Observable } from 'rxjs'\nexport interface SegmentedControl {\n url: string\n text: Observable<string> | string\n}\n@Component({\n selector: 'ngg-segmented-control',\n template: `\n <div class=\"group\">\n <a\n *ngFor=\"let control of $controls | async\"\n [routerLink]=\"control.url\"\n routerLinkActive=\"active\"\n class=\"button\"\n >{{ control.text }}</a\n >\n </div>\n `,\n styles: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggSegmentedControlComponent {\n @Input() $controls: Observable<Array<SegmentedControl>> | undefined\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlComponent } from './segmented-control.component'\nimport { RouterModule } from '@angular/router'\n\n@NgModule({\n declarations: [NggSegmentedControlComponent],\n imports: [RouterModule, CommonModule],\n exports: [NggSegmentedControlComponent],\n})\nexport class NggSegmentedControlModule {}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport {\n createDropdown,\n AbstractDropdown,\n DropdownHandler,\n DropdownOption,\n ExtendedDropdownOption,\n ElementProps,\n DropdownArgs,\n} from '@sebgroup/extract'\n\n@Component({\n selector: 'ngg-dropdown',\n template: `\n <div>\n <button\n #togglerRef\n [id]=\"toggler?.attributes?.id\"\n [attr.aria-haspopup]=\"toggler?.attributes?.['aria-haspopup']\"\n [attr.aria-expanded]=\"toggler?.attributes?.['aria-expanded']\"\n [attr.aria-owns]=\"toggler?.attributes?.['aria-owns']\"\n [tabindex]=\"toggler?.attributes?.tabIndex\"\n [style]=\"toggler?.attributes?.style\"\n [class]=\"toggler?.classes\"\n (click)=\"handler?.toggle()\"\n >\n {{ dropdown?.text }}\n </button>\n <div\n #listboxRef\n [id]=\"listbox?.attributes?.id\"\n [attr.role]=\"listbox?.attributes?.role\"\n [attr.aria-activedescendant]=\"\n listbox?.attributes?.['aria-activedescendant']\n \"\n [tabindex]=\"listbox?.attributes?.tabIndex\"\n [style]=\"listbox?.attributes?.style\"\n [class]=\"listbox?.classes\"\n >\n <button\n class=\"close m-4 m-sm-2 d-block d-sm-none\"\n (click)=\"handler?.close()\"\n >\n <span class=\"sr-only\">Close</span>\n </button>\n <ul role=\"listbox\">\n <li\n *ngFor=\"let option of dropdown?.options; trackBy: trackByKey\"\n [id]=\"option.attributes.id\"\n [attr.role]=\"option.attributes.role\"\n [attr.aria-selected]=\"option.attributes['aria-selected']\"\n [style]=\"option.attributes.style\"\n [class]=\"option.classes\"\n (click)=\"select(option)\"\n >\n {{ option.key }}\n </li>\n </ul>\n </div>\n </div>\n `,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: NggDropdownComponent,\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NggDropdownComponent\n implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges\n{\n @Input() id?: string\n @Input() text?: string\n @Input() loop?: boolean\n @Input() options: DropdownOption[] = []\n\n @ViewChild('togglerRef') public togglerRef:\n | ElementRef<HTMLElement>\n | undefined\n\n @ViewChild('listboxRef') public listboxRef:\n | ElementRef<HTMLElement>\n | undefined\n\n value: any = undefined\n onChangeFn?: any\n onTouchedFn?: any\n\n dropdown?: AbstractDropdown\n handler?: DropdownHandler\n toggler?: Partial<ElementProps>\n listbox?: Partial<ElementProps>\n\n constructor(private cd: ChangeDetectorRef) {}\n\n ngAfterViewInit(): void {\n if (this.togglerRef?.nativeElement && this.listboxRef?.nativeElement) {\n this.handler = createDropdown(\n this.props,\n this.togglerRef.nativeElement,\n this.listboxRef.nativeElement,\n (dropdown) => {\n this.dropdown = dropdown\n this.toggler = dropdown.elements.toggler\n this.listbox = dropdown.elements.listbox\n this.cd.detectChanges()\n }\n )\n\n this.selectFromValue(this.value)\n }\n }\n\n ngOnDestroy(): void {\n this.handler?.destroy()\n }\n\n ngOnChanges(): void {\n if (this.handler && this.dropdown) {\n this.handler.update(this.props)\n }\n }\n\n writeValue(obj: any): void {\n this.value = obj\n this.selectFromValue(this.value)\n }\n\n registerOnChange(fn: any): void {\n this.onChangeFn = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouchedFn = fn\n }\n\n select(option: ExtendedDropdownOption) {\n this.handler?.select(option)\n this.onChangeFn && this.onChangeFn(option.value)\n this.onTouchedFn && this.onTouchedFn()\n }\n\n trackByKey = (index: number, option: ExtendedDropdownOption): string => {\n return option.key\n }\n\n private get props(): DropdownArgs {\n return {\n id: this.id,\n text: this.text,\n options: this.options,\n loop: this.loop,\n }\n }\n\n private selectFromValue(value: any) {\n if (this.handler && value !== undefined) {\n const option = this.handler.dropdown.options.find(\n (option) => option.value === value\n )\n if (option) this.handler?.select(option)\n }\n }\n}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggDropdownComponent } from './dropdown.component'\n\n@NgModule({\n declarations: [NggDropdownComponent],\n imports: [CommonModule],\n exports: [NggDropdownComponent],\n})\nexport class NggDropdownModule {}\n","import { NgModule } from '@angular/core'\nimport { CommonModule } from '@angular/common'\nimport { NggSegmentedControlModule } from './segmented-control/segmented-control.module'\nimport { NggDropdownModule } from './dropdown/dropdown.module'\n\n@NgModule({\n declarations: [],\n imports: [CommonModule],\n exports: [NggSegmentedControlModule, NggDropdownModule],\n})\nexport class NggModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAsBa,4BAA4B;;yHAA5B,4BAA4B;6GAA5B,4BAA4B,iGAd7B;;;;;;;;;;GAUT;2FAIU,4BAA4B;kBAhBxC,SAAS;mBAAC;oBACT,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE;;;;;;;;;;GAUT;oBACD,MAAM,EAAE,EAAE;oBACV,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAEU,SAAS;sBAAjB,KAAK;;;MCbK,yBAAyB;;sHAAzB,yBAAyB;uHAAzB,yBAAyB,iBAJrB,4BAA4B,aACjC,YAAY,EAAE,YAAY,aAC1B,4BAA4B;uHAE3B,yBAAyB,YAH3B,CAAC,YAAY,EAAE,YAAY,CAAC;2FAG1B,yBAAyB;kBALrC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,4BAA4B,CAAC;oBAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,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;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,sBAAsB;4BACjC,KAAK,EAAE,IAAI;yBACZ;qBACF;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAIU,EAAE;sBAAV,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,IAAI;sBAAZ,KAAK;gBACG,OAAO;sBAAf,KAAK;gBAE0B,UAAU;sBAAzC,SAAS;uBAAC,YAAY;gBAIS,UAAU;sBAAzC,SAAS;uBAAC,YAAY;;;MCpFZ,iBAAiB;;8GAAjB,iBAAiB;+GAAjB,iBAAiB,iBAJb,oBAAoB,aACzB,YAAY,aACZ,oBAAoB;+GAEnB,iBAAiB,YAHnB,CAAC,YAAY,CAAC;2FAGZ,iBAAiB;kBAL7B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,oBAAoB,CAAC;iBAChC;;;MCEY,SAAS;;sGAAT,SAAS;uGAAT,SAAS,YAHV,YAAY,aACZ,yBAAyB,EAAE,iBAAiB;uGAE3C,SAAS,YAHX,CAAC,YAAY,CAAC,EACb,yBAAyB,EAAE,iBAAiB;2FAE3C,SAAS;kBALrB,QAAQ;mBAAC;oBACR,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,yBAAyB,EAAE,iBAAiB,CAAC;iBACxD;;;ACTD;;;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './lib/green-angular.module';
|
|
2
|
+
export * from './lib/dropdown/dropdown.module';
|
|
3
|
+
export * from './lib/dropdown/dropdown.component';
|
|
4
|
+
export * from './lib/segmented-control/segmented-control.module';
|
|
5
|
+
export * from './lib/segmented-control/segmented-control.component';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import { AbstractDropdown, DropdownHandler, DropdownOption, ExtendedDropdownOption, ElementProps } from '@sebgroup/extract';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class NggDropdownComponent implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges {
|
|
6
|
+
private cd;
|
|
7
|
+
id?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
options: DropdownOption[];
|
|
11
|
+
togglerRef: ElementRef<HTMLElement> | undefined;
|
|
12
|
+
listboxRef: ElementRef<HTMLElement> | undefined;
|
|
13
|
+
value: any;
|
|
14
|
+
onChangeFn?: any;
|
|
15
|
+
onTouchedFn?: any;
|
|
16
|
+
dropdown?: AbstractDropdown;
|
|
17
|
+
handler?: DropdownHandler;
|
|
18
|
+
toggler?: Partial<ElementProps>;
|
|
19
|
+
listbox?: Partial<ElementProps>;
|
|
20
|
+
constructor(cd: ChangeDetectorRef);
|
|
21
|
+
ngAfterViewInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
ngOnChanges(): void;
|
|
24
|
+
writeValue(obj: any): void;
|
|
25
|
+
registerOnChange(fn: any): void;
|
|
26
|
+
registerOnTouched(fn: any): void;
|
|
27
|
+
select(option: ExtendedDropdownOption): void;
|
|
28
|
+
trackByKey: (index: number, option: ExtendedDropdownOption) => string;
|
|
29
|
+
private get props();
|
|
30
|
+
private selectFromValue;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NggDropdownComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NggDropdownComponent, "ngg-dropdown", never, { "id": "id"; "text": "text"; "loop": "loop"; "options": "options"; }, {}, never, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./dropdown.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class NggDropdownModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NggDropdownModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NggDropdownModule, [typeof i1.NggDropdownComponent], [typeof i2.CommonModule], [typeof i1.NggDropdownComponent]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NggDropdownModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "./segmented-control/segmented-control.module";
|
|
4
|
+
import * as i3 from "./dropdown/dropdown.module";
|
|
5
|
+
export declare class NggModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NggModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NggModule, never, [typeof i1.CommonModule], [typeof i2.NggSegmentedControlModule, typeof i3.NggDropdownModule]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NggModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface SegmentedControl {
|
|
4
|
+
url: string;
|
|
5
|
+
text: Observable<string> | string;
|
|
6
|
+
}
|
|
7
|
+
export declare class NggSegmentedControlComponent {
|
|
8
|
+
$controls: Observable<Array<SegmentedControl>> | undefined;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NggSegmentedControlComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NggSegmentedControlComponent, "ngg-segmented-control", never, { "$controls": "$controls"; }, {}, never, never>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./segmented-control.component";
|
|
3
|
+
import * as i2 from "@angular/router";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
export declare class NggSegmentedControlModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NggSegmentedControlModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NggSegmentedControlModule, [typeof i1.NggSegmentedControlComponent], [typeof i2.RouterModule, typeof i3.CommonModule], [typeof i1.NggSegmentedControlComponent]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NggSegmentedControlModule>;
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-angular",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^13.0.0",
|
|
6
|
+
"@angular/core": "^13.0.0",
|
|
7
|
+
"rxjs": "^6.6.7",
|
|
8
|
+
"@angular/forms": "^13.0.0",
|
|
9
|
+
"@angular/platform-browser": "^13.0.0",
|
|
10
|
+
"@angular/router": "^13.0.0"
|
|
7
11
|
},
|
|
8
12
|
"dependencies": {
|
|
9
|
-
"
|
|
10
|
-
"@sebgroup/
|
|
13
|
+
"@sebgroup/chlorophyll": "^1.0.0-beta.4",
|
|
14
|
+
"@sebgroup/extract": "^1.0.0-beta.4",
|
|
15
|
+
"tslib": "^2.3.1"
|
|
11
16
|
},
|
|
12
17
|
"description": "Angular components built on top of @sebgroup/chlorophyll.",
|
|
13
18
|
"repository": {
|
|
@@ -24,5 +29,25 @@
|
|
|
24
29
|
"bugs": {
|
|
25
30
|
"url": "https://github.com/sebgroup/green/labels/angular"
|
|
26
31
|
},
|
|
27
|
-
"homepage": "https://sebgroup.github.io/green/latest/angular/"
|
|
32
|
+
"homepage": "https://sebgroup.github.io/green/latest/angular/",
|
|
33
|
+
"module": "fesm2015/sebgroup-green-angular.mjs",
|
|
34
|
+
"es2020": "fesm2020/sebgroup-green-angular.mjs",
|
|
35
|
+
"esm2020": "esm2020/sebgroup-green-angular.mjs",
|
|
36
|
+
"fesm2020": "fesm2020/sebgroup-green-angular.mjs",
|
|
37
|
+
"fesm2015": "fesm2015/sebgroup-green-angular.mjs",
|
|
38
|
+
"typings": "sebgroup-green-angular.d.ts",
|
|
39
|
+
"exports": {
|
|
40
|
+
"./package.json": {
|
|
41
|
+
"default": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./sebgroup-green-angular.d.ts",
|
|
45
|
+
"esm2020": "./esm2020/sebgroup-green-angular.mjs",
|
|
46
|
+
"es2020": "./fesm2020/sebgroup-green-angular.mjs",
|
|
47
|
+
"es2015": "./fesm2015/sebgroup-green-angular.mjs",
|
|
48
|
+
"node": "./fesm2015/sebgroup-green-angular.mjs",
|
|
49
|
+
"default": "./fesm2020/sebgroup-green-angular.mjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"sideEffects": false
|
|
28
53
|
}
|