@ng-forge/dynamic-forms-material 1.2.0-next.5 → 1.2.0-next.7
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/fesm2022/ng-forge-dynamic-forms-material-lazy-addon-button.mjs +106 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-addon-button.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-addon-icon.mjs +34 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-addon-icon.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-button.mjs +60 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-button.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-checkbox.mjs +76 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-checkbox.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-datepicker.mjs +124 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-datepicker.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-input.mjs +196 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-input.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-multi-checkbox.mjs +136 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-multi-checkbox.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-radio.mjs +92 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-radio.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-select.mjs +106 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-select.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-slider.mjs +76 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-slider.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-textarea.mjs +92 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-textarea.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-toggle.mjs +76 -0
- package/fesm2022/ng-forge-dynamic-forms-material-lazy-toggle.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs +26 -0
- package/fesm2022/ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material-shared.mjs +14 -0
- package/fesm2022/ng-forge-dynamic-forms-material-shared.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-material.mjs +42 -93
- package/fesm2022/ng-forge-dynamic-forms-material.mjs.map +1 -1
- package/package.json +55 -3
- package/types/ng-forge-dynamic-forms-material-lazy-addon-button.d.ts +18 -0
- package/types/ng-forge-dynamic-forms-material-lazy-addon-icon.d.ts +17 -0
- package/types/ng-forge-dynamic-forms-material-lazy-button.d.ts +114 -0
- package/types/ng-forge-dynamic-forms-material-lazy-checkbox.d.ts +26 -0
- package/types/ng-forge-dynamic-forms-material-lazy-datepicker.d.ts +37 -0
- package/types/ng-forge-dynamic-forms-material-lazy-input.d.ts +55 -0
- package/types/ng-forge-dynamic-forms-material-lazy-multi-checkbox.d.ts +29 -0
- package/types/ng-forge-dynamic-forms-material-lazy-radio.d.ts +24 -0
- package/types/ng-forge-dynamic-forms-material-lazy-select.d.ts +35 -0
- package/types/ng-forge-dynamic-forms-material-lazy-slider.d.ts +27 -0
- package/types/ng-forge-dynamic-forms-material-lazy-textarea.d.ts +31 -0
- package/types/ng-forge-dynamic-forms-material-lazy-toggle.d.ts +28 -0
- package/types/ng-forge-dynamic-forms-material-shared.d.ts +91 -0
- package/types/ng-forge-dynamic-forms-material.d.ts +10 -161
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FormField } from '@angular/forms/signals';
|
|
4
|
+
import { MatSlider, MatSliderThumb } from '@angular/material/slider';
|
|
5
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
6
|
+
import { injectNgForgeField, NgForgeControl, DynamicTextPipe, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';
|
|
7
|
+
import { MatError } from '@angular/material/input';
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
|
+
|
|
10
|
+
class MatSliderFieldComponent {
|
|
11
|
+
ngf = injectNgForgeField();
|
|
12
|
+
step = input(/* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [undefined, { debugName: "step" }] : /* istanbul ignore next */ []));
|
|
14
|
+
props = input(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatSliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: MatSliderFieldComponent, isStandalone: true, selector: "df-mat-slider", inputs: { step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
18
|
+
@let f = ngf.field();
|
|
19
|
+
@let inputId = ngf.key() + '-input';
|
|
20
|
+
|
|
21
|
+
@if (ngf.label(); as label) {
|
|
22
|
+
<label class="slider-label" [for]="inputId">{{ label | dynamicText | async }}</label>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
<mat-slider
|
|
26
|
+
[min]="f().min?.() ?? 0"
|
|
27
|
+
[max]="f().max?.() ?? 100"
|
|
28
|
+
[step]="step() ?? props()?.step ?? 1"
|
|
29
|
+
[discrete]="props()?.thumbLabel || props()?.showThumbLabel"
|
|
30
|
+
[showTickMarks]="props()?.tickInterval !== undefined"
|
|
31
|
+
[color]="props()?.color || 'primary'"
|
|
32
|
+
class="slider-container"
|
|
33
|
+
>
|
|
34
|
+
<input matSliderThumb ngForgeControl [id]="inputId" [formField]="f" [attr.tabindex]="ngf.tabIndex()" />
|
|
35
|
+
</mat-slider>
|
|
36
|
+
|
|
37
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
38
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
39
|
+
} @else if (props()?.hint; as hint) {
|
|
40
|
+
<div class="mat-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
41
|
+
}
|
|
42
|
+
`, isInline: true, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n", ".slider-container{width:100%}\n"], dependencies: [{ kind: "component", type: MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatSliderFieldComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{ selector: 'df-mat-slider', imports: [MatSlider, MatSliderThumb, MatError, DynamicTextPipe, AsyncPipe, FormField, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
47
|
+
@let f = ngf.field();
|
|
48
|
+
@let inputId = ngf.key() + '-input';
|
|
49
|
+
|
|
50
|
+
@if (ngf.label(); as label) {
|
|
51
|
+
<label class="slider-label" [for]="inputId">{{ label | dynamicText | async }}</label>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
<mat-slider
|
|
55
|
+
[min]="f().min?.() ?? 0"
|
|
56
|
+
[max]="f().max?.() ?? 100"
|
|
57
|
+
[step]="step() ?? props()?.step ?? 1"
|
|
58
|
+
[discrete]="props()?.thumbLabel || props()?.showThumbLabel"
|
|
59
|
+
[showTickMarks]="props()?.tickInterval !== undefined"
|
|
60
|
+
[color]="props()?.color || 'primary'"
|
|
61
|
+
class="slider-container"
|
|
62
|
+
>
|
|
63
|
+
<input matSliderThumb ngForgeControl [id]="inputId" [formField]="f" [attr.tabindex]="ngf.tabIndex()" />
|
|
64
|
+
</mat-slider>
|
|
65
|
+
|
|
66
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
67
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
68
|
+
} @else if (props()?.hint; as hint) {
|
|
69
|
+
<div class="mat-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
70
|
+
}
|
|
71
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n", ".slider-container{width:100%}\n"] }]
|
|
72
|
+
}], propDecorators: { step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export { MatSliderFieldComponent };
|
|
76
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-material-lazy-slider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-material-lazy-slider.mjs","mappings":";;;;;;;;;AAiDc;;AAGH;;AAEA;;;AALU;;;;;;;;;;;;;;;;;;;;;;;;;AAXlB","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-material/src/lib/fields/slider/mat-slider.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { MatSlider, MatSliderThumb } from '@angular/material/slider';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\nimport { MatSliderProps } from './mat-slider.type';\nimport { MatError } from '@angular/material/input';\nimport { AsyncPipe } from '@angular/common';\n\n@Component({\n selector: 'df-mat-slider',\n imports: [MatSlider, MatSliderThumb, MatError, DynamicTextPipe, AsyncPipe, FormField, NgForgeControl],\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let f = ngf.field();\n @let inputId = ngf.key() + '-input';\n\n @if (ngf.label(); as label) {\n <label class=\"slider-label\" [for]=\"inputId\">{{ label | dynamicText | async }}</label>\n }\n\n <mat-slider\n [min]=\"f().min?.() ?? 0\"\n [max]=\"f().max?.() ?? 100\"\n [step]=\"step() ?? props()?.step ?? 1\"\n [discrete]=\"props()?.thumbLabel || props()?.showThumbLabel\"\n [showTickMarks]=\"props()?.tickInterval !== undefined\"\n [color]=\"props()?.color || 'primary'\"\n class=\"slider-container\"\n >\n <input matSliderThumb ngForgeControl [id]=\"inputId\" [formField]=\"f\" [attr.tabindex]=\"ngf.tabIndex()\" />\n </mat-slider>\n\n @if (ngf.errorsToDisplay()[0]; as error) {\n <mat-error [id]=\"ngf.errorId()\">{{ error.message }}</mat-error>\n } @else if (props()?.hint; as hint) {\n <div class=\"mat-hint\" [id]=\"ngf.hintId()\">{{ hint | dynamicText | async }}</div>\n }\n `,\n styleUrl: '../../styles/_form-field.scss',\n styles: [\n `\n .slider-container {\n width: 100%;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class MatSliderFieldComponent {\n protected readonly ngf = injectNgForgeField<number>();\n\n readonly step = input<number>();\n\n readonly props = input<MatSliderProps>();\n}\n"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FormField } from '@angular/forms/signals';
|
|
4
|
+
import { MatFormField, MatLabel, MatError } from '@angular/material/form-field';
|
|
5
|
+
import { MatInput, MatHint } from '@angular/material/input';
|
|
6
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
7
|
+
import { injectNgForgeField, NgForgeControl, DynamicTextPipe, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
|
+
import { MATERIAL_CONFIG } from '@ng-forge/dynamic-forms-material/shared';
|
|
10
|
+
|
|
11
|
+
class MatTextareaFieldComponent {
|
|
12
|
+
materialConfig = inject(MATERIAL_CONFIG, { optional: true });
|
|
13
|
+
ngf = injectNgForgeField();
|
|
14
|
+
props = input(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
16
|
+
appearance = computed(() => this.props()?.appearance ?? this.materialConfig?.appearance ?? 'outline', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
18
|
+
subscriptSizing = computed(() => this.props()?.subscriptSizing ?? this.materialConfig?.subscriptSizing ?? 'dynamic', /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "subscriptSizing" }] : /* istanbul ignore next */ []));
|
|
20
|
+
floatLabel = computed(() => this.props()?.floatLabel ?? this.materialConfig?.floatLabel ?? 'auto', /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "floatLabel" }] : /* istanbul ignore next */ []));
|
|
22
|
+
hideRequiredMarker = computed(() => this.props()?.hideRequiredMarker ?? this.materialConfig?.hideRequiredMarker ?? false, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "hideRequiredMarker" }] : /* istanbul ignore next */ []));
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatTextareaFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: MatTextareaFieldComponent, isStandalone: true, selector: "df-mat-textarea", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
26
|
+
@let textareaId = ngf.key() + '-textarea';
|
|
27
|
+
|
|
28
|
+
<mat-form-field
|
|
29
|
+
[appearance]="appearance()"
|
|
30
|
+
[subscriptSizing]="subscriptSizing()"
|
|
31
|
+
[floatLabel]="floatLabel()"
|
|
32
|
+
[hideRequiredMarker]="hideRequiredMarker()"
|
|
33
|
+
>
|
|
34
|
+
@if (ngf.label()) {
|
|
35
|
+
<mat-label>{{ ngf.label() | dynamicText | async }}</mat-label>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
<textarea
|
|
39
|
+
ngForgeControl
|
|
40
|
+
matInput
|
|
41
|
+
[id]="textareaId"
|
|
42
|
+
[formField]="ngf.field()"
|
|
43
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
44
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
45
|
+
[style.resize]="props()?.resize || 'vertical'"
|
|
46
|
+
></textarea>
|
|
47
|
+
|
|
48
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
49
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
50
|
+
} @else if (props()?.hint; as hint) {
|
|
51
|
+
<mat-hint [id]="ngf.hintId()">{{ hint | dynamicText | async }}</mat-hint>
|
|
52
|
+
}
|
|
53
|
+
</mat-form-field>
|
|
54
|
+
`, isInline: true, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n", "mat-form-field{width:100%}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatTextareaFieldComponent, decorators: [{
|
|
57
|
+
type: Component,
|
|
58
|
+
args: [{ selector: 'df-mat-textarea', imports: [MatFormField, MatLabel, MatInput, MatHint, FormField, MatError, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
59
|
+
@let textareaId = ngf.key() + '-textarea';
|
|
60
|
+
|
|
61
|
+
<mat-form-field
|
|
62
|
+
[appearance]="appearance()"
|
|
63
|
+
[subscriptSizing]="subscriptSizing()"
|
|
64
|
+
[floatLabel]="floatLabel()"
|
|
65
|
+
[hideRequiredMarker]="hideRequiredMarker()"
|
|
66
|
+
>
|
|
67
|
+
@if (ngf.label()) {
|
|
68
|
+
<mat-label>{{ ngf.label() | dynamicText | async }}</mat-label>
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
<textarea
|
|
72
|
+
ngForgeControl
|
|
73
|
+
matInput
|
|
74
|
+
[id]="textareaId"
|
|
75
|
+
[formField]="ngf.field()"
|
|
76
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
77
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
78
|
+
[style.resize]="props()?.resize || 'vertical'"
|
|
79
|
+
></textarea>
|
|
80
|
+
|
|
81
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
82
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
83
|
+
} @else if (props()?.hint; as hint) {
|
|
84
|
+
<mat-hint [id]="ngf.hintId()">{{ hint | dynamicText | async }}</mat-hint>
|
|
85
|
+
}
|
|
86
|
+
</mat-form-field>
|
|
87
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n", "mat-form-field{width:100%}\n"] }]
|
|
88
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export { MatTextareaFieldComponent };
|
|
92
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-material-lazy-textarea.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-material-lazy-textarea.mjs","mappings":";;;;;;;;;;AAsDc;;;AAKH;;AAEA;;AACA;;AAEA;;AACA;;;AAXU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAXlB","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-material/src/lib/fields/textarea/mat-textarea.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { MatError, MatFormField, MatLabel } from '@angular/material/form-field';\nimport { MatHint, MatInput } from '@angular/material/input';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\nimport { MatTextareaProps } from './mat-textarea.type';\nimport { AsyncPipe } from '@angular/common';\nimport { MATERIAL_CONFIG } from '@ng-forge/dynamic-forms-material/shared';\n\n@Component({\n selector: 'df-mat-textarea',\n imports: [MatFormField, MatLabel, MatInput, MatHint, FormField, MatError, DynamicTextPipe, AsyncPipe, NgForgeControl],\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let textareaId = ngf.key() + '-textarea';\n\n <mat-form-field\n [appearance]=\"appearance()\"\n [subscriptSizing]=\"subscriptSizing()\"\n [floatLabel]=\"floatLabel()\"\n [hideRequiredMarker]=\"hideRequiredMarker()\"\n >\n @if (ngf.label()) {\n <mat-label>{{ ngf.label() | dynamicText | async }}</mat-label>\n }\n\n <textarea\n ngForgeControl\n matInput\n [id]=\"textareaId\"\n [formField]=\"ngf.field()\"\n [placeholder]=\"(ngf.placeholder() | dynamicText | async) ?? ''\"\n [attr.tabindex]=\"ngf.tabIndex()\"\n [style.resize]=\"props()?.resize || 'vertical'\"\n ></textarea>\n\n @if (ngf.errorsToDisplay()[0]; as error) {\n <mat-error [id]=\"ngf.errorId()\">{{ error.message }}</mat-error>\n } @else if (props()?.hint; as hint) {\n <mat-hint [id]=\"ngf.hintId()\">{{ hint | dynamicText | async }}</mat-hint>\n }\n </mat-form-field>\n `,\n styleUrl: '../../styles/_form-field.scss',\n styles: [\n `\n mat-form-field {\n width: 100%;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class MatTextareaFieldComponent {\n private materialConfig = inject(MATERIAL_CONFIG, { optional: true });\n\n protected readonly ngf = injectNgForgeField<string>();\n\n readonly props = input<MatTextareaProps>();\n\n readonly appearance = computed(() => this.props()?.appearance ?? this.materialConfig?.appearance ?? 'outline');\n readonly subscriptSizing = computed(() => this.props()?.subscriptSizing ?? this.materialConfig?.subscriptSizing ?? 'dynamic');\n\n readonly floatLabel = computed(() => this.props()?.floatLabel ?? this.materialConfig?.floatLabel ?? 'auto');\n readonly hideRequiredMarker = computed(() => this.props()?.hideRequiredMarker ?? this.materialConfig?.hideRequiredMarker ?? false);\n}\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FormField } from '@angular/forms/signals';
|
|
4
|
+
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
|
5
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
6
|
+
import { injectNgForgeField, NgForgeControl, DynamicTextPipe, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';
|
|
7
|
+
import { MatError } from '@angular/material/input';
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
|
+
import { MATERIAL_CONFIG } from '@ng-forge/dynamic-forms-material/shared';
|
|
10
|
+
|
|
11
|
+
class MatToggleFieldComponent {
|
|
12
|
+
materialConfig = inject(MATERIAL_CONFIG, { optional: true });
|
|
13
|
+
ngf = injectNgForgeField();
|
|
14
|
+
props = input(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
16
|
+
disableRipple = computed(() => this.props()?.disableRipple ?? this.materialConfig?.disableRipple ?? false, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "disableRipple" }] : /* istanbul ignore next */ []));
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatToggleFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: MatToggleFieldComponent, isStandalone: true, selector: "df-mat-toggle", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
20
|
+
@let f = ngf.field();
|
|
21
|
+
@let toggleId = ngf.key() + '-toggle';
|
|
22
|
+
|
|
23
|
+
<mat-slide-toggle
|
|
24
|
+
ngForgeControl="button[role='switch']"
|
|
25
|
+
[id]="toggleId"
|
|
26
|
+
[formField]="f"
|
|
27
|
+
[color]="props()?.color || 'primary'"
|
|
28
|
+
[labelPosition]="props()?.labelPosition || 'after'"
|
|
29
|
+
[hideIcon]="props()?.hideIcon || false"
|
|
30
|
+
[disableRipple]="disableRipple()"
|
|
31
|
+
[required]="!!f().required()"
|
|
32
|
+
[tabIndex]="ngf.tabIndex() ?? 0"
|
|
33
|
+
class="toggle-container"
|
|
34
|
+
>
|
|
35
|
+
{{ ngf.label() | dynamicText | async }}
|
|
36
|
+
</mat-slide-toggle>
|
|
37
|
+
|
|
38
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
39
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
40
|
+
} @else if (props()?.hint; as hint) {
|
|
41
|
+
<div class="mat-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
42
|
+
}
|
|
43
|
+
`, isInline: true, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n"], dependencies: [{ kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatToggleFieldComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{ selector: 'df-mat-toggle', imports: [MatSlideToggle, FormField, MatError, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
48
|
+
@let f = ngf.field();
|
|
49
|
+
@let toggleId = ngf.key() + '-toggle';
|
|
50
|
+
|
|
51
|
+
<mat-slide-toggle
|
|
52
|
+
ngForgeControl="button[role='switch']"
|
|
53
|
+
[id]="toggleId"
|
|
54
|
+
[formField]="f"
|
|
55
|
+
[color]="props()?.color || 'primary'"
|
|
56
|
+
[labelPosition]="props()?.labelPosition || 'after'"
|
|
57
|
+
[hideIcon]="props()?.hideIcon || false"
|
|
58
|
+
[disableRipple]="disableRipple()"
|
|
59
|
+
[required]="!!f().required()"
|
|
60
|
+
[tabIndex]="ngf.tabIndex() ?? 0"
|
|
61
|
+
class="toggle-container"
|
|
62
|
+
>
|
|
63
|
+
{{ ngf.label() | dynamicText | async }}
|
|
64
|
+
</mat-slide-toggle>
|
|
65
|
+
|
|
66
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
67
|
+
<mat-error [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
68
|
+
} @else if (props()?.hint; as hint) {
|
|
69
|
+
<div class="mat-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
70
|
+
}
|
|
71
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%}:host([hidden]){display:none!important}.df-mat-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%}.df-mat-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit)}.df-mat-hint{color:var(--df-hint-color, rgba(0, 0, 0, .6));font-size:var(--df-hint-font-size, .875rem)}.df-mat-error{color:var(--df-error-color, #f44336);font-size:var(--df-error-font-size, .875rem)}\n"] }]
|
|
72
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export { MatToggleFieldComponent };
|
|
76
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-material-lazy-toggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-material-lazy-toggle.mjs","mappings":";;;;;;;;;;AA2Cc;;;AAKH;;AAEA;;;AAPU;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/BT","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-material/src/lib/fields/toggle/mat-toggle.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\n\nimport { MatToggleProps } from './mat-toggle.type';\nimport { MatError } from '@angular/material/input';\nimport { AsyncPipe } from '@angular/common';\nimport { MATERIAL_CONFIG } from '@ng-forge/dynamic-forms-material/shared';\n\n@Component({\n selector: 'df-mat-toggle',\n imports: [MatSlideToggle, FormField, MatError, DynamicTextPipe, AsyncPipe, NgForgeControl],\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let f = ngf.field();\n @let toggleId = ngf.key() + '-toggle';\n\n <mat-slide-toggle\n ngForgeControl=\"button[role='switch']\"\n [id]=\"toggleId\"\n [formField]=\"f\"\n [color]=\"props()?.color || 'primary'\"\n [labelPosition]=\"props()?.labelPosition || 'after'\"\n [hideIcon]=\"props()?.hideIcon || false\"\n [disableRipple]=\"disableRipple()\"\n [required]=\"!!f().required()\"\n [tabIndex]=\"ngf.tabIndex() ?? 0\"\n class=\"toggle-container\"\n >\n {{ ngf.label() | dynamicText | async }}\n </mat-slide-toggle>\n\n @if (ngf.errorsToDisplay()[0]; as error) {\n <mat-error [id]=\"ngf.errorId()\">{{ error.message }}</mat-error>\n } @else if (props()?.hint; as hint) {\n <div class=\"mat-hint\" [id]=\"ngf.hintId()\">{{ hint | dynamicText | async }}</div>\n }\n `,\n styleUrl: '../../styles/_form-field.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class MatToggleFieldComponent {\n private materialConfig = inject(MATERIAL_CONFIG, { optional: true });\n\n protected readonly ngf = injectNgForgeField<boolean>();\n\n readonly props = input<MatToggleProps>();\n\n readonly disableRipple = computed(() => this.props()?.disableRipple ?? this.materialConfig?.disableRipple ?? false);\n}\n"]}
|
package/fesm2022/ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { MatError } from '@angular/material/form-field';
|
|
4
|
+
import { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
|
|
6
|
+
class MatFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatFieldErrorsWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
8
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: MatFieldErrorsWrapperComponent, isStandalone: true, selector: "df-mat-field-errors", providers: [provideFieldErrorDisplay(() => MatFieldErrorsWrapperComponent)], usesInheritance: true, ngImport: i0, template: `
|
|
9
|
+
<ng-container #fieldComponent></ng-container>
|
|
10
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
11
|
+
<mat-error class="df-mat-field-error" role="alert" [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
12
|
+
}
|
|
13
|
+
`, isInline: true, styles: [".df-mat-field-error{display:block;color:var(--df-error-color, var(--mat-form-field-error-text-color, #f44336));font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--df-error-font-size, var(--mat-form-field-subscript-text-size, 12px));font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, .0333333333em);margin-top:var(--df-field-gap, .5rem);padding-inline-start:var(--df-mat-error-inset, 16px)}\n"], dependencies: [{ kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: MatFieldErrorsWrapperComponent, decorators: [{
|
|
16
|
+
type: Component,
|
|
17
|
+
args: [{ selector: 'df-mat-field-errors', imports: [MatError], template: `
|
|
18
|
+
<ng-container #fieldComponent></ng-container>
|
|
19
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
20
|
+
<mat-error class="df-mat-field-error" role="alert" [id]="ngf.errorId()">{{ error.message }}</mat-error>
|
|
21
|
+
}
|
|
22
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideFieldErrorDisplay(() => MatFieldErrorsWrapperComponent)], styles: [".df-mat-field-error{display:block;color:var(--df-error-color, var(--mat-form-field-error-text-color, #f44336));font-family:var(--mat-form-field-subscript-text-font, inherit);font-size:var(--df-error-font-size, var(--mat-form-field-subscript-text-size, 12px));font-weight:var(--mat-form-field-subscript-text-weight, 400);line-height:var(--mat-form-field-subscript-text-line-height, 20px);letter-spacing:var(--mat-form-field-subscript-text-tracking, .0333333333em);margin-top:var(--df-field-gap, .5rem);padding-inline-start:var(--df-mat-error-inset, 16px)}\n"] }]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
export { MatFieldErrorsWrapperComponent, MatFieldErrorsWrapperComponent as default };
|
|
26
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs.map
|
package/fesm2022/ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-material-mat-field-errors-wrapper.component-QsDJRuUx.mjs","mappings":";;;;;AAkBc;;;;;;;AALX;;;;AAPS","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-material/src/lib/wrappers/field-errors/mat-field-errors-wrapper.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { MatError } from '@angular/material/form-field';\nimport { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';\n\n/** Material rendering of a validation message for the wrapped field. Replaces the core default. */\n@Component({\n selector: 'df-mat-field-errors',\n imports: [MatError],\n template: `\n <ng-container #fieldComponent></ng-container>\n @if (ngf.errorsToDisplay()[0]; as error) {\n <mat-error class=\"df-mat-field-error\" role=\"alert\" [id]=\"ngf.errorId()\">{{ error.message }}</mat-error>\n }\n `,\n styleUrl: './mat-field-errors-wrapper.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [provideFieldErrorDisplay(() => MatFieldErrorsWrapperComponent)],\n})\nexport default class MatFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {}\n\nexport { MatFieldErrorsWrapperComponent };\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { runPresetAction } from '@ng-forge/dynamic-forms/integration';
|
|
3
|
+
|
|
4
|
+
const MATERIAL_CONFIG = new InjectionToken('MATERIAL_CONFIG');
|
|
5
|
+
|
|
6
|
+
const MAT_INPUT_TYPE_OVERRIDE = new InjectionToken('MAT_INPUT_TYPE_OVERRIDE');
|
|
7
|
+
|
|
8
|
+
function runMatPresetAction(preset, context, collaborators) {
|
|
9
|
+
return runPresetAction(preset, context, collaborators, 'Material', 'mat-input');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export { MATERIAL_CONFIG, MAT_INPUT_TYPE_OVERRIDE, runMatPresetAction };
|
|
14
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-material-shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-material-shared.mjs","mappings":";;;;;;;;AAWE;AACF","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-material/shared/preset-actions.ts"],"sourcesContent":["import type { AddonActionContext, AddonActionPreset } from '@ng-forge/dynamic-forms';\nimport { runPresetAction, type PresetCollaborators } from '@ng-forge/dynamic-forms/integration';\n\nexport type { PresetCollaborators };\n\n/** Material adapter binding for the shared preset runner. */\nexport function runMatPresetAction(\n preset: AddonActionPreset,\n context: AddonActionContext,\n collaborators: PresetCollaborators,\n): Promise<void> {\n return runPresetAction(preset, context, collaborators, 'Material', 'mat-input');\n}\n"]}
|