@energinet/watt 4.3.21 → 4.3.23
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/core/breakpoints/_include-media.scss +15 -3
- package/fesm2022/energinet-watt-field.mjs +2 -2
- package/fesm2022/energinet-watt-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-separator.mjs +10 -8
- package/fesm2022/energinet-watt-separator.mjs.map +1 -1
- package/fesm2022/energinet-watt-textarea-field.mjs +35 -3
- package/fesm2022/energinet-watt-textarea-field.mjs.map +1 -1
- package/fesm2022/energinet-watt-tooltip.mjs +67 -86
- package/fesm2022/energinet-watt-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/energinet-watt-separator.d.ts +8 -6
- package/types/energinet-watt-textarea-field.d.ts +8 -2
- package/types/energinet-watt-tooltip.d.ts +4 -4
|
@@ -276,7 +276,11 @@ $im-no-media-expressions: ("screen", "portrait", "landscape") !default;
|
|
|
276
276
|
/// @return {String} - `min` or `max`
|
|
277
277
|
///
|
|
278
278
|
@function get-expression-prefix($operator) {
|
|
279
|
-
@
|
|
279
|
+
@if list.index(("<", "<=", "≤"), $operator) {
|
|
280
|
+
@return "max";
|
|
281
|
+
} @else {
|
|
282
|
+
@return "min";
|
|
283
|
+
}
|
|
280
284
|
}
|
|
281
285
|
|
|
282
286
|
///
|
|
@@ -407,7 +411,11 @@ $im-no-media-expressions: ("screen", "portrait", "landscape") !default;
|
|
|
407
411
|
$character: string.slice($value, $i, $i);
|
|
408
412
|
|
|
409
413
|
@if not(list.index(map.keys($numbers), $character) or $character == ".") {
|
|
410
|
-
|
|
414
|
+
$signed-result: $result;
|
|
415
|
+
@if $minus {
|
|
416
|
+
$signed-result: -$result;
|
|
417
|
+
}
|
|
418
|
+
@return to-length($signed-result, string.slice($value, $i));
|
|
411
419
|
}
|
|
412
420
|
|
|
413
421
|
@if $character == "." {
|
|
@@ -420,7 +428,11 @@ $im-no-media-expressions: ("screen", "portrait", "landscape") !default;
|
|
|
420
428
|
}
|
|
421
429
|
}
|
|
422
430
|
|
|
423
|
-
@
|
|
431
|
+
@if $minus {
|
|
432
|
+
@return -$result;
|
|
433
|
+
} @else {
|
|
434
|
+
@return $result;
|
|
435
|
+
}
|
|
424
436
|
}
|
|
425
437
|
|
|
426
438
|
///
|
|
@@ -185,7 +185,7 @@ class WattFieldComponent {
|
|
|
185
185
|
<watt-field-error>{{ intl.required }}</watt-field-error>
|
|
186
186
|
}
|
|
187
187
|
</ng-template>
|
|
188
|
-
`, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field :is(watt-field-error,watt-field-warning),.ng-valid watt-field :is(watt-field-error,watt-field-warning),watt-field:has(.ng-valid) :is(watt-field-error,watt-field-warning){display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,form.ng-submitted watt-field:has(.ng-invalid) watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors :is(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning){display:block}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label.required:after,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label.required:after,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label.required:after{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning){padding-bottom:0}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label{color:var(--watt-text-color)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper{border-color:var(--watt-color-state-warning)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip,:has(watt-field-hint)){padding-bottom:20px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\"}watt-field>label,watt-field>.watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field>label .watt-field-wrapper,watt-field>.watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding:0 var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field>label .watt-field-wrapper:focus-within,watt-field>.watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field>label watt-field-hint,watt-field>label watt-field-error,watt-field>label watt-field-warning,watt-field>.watt-label watt-field-hint,watt-field>.watt-label watt-field-error,watt-field>.watt-label watt-field-warning{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field>label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning),watt-field>.watt-label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning){padding:0 var(--watt-space-s)}watt-field:not(.watt-field--box)
|
|
188
|
+
`, isInline: true, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field :is(watt-field-error,watt-field-warning),.ng-valid watt-field :is(watt-field-error,watt-field-warning),watt-field:has(.ng-valid) :is(watt-field-error,watt-field-warning){display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,form.ng-submitted watt-field:has(.ng-invalid) watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors :is(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning){display:block}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label.required:after,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label.required:after,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label.required:after{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning){padding-bottom:0}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label{color:var(--watt-text-color)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper{border-color:var(--watt-color-state-warning)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip,:has(watt-field-hint)){padding-bottom:20px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\"}watt-field>label,watt-field>.watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field>label .watt-field-wrapper,watt-field>.watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding:0 var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field>label .watt-field-wrapper:focus-within,watt-field>.watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field>label watt-field-hint,watt-field>label watt-field-error,watt-field>label watt-field-warning,watt-field>.watt-label watt-field-hint,watt-field>.watt-label watt-field-error,watt-field>.watt-label watt-field-warning{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field>label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning),watt-field>.watt-label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning){padding:0 var(--watt-space-s)}watt-field:not(.watt-field--box)>:is(label,.watt-label)>vater-flex>.watt-field-wrapper{border:none;padding:0}watt-field.watt-field--chip watt-field-hint,watt-field.watt-field--chip watt-field-error,watt-field.watt-field--chip watt-field-warning{margin-top:var(--watt-space-xs)}watt-field.watt-field--box .watt-field-wrapper{min-height:46px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "directive", type: WattTooltipDirective, selector: "[wattTooltip]", inputs: ["wattTooltip", "wattTooltipPosition", "wattTooltipVariant", "wattTooltipAlwaysVisible"], exportAs: ["wattTooltip"] }, { kind: "component", type: WattFieldErrorComponent, selector: "watt-field-error" }, { kind: "component", type: VaterFlexComponent, selector: "vater-flex, [vater-flex]", inputs: ["autoSize"] }, { kind: "directive", type: VaterUtilityDirective, selector: "[vater]", inputs: ["center", "fill", "inset", "scrollable", "sticky", "fragment", "contain"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
189
189
|
}
|
|
190
190
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattFieldComponent, decorators: [{
|
|
191
191
|
type: Component,
|
|
@@ -247,7 +247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
247
247
|
'[class.watt-field--disabled]': 'control()?.disabled',
|
|
248
248
|
'[class.watt-field--show-errors]': 'showErrors()',
|
|
249
249
|
'[class]': 'className()',
|
|
250
|
-
}, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field :is(watt-field-error,watt-field-warning),.ng-valid watt-field :is(watt-field-error,watt-field-warning),watt-field:has(.ng-valid) :is(watt-field-error,watt-field-warning){display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,form.ng-submitted watt-field:has(.ng-invalid) watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors :is(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning){display:block}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label.required:after,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label.required:after,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label.required:after{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning){padding-bottom:0}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label{color:var(--watt-text-color)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper{border-color:var(--watt-color-state-warning)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip,:has(watt-field-hint)){padding-bottom:20px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\"}watt-field>label,watt-field>.watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field>label .watt-field-wrapper,watt-field>.watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding:0 var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field>label .watt-field-wrapper:focus-within,watt-field>.watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field>label watt-field-hint,watt-field>label watt-field-error,watt-field>label watt-field-warning,watt-field>.watt-label watt-field-hint,watt-field>.watt-label watt-field-error,watt-field>.watt-label watt-field-warning{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field>label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning),watt-field>.watt-label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning){padding:0 var(--watt-space-s)}watt-field:not(.watt-field--box)
|
|
250
|
+
}, styles: ["[watt-field-disabled=true] watt-field .label,.watt-field--disabled .label{color:var(--watt-disabled-text-label-color)}[watt-field-disabled=true] .watt-field-wrapper,.watt-field--disabled .watt-field-wrapper{background-color:var(--watt-field-disabled-background-color)}watt-field watt-field-hint{display:block}watt-field :is(watt-field-error,watt-field-warning),.ng-valid watt-field :is(watt-field-error,watt-field-warning),watt-field:has(.ng-valid) :is(watt-field-error,watt-field-warning){display:none}form.ng-submitted .ng-invalid watt-field watt-field-hint,form.ng-submitted watt-field:has(.ng-invalid) watt-field-hint,:not(form).ng-touched.ng-invalid watt-field watt-field-hint{display:none}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors :is(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors :is(watt-field-error,watt-field-warning){display:block}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .watt-field-wrapper{border-color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors .label.required:after,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors .label.required:after,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors .label.required:after{color:var(--watt-color-state-danger)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning),form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-error,watt-field-warning),:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-error,watt-field-warning){padding-bottom:0}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .label{color:var(--watt-text-color)}form.ng-submitted .ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,form.ng-submitted watt-field:has(.ng-invalid).watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper,:not(form).ng-touched.ng-invalid watt-field.watt-field--show-errors:has(watt-field-warning):not(:has(watt-field-error)) .watt-field-wrapper{border-color:var(--watt-color-state-warning)}.watt-field-wrapper input{width:100%;border:none;outline:none;background-color:transparent}.watt-field-placeholder{position:absolute;padding:1px 2px;pointer-events:none;white-space:nowrap}.watt-field--has-placeholder input,.watt-field-placeholder{font-family:Droid Sans Mono,monospace;letter-spacing:-.03em}.watt-field-filler{color:var(--watt-on-light-low-emphasis)}.watt-field-ghost{color:transparent}watt-field{--watt-text-color: var(--watt-on-light-high-emphasis);--watt-disabled-text-label-color: var(--watt-on-light-low-emphasis);--watt-field-disabled-background-color: var(--watt-color-neutral-grey-100);--watt-input-border-radius: 4px;--watt-border-color: var(--watt-on-light-low-emphasis);--watt-label-text-color: var(--watt-text-color);width:100%;display:block}watt-field:not(.watt-field--chip,:has(watt-field-hint)){padding-bottom:20px}watt-field .label{min-height:27px;display:flex;align-items:center}watt-field .label watt-icon{margin-left:var(--watt-space-s)}watt-field .label watt-tooltip{max-width:250px}watt-field .label.required:after{content:\"*\"}watt-field>label,watt-field>.watt-label{color:var(--watt-label-text-color);display:block;width:100%}watt-field>label .watt-field-wrapper,watt-field>.watt-label .watt-field-wrapper{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;display:flex;position:relative;width:100%;padding:0 var(--watt-space-s);border-radius:var(--watt-input-border-radius);border:1px solid var(--watt-border-color);overflow:hidden;color:var(--watt-text-color);align-items:center;gap:var(--watt-space-m);background-color:var(--watt-color-neutral-white)}watt-field>label .watt-field-wrapper:focus-within,watt-field>.watt-label .watt-field-wrapper:focus-within{--watt-border-color: var(--watt-color-primary)}watt-field>label watt-field-hint,watt-field>label watt-field-error,watt-field>label watt-field-warning,watt-field>.watt-label watt-field-hint,watt-field>.watt-label watt-field-error,watt-field>.watt-label watt-field-warning{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0}watt-field>label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning),watt-field>.watt-label :not(.watt-field--chip) :is(watt-field-hint,watt-field-error,watt-field-warning){padding:0 var(--watt-space-s)}watt-field:not(.watt-field--box)>:is(label,.watt-label)>vater-flex>.watt-field-wrapper{border:none;padding:0}watt-field.watt-field--chip watt-field-hint,watt-field.watt-field--chip watt-field-error,watt-field.watt-field--chip watt-field-warning{margin-top:var(--watt-space-xs)}watt-field.watt-field--box .watt-field-wrapper{min-height:46px}\n"] }]
|
|
251
251
|
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], chipMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipMode", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], anchorName: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorName", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], labelElement: [{ type: i0.ViewChild, args: ['label', { isSignal: true }] }], wattLabelElement: [{ type: i0.ViewChild, args: ['wattLabel', { isSignal: true }] }], showErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "showErrors", required: false }] }], wrapper: [{ type: i0.ViewChild, args: ['wrapper', { isSignal: true }] }] } });
|
|
252
252
|
|
|
253
253
|
//#region License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-field.mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/watt-field-warning.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"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 { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#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 ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n\n effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#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 { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\n","//#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\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldWarningComponent } from './watt-field-warning.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrBlC;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAea,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,4EAVxB,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,0DAAA,CAAA,EAAA,a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mjs","sources":["../../../libs/watt/package/field/watt-field-intl.service.ts","../../../libs/watt/package/field/watt-field-error.component.ts","../../../libs/watt/package/field/watt-field.component.ts","../../../libs/watt/package/field/watt-field-hint.component.ts","../../../libs/watt/package/field/watt-field-warning.component.ts","../../../libs/watt/package/field/index.ts","../../../libs/watt/package/field/energinet-watt-field.ts"],"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 { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class WattFieldIntlService {\n readonly changes: Subject<void> = new Subject<void>();\n required = 'Field is required';\n}\n","//#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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-error',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-error {\n color: var(--watt-color-state-danger);\n }\n `,\n ],\n})\nexport class WattFieldErrorComponent {}\n","//#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 ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FormControl, ValidationErrors, Validators } from '@angular/forms';\nimport { filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattTooltipDirective } from '@energinet/watt/tooltip';\nimport { VaterFlexComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattRangeValidators } from '@energinet/watt/validators';\n\nimport { WattFieldIntlService } from './watt-field-intl.service';\nimport { WattFieldErrorComponent } from './watt-field-error.component';\n\n@Component({\n selector: 'watt-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [\n NgTemplateOutlet,\n WattIconComponent,\n WattTooltipDirective,\n WattFieldErrorComponent,\n VaterFlexComponent,\n VaterUtilityDirective,\n ],\n styleUrls: ['./watt-field.component.scss'],\n template: `\n @if (chipMode() || displayMode() !== 'box') {\n <span [attr.autofocus]=\"autoFocus() || null\" class=\"watt-label\" #wattLabel>\n <ng-container *ngTemplateOutlet=\"template\" />\n </span>\n } @else {\n <label [attr.autofocus]=\"autoFocus() || null\" [attr.for]=\"id()\" #label>\n <ng-container *ngTemplateOutlet=\"template\" />\n </label>\n }\n\n <ng-template #template>\n @if (label()) {\n <span class=\"label\" [class.required]=\"isRequired()\">\n {{ label() }}\n @if (tooltip(); as tooltip) {\n <watt-icon name=\"info\" wattTooltipPosition=\"top\" [wattTooltip]=\"tooltip\" />\n }\n </span>\n }\n <vater-flex direction=\"row\" gap=\"s\" align=\"center\">\n <div\n vater\n fill=\"horizontal\"\n #wrapper\n class=\"watt-field-wrapper\"\n [class.watt-field--has-placeholder]=\"!!placeholder()\"\n [style.anchor-name]=\"anchorName()\"\n >\n @if (placeholder()) {\n <div class=\"watt-field-placeholder\" aria-hidden=\"true\">\n <span class=\"watt-field-ghost\">{{ ghost() }}</span>\n <span class=\"watt-field-filler\">{{ filler() }}</span>\n </div>\n }\n <ng-content />\n </div>\n <ng-content select=\"watt-field-descriptor\" />\n </vater-flex>\n <ng-content select=\"[popover]\" />\n <ng-content select=\"watt-field-hint\" />\n <ng-content select=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" />\n @if (isEmpty()) {\n <watt-field-error>{{ intl.required }}</watt-field-error>\n }\n </ng-template>\n `,\n host: {\n '[class.watt-field--disabled]': 'control()?.disabled',\n '[class.watt-field--show-errors]': 'showErrors()',\n '[class]': 'className()',\n },\n})\nexport class WattFieldComponent {\n intl = inject(WattFieldIntlService);\n elementRef = inject<ElementRef>(ElementRef);\n\n control = input<FormControl | null>(null);\n label = input<string>();\n id = input<string>();\n /** @deprecated Use `displayMode` instead. */\n chipMode = input(false);\n tooltip = input<string>();\n placeholder = input('');\n anchorName = input<string>();\n displayMode = input<'box' | 'chip' | 'content'>('box');\n className = computed(() => `watt-field--${this.chipMode() ? 'chip' : this.displayMode()}`);\n\n /**\n * Whether the input should receive focus when the component is rendered.\n */\n autoFocus = input(false);\n\n /** @ignore */\n labelElement = viewChild<ElementRef<HTMLLabelElement>>('label');\n wattLabelElement = viewChild<ElementRef<HTMLSpanElement>>('wattLabel');\n\n value = signal('');\n filler = computed(() => this.placeholder().slice(this.value().length));\n ghost = computed(() => this.value().slice(0, this.placeholder().length));\n\n errors = signal<ValidationErrors | null>(null);\n isRequired = signal(false);\n isEmpty = computed(() => this.errors()?.['required'] || this.errors()?.['rangeRequired']);\n showErrors = input(true);\n\n // Used for text fields with autocomplete\n wrapper = viewChild<ElementRef>('wrapper');\n\n constructor() {\n const control$ = toObservable(this.control).pipe(filter((control) => control !== null));\n\n // Track value in order to update ghost and filler\n const value$ = control$.pipe(\n switchMap((control) =>\n control.valueChanges.pipe(\n startWith(control.value),\n map((value) => (value === null || value === undefined ? '' : value.toString())),\n tap((value) => this.value.set(value))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Track status in order to update required state and show errors\n const status$ = control$.pipe(\n switchMap((control) =>\n control.statusChanges.pipe(\n startWith(control.status),\n tap(() => this.isRequired.set(this.isRequiredControl(control))),\n tap(() => this.errors.set(control.errors))\n )\n ),\n takeUntilDestroyed()\n );\n\n // Subscribe for side effects\n value$.subscribe();\n status$.subscribe();\n\n effect(() => {\n if (this.autoFocus()) {\n if (this.chipMode()) {\n this.wattLabelElement()?.nativeElement.focus();\n } else {\n this.labelElement()?.nativeElement.focus();\n }\n }\n });\n }\n\n isRequiredControl(control: FormControl) {\n const validators = [Validators.required, WattRangeValidators.required];\n return validators.some((validator) => control.hasValidator(validator));\n }\n}\n","//#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 { Component } from '@angular/core';\n\n@Component({\n selector: 'watt-field-hint',\n styles: [\n `\n :host {\n color: var(--watt-color-neutral-grey-700);\n }\n `,\n ],\n template: `<ng-content />`,\n})\nexport class WattFieldHintComponent {}\n","//#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 { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-field-warning',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: [\n `\n watt-field-warning {\n color: var(--watt-color-state-warning);\n }\n `,\n ],\n})\nexport class WattFieldWarningComponent {}\n","//#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\nexport { WattFieldComponent } from './watt-field.component';\nexport { WattFieldErrorComponent } from './watt-field-error.component';\nexport { WattFieldHintComponent } from './watt-field-hint.component';\nexport { WattFieldWarningComponent } from './watt-field-warning.component';\nexport { WattFieldIntlService } from './watt-field-intl.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAKa,oBAAoB,CAAA;AACtB,IAAA,OAAO,GAAkB,IAAI,OAAO,EAAQ;IACrD,QAAQ,GAAG,mBAAmB;uGAFnB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAApB,IAAA,OAAA,KAAA,GAAA,E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AAA,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,8EAV1B,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAUf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAZrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,QAAA,EACpB,CAAA,cAAA,CAAgB,EAAA,aAAA,EACX,iBAAiB,CAAC,IAAI,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA;;;ACvBvC;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
//#region License
|
|
5
5
|
/**
|
|
@@ -24,17 +24,19 @@ import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
|
24
24
|
* `import { WattSeparatorComponent } from '@energinet/watt/separator';`
|
|
25
25
|
*/
|
|
26
26
|
class WattSeparatorComponent {
|
|
27
|
-
|
|
27
|
+
weight = input('regular', ...(ngDevMode ? [{ debugName: "weight" }] : []));
|
|
28
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
28
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", type: WattSeparatorComponent, isStandalone: true, selector: "watt-separator", inputs: {
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", type: WattSeparatorComponent, isStandalone: true, selector: "watt-separator", inputs: { weight: { classPropertyName: "weight", publicName: "weight", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-orientation": "orientation()", "attr.role": "\"separator\"", "class": "\"watt-separator--\" + orientation() + \" watt-separator--\" + weight()" } }, ngImport: i0, template: '', isInline: true, styles: ["watt-separator{display:block;border-color:var(--watt-color-neutral-grey-300);border-style:solid;border-width:0}watt-separator.watt-separator--horizontal{width:100%;border-top-width:1px}watt-separator.watt-separator--horizontal.watt-separator--bold{border-top-width:2px}watt-separator.watt-separator--vertical{align-self:stretch;height:auto;border-left-width:1px}watt-separator.watt-separator--vertical.watt-separator--bold{border-left-width:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
30
31
|
}
|
|
31
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattSeparatorComponent, decorators: [{
|
|
32
33
|
type: Component,
|
|
33
|
-
args: [{ selector: 'watt-separator', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
34
|
-
|
|
35
|
-
'[
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
args: [{ selector: 'watt-separator', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
35
|
+
'[attr.aria-orientation]': 'orientation()',
|
|
36
|
+
'[attr.role]': '"separator"',
|
|
37
|
+
'[class]': '"watt-separator--" + orientation() + " watt-separator--" + weight()',
|
|
38
|
+
}, template: '', styles: ["watt-separator{display:block;border-color:var(--watt-color-neutral-grey-300);border-style:solid;border-width:0}watt-separator.watt-separator--horizontal{width:100%;border-top-width:1px}watt-separator.watt-separator--horizontal.watt-separator--bold{border-top-width:2px}watt-separator.watt-separator--vertical{align-self:stretch;height:auto;border-left-width:1px}watt-separator.watt-separator--vertical.watt-separator--bold{border-left-width:2px}\n"] }]
|
|
39
|
+
}], propDecorators: { weight: [{ type: i0.Input, args: [{ isSignal: true, alias: "weight", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
|
|
38
40
|
|
|
39
41
|
//#region License
|
|
40
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-separator.mjs","sources":["../../../libs/watt/package/separator/watt-separator.component.ts","../../../libs/watt/package/separator/index.ts","../../../libs/watt/package/separator/energinet-watt-separator.ts"],"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 { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nexport type
|
|
1
|
+
{"version":3,"file":"energinet-watt-separator.mjs","sources":["../../../libs/watt/package/separator/watt-separator.component.ts","../../../libs/watt/package/separator/index.ts","../../../libs/watt/package/separator/energinet-watt-separator.ts"],"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 { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\n\nexport type WattSeparatorWeight = 'regular' | 'bold';\nexport type WattSeparatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Usage:\n * `import { WattSeparatorComponent } from '@energinet/watt/separator';`\n */\n@Component({\n selector: 'watt-separator',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.aria-orientation]': 'orientation()',\n '[attr.role]': '\"separator\"',\n '[class]': '\"watt-separator--\" + orientation() + \" watt-separator--\" + weight()',\n },\n template: '',\n styles: `\n watt-separator {\n display: block;\n border-color: var(--watt-color-neutral-grey-300);\n border-style: solid;\n border-width: 0;\n }\n\n watt-separator.watt-separator--horizontal {\n width: 100%;\n border-top-width: 1px;\n }\n\n watt-separator.watt-separator--horizontal.watt-separator--bold {\n border-top-width: 2px;\n }\n\n watt-separator.watt-separator--vertical {\n align-self: stretch;\n height: auto;\n border-left-width: 1px;\n }\n\n watt-separator.watt-separator--vertical.watt-separator--bold {\n border-left-width: 2px;\n }\n `,\n})\nexport class WattSeparatorComponent {\n weight = input<WattSeparatorWeight>('regular');\n orientation = input<WattSeparatorOrientation>('horizontal');\n}\n","//#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\nexport { WattSeparatorComponent, WattSeparatorWeight } from './watt-separator.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAMA;;;AAGG;MAuCU,sBAAsB,CAAA;AACjC,IAAA,MAAM,GAAG,KAAK,CAAsB,SAAS,kDAAC;AAC9C,IAAA,WAAW,GAAG,KAAK,CAA2B,YAAY,uDAAC;uGAFhD,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,ihBA7BvB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,icAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FA6BD,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAtClC,SAAS;+BACE,gBAAgB,EAAA,eAAA,EACT,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,yBAAyB,EAAE,eAAe;AAC1C,wBAAA,aAAa,EAAE,aAAa;AAC5B,wBAAA,SAAS,EAAE,qEAAqE;AACjF,qBAAA,EAAA,QAAA,EACS,EAAE,EAAA,MAAA,EAAA,CAAA,icAAA,CAAA,EAAA;;;ACpCd;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -65,6 +65,7 @@ class WattTextAreaFieldComponent {
|
|
|
65
65
|
},
|
|
66
66
|
], ngImport: i0, template: `<watt-field [label]="label()" [control]="formControl()">
|
|
67
67
|
<div class="textarea-wrapper">
|
|
68
|
+
<ng-content select="watt-textarea-notice" />
|
|
68
69
|
<textarea
|
|
69
70
|
[attr.placeholder]="placeholder()"
|
|
70
71
|
[value]="value()"
|
|
@@ -81,7 +82,7 @@ class WattTextAreaFieldComponent {
|
|
|
81
82
|
|
|
82
83
|
<ng-content ngProjectAs="watt-field-hint" select="watt-field-hint" />
|
|
83
84
|
<ng-content ngProjectAs="watt-field-error" select="watt-field-error" />
|
|
84
|
-
</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-wrapper{width:100%}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 .textarea-footer{padding:0 0 var(--watt-space-s) 0}watt-textarea-field .textarea-footer:empty{display:none}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"] }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }], encapsulation: i0.ViewEncapsulation.None });
|
|
85
|
+
</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-wrapper{width:100%}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 .textarea-footer{padding:0 0 var(--watt-space-s) 0}watt-textarea-field .textarea-footer:empty{display:none}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}watt-textarea-field .watt-field-wrapper{padding:0!important}watt-textarea-field .watt-field-wrapper textarea,watt-textarea-field .watt-field-wrapper .textarea-footer{padding:var(--watt-space-m) var(--watt-space-s) var(--watt-space-s) var(--watt-space-s)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }], encapsulation: i0.ViewEncapsulation.None });
|
|
85
86
|
}
|
|
86
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTextAreaFieldComponent, decorators: [{
|
|
87
88
|
type: Component,
|
|
@@ -93,6 +94,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
93
94
|
},
|
|
94
95
|
], selector: 'watt-textarea-field', encapsulation: ViewEncapsulation.None, template: `<watt-field [label]="label()" [control]="formControl()">
|
|
95
96
|
<div class="textarea-wrapper">
|
|
97
|
+
<ng-content select="watt-textarea-notice" />
|
|
96
98
|
<textarea
|
|
97
99
|
[attr.placeholder]="placeholder()"
|
|
98
100
|
[value]="value()"
|
|
@@ -113,9 +115,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
113
115
|
'[attr.watt-field-disabled]': 'isDisabled()',
|
|
114
116
|
'[attr.small]': 'small()',
|
|
115
117
|
'[attr.resize]': 'resize()',
|
|
116
|
-
}, 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-wrapper{width:100%}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 .textarea-footer{padding:0 0 var(--watt-space-s) 0}watt-textarea-field .textarea-footer:empty{display:none}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"] }]
|
|
118
|
+
}, 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-wrapper{width:100%}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 .textarea-footer{padding:0 0 var(--watt-space-s) 0}watt-textarea-field .textarea-footer:empty{display:none}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}watt-textarea-field .watt-field-wrapper{padding:0!important}watt-textarea-field .watt-field-wrapper textarea,watt-textarea-field .watt-field-wrapper .textarea-footer{padding:var(--watt-space-m) var(--watt-space-s) var(--watt-space-s) var(--watt-space-s)}\n"] }]
|
|
117
119
|
}], 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"] }] } });
|
|
118
120
|
|
|
121
|
+
//#region License
|
|
122
|
+
/**
|
|
123
|
+
* @license
|
|
124
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
125
|
+
*
|
|
126
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
127
|
+
* you may not use this file except in compliance with the License.
|
|
128
|
+
* You may obtain a copy of the License at
|
|
129
|
+
*
|
|
130
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
131
|
+
*
|
|
132
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
133
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
134
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
135
|
+
* See the License for the specific language governing permissions and
|
|
136
|
+
* limitations under the License.
|
|
137
|
+
*/
|
|
138
|
+
//#endregion
|
|
139
|
+
class WattTextareaNoticeComponent {
|
|
140
|
+
type = input('info', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTextareaNoticeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.5", type: WattTextareaNoticeComponent, isStandalone: true, selector: "watt-textarea-notice", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.type": "type()" } }, ngImport: i0, template: `<ng-content />`, isInline: true, styles: ["watt-textarea-notice{display:flex;align-items:center;gap:var(--watt-space-s);padding:var(--watt-space-xs) var(--watt-space-s);color:var(--watt-on-light-high-emphasis);background:var(--watt-color-neutral-grey-200)}watt-textarea-notice[type=danger]{color:var(--watt-color-state-danger);background:var(--watt-color-state-danger-light)}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
143
|
+
}
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTextareaNoticeComponent, decorators: [{
|
|
145
|
+
type: Component,
|
|
146
|
+
args: [{ selector: 'watt-textarea-notice', template: `<ng-content />`, encapsulation: ViewEncapsulation.None, host: {
|
|
147
|
+
'[attr.type]': 'type()',
|
|
148
|
+
}, styles: ["watt-textarea-notice{display:flex;align-items:center;gap:var(--watt-space-s);padding:var(--watt-space-xs) var(--watt-space-s);color:var(--watt-on-light-high-emphasis);background:var(--watt-color-neutral-grey-200)}watt-textarea-notice[type=danger]{color:var(--watt-color-state-danger);background:var(--watt-color-state-danger-light)}\n"] }]
|
|
149
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
150
|
+
|
|
119
151
|
//#region License
|
|
120
152
|
/**
|
|
121
153
|
* @license
|
|
@@ -139,5 +171,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
139
171
|
* Generated bundle index. Do not edit.
|
|
140
172
|
*/
|
|
141
173
|
|
|
142
|
-
export { WattTextAreaFieldComponent };
|
|
174
|
+
export { WattTextAreaFieldComponent, WattTextareaNoticeComponent };
|
|
143
175
|
//# sourceMappingURL=energinet-watt-textarea-field.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-textarea-field.mjs","sources":["../../../libs/watt/package/textarea-field/watt-textarea-field.component.ts","../../../libs/watt/package/textarea-field/index.ts","../../../libs/watt/package/textarea-field/energinet-watt-textarea-field.ts"],"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';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\n@Component({\n imports: [FormsModule, WattFieldComponent, VaterStackComponent],\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 <div class=\"textarea-wrapper\">\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\n <vater-stack direction=\"row\" wrap gap=\"s\" class=\"textarea-footer\">\n <ng-content />\n </vater-stack>\n </div>\n\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","//#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\nexport { WattTextAreaFieldComponent } from './watt-textarea-field.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAsDa,0BAA0B,CAAA;;AAE7B,IAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAe;IAC3C,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC7B,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AACvB,IAAA,SAAS,GAAG,KAAK,CAAyB,IAAI,qDAAC;IAC/C,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;IACvB,KAAK,GAAG,KAAK,CAAC,K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AA,EACR;AACJ,wBAAA,4BAA4B,EAAE,cAAc;AAC5C,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,eAAe,EAAE,UAAU;AAC5B,qBAAA,EAAA,MAAA,EAAA,CAAA,ouBAAA,CAAA,EAAA;;;ACrEH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-textarea-field.mjs","sources":["../../../libs/watt/package/textarea-field/watt-textarea-field.component.ts","../../../libs/watt/package/textarea-field/watt-textarea-notice.component.ts","../../../libs/watt/package/textarea-field/index.ts","../../../libs/watt/package/textarea-field/energinet-watt-textarea-field.ts"],"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';\nimport { VaterStackComponent } from '@energinet/watt/vater';\n\n@Component({\n imports: [FormsModule, WattFieldComponent, VaterStackComponent],\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 <div class=\"textarea-wrapper\">\n <ng-content select=\"watt-textarea-notice\" />\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\n <vater-stack direction=\"row\" wrap gap=\"s\" class=\"textarea-footer\">\n <ng-content />\n </vater-stack>\n </div>\n\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","//#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 { Component, input, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'watt-textarea-notice',\n template: `<ng-content />`,\n encapsulation: ViewEncapsulation.None,\n styles: `\n watt-textarea-notice {\n display: flex;\n align-items: center;\n gap: var(--watt-space-s);\n padding: var(--watt-space-xs) var(--watt-space-s);\n color: var(--watt-on-light-high-emphasis);\n background: var(--watt-color-neutral-grey-200);\n\n &[type='danger'] {\n color: var(--watt-color-state-danger);\n background: var(--watt-color-state-danger-light);\n }\n }\n `,\n host: {\n '[attr.type]': 'type()',\n },\n})\nexport class WattTextareaNoticeComponent {\n type = input<'info' | 'danger'>('info');\n}\n","//#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\nexport { WattTextAreaFieldComponent } from './watt-textarea-field.component';\nexport { WattTextareaNoticeComponent } from './watt-textarea-notice.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAuDa,0BAA0B,CAAA;;AAE7B,IAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,IAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,sDAAe;IAC3C,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC7B,IAAA,Q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G;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, inject, ElementRef,
|
|
2
|
+
import { input, signal, computed, viewChild, inject, ElementRef, DestroyRef, afterNextRender, ChangeDetectionStrategy, Component, booleanAttribute, ViewContainerRef, effect, Directive } from '@angular/core';
|
|
3
3
|
import { createPopper } from '@popperjs/core';
|
|
4
|
-
import { Platform } from '@angular/cdk/platform';
|
|
5
|
-
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
6
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
4
|
|
|
8
5
|
//#region License
|
|
9
6
|
/**
|
|
@@ -24,91 +21,67 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
24
21
|
*/
|
|
25
22
|
//#endregion
|
|
26
23
|
class WattTooltipComponent {
|
|
27
|
-
static nextId = 0;
|
|
28
24
|
text = input.required(...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
29
25
|
target = input.required(...(ngDevMode ? [{ debugName: "target" }] : []));
|
|
30
26
|
position = input.required(...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
31
27
|
variant = input.required(...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
32
|
-
|
|
28
|
+
alwaysVisible = input(false, ...(ngDevMode ? [{ debugName: "alwaysVisible" }] : []));
|
|
29
|
+
id = `watt-tooltip-${crypto.randomUUID()}`;
|
|
30
|
+
visible = signal(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
33
31
|
hostClass = computed(() => `tooltip-${this.variant()}`, ...(ngDevMode ? [{ debugName: "hostClass" }] : []));
|
|
32
|
+
arrowRef = viewChild('arrowEl', ...(ngDevMode ? [{ debugName: "arrowRef" }] : []));
|
|
34
33
|
element = inject(ElementRef).nativeElement;
|
|
35
|
-
platform = inject(Platform);
|
|
36
|
-
renderer = inject(Renderer2);
|
|
37
|
-
focusMonitor = inject(FocusMonitor);
|
|
38
34
|
destroyRef = inject(DestroyRef);
|
|
39
|
-
listeners = [];
|
|
40
|
-
showClass = 'show';
|
|
41
35
|
popper = null;
|
|
42
36
|
constructor() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.listeners.forEach((listener) => listener());
|
|
46
|
-
});
|
|
47
|
-
effect(() => {
|
|
48
|
-
this.setupEventListeners();
|
|
49
|
-
this.focusMonitor
|
|
50
|
-
.monitor(this.target(), true)
|
|
51
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
52
|
-
.subscribe((origin) => {
|
|
53
|
-
if (!origin) {
|
|
54
|
-
this.hide();
|
|
55
|
-
}
|
|
56
|
-
else if (origin === 'keyboard') {
|
|
57
|
-
this.show();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
setupEventListeners() {
|
|
63
|
-
// The mouse events shouldn't be bound on mobile devices, because they can prevent the
|
|
64
|
-
// first tap from firing its click event or can cause the tooltip to open for clicks.
|
|
65
|
-
if (this.platformSupportsMouseEvents()) {
|
|
66
|
-
const mouseEnter = this.renderer.listen(this.target(), 'mouseenter', this.show.bind(this));
|
|
67
|
-
const mouseLeave = this.renderer.listen(this.target(), 'mouseleave', this.hide.bind(this));
|
|
68
|
-
const wheel = this.renderer.listen(this.target(), 'wheel', this.hide.bind(this));
|
|
69
|
-
this.listeners.push(mouseEnter, mouseLeave, wheel);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
const touchStart = this.renderer.listen(this.target(), 'touchstart', this.show.bind(this));
|
|
73
|
-
const touchEnd = this.renderer.listen(this.target(), 'touchend', this.hide.bind(this));
|
|
74
|
-
const touchCancel = this.renderer.listen(this.target(), 'touchcancel', this.hide.bind(this));
|
|
75
|
-
this.listeners.push(touchStart, touchEnd, touchCancel);
|
|
76
|
-
}
|
|
37
|
+
afterNextRender(() => this.setupEventListeners());
|
|
38
|
+
this.destroyRef.onDestroy(() => this.popper?.destroy());
|
|
77
39
|
}
|
|
78
40
|
show() {
|
|
79
41
|
if (!this.popper) {
|
|
42
|
+
const arrowEl = this.arrowRef()?.nativeElement;
|
|
80
43
|
this.popper = createPopper(this.target(), this.element, {
|
|
81
44
|
placement: this.position(),
|
|
45
|
+
modifiers: [
|
|
46
|
+
{ name: 'offset', options: { offset: [0, 8] } },
|
|
47
|
+
...(arrowEl ? [{ name: 'arrow', options: { element: arrowEl, padding: 6 } }] : []),
|
|
48
|
+
],
|
|
82
49
|
});
|
|
83
50
|
}
|
|
84
51
|
else {
|
|
85
52
|
this.popper.forceUpdate();
|
|
86
53
|
}
|
|
87
|
-
this.
|
|
54
|
+
this.visible.set(true);
|
|
88
55
|
}
|
|
89
56
|
hide() {
|
|
90
|
-
this.
|
|
57
|
+
if (this.alwaysVisible())
|
|
58
|
+
return;
|
|
59
|
+
this.visible.set(false);
|
|
91
60
|
}
|
|
92
|
-
|
|
93
|
-
|
|
61
|
+
setupEventListeners() {
|
|
62
|
+
const target = this.target();
|
|
63
|
+
const onShow = () => this.show();
|
|
64
|
+
const onHide = () => this.hide();
|
|
65
|
+
target.addEventListener('mouseenter', onShow);
|
|
66
|
+
target.addEventListener('mouseleave', onHide);
|
|
67
|
+
target.addEventListener('wheel', onHide, { passive: true });
|
|
68
|
+
target.addEventListener('focusin', onShow);
|
|
69
|
+
target.addEventListener('focusout', onHide);
|
|
94
70
|
}
|
|
95
71
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
97
|
-
{
|
|
98
|
-
<div #arrow class="arrow"></div>
|
|
99
|
-
`, isInline: true, styles: [":host{position:absolute;left:0;pointer-events:none;z-index:1000;display:inline-block;line-height:18px;border-radius:6px;padding:var(--watt-space-xs) var(--watt-space-s);font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;white-space:pre-wrap;opacity:0;transition:opacity .3s ease-in-out}:host.tooltip-dark{background:var(--watt-color-primary-dark);color:var(--watt-color-primary-dark-contrast)}:host.tooltip-light{background:var(--watt-color-neutral-white);color:var(--watt-color-primary-light-contrast)}:host.show{opacity:1}:host[data-popper-placement^=top]{inset-block-end:6px!important}:host[data-popper-placement^=bottom]{inset-block-start:6px!important}:host[data-popper-placement^=bottom]>.arrow{top:-4px}:host[data-popper-placement^=left]{inset-inline-end:6px!important}:host[data-popper-placement^=left]>.arrow{right:-4px}:host[data-popper-placement^=right]{inset-inline-start:6px!important}:host[data-popper-placement^=right]>.arrow{left:-4px}:host[data-popper-placement=left]>.arrow,:host[data-popper-placement=right]>.arrow{top:calc(50% - 4px)}:host[data-popper-placement=top]>.arrow,:host[data-popper-placement=bottom]>.arrow{left:calc(50% - 4px)!important}:host[data-popper-placement=top-end]>.arrow,:host[data-popper-placement=bottom-end]>.arrow{left:10px!important}:host[data-popper-placement=top-start]>.arrow,:host[data-popper-placement=bottom-start]>.arrow{left:calc(100% - 18px)}.arrow,.arrow:before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow:before{visibility:visible;content:\"\";transform:rotate(45deg)}\n"] });
|
|
72
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", type: WattTooltipComponent, isStandalone: true, selector: "watt-tooltip", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: true, transformFunction: null }, alwaysVisible: { classPropertyName: "alwaysVisible", publicName: "alwaysVisible", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, properties: { "id": "id", "class": "hostClass()", "class.show": "visible()" } }, viewQueries: [{ propertyName: "arrowRef", first: true, predicate: ["arrowEl"], descendants: true, isSignal: true }], ngImport: i0, template: `{{ text() }}
|
|
73
|
+
<div #arrowEl class="arrow"></div>`, isInline: true, styles: [":host{position:absolute;left:0;pointer-events:none;z-index:1000;display:inline-block;border-radius:6px;padding:var(--watt-space-xs) var(--watt-space-s);font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;white-space:pre-wrap;opacity:0;transition:opacity var(--watt-time-short) var(--watt-move-inside-screen)}:host.tooltip-dark{background:var(--watt-color-primary-dark);color:var(--watt-color-primary-dark-contrast)}:host.tooltip-light{background:var(--watt-color-neutral-white);color:var(--watt-color-primary-light-contrast)}:host.show{opacity:1}.arrow,.arrow:before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow:before{visibility:visible;content:\"\";transform:rotate(45deg)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
100
74
|
}
|
|
101
75
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTooltipComponent, decorators: [{
|
|
102
76
|
type: Component,
|
|
103
|
-
args: [{
|
|
104
|
-
{{ text() }}
|
|
105
|
-
<div #arrow class="arrow"></div>
|
|
106
|
-
`, selector: 'watt-tooltip', host: {
|
|
77
|
+
args: [{ selector: 'watt-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
107
78
|
'[id]': 'id',
|
|
108
|
-
|
|
79
|
+
role: 'tooltip',
|
|
109
80
|
'[class]': 'hostClass()',
|
|
110
|
-
|
|
111
|
-
|
|
81
|
+
'[class.show]': 'visible()',
|
|
82
|
+
}, template: `{{ text() }}
|
|
83
|
+
<div #arrowEl class="arrow"></div>`, styles: [":host{position:absolute;left:0;pointer-events:none;z-index:1000;display:inline-block;border-radius:6px;padding:var(--watt-space-xs) var(--watt-space-s);font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;white-space:pre-wrap;opacity:0;transition:opacity var(--watt-time-short) var(--watt-move-inside-screen)}:host.tooltip-dark{background:var(--watt-color-primary-dark);color:var(--watt-color-primary-dark-contrast)}:host.tooltip-light{background:var(--watt-color-neutral-white);color:var(--watt-color-primary-light-contrast)}:host.show{opacity:1}.arrow,.arrow:before{position:absolute;width:8px;height:8px;background:inherit}.arrow{visibility:hidden}.arrow:before{visibility:visible;content:\"\";transform:rotate(45deg)}:host([data-popper-placement^=top]) .arrow{bottom:-4px}:host([data-popper-placement^=bottom]) .arrow{top:-4px}:host([data-popper-placement^=left]) .arrow{right:-4px}:host([data-popper-placement^=right]) .arrow{left:-4px}\n"] }]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: true }] }], alwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "alwaysVisible", required: false }] }], arrowRef: [{ type: i0.ViewChild, args: ['arrowEl', { isSignal: true }] }] } });
|
|
112
85
|
|
|
113
86
|
//#region License
|
|
114
87
|
/**
|
|
@@ -132,39 +105,47 @@ class WattTooltipDirective {
|
|
|
132
105
|
text = input('', { ...(ngDevMode ? { debugName: "text" } : {}), alias: 'wattTooltip' });
|
|
133
106
|
position = input('top', { ...(ngDevMode ? { debugName: "position" } : {}), alias: 'wattTooltipPosition' });
|
|
134
107
|
variant = input('dark', { ...(ngDevMode ? { debugName: "variant" } : {}), alias: 'wattTooltipVariant' });
|
|
108
|
+
alwaysVisible = input(false, { ...(ngDevMode ? { debugName: "alwaysVisible" } : {}), alias: 'wattTooltipAlwaysVisible',
|
|
109
|
+
transform: booleanAttribute });
|
|
135
110
|
element = inject(ElementRef).nativeElement;
|
|
136
111
|
viewContainerRef = inject(ViewContainerRef);
|
|
137
|
-
|
|
138
|
-
tooltip = computed(() => this.createTooltipComponent(), ...(ngDevMode ? [{ debugName: "tooltip" }] : []));
|
|
112
|
+
tooltipRef = null;
|
|
139
113
|
constructor() {
|
|
140
|
-
//
|
|
114
|
+
// Create or destroy the tooltip component when text changes
|
|
141
115
|
effect(() => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
116
|
+
const text = this.text();
|
|
117
|
+
if (!text) {
|
|
118
|
+
this.destroyTooltip();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (!this.tooltipRef) {
|
|
122
|
+
this.tooltipRef = this.viewContainerRef.createComponent(WattTooltipComponent);
|
|
123
|
+
this.tooltipRef.setInput('target', this.element);
|
|
124
|
+
this.element.setAttribute('aria-describedby', this.tooltipRef.instance.id);
|
|
125
|
+
}
|
|
126
|
+
this.tooltipRef.setInput('text', text);
|
|
127
|
+
});
|
|
128
|
+
// Update position, variant, and alwaysVisible without recreating the component
|
|
129
|
+
effect(() => {
|
|
130
|
+
if (!this.tooltipRef)
|
|
131
|
+
return;
|
|
132
|
+
this.tooltipRef.setInput('position', this.position());
|
|
133
|
+
this.tooltipRef.setInput('variant', this.variant());
|
|
134
|
+
this.tooltipRef.setInput('alwaysVisible', this.alwaysVisible());
|
|
135
|
+
if (this.alwaysVisible()) {
|
|
136
|
+
const instance = this.tooltipRef.instance;
|
|
137
|
+
requestAnimationFrame(() => requestAnimationFrame(() => instance.show()));
|
|
138
|
+
}
|
|
149
139
|
});
|
|
140
|
+
inject(DestroyRef).onDestroy(() => this.destroyTooltip());
|
|
150
141
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const tooltipComponent = this.viewContainerRef.createComponent(WattTooltipComponent);
|
|
156
|
-
// Get the component instance
|
|
157
|
-
const instance = tooltipComponent.instance;
|
|
158
|
-
// Set up bindings
|
|
159
|
-
tooltipComponent.setInput('text', this.text());
|
|
160
|
-
tooltipComponent.setInput('target', this.element);
|
|
161
|
-
tooltipComponent.setInput('position', this.position());
|
|
162
|
-
tooltipComponent.setInput('variant', this.variant());
|
|
163
|
-
this.element.setAttribute('aria-describedby', instance.id);
|
|
164
|
-
return tooltipComponent;
|
|
142
|
+
destroyTooltip() {
|
|
143
|
+
this.tooltipRef?.destroy();
|
|
144
|
+
this.tooltipRef = null;
|
|
145
|
+
this.element.removeAttribute('aria-describedby');
|
|
165
146
|
}
|
|
166
147
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
167
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: WattTooltipDirective, isStandalone: true, selector: "[wattTooltip]", inputs: { text: { classPropertyName: "text", publicName: "wattTooltip", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "wattTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "wattTooltipVariant", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["wattTooltip"], ngImport: i0 });
|
|
148
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: WattTooltipDirective, isStandalone: true, selector: "[wattTooltip]", inputs: { text: { classPropertyName: "text", publicName: "wattTooltip", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "wattTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "wattTooltipVariant", isSignal: true, isRequired: false, transformFunction: null }, alwaysVisible: { classPropertyName: "alwaysVisible", publicName: "wattTooltipAlwaysVisible", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["wattTooltip"], ngImport: i0 });
|
|
168
149
|
}
|
|
169
150
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattTooltipDirective, decorators: [{
|
|
170
151
|
type: Directive,
|
|
@@ -172,7 +153,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
172
153
|
selector: '[wattTooltip]',
|
|
173
154
|
exportAs: 'wattTooltip',
|
|
174
155
|
}]
|
|
175
|
-
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltip", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltipPosition", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltipVariant", required: false }] }] } });
|
|
156
|
+
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltip", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltipPosition", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltipVariant", required: false }] }], alwaysVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "wattTooltipAlwaysVisible", required: false }] }] } });
|
|
176
157
|
|
|
177
158
|
//#region License
|
|
178
159
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-tooltip.mjs","sources":["../../../libs/watt/package/tooltip/watt-tooltip.component.ts","../../../libs/watt/package/tooltip/watt-tooltip.directive.ts","../../../libs/watt/package/tooltip/index.ts","../../../libs/watt/package/tooltip/energinet-watt-tooltip.ts"],"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 computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n Renderer2,\n} from '@angular/core';\nimport { createPopper, Instance } from '@popperjs/core';\nimport { Platform } from '@angular/cdk/platform';\n\nimport { wattTooltipPosition, wattTooltipVariant } from './watt-tooltip.directive';\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\ntype unlistenerFunction = () => void;\n\n@Component({\n template: `\n {{ text() }}\n <div #arrow class=\"arrow\"></div>\n `,\n selector: 'watt-tooltip',\n styleUrls: ['./watt-tooltip.component.scss'],\n host: {\n '[id]': 'id',\n '[attr.role]': '\"tooltip\"',\n '[class]': 'hostClass()',\n },\n})\nexport class WattTooltipComponent {\n static nextId = 0;\n\n text = input.required<string>();\n target = input.required<HTMLElement>();\n position = input.required<wattTooltipPosition>();\n variant = input.required<wattTooltipVariant>();\n\n readonly id = `watt-tooltip-${WattTooltipComponent.nextId++}`; // used by aria-describedby\n hostClass = computed(() => `tooltip-${this.variant()}`);\n\n private element: HTMLElement = inject(ElementRef).nativeElement;\n private platform = inject(Platform);\n private renderer: Renderer2 = inject(Renderer2);\n private focusMonitor: FocusMonitor = inject(FocusMonitor);\n private destroyRef = inject(DestroyRef);\n\n private listeners: unlistenerFunction[] = [];\n private showClass = 'show';\n private popper: Instance | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n this.popper?.destroy();\n this.listeners.forEach((listener) => listener());\n });\n\n effect(() => {\n this.setupEventListeners();\n\n this.focusMonitor\n .monitor(this.target(), true)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((origin) => {\n if (!origin) {\n this.hide();\n } else if (origin === 'keyboard') {\n this.show();\n }\n });\n });\n }\n\n private setupEventListeners(): void {\n // The mouse events shouldn't be bound on mobile devices, because they can prevent the\n // first tap from firing its click event or can cause the tooltip to open for clicks.\n if (this.platformSupportsMouseEvents()) {\n const mouseEnter = this.renderer.listen(this.target(), 'mouseenter', this.show.bind(this));\n const mouseLeave = this.renderer.listen(this.target(), 'mouseleave', this.hide.bind(this));\n const wheel = this.renderer.listen(this.target(), 'wheel', this.hide.bind(this));\n this.listeners.push(mouseEnter, mouseLeave, wheel);\n } else {\n const touchStart = this.renderer.listen(this.target(), 'touchstart', this.show.bind(this));\n const touchEnd = this.renderer.listen(this.target(), 'touchend', this.hide.bind(this));\n const touchCancel = this.renderer.listen(this.target(), 'touchcancel', this.hide.bind(this));\n this.listeners.push(touchStart, touchEnd, touchCancel);\n }\n }\n\n private show(): void {\n if (!this.popper) {\n this.popper = createPopper(this.target(), this.element, {\n placement: this.position(),\n });\n } else {\n this.popper.forceUpdate();\n }\n this.renderer.addClass(this.element, this.showClass);\n }\n\n private hide(): void {\n this.renderer.removeClass(this.element, this.showClass);\n }\n\n private platformSupportsMouseEvents() {\n return !this.platform.IOS && !this.platform.ANDROID;\n }\n}\n","//#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 computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { WattTooltipComponent } from './watt-tooltip.component';\n\nexport type wattTooltipPosition =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left';\n\nexport type wattTooltipVariant = 'dark' | 'light';\n\n@Directive({\n selector: '[wattTooltip]',\n exportAs: 'wattTooltip',\n})\nexport class WattTooltipDirective {\n readonly text = input<string>('', { alias: 'wattTooltip' });\n readonly position = input<wattTooltipPosition>('top', { alias: 'wattTooltipPosition' });\n readonly variant = input<wattTooltipVariant>('dark', { alias: 'wattTooltipVariant' });\n\n private readonly element = inject(ElementRef).nativeElement;\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private tooltip = computed(() => this.createTooltipComponent());\n\n constructor() {\n // Setup effect to manage tooltip component lifecycle\n effect(() => {\n // Access the tooltip computed to create/update it when inputs change\n const tooltipComponent = this.tooltip();\n\n // Cleanup on destroy\n this.destroyRef.onDestroy(() => {\n tooltipComponent?.destroy();\n this.element.removeAttribute('aria-describedby');\n });\n });\n }\n\n private createTooltipComponent() {\n if (!this.text()) return null;\n\n // Create the component\n const tooltipComponent = this.viewContainerRef.createComponent(WattTooltipComponent);\n\n // Get the component instance\n const instance = tooltipComponent.instance;\n\n // Set up bindings\n tooltipComponent.setInput('text', this.text());\n tooltipComponent.setInput('target', this.element);\n tooltipComponent.setInput('position', this.position());\n tooltipComponent.setInput('variant', this.variant());\n\n this.element.setAttribute('aria-describedby', instance.id);\n\n return tooltipComponent;\n }\n}\n","//#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\nexport {\n WattTooltipDirective,\n wattTooltipPosition,\n wattToo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;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-tooltip.mjs","sources":["../../../libs/watt/package/tooltip/watt-tooltip.component.ts","../../../libs/watt/package/tooltip/watt-tooltip.directive.ts","../../../libs/watt/package/tooltip/index.ts","../../../libs/watt/package/tooltip/energinet-watt-tooltip.ts"],"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 afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { createPopper, Instance } from '@popperjs/core';\n\nimport { wattTooltipPosition, wattTooltipVariant } from './watt-tooltip.directive';\n\n@Component({\n selector: 'watt-tooltip',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrl: './watt-tooltip.component.scss',\n host: {\n '[id]': 'id',\n role: 'tooltip',\n '[class]': 'hostClass()',\n '[class.show]': 'visible()',\n },\n template: `{{ text() }}\n <div #arrowEl class=\"arrow\"></div>`,\n})\nexport class WattTooltipComponent {\n text = input.required<string>();\n target = input.required<HTMLElement>();\n position = input.required<wattTooltipPosition>();\n variant = input.required<wattTooltipVariant>();\n alwaysVisible = input(false);\n\n readonly id = `watt-tooltip-${crypto.randomUUID()}`;\n protected readonly visible = signal(false);\n protected readonly hostClass = computed(() => `tooltip-${this.variant()}`);\n\n private readonly arrowRef = viewChild<ElementRef>('arrowEl');\n private readonly element: HTMLElement = inject(ElementRef).nativeElement;\n private readonly destroyRef = inject(DestroyRef);\n\n private popper: Instance | null = null;\n\n constructor() {\n afterNextRender(() => this.setupEventListeners());\n\n this.destroyRef.onDestroy(() => this.popper?.destroy());\n }\n\n show(): void {\n if (!this.popper) {\n const arrowEl = this.arrowRef()?.nativeElement;\n this.popper = createPopper(this.target(), this.element, {\n placement: this.position(),\n modifiers: [\n { name: 'offset', options: { offset: [0, 8] } },\n ...(arrowEl ? [{ name: 'arrow', options: { element: arrowEl, padding: 6 } }] : []),\n ],\n });\n } else {\n this.popper.forceUpdate();\n }\n this.visible.set(true);\n }\n\n private hide(): void {\n if (this.alwaysVisible()) return;\n this.visible.set(false);\n }\n\n private setupEventListeners(): void {\n const target = this.target();\n\n const onShow = () => this.show();\n const onHide = () => this.hide();\n\n target.addEventListener('mouseenter', onShow);\n target.addEventListener('mouseleave', onHide);\n target.addEventListener('wheel', onHide, { passive: true });\n target.addEventListener('focusin', onShow);\n target.addEventListener('focusout', onHide);\n }\n}\n","//#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 ComponentRef,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n ViewContainerRef,\n booleanAttribute,\n} from '@angular/core';\n\nimport { WattTooltipComponent } from './watt-tooltip.component';\n\nexport type wattTooltipPosition =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end'\n | 'left';\n\nexport type wattTooltipVariant = 'dark' | 'light';\n\n@Directive({\n selector: '[wattTooltip]',\n exportAs: 'wattTooltip',\n})\nexport class WattTooltipDirective {\n readonly text = input<string>('', { alias: 'wattTooltip' });\n readonly position = input<wattTooltipPosition>('top', { alias: 'wattTooltipPosition' });\n readonly variant = input<wattTooltipVariant>('dark', { alias: 'wattTooltipVariant' });\n readonly alwaysVisible = input(false, {\n alias: 'wattTooltipAlwaysVisible',\n transform: booleanAttribute,\n });\n\n private readonly element = inject(ElementRef).nativeElement;\n private readonly viewContainerRef = inject(ViewContainerRef);\n private tooltipRef: ComponentRef<WattTooltipComponent> | null = null;\n\n constructor() {\n // Create or destroy the tooltip component when text changes\n effect(() => {\n const text = this.text();\n\n if (!text) {\n this.destroyTooltip();\n return;\n }\n\n if (!this.tooltipRef) {\n this.tooltipRef = this.viewContainerRef.createComponent(WattTooltipComponent);\n this.tooltipRef.setInput('target', this.element);\n this.element.setAttribute('aria-describedby', this.tooltipRef.instance.id);\n }\n\n this.tooltipRef.setInput('text', text);\n });\n\n // Update position, variant, and alwaysVisible without recreating the component\n effect(() => {\n if (!this.tooltipRef) return;\n\n this.tooltipRef.setInput('position', this.position());\n this.tooltipRef.setInput('variant', this.variant());\n this.tooltipRef.setInput('alwaysVisible', this.alwaysVisible());\n\n if (this.alwaysVisible()) {\n const instance = this.tooltipRef.instance;\n requestAnimationFrame(() => requestAnimationFrame(() => instance.show()));\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.destroyTooltip());\n }\n\n private destroyTooltip(): void {\n this.tooltipRef?.destroy();\n this.tooltipRef = null;\n this.element.removeAttribute('aria-describedby');\n }\n}\n","//#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\nexport {\n WattTooltipDirective,\n wattTooltipPosition,\n wattTooltipVariant,\n} from './watt-tooltip.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MA8Ba,oBAAoB,CAAA;AAC/B,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAU;AAC/B,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,iDAAe;AACtC,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAuB;AAChD,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,kDAAsB;AAC9C,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,yDAAC;AAEnB,IAAA,EAAE,GAAG,CAAA,aAAA,EAAgB,MAAM,CAAC,UAAU,EAAE,EAAE;AAChC,IAAA,OAAO,GAAG,MAAM,CAAC,KAAK,mDAAC;AACvB,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAA,QAAA,EAAW,IAAI,CAAC,OAAO,EAAE,CAAA,CAAE,qDAAC;AAEzD,IAAA,QAAQ,GAAG,SAAS,CAAa,SAAS,oDAAC;AAC3C,IAAA,OAAO,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa;AACvD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAExC,MAAM,GAAoB,IAAI;AAEtC,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;AAEjD,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IACzD;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,aAAa;AAC9C,YAAA,IAAI,CAAC,MAA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,EAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE,aAAa;AACxB,iBAAA;;;AC/CD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
type WattSeparatorWeight = 'regular' | 'bold';
|
|
4
|
+
type WattSeparatorOrientation = 'horizontal' | 'vertical';
|
|
4
5
|
/**
|
|
5
6
|
* Usage:
|
|
6
7
|
* `import { WattSeparatorComponent } from '@energinet/watt/separator';`
|
|
7
8
|
*/
|
|
8
9
|
declare class WattSeparatorComponent {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static
|
|
10
|
+
weight: _angular_core.InputSignal<WattSeparatorWeight>;
|
|
11
|
+
orientation: _angular_core.InputSignal<WattSeparatorOrientation>;
|
|
12
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattSeparatorComponent, never>;
|
|
13
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WattSeparatorComponent, "watt-separator", never, { "weight": { "alias": "weight"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export { WattSeparatorComponent };
|
|
15
|
-
export type {
|
|
17
|
+
export type { WattSeparatorWeight };
|
|
@@ -25,7 +25,13 @@ declare class WattTextAreaFieldComponent implements ControlValueAccessor {
|
|
|
25
25
|
/** @ignore */
|
|
26
26
|
setDisabledState(isDisabled: boolean): void;
|
|
27
27
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattTextAreaFieldComponent, never>;
|
|
28
|
-
static ɵcmp: _angular_core.ɵɵ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>;
|
|
28
|
+
static ɵcmp: _angular_core.ɵɵ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-textarea-notice", "*", "watt-field-hint", "watt-field-error"], true, never>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
declare class WattTextareaNoticeComponent {
|
|
32
|
+
type: _angular_core.InputSignal<"info" | "danger">;
|
|
33
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattTextareaNoticeComponent, never>;
|
|
34
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WattTextareaNoticeComponent, "watt-textarea-notice", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { WattTextAreaFieldComponent, WattTextareaNoticeComponent };
|
|
@@ -6,14 +6,14 @@ declare class WattTooltipDirective {
|
|
|
6
6
|
readonly text: _angular_core.InputSignal<string>;
|
|
7
7
|
readonly position: _angular_core.InputSignal<wattTooltipPosition>;
|
|
8
8
|
readonly variant: _angular_core.InputSignal<wattTooltipVariant>;
|
|
9
|
+
readonly alwaysVisible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
9
10
|
private readonly element;
|
|
10
11
|
private readonly viewContainerRef;
|
|
11
|
-
private
|
|
12
|
-
private tooltip;
|
|
12
|
+
private tooltipRef;
|
|
13
13
|
constructor();
|
|
14
|
-
private
|
|
14
|
+
private destroyTooltip;
|
|
15
15
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattTooltipDirective, never>;
|
|
16
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WattTooltipDirective, "[wattTooltip]", ["wattTooltip"], { "text": { "alias": "wattTooltip"; "required": false; "isSignal": true; }; "position": { "alias": "wattTooltipPosition"; "required": false; "isSignal": true; }; "variant": { "alias": "wattTooltipVariant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
16
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WattTooltipDirective, "[wattTooltip]", ["wattTooltip"], { "text": { "alias": "wattTooltip"; "required": false; "isSignal": true; }; "position": { "alias": "wattTooltipPosition"; "required": false; "isSignal": true; }; "variant": { "alias": "wattTooltipVariant"; "required": false; "isSignal": true; }; "alwaysVisible": { "alias": "wattTooltipAlwaysVisible"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { WattTooltipDirective };
|