@patter/ngx-components 0.0.1 → 0.5.1
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 +24 -24
- package/esm2022/lib/forms/form/form.component.mjs +87 -0
- package/esm2022/lib/forms/interfaces.mjs +2 -0
- package/esm2022/lib/menu/menu.component.mjs +15 -8
- package/esm2022/lib/ptr-title/ptr-title.component.mjs +42 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/patter-ngx-components.mjs +135 -7
- package/fesm2022/patter-ngx-components.mjs.map +1 -1
- package/lib/forms/form/form.component.d.ts +20 -0
- package/lib/forms/interfaces.d.ts +27 -0
- package/lib/menu/menu.component.d.ts +9 -3
- package/lib/ptr-title/ptr-title.component.d.ts +14 -0
- package/package.json +1 -1
- package/patter-ngx-components-0.5.1.tgz +0 -0
- package/public-api.d.ts +3 -0
- package/patter-ngx-components-0.0.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# NgxComponents
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.1.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project ngx-components` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-components`.
|
|
8
|
-
> Note: Don't forget to add `--project ngx-components` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build ngx-components` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build ngx-components`, go to the dist folder `cd dist/ngx-components` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test ngx-components` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
1
|
+
# NgxComponents
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project ngx-components` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-components`.
|
|
8
|
+
> Note: Don't forget to add `--project ngx-components` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build ngx-components` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build ngx-components`, go to the dist folder `cd dist/ngx-components` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test ngx-components` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, inject, Input, Output } from '@angular/core';
|
|
3
|
+
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import * as i2 from "@angular/forms";
|
|
7
|
+
export class PtrFormComponent {
|
|
8
|
+
config;
|
|
9
|
+
loading = false;
|
|
10
|
+
formChanges = new EventEmitter();
|
|
11
|
+
formSubmit = new EventEmitter();
|
|
12
|
+
form;
|
|
13
|
+
processedFields = [];
|
|
14
|
+
fb = inject(FormBuilder);
|
|
15
|
+
cdr = inject(ChangeDetectorRef);
|
|
16
|
+
ngOnInit() {
|
|
17
|
+
this.form = this.fb.group({});
|
|
18
|
+
this.processedFields = this.config.fields.map(field => this.processField(field));
|
|
19
|
+
this.processedFields.forEach(field => {
|
|
20
|
+
if (field.type === 'select') {
|
|
21
|
+
if (field.simpleOptions) {
|
|
22
|
+
this.form.addControl(field.id, this.fb.control(field.value ?? field.simpleOptions[0].value ?? null, field.required ? Validators.required : null));
|
|
23
|
+
}
|
|
24
|
+
else if (field.groupedOptions) {
|
|
25
|
+
this.form.addControl(field.id, this.fb.control(field.value || field.groupedOptions[0].options[0].value, field.required ? Validators.required : null));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
this.form.valueChanges.subscribe(values => {
|
|
36
|
+
this.formChanges.emit(values);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
processField(field) {
|
|
40
|
+
const classes = ['gfield'];
|
|
41
|
+
if (field.size)
|
|
42
|
+
classes.push(`gfield--width-${field.size}`);
|
|
43
|
+
if (field.type === 'hidden')
|
|
44
|
+
classes.push('gform_hidden');
|
|
45
|
+
if (field.class)
|
|
46
|
+
classes.push(field.class);
|
|
47
|
+
return {
|
|
48
|
+
...field,
|
|
49
|
+
class: classes.join(' ')
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
onSubmit() {
|
|
53
|
+
if (this.form.valid) {
|
|
54
|
+
this.formSubmit.emit(this.form.value);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log('Form is invalid');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
resetForm() {
|
|
61
|
+
if (this.form) {
|
|
62
|
+
this.form.reset();
|
|
63
|
+
this.config.fields.forEach(field => {
|
|
64
|
+
this.form.get(field.id)?.setValue(field.value || null);
|
|
65
|
+
});
|
|
66
|
+
this.cdr.markForCheck();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
70
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrFormComponent, isStandalone: true, selector: "ptr-form", inputs: { config: "config", loading: "loading" }, outputs: { formChanges: "formChanges", formSubmit: "formSubmit" }, ngImport: i0, template: "<div [class]=\"'gform_wrapper ' + (config.formClass || 'small-section')\">\r\n <div *ngIf=\"config.title\" class=\"gform_heading\">\r\n <h2 class=\"gform_title\">{{ config.title }}</h2>\r\n </div>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"gform_fields\">\r\n\r\n <ng-container *ngFor=\"let field of processedFields\">\r\n\r\n <div [class]=\"field.class\">\r\n <label *ngIf=\"field.type !== 'hidden'\" [for]=\"field.id\" class=\"gfield_label gform-field-label\">\r\n {{ field.name }}\r\n </label>\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"field.id\" [formControlName]=\"field.id\"></textarea>\r\n\r\n <select *ngSwitchCase=\"'select'\" [id]=\"field.id\" [formControlName]=\"field.id\">\r\n <ng-container *ngIf=\"field.simpleOptions\">\r\n <option *ngFor=\"let option of field.simpleOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </ng-container>\r\n <ng-container *ngIf=\"field.groupedOptions\">\r\n <optgroup *ngFor=\"let group of field.groupedOptions\" [label]=\"group.label\">\r\n <option *ngFor=\"let option of group.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </optgroup>\r\n </ng-container>\r\n </select>\r\n\r\n <input *ngSwitchDefault [type]=\"field.type\" [id]=\"field.id\" [formControlName]=\"field.id\"\r\n [attr.maxlength]=\"field.maxlength\">\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n <div class=\"gform_footer\">\r\n <button type=\"submit\" [name]=\"config.submitName\"\r\n [disabled]=\"loading || !form.valid\">{{config.submitValue}}</button>\r\n </div>\r\n </form>\r\n\r\n <ng-content></ng-content>\r\n\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrFormComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{ selector: 'ptr-form', standalone: true, imports: [
|
|
75
|
+
CommonModule,
|
|
76
|
+
ReactiveFormsModule
|
|
77
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'gform_wrapper ' + (config.formClass || 'small-section')\">\r\n <div *ngIf=\"config.title\" class=\"gform_heading\">\r\n <h2 class=\"gform_title\">{{ config.title }}</h2>\r\n </div>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"gform_fields\">\r\n\r\n <ng-container *ngFor=\"let field of processedFields\">\r\n\r\n <div [class]=\"field.class\">\r\n <label *ngIf=\"field.type !== 'hidden'\" [for]=\"field.id\" class=\"gfield_label gform-field-label\">\r\n {{ field.name }}\r\n </label>\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"field.id\" [formControlName]=\"field.id\"></textarea>\r\n\r\n <select *ngSwitchCase=\"'select'\" [id]=\"field.id\" [formControlName]=\"field.id\">\r\n <ng-container *ngIf=\"field.simpleOptions\">\r\n <option *ngFor=\"let option of field.simpleOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </ng-container>\r\n <ng-container *ngIf=\"field.groupedOptions\">\r\n <optgroup *ngFor=\"let group of field.groupedOptions\" [label]=\"group.label\">\r\n <option *ngFor=\"let option of group.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </optgroup>\r\n </ng-container>\r\n </select>\r\n\r\n <input *ngSwitchDefault [type]=\"field.type\" [id]=\"field.id\" [formControlName]=\"field.id\"\r\n [attr.maxlength]=\"field.maxlength\">\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n <div class=\"gform_footer\">\r\n <button type=\"submit\" [name]=\"config.submitName\"\r\n [disabled]=\"loading || !form.valid\">{{config.submitValue}}</button>\r\n </div>\r\n </form>\r\n\r\n <ng-content></ng-content>\r\n\r\n</div>" }]
|
|
78
|
+
}], propDecorators: { config: [{
|
|
79
|
+
type: Input
|
|
80
|
+
}], loading: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], formChanges: [{
|
|
83
|
+
type: Output
|
|
84
|
+
}], formSubmit: [{
|
|
85
|
+
type: Output
|
|
86
|
+
}] } });
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9wYXR0ZXIvbmd4LWNvbXBvbmVudHMvc3JjL2xpYi9mb3Jtcy9mb3JtL2Zvcm0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGF0dGVyL25neC1jb21wb25lbnRzL3NyYy9saWIvZm9ybXMvZm9ybS9mb3JtLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsdUJBQXVCL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B8ICdoYWxmJyB8ICd0aGlyZCc7XHJcbiAgdmFsdWU/OiBzdHJpbmc7XHJcbiAgY2xhc3M/OiBzdHJpbmc7XHJcbiAgbWF4bGVuZ3RoPzogbnVtYmVyO1xyXG59XHJcblxyXG5leHBvcnQgaW50ZXJmYWNlIFB0ckZvcm1Db25maWcge1xyXG4gIHRpdGxlPzogc3RyaW5nO1xyXG4gIGZpZWxkczogUHRyRm9ybUZpZWxkQ29uZmlnW107XHJcbiAgc3VibWl0TmFtZTogc3RyaW5nO1xyXG4gIHN1Ym1pdFZhbHVlOiBzdHJpbmc7XHJcbiAgZm9ybUNsYXNzPzogc3RyaW5nO1xyXG59Il19
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
3
|
+
import { RouterModule } from '@angular/router';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import * as i1 from "@angular/common";
|
|
6
|
+
import * as i2 from "@angular/router";
|
|
7
|
+
export class PtrMenuComponent {
|
|
8
|
+
menuItems = [];
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrMenuComponent, isStandalone: true, selector: "ptr-menu", inputs: { menuItems: "menuItems" }, ngImport: i0, template: "<nav class=\"ptr-menu\">\r\n <ul class=\"menu\">\r\n <li class=\"menu-item\" *ngFor=\"let item of menuItems\" routerLinkActive=\"current_page_item\"\r\n [routerLinkActiveOptions]=\"{exact: true}\">\r\n <a [routerLink]=\"item.link || '#'\">{{item.label}}</a>\r\n </li>\r\n </ul>\r\n</nav>\r\n", styles: [".menu{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu>ul{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu--vertical{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu--vertical>ul{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu li.current-menu-item>a,.menu li.current_page_item>a,.menu li.current-menu-parent>a{opacity:1;font-weight:700}.menu a{transition:color .33s}.menu a:hover,.menu a:focus{text-decoration:none}.menu a{position:relative;text-decoration:none;padding:8px 0;font-family:var(--wp--preset--font-family--heading-font);letter-spacing:-.72px;color:var(--ptr-menu-color, var(--wp--preset--color--black))}.menu a:before,.menu a:after{content:\"\";position:absolute;bottom:2px;left:0;right:0;height:2px;background-color:var(--wp--preset--color--primary)}.menu a:before{opacity:0;transform:translateY(-8px);transition:transform 0s cubic-bezier(.175,.885,.32,1.275),opacity 0s}.menu a:after{opacity:0;transform:translateY(4px);transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:before,.menu a:hover:after,.menu a:focus:before,.menu a:focus:after{opacity:1;transform:translateY(0)}.menu a:hover:before,.menu a:focus:before{transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:after,.menu a:focus:after{transition:transform 0s .2s cubic-bezier(.175,.885,.32,1.275),opacity 0s .2s}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6
11
|
}
|
|
7
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type:
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrMenuComponent, decorators: [{
|
|
8
13
|
type: Component,
|
|
9
|
-
args: [{ selector: 'ptr-menu', standalone: true, imports: [], template: "<
|
|
10
|
-
}]
|
|
11
|
-
|
|
14
|
+
args: [{ selector: 'ptr-menu', standalone: true, imports: [CommonModule, RouterModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav class=\"ptr-menu\">\r\n <ul class=\"menu\">\r\n <li class=\"menu-item\" *ngFor=\"let item of menuItems\" routerLinkActive=\"current_page_item\"\r\n [routerLinkActiveOptions]=\"{exact: true}\">\r\n <a [routerLink]=\"item.link || '#'\">{{item.label}}</a>\r\n </li>\r\n </ul>\r\n</nav>\r\n", styles: [".menu{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu>ul{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu--vertical{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu--vertical>ul{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu li.current-menu-item>a,.menu li.current_page_item>a,.menu li.current-menu-parent>a{opacity:1;font-weight:700}.menu a{transition:color .33s}.menu a:hover,.menu a:focus{text-decoration:none}.menu a{position:relative;text-decoration:none;padding:8px 0;font-family:var(--wp--preset--font-family--heading-font);letter-spacing:-.72px;color:var(--ptr-menu-color, var(--wp--preset--color--black))}.menu a:before,.menu a:after{content:\"\";position:absolute;bottom:2px;left:0;right:0;height:2px;background-color:var(--wp--preset--color--primary)}.menu a:before{opacity:0;transform:translateY(-8px);transition:transform 0s cubic-bezier(.175,.885,.32,1.275),opacity 0s}.menu a:after{opacity:0;transform:translateY(4px);transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:before,.menu a:hover:after,.menu a:focus:before,.menu a:focus:after{opacity:1;transform:translateY(0)}.menu a:hover:before,.menu a:focus:before{transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:after,.menu a:focus:after{transition:transform 0s .2s cubic-bezier(.175,.885,.32,1.275),opacity 0s .2s}\n"] }]
|
|
15
|
+
}], propDecorators: { menuItems: [{
|
|
16
|
+
type: Input
|
|
17
|
+
}] } });
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9wYXR0ZXIvbmd4LWNvbXBvbmVudHMvc3JjL2xpYi9tZW51L21lbnUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGF0dGVyL25neC1jb21wb25lbnRzL3NyYy9saWIvbWVudS9tZW51LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMxRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7Ozs7QUFnQi9DLE1BQU0sT0FBTyxnQkFBZ0I7SUFFbEIsU0FBUyxHQUFrQixFQUFFLENBQUM7dUdBRjVCLGdCQUFnQjsyRkFBaEIsZ0JBQWdCLHdHQ2xCN0IsdVRBUUEsb2xEREtZLFlB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mF2IGNsYXNzPVwicHRyLW1lbnVcIj5cclxuICA8dWwgY2xhc3M9XCJtZW51XCI+XHJcbiAgICA8bGkgY2xhc3M9XCJtZW51LWl0ZW1cIiAqbmdGb3I9XCJsZXQgaXRlbSBvZiBtZW51SXRlbXNcIiByb3V0ZXJMaW5rQWN0aXZlPVwiY3VycmVudF9wYWdlX2l0ZW1cIlxyXG4gICAgICBbcm91dGVyTGlua0FjdGl2ZU9wdGlvbnNdPVwie2V4YWN0OiB0cnVlfVwiPlxyXG4gICAgICA8YSBbcm91dGVyTGlua109XCJpdGVtLmxpbmsgfHwgJyMnXCI+e3tpdGVtLmxhYmVsfX08L2E+XHJcbiAgICA8L2xpPlxyXG4gIDwvdWw+XHJcbjwvbmF2PlxyXG4iXX0=
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
3
|
+
import { ActivatedRoute, NavigationEnd, Router, TitleStrategy } from '@angular/router';
|
|
4
|
+
import { filter, map } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "@angular/common";
|
|
7
|
+
export class PtrTitleComponent {
|
|
8
|
+
router = inject(Router);
|
|
9
|
+
activatedRoute = inject(ActivatedRoute);
|
|
10
|
+
titleStrategy = inject(TitleStrategy);
|
|
11
|
+
title$;
|
|
12
|
+
hideTitle$;
|
|
13
|
+
ngOnInit() {
|
|
14
|
+
const routeEvents$ = this.router.events.pipe(filter((event) => event instanceof NavigationEnd), map(() => this.getRoute(this.activatedRoute)));
|
|
15
|
+
this.hideTitle$ = routeEvents$.pipe(map(route => !!route.snapshot.data['hideTitle']));
|
|
16
|
+
this.title$ = routeEvents$.pipe(map(route => {
|
|
17
|
+
if (route.snapshot.data['hideTitle']) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
return this.titleStrategy.getResolvedTitleForRoute(route.snapshot) || '';
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
getRoute(route) {
|
|
24
|
+
while (route.firstChild) {
|
|
25
|
+
route = route.firstChild;
|
|
26
|
+
}
|
|
27
|
+
return route;
|
|
28
|
+
}
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrTitleComponent, isStandalone: true, selector: "ptr-title", ngImport: i0, template: '<header class="entry-header is-layout-constrained my-3" *ngIf="!(hideTitle$ | async)"><h1 class="entry-title">{{ title$ | async }}</h1></header>', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrTitleComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: 'ptr-title',
|
|
36
|
+
standalone: true,
|
|
37
|
+
imports: [CommonModule],
|
|
38
|
+
template: '<header class="entry-header is-layout-constrained my-3" *ngIf="!(hideTitle$ | async)"><h1 class="entry-title">{{ title$ | async }}</h1></header>',
|
|
39
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
40
|
+
}]
|
|
41
|
+
}] });
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHRyLXRpdGxlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Bhd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gICAgICByb3V0ZSA9IHJvdXRlLmZpcnN0Q2hpbGQ7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gcm91dGU7XHJcbiAgfVxyXG5cclxufVxyXG4iXX0=
|
package/esm2022/public-api.mjs
CHANGED
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
* Public API Surface of ngx-components
|
|
3
3
|
*/
|
|
4
4
|
export * from './lib/menu/menu.component';
|
|
5
|
-
|
|
5
|
+
export * from './lib/forms/interfaces';
|
|
6
|
+
export { PtrFormComponent } from './lib/forms/form/form.component';
|
|
7
|
+
export { PtrTitleComponent } from './lib/ptr-title/ptr-title.component';
|
|
8
|
+
// export { PtrTitleStrategy } from './lib/ptr-title/ptr-title-strategy';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3BhdHRlci9uZ3gtY29tcG9uZW50cy9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsMkJBQTJCLENBQUM7QUFFMUMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVuRSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUN4RSx5RUFBeUUiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygbmd4LWNvbXBvbmVudHNcclxuICovXHJcblxyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9tZW51L21lbnUuY29tcG9uZW50JztcclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2Zvcm1zL2ludGVyZmFjZXMnO1xyXG5leHBvcnQgeyBQdHJGb3JtQ29tcG9uZW50IH0gZnJvbSAnLi9saWIvZm9ybXMvZm9ybS9mb3JtLmNvbXBvbmVudCc7XHJcblxyXG5leHBvcnQgeyBQdHJUaXRsZUNvbXBvbmVudCB9IGZyb20gJy4vbGliL3B0ci10aXRsZS9wdHItdGl0bGUuY29tcG9uZW50JztcclxuLy8gZXhwb3J0IHsgUHRyVGl0bGVTdHJhdGVneSB9IGZyb20gJy4vbGliL3B0ci10aXRsZS9wdHItdGl0bGUtc3RyYXRlZ3knOyJdfQ==
|
|
@@ -1,22 +1,150 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component } from '@angular/core';
|
|
4
|
+
import { Component, ChangeDetectionStrategy, Input, EventEmitter, inject, ChangeDetectorRef, Output } from '@angular/core';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { RouterModule, Router, ActivatedRoute, TitleStrategy, NavigationEnd } from '@angular/router';
|
|
7
|
+
import * as i2$1 from '@angular/forms';
|
|
8
|
+
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { filter, map } from 'rxjs';
|
|
3
10
|
|
|
4
|
-
class
|
|
5
|
-
|
|
6
|
-
static
|
|
11
|
+
class PtrMenuComponent {
|
|
12
|
+
menuItems = [];
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrMenuComponent, isStandalone: true, selector: "ptr-menu", inputs: { menuItems: "menuItems" }, ngImport: i0, template: "<nav class=\"ptr-menu\">\r\n <ul class=\"menu\">\r\n <li class=\"menu-item\" *ngFor=\"let item of menuItems\" routerLinkActive=\"current_page_item\"\r\n [routerLinkActiveOptions]=\"{exact: true}\">\r\n <a [routerLink]=\"item.link || '#'\">{{item.label}}</a>\r\n </li>\r\n </ul>\r\n</nav>\r\n", styles: [".menu{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu>ul{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu--vertical{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu--vertical>ul{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu li.current-menu-item>a,.menu li.current_page_item>a,.menu li.current-menu-parent>a{opacity:1;font-weight:700}.menu a{transition:color .33s}.menu a:hover,.menu a:focus{text-decoration:none}.menu a{position:relative;text-decoration:none;padding:8px 0;font-family:var(--wp--preset--font-family--heading-font);letter-spacing:-.72px;color:var(--ptr-menu-color, var(--wp--preset--color--black))}.menu a:before,.menu a:after{content:\"\";position:absolute;bottom:2px;left:0;right:0;height:2px;background-color:var(--wp--preset--color--primary)}.menu a:before{opacity:0;transform:translateY(-8px);transition:transform 0s cubic-bezier(.175,.885,.32,1.275),opacity 0s}.menu a:after{opacity:0;transform:translateY(4px);transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:before,.menu a:hover:after,.menu a:focus:before,.menu a:focus:after{opacity:1;transform:translateY(0)}.menu a:hover:before,.menu a:focus:before{transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:after,.menu a:focus:after{transition:transform 0s .2s cubic-bezier(.175,.885,.32,1.275),opacity 0s .2s}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7
15
|
}
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type:
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrMenuComponent, decorators: [{
|
|
9
17
|
type: Component,
|
|
10
|
-
args: [{ selector: 'ptr-menu', standalone: true, imports: [], template: "<
|
|
18
|
+
args: [{ selector: 'ptr-menu', standalone: true, imports: [CommonModule, RouterModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav class=\"ptr-menu\">\r\n <ul class=\"menu\">\r\n <li class=\"menu-item\" *ngFor=\"let item of menuItems\" routerLinkActive=\"current_page_item\"\r\n [routerLinkActiveOptions]=\"{exact: true}\">\r\n <a [routerLink]=\"item.link || '#'\">{{item.label}}</a>\r\n </li>\r\n </ul>\r\n</nav>\r\n", styles: [".menu{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu>ul{display:flex;flex-direction:row;gap:var(--wp--custom--content--gap, 40px);align-items:center}.menu--vertical{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu--vertical>ul{flex-direction:column;align-items:flex-start;gap:calc(var(--wp--custom--content--gap, 40px) / 2)}.menu li.current-menu-item>a,.menu li.current_page_item>a,.menu li.current-menu-parent>a{opacity:1;font-weight:700}.menu a{transition:color .33s}.menu a:hover,.menu a:focus{text-decoration:none}.menu a{position:relative;text-decoration:none;padding:8px 0;font-family:var(--wp--preset--font-family--heading-font);letter-spacing:-.72px;color:var(--ptr-menu-color, var(--wp--preset--color--black))}.menu a:before,.menu a:after{content:\"\";position:absolute;bottom:2px;left:0;right:0;height:2px;background-color:var(--wp--preset--color--primary)}.menu a:before{opacity:0;transform:translateY(-8px);transition:transform 0s cubic-bezier(.175,.885,.32,1.275),opacity 0s}.menu a:after{opacity:0;transform:translateY(4px);transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:before,.menu a:hover:after,.menu a:focus:before,.menu a:focus:after{opacity:1;transform:translateY(0)}.menu a:hover:before,.menu a:focus:before{transition:transform .2s cubic-bezier(.175,.885,.32,1.275),opacity .2s}.menu a:hover:after,.menu a:focus:after{transition:transform 0s .2s cubic-bezier(.175,.885,.32,1.275),opacity 0s .2s}\n"] }]
|
|
19
|
+
}], propDecorators: { menuItems: [{
|
|
20
|
+
type: Input
|
|
21
|
+
}] } });
|
|
22
|
+
|
|
23
|
+
class PtrFormComponent {
|
|
24
|
+
config;
|
|
25
|
+
loading = false;
|
|
26
|
+
formChanges = new EventEmitter();
|
|
27
|
+
formSubmit = new EventEmitter();
|
|
28
|
+
form;
|
|
29
|
+
processedFields = [];
|
|
30
|
+
fb = inject(FormBuilder);
|
|
31
|
+
cdr = inject(ChangeDetectorRef);
|
|
32
|
+
ngOnInit() {
|
|
33
|
+
this.form = this.fb.group({});
|
|
34
|
+
this.processedFields = this.config.fields.map(field => this.processField(field));
|
|
35
|
+
this.processedFields.forEach(field => {
|
|
36
|
+
if (field.type === 'select') {
|
|
37
|
+
if (field.simpleOptions) {
|
|
38
|
+
this.form.addControl(field.id, this.fb.control(field.value ?? field.simpleOptions[0].value ?? null, field.required ? Validators.required : null));
|
|
39
|
+
}
|
|
40
|
+
else if (field.groupedOptions) {
|
|
41
|
+
this.form.addControl(field.id, this.fb.control(field.value || field.groupedOptions[0].options[0].value, field.required ? Validators.required : null));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
this.form.valueChanges.subscribe(values => {
|
|
52
|
+
this.formChanges.emit(values);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
processField(field) {
|
|
56
|
+
const classes = ['gfield'];
|
|
57
|
+
if (field.size)
|
|
58
|
+
classes.push(`gfield--width-${field.size}`);
|
|
59
|
+
if (field.type === 'hidden')
|
|
60
|
+
classes.push('gform_hidden');
|
|
61
|
+
if (field.class)
|
|
62
|
+
classes.push(field.class);
|
|
63
|
+
return {
|
|
64
|
+
...field,
|
|
65
|
+
class: classes.join(' ')
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
onSubmit() {
|
|
69
|
+
if (this.form.valid) {
|
|
70
|
+
this.formSubmit.emit(this.form.value);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.log('Form is invalid');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
resetForm() {
|
|
77
|
+
if (this.form) {
|
|
78
|
+
this.form.reset();
|
|
79
|
+
this.config.fields.forEach(field => {
|
|
80
|
+
this.form.get(field.id)?.setValue(field.value || null);
|
|
81
|
+
});
|
|
82
|
+
this.cdr.markForCheck();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrFormComponent, isStandalone: true, selector: "ptr-form", inputs: { config: "config", loading: "loading" }, outputs: { formChanges: "formChanges", formSubmit: "formSubmit" }, ngImport: i0, template: "<div [class]=\"'gform_wrapper ' + (config.formClass || 'small-section')\">\r\n <div *ngIf=\"config.title\" class=\"gform_heading\">\r\n <h2 class=\"gform_title\">{{ config.title }}</h2>\r\n </div>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"gform_fields\">\r\n\r\n <ng-container *ngFor=\"let field of processedFields\">\r\n\r\n <div [class]=\"field.class\">\r\n <label *ngIf=\"field.type !== 'hidden'\" [for]=\"field.id\" class=\"gfield_label gform-field-label\">\r\n {{ field.name }}\r\n </label>\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"field.id\" [formControlName]=\"field.id\"></textarea>\r\n\r\n <select *ngSwitchCase=\"'select'\" [id]=\"field.id\" [formControlName]=\"field.id\">\r\n <ng-container *ngIf=\"field.simpleOptions\">\r\n <option *ngFor=\"let option of field.simpleOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </ng-container>\r\n <ng-container *ngIf=\"field.groupedOptions\">\r\n <optgroup *ngFor=\"let group of field.groupedOptions\" [label]=\"group.label\">\r\n <option *ngFor=\"let option of group.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </optgroup>\r\n </ng-container>\r\n </select>\r\n\r\n <input *ngSwitchDefault [type]=\"field.type\" [id]=\"field.id\" [formControlName]=\"field.id\"\r\n [attr.maxlength]=\"field.maxlength\">\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n <div class=\"gform_footer\">\r\n <button type=\"submit\" [name]=\"config.submitName\"\r\n [disabled]=\"loading || !form.valid\">{{config.submitValue}}</button>\r\n </div>\r\n </form>\r\n\r\n <ng-content></ng-content>\r\n\r\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrFormComponent, decorators: [{
|
|
89
|
+
type: Component,
|
|
90
|
+
args: [{ selector: 'ptr-form', standalone: true, imports: [
|
|
91
|
+
CommonModule,
|
|
92
|
+
ReactiveFormsModule
|
|
93
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'gform_wrapper ' + (config.formClass || 'small-section')\">\r\n <div *ngIf=\"config.title\" class=\"gform_heading\">\r\n <h2 class=\"gform_title\">{{ config.title }}</h2>\r\n </div>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"gform_fields\">\r\n\r\n <ng-container *ngFor=\"let field of processedFields\">\r\n\r\n <div [class]=\"field.class\">\r\n <label *ngIf=\"field.type !== 'hidden'\" [for]=\"field.id\" class=\"gfield_label gform-field-label\">\r\n {{ field.name }}\r\n </label>\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"field.id\" [formControlName]=\"field.id\"></textarea>\r\n\r\n <select *ngSwitchCase=\"'select'\" [id]=\"field.id\" [formControlName]=\"field.id\">\r\n <ng-container *ngIf=\"field.simpleOptions\">\r\n <option *ngFor=\"let option of field.simpleOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </ng-container>\r\n <ng-container *ngIf=\"field.groupedOptions\">\r\n <optgroup *ngFor=\"let group of field.groupedOptions\" [label]=\"group.label\">\r\n <option *ngFor=\"let option of group.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </optgroup>\r\n </ng-container>\r\n </select>\r\n\r\n <input *ngSwitchDefault [type]=\"field.type\" [id]=\"field.id\" [formControlName]=\"field.id\"\r\n [attr.maxlength]=\"field.maxlength\">\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n <div class=\"gform_footer\">\r\n <button type=\"submit\" [name]=\"config.submitName\"\r\n [disabled]=\"loading || !form.valid\">{{config.submitValue}}</button>\r\n </div>\r\n </form>\r\n\r\n <ng-content></ng-content>\r\n\r\n</div>" }]
|
|
94
|
+
}], propDecorators: { config: [{
|
|
95
|
+
type: Input
|
|
96
|
+
}], loading: [{
|
|
97
|
+
type: Input
|
|
98
|
+
}], formChanges: [{
|
|
99
|
+
type: Output
|
|
100
|
+
}], formSubmit: [{
|
|
101
|
+
type: Output
|
|
102
|
+
}] } });
|
|
103
|
+
|
|
104
|
+
class PtrTitleComponent {
|
|
105
|
+
router = inject(Router);
|
|
106
|
+
activatedRoute = inject(ActivatedRoute);
|
|
107
|
+
titleStrategy = inject(TitleStrategy);
|
|
108
|
+
title$;
|
|
109
|
+
hideTitle$;
|
|
110
|
+
ngOnInit() {
|
|
111
|
+
const routeEvents$ = this.router.events.pipe(filter((event) => event instanceof NavigationEnd), map(() => this.getRoute(this.activatedRoute)));
|
|
112
|
+
this.hideTitle$ = routeEvents$.pipe(map(route => !!route.snapshot.data['hideTitle']));
|
|
113
|
+
this.title$ = routeEvents$.pipe(map(route => {
|
|
114
|
+
if (route.snapshot.data['hideTitle']) {
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
return this.titleStrategy.getResolvedTitleForRoute(route.snapshot) || '';
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
getRoute(route) {
|
|
121
|
+
while (route.firstChild) {
|
|
122
|
+
route = route.firstChild;
|
|
123
|
+
}
|
|
124
|
+
return route;
|
|
125
|
+
}
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: PtrTitleComponent, isStandalone: true, selector: "ptr-title", ngImport: i0, template: '<header class="entry-header is-layout-constrained my-3" *ngIf="!(hideTitle$ | async)"><h1 class="entry-title">{{ title$ | async }}</h1></header>', isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
128
|
+
}
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: PtrTitleComponent, decorators: [{
|
|
130
|
+
type: Component,
|
|
131
|
+
args: [{
|
|
132
|
+
selector: 'ptr-title',
|
|
133
|
+
standalone: true,
|
|
134
|
+
imports: [CommonModule],
|
|
135
|
+
template: '<header class="entry-header is-layout-constrained my-3" *ngIf="!(hideTitle$ | async)"><h1 class="entry-title">{{ title$ | async }}</h1></header>',
|
|
136
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
137
|
+
}]
|
|
11
138
|
}] });
|
|
12
139
|
|
|
13
140
|
/*
|
|
14
141
|
* Public API Surface of ngx-components
|
|
15
142
|
*/
|
|
143
|
+
// export { PtrTitleStrategy } from './lib/ptr-title/ptr-title-strategy';
|
|
16
144
|
|
|
17
145
|
/**
|
|
18
146
|
* Generated bundle index. Do not edit.
|
|
19
147
|
*/
|
|
20
148
|
|
|
21
|
-
export {
|
|
149
|
+
export { PtrFormComponent, PtrMenuComponent, PtrTitleComponent };
|
|
22
150
|
//# sourceMappingURL=patter-ngx-components.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patter-ngx-components.mjs","sources":["../../../../projects/patter/ngx-components/src/lib/menu/menu.component.ts","../../../../projects/patter/ngx-components/src/lib/menu/menu.component.html","../../../../projects/patter/ngx-components/src/public-api.ts","../../../../projects/patter/ngx-components/src/patter-ngx-components.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'ptr-menu',\n standalone: true,\n imports: [],\n templateUrl: './menu.component.html',\n styleUrl: './menu.component.css'\n})\nexport class MenuComponent {\n\n}\n","<p>menu works!</p>\n","/*\n * Public API Surface of ngx-components\n */\n\nexport * from './lib/menu/menu.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASa,aAAa,CAAA;uGAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,oECT1B,sBACA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FDQa,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;+BACE,UAAU,EAAA,UAAA,EACR,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,QAAA,EAAA,sBAAA,EAAA,CAAA;;;AELb;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"patter-ngx-components.mjs","sources":["../../../../projects/patter/ngx-components/src/lib/menu/menu.component.ts","../../../../projects/patter/ngx-components/src/lib/menu/menu.component.html","../../../../projects/patter/ngx-components/src/lib/forms/form/form.component.ts","../../../../projects/patter/ngx-components/src/lib/forms/form/form.component.html","../../../../projects/patter/ngx-components/src/lib/ptr-title/ptr-title.component.ts","../../../../projects/patter/ngx-components/src/public-api.ts","../../../../projects/patter/ngx-components/src/patter-ngx-components.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nexport interface PtrMenuItem {\r\n label: string;\r\n link?: string;\r\n children?: PtrMenuItem[];\r\n}\r\n\r\n@Component({\r\n selector: 'ptr-menu',\r\n standalone: true,\r\n imports: [CommonModule, RouterModule],\r\n templateUrl: './menu.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n styleUrls: ['./menu.component.scss']\r\n})\r\nexport class PtrMenuComponent {\r\n\r\n @Input() menuItems: PtrMenuItem[] = [];\r\n\r\n}\r\n","<nav class=\"ptr-menu\">\r\n <ul class=\"menu\">\r\n <li class=\"menu-item\" *ngFor=\"let item of menuItems\" routerLinkActive=\"current_page_item\"\r\n [routerLinkActiveOptions]=\"{exact: true}\">\r\n <a [routerLink]=\"item.link || '#'\">{{item.label}}</a>\r\n </li>\r\n </ul>\r\n</nav>\r\n","import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, inject, Input, Output } from '@angular/core';\r\nimport { AbstractControl, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { PtrFormConfig, PtrFormFieldConfig } from '../interfaces';\r\n\r\n@Component({\r\n selector: 'ptr-form',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule\r\n ],\r\n templateUrl: './form.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class PtrFormComponent {\r\n\r\n @Input() config!: PtrFormConfig;\r\n @Input() loading = false;\r\n\r\n @Output() formChanges = new EventEmitter<AbstractControl<any>>();\r\n @Output() formSubmit = new EventEmitter<AbstractControl<any>>();\r\n\r\n form!: FormGroup;\r\n processedFields: PtrFormFieldConfig[] = [];\r\n\r\n fb = inject(FormBuilder);\r\n cdr = inject(ChangeDetectorRef);\r\n\r\n ngOnInit() {\r\n this.form = this.fb.group({});\r\n this.processedFields = this.config.fields.map(field => this.processField(field));\r\n this.processedFields.forEach(field => {\r\n if (field.type === 'select') {\r\n if (field.simpleOptions) {\r\n this.form.addControl(field.id, this.fb.control(field.value ?? field.simpleOptions![0].value ?? null, field.required ? Validators.required : null));\r\n } else if (field.groupedOptions) {\r\n this.form.addControl(field.id, this.fb.control(field.value || field.groupedOptions[0].options[0].value, field.required ? Validators.required : null));\r\n } else {\r\n this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));\r\n }\r\n } else {\r\n this.form.addControl(field.id, this.fb.control(field.value || '', field.required ? Validators.required : null));\r\n }\r\n });\r\n\r\n this.form.valueChanges.subscribe(values => {\r\n this.formChanges.emit(values);\r\n });\r\n }\r\n\r\n private processField(field: PtrFormFieldConfig): PtrFormFieldConfig {\r\n const classes = ['gfield'];\r\n if (field.size) classes.push(`gfield--width-${field.size}`);\r\n if (field.type === 'hidden') classes.push('gform_hidden');\r\n if (field.class) classes.push(field.class);\r\n\r\n return {\r\n ...field,\r\n class: classes.join(' ')\r\n };\r\n }\r\n\r\n onSubmit() {\r\n if (this.form.valid) {\r\n this.formSubmit.emit(this.form.value);\r\n } else {\r\n console.log('Form is invalid');\r\n }\r\n }\r\n\r\n resetForm() {\r\n if (this.form) {\r\n this.form.reset();\r\n this.config.fields.forEach(field => {\r\n this.form.get(field.id)?.setValue(field.value || null);\r\n });\r\n this.cdr.markForCheck();\r\n }\r\n }\r\n\r\n}\r\n","<div [class]=\"'gform_wrapper ' + (config.formClass || 'small-section')\">\r\n <div *ngIf=\"config.title\" class=\"gform_heading\">\r\n <h2 class=\"gform_title\">{{ config.title }}</h2>\r\n </div>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <div class=\"gform_fields\">\r\n\r\n <ng-container *ngFor=\"let field of processedFields\">\r\n\r\n <div [class]=\"field.class\">\r\n <label *ngIf=\"field.type !== 'hidden'\" [for]=\"field.id\" class=\"gfield_label gform-field-label\">\r\n {{ field.name }}\r\n </label>\r\n\r\n <ng-container [ngSwitch]=\"field.type\">\r\n\r\n <textarea *ngSwitchCase=\"'textarea'\" [id]=\"field.id\" [formControlName]=\"field.id\"></textarea>\r\n\r\n <select *ngSwitchCase=\"'select'\" [id]=\"field.id\" [formControlName]=\"field.id\">\r\n <ng-container *ngIf=\"field.simpleOptions\">\r\n <option *ngFor=\"let option of field.simpleOptions\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </ng-container>\r\n <ng-container *ngIf=\"field.groupedOptions\">\r\n <optgroup *ngFor=\"let group of field.groupedOptions\" [label]=\"group.label\">\r\n <option *ngFor=\"let option of group.options\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </option>\r\n </optgroup>\r\n </ng-container>\r\n </select>\r\n\r\n <input *ngSwitchDefault [type]=\"field.type\" [id]=\"field.id\" [formControlName]=\"field.id\"\r\n [attr.maxlength]=\"field.maxlength\">\r\n\r\n </ng-container>\r\n\r\n </div>\r\n\r\n </ng-container>\r\n\r\n </div>\r\n <div class=\"gform_footer\">\r\n <button type=\"submit\" [name]=\"config.submitName\"\r\n [disabled]=\"loading || !form.valid\">{{config.submitValue}}</button>\r\n </div>\r\n </form>\r\n\r\n <ng-content></ng-content>\r\n\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';\r\nimport { Title } from '@angular/platform-browser';\r\nimport { ActivatedRoute, NavigationEnd, Router, TitleStrategy } from '@angular/router';\r\nimport { filter, map, Observable } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'ptr-title',\r\n standalone: true,\r\n imports: [CommonModule],\r\n template: '<header class=\"entry-header is-layout-constrained my-3\" *ngIf=\"!(hideTitle$ | async)\"><h1 class=\"entry-title\">{{ title$ | async }}</h1></header>',\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class PtrTitleComponent implements OnInit {\r\n\r\n private router = inject(Router);\r\n private activatedRoute = inject(ActivatedRoute);\r\n private titleStrategy = inject(TitleStrategy);\r\n\r\n title$!: Observable<string>;\r\n hideTitle$!: Observable<boolean>;\r\n\r\n ngOnInit() {\r\n const routeEvents$ = this.router.events.pipe(\r\n filter((event): event is NavigationEnd => event instanceof NavigationEnd),\r\n map(() => this.getRoute(this.activatedRoute))\r\n );\r\n\r\n this.hideTitle$ = routeEvents$.pipe(\r\n map(route => !!route.snapshot.data['hideTitle'])\r\n );\r\n\r\n this.title$ = routeEvents$.pipe(\r\n map(route => {\r\n if (route.snapshot.data['hideTitle']) {\r\n return '';\r\n }\r\n return this.titleStrategy.getResolvedTitleForRoute(route.snapshot) || '';\r\n })\r\n );\r\n\r\n }\r\n\r\n private getRoute(route: ActivatedRoute): ActivatedRoute {\r\n while (route.firstChild) {\r\n route = route.firstChild;\r\n }\r\n return route;\r\n }\r\n\r\n}\r\n","/*\r\n * Public API Surface of ngx-components\r\n */\r\n\r\nexport * from './lib/menu/menu.component';\r\n\r\nexport * from './lib/forms/interfaces';\r\nexport { PtrFormComponent } from './lib/forms/form/form.component';\r\n\r\nexport { PtrTitleComponent } from './lib/ptr-title/ptr-title.component';\r\n// export { PtrTitleStrategy } from './lib/ptr-title/ptr-title-strategy';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2"],"mappings":";;;;;;;;;;MAkBa,gBAAgB,CAAA;IAElB,SAAS,GAAkB,EAAE,CAAC;uGAF5B,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,EClB7B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,uTAQA,EDKY,MAAA,EAAA,CAAA,6hDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,YAAY,2JAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IA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,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EADlJ,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIX,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAP7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;AACvB,oBAAA,QAAQ,EAAE,kJAAkJ;oBAC5J,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA,CAAA;;;ACZD;;AAEG;AAQH;;ACVA;;AAEG;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { PtrFormConfig, PtrFormFieldConfig } from '../interfaces';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class PtrFormComponent {
|
|
6
|
+
config: PtrFormConfig;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
formChanges: EventEmitter<AbstractControl<any, any>>;
|
|
9
|
+
formSubmit: EventEmitter<AbstractControl<any, any>>;
|
|
10
|
+
form: FormGroup;
|
|
11
|
+
processedFields: PtrFormFieldConfig[];
|
|
12
|
+
fb: FormBuilder;
|
|
13
|
+
cdr: ChangeDetectorRef;
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
private processField;
|
|
16
|
+
onSubmit(): void;
|
|
17
|
+
resetForm(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PtrFormComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PtrFormComponent, "ptr-form", never, { "config": { "alias": "config"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; }, { "formChanges": "formChanges"; "formSubmit": "formSubmit"; }, never, ["*"], true, never>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface PtrFormFieldOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PtrFormFieldOptionGroup {
|
|
6
|
+
label: string;
|
|
7
|
+
options: PtrFormFieldOption[];
|
|
8
|
+
}
|
|
9
|
+
export interface PtrFormFieldConfig {
|
|
10
|
+
id: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
type: 'text' | 'textarea' | 'select' | 'date' | 'hidden';
|
|
14
|
+
simpleOptions?: PtrFormFieldOption[];
|
|
15
|
+
groupedOptions?: PtrFormFieldOptionGroup[];
|
|
16
|
+
size?: 'full' | 'half' | 'third';
|
|
17
|
+
value?: string;
|
|
18
|
+
class?: string;
|
|
19
|
+
maxlength?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface PtrFormConfig {
|
|
22
|
+
title?: string;
|
|
23
|
+
fields: PtrFormFieldConfig[];
|
|
24
|
+
submitName: string;
|
|
25
|
+
submitValue: string;
|
|
26
|
+
formClass?: string;
|
|
27
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface PtrMenuItem {
|
|
3
|
+
label: string;
|
|
4
|
+
link?: string;
|
|
5
|
+
children?: PtrMenuItem[];
|
|
6
|
+
}
|
|
7
|
+
export declare class PtrMenuComponent {
|
|
8
|
+
menuItems: PtrMenuItem[];
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PtrMenuComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PtrMenuComponent, "ptr-menu", never, { "menuItems": { "alias": "menuItems"; "required": false; }; }, {}, never, never, true, never>;
|
|
5
11
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PtrTitleComponent implements OnInit {
|
|
5
|
+
private router;
|
|
6
|
+
private activatedRoute;
|
|
7
|
+
private titleStrategy;
|
|
8
|
+
title$: Observable<string>;
|
|
9
|
+
hideTitle$: Observable<boolean>;
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
private getRoute;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PtrTitleComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PtrTitleComponent, "ptr-title", never, {}, {}, never, never, true, never>;
|
|
14
|
+
}
|
package/package.json
CHANGED
|
Binary file
|
package/public-api.d.ts
CHANGED
|
Binary file
|