@energinet/watt 4.2.12 → 4.2.13
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.
|
@@ -29,6 +29,7 @@ export class WattTextAreaFieldComponent {
|
|
|
29
29
|
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
|
|
30
30
|
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
31
31
|
small = input(false, ...(ngDevMode ? [{ debugName: "small", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
32
|
+
resize = input('none', ...(ngDevMode ? [{ debugName: "resize" }] : []));
|
|
32
33
|
onInput(event) {
|
|
33
34
|
const target = event.target;
|
|
34
35
|
this.value.set(target.value);
|
|
@@ -54,7 +55,7 @@ export class WattTextAreaFieldComponent {
|
|
|
54
55
|
this.isDisabled.set(isDisabled);
|
|
55
56
|
}
|
|
56
57
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTextAreaFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: WattTextAreaFieldComponent, isStandalone: true, selector: "watt-textarea-field", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, small: { classPropertyName: "small", publicName: "small", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.watt-field-disabled": "isDisabled()" } }, providers: [
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.15", type: WattTextAreaFieldComponent, isStandalone: true, selector: "watt-textarea-field", inputs: { formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, small: { classPropertyName: "small", publicName: "small", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.watt-field-disabled": "isDisabled()", "attr.small": "small()", "attr.resize": "resize()" } }, providers: [
|
|
58
59
|
{
|
|
59
60
|
provide: NG_VALUE_ACCESSOR,
|
|
60
61
|
useExisting: forwardRef(() => WattTextAreaFieldComponent),
|
|
@@ -71,7 +72,7 @@ export class WattTextAreaFieldComponent {
|
|
|
71
72
|
></textarea>
|
|
72
73
|
<ng-content ngProjectAs="watt-field-hint" select="watt-field-hint" />
|
|
73
74
|
<ng-content ngProjectAs="watt-field-error" select="watt-field-error" />
|
|
74
|
-
</watt-field>`, isInline: true, styles: ["watt-textarea-field{display:block;width:100%;--watt-textarea-min-height: 200px}watt-textarea-field[small]{--watt-textarea-min-height: 80px}watt-textarea-field textarea{border:none;width:100%;outline:none;padding:var(--watt-space-s);padding-left:0;background-color:transparent;min-height:var(--watt-textarea-min-height)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
75
|
+
</watt-field>`, isInline: true, styles: ["watt-textarea-field{display:block;width:100%;--watt-textarea-min-height: 200px}watt-textarea-field[small=true]{--watt-textarea-min-height: 80px}watt-textarea-field textarea{border:none;width:100%;outline:none;padding:var(--watt-space-s);padding-left:0;background-color:transparent;min-height:var(--watt-textarea-min-height)}watt-textarea-field[resize=none] textarea{resize:none}watt-textarea-field[resize=horizontal] textarea{resize:horizontal}watt-textarea-field[resize=vertical] textarea{resize:vertical}watt-textarea-field[resize=both] textarea{resize:both}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
75
76
|
}
|
|
76
77
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattTextAreaFieldComponent, decorators: [{
|
|
77
78
|
type: Component,
|
|
@@ -94,6 +95,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
94
95
|
<ng-content ngProjectAs="watt-field-error" select="watt-field-error" />
|
|
95
96
|
</watt-field>`, host: {
|
|
96
97
|
'[attr.watt-field-disabled]': 'isDisabled()',
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
'[attr.small]': 'small()',
|
|
99
|
+
'[attr.resize]': 'resize()',
|
|
100
|
+
}, styles: ["watt-textarea-field{display:block;width:100%;--watt-textarea-min-height: 200px}watt-textarea-field[small=true]{--watt-textarea-min-height: 80px}watt-textarea-field textarea{border:none;width:100%;outline:none;padding:var(--watt-space-s);padding-left:0;background-color:transparent;min-height:var(--watt-textarea-min-height)}watt-textarea-field[resize=none] textarea{resize:none}watt-textarea-field[resize=horizontal] textarea{resize:horizontal}watt-textarea-field[resize=vertical] textarea{resize:vertical}watt-textarea-field[resize=both] textarea{resize:both}\n"] }]
|
|
101
|
+
}], propDecorators: { formControl: [{ type: i0.Input, args: [{ isSignal: true, alias: "formControl", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], small: [{ type: i0.Input, args: [{ isSignal: true, alias: "small", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
99
102
|
//# sourceMappingURL=watt-textarea-field.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watt-textarea-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/textarea-field/watt-textarea-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN,UAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqC,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;
|
|
1
|
+
{"version":3,"file":"watt-textarea-field.component.js","sourceRoot":"","sources":["../../../../libs/watt/package/textarea-field/watt-textarea-field.component.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB;;;;;;;;;;;;;;;GAeG;AACH,YAAY;AACZ,OAAO,EACL,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN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AAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,cAAc;IACd,gBAAgB,CAAC,UAAmB;QAClC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;wGAxCU,0BAA0B;4FAA1B,0BAA0B,suCA5B1B;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;gBACzD,KAAK,EAAE,IAAI;aACZ;SACF,0BAIS;;;;;;;;;;;gBAWI,2nBAtBJ,WAAW,+BAAE,kBAAkB;;4FA6B9B,0BAA0B;kBA9BtC,SAAS;8BACC,CAAC,WAAW,EAAE,kBAAkB,CAAC,aAC/B;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;4BACzD,KAAK,EAAE,IAAI;yBACZ;qBACF,YACS,qBAAqB,iBAEhB,iBAAiB,CAAC,IAAI,YAC3B;;;;;;;;;;;gBAWI,QACR;wBACJ,4BAA4B,EAAE,cAAc;wBAC5C,cAAc,EAAE,SAAS;wBACzB,eAAe,EAAE,UAAU;qBAC5B","sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n forwardRef,\n ViewEncapsulation,\n inject,\n ElementRef,\n input,\n model,\n signal,\n booleanAttribute,\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { WattFieldComponent } from '@energinet/watt/field';\n\n@Component({\n imports: [FormsModule, WattFieldComponent],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattTextAreaFieldComponent),\n multi: true,\n },\n ],\n selector: 'watt-textarea-field',\n styleUrls: ['./watt-textarea-field.component.scss'],\n encapsulation: ViewEncapsulation.None,\n template: `<watt-field [label]=\"label()\" [control]=\"formControl()\">\n <textarea\n [attr.placeholder]=\"placeholder()\"\n [value]=\"value()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.maxlength]=\"maxLength()\"\n (input)=\"onInput($event)\"\n ></textarea>\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n </watt-field>`,\n host: {\n '[attr.watt-field-disabled]': 'isDisabled()',\n '[attr.small]': 'small()',\n '[attr.resize]': 'resize()',\n },\n})\nexport class WattTextAreaFieldComponent implements ControlValueAccessor {\n /** @ignore */\n private element = inject(ElementRef);\n formControl = input.required<FormControl>();\n placeholder = input<string>();\n required = input(false);\n maxLength = input<string | number | null>(null);\n label = input<string>();\n small = input(false, { transform: booleanAttribute });\n resize = input<'none' | 'horizontal' | 'vertical' | 'both'>('none');\n\n onInput(event: Event) {\n const target = event.target as HTMLTextAreaElement;\n this.value.set(target.value);\n }\n\n /** @ignore */\n value = model<string>('');\n\n /** @ignore */\n isDisabled = signal(false);\n\n /** @ignore */\n writeValue(value: string): void {\n this.value.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string) => void): void {\n this.value.subscribe(fn);\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.element.nativeElement.addEventListener('focusout', fn);\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ export declare class WattTextAreaFieldComponent implements ControlValueAccessor
|
|
|
9
9
|
maxLength: import("@angular/core").InputSignal<string | number | null>;
|
|
10
10
|
label: import("@angular/core").InputSignal<string | undefined>;
|
|
11
11
|
small: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
12
|
+
resize: import("@angular/core").InputSignal<"none" | "horizontal" | "vertical" | "both">;
|
|
12
13
|
onInput(event: Event): void;
|
|
13
14
|
/** @ignore */
|
|
14
15
|
value: import("@angular/core").ModelSignal<string>;
|
|
@@ -23,5 +24,5 @@ export declare class WattTextAreaFieldComponent implements ControlValueAccessor
|
|
|
23
24
|
/** @ignore */
|
|
24
25
|
setDisabledState(isDisabled: boolean): void;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<WattTextAreaFieldComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WattTextAreaFieldComponent, "watt-textarea-field", never, { "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "small": { "alias": "small"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["watt-field-hint", "watt-field-error"], true, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WattTextAreaFieldComponent, "watt-textarea-field", never, { "formControl": { "alias": "formControl"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "small": { "alias": "small"; "required": false; "isSignal": true; }; "resize": { "alias": "resize"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["watt-field-hint", "watt-field-error"], true, never>;
|
|
27
28
|
}
|