@energinet/watt 4.3.48 → 4.3.50
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.
|
@@ -60,11 +60,11 @@ class WattButtonComponent {
|
|
|
60
60
|
<watt-icon [name]="icon()" />
|
|
61
61
|
}
|
|
62
62
|
@if (variant() !== 'icon') {
|
|
63
|
-
<ng-content
|
|
63
|
+
<span class="text-content"><ng-content /></span>
|
|
64
64
|
}
|
|
65
65
|
</div>
|
|
66
66
|
</button>
|
|
67
|
-
`, isInline: true, styles: [":root{--watt-button-color: var(--watt-color-primary);--watt-button-text-hover-color: var(--watt-color-primary-dark);--watt-button-text-focus-color: var(--watt-color-primary);--watt-button-text-transform: none;--watt-button-primary-disabled-color: var(--watt-color-neutral-grey-500);--mat-button-text-with-icon-horizontal-padding: var(--watt-space-m)}watt-button{display:inline-block}watt-button.watt-button--primary.watt-button--disabled .mat-mdc-button.mat-primary{background-color:transparent;color:var(--watt-button-primary-disabled-color)}watt-button.watt-button--primary watt-spinner{--watt-spinner-circle-color: var(--watt-color-neutral-white)}watt-button.watt-button--primary .mat-mdc-button.mat-primary{color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);border:1px solid var(--watt-color-neutral-grey-300);--mat-button-text-label-text-color: var(--watt-color-primary-contrast)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-secondary)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:hover,watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark)}watt-button.watt-button--secondary.watt-button--disabled .mat-mdc-button.mat-secondary{background-color:transparent;border-color:var(--watt-color-neutral-grey-300);color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary{border:1px solid var(--watt-color-primary);color:var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light);outline:1px solid var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:hover,watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light)}watt-button.watt-button--text.watt-button--disabled .mat-mdc-button.mat-text{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--text .mat-mdc-button.mat-text{color:var(--watt-button-color);text-transform:var(--watt-button-text-transform);outline:2px solid transparent}watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color);outline:2px solid var(--watt-button-text-focus-color)}watt-button.watt-button--text .mat-mdc-button.mat-text:hover,watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color)}watt-button.watt-button--selection .mat-mdc-button.mat-selection{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;border-radius:4px;border:1px solid var(--watt-color-neutral-grey-500)}watt-button.watt-button--selection .mat-mdc-button.mat-selection:hover{background-color:var(--watt-color-neutral-grey-100)}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button{width:100%;height:56px}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label{justify-content:flex-end;align-items:start;width:100%}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper{width:100%;display:flex}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper watt-icon{order:2;margin-left:auto}watt-button.watt-button--icon.watt-button--disabled .mat-mdc-button.mat-icon{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--icon .mat-mdc-button.mat-icon{color:var(--watt-color-primary);padding:var(--watt-space-s)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-primary)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:hover,watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark)}watt-button.watt-button--icon .mat-mdc-button.mat-icon.mat-button{min-width:44px}watt-button .mdc-button{font-weight:600;font-size:1rem;line-height:1.5rem;padding:var(--watt-space-s) var(--watt-space-m)}watt-button .mdc-button.mat-mdc-button{min-width:44px;height:44px;--mat-button-text-label-text-tracking: 0;--mat-button-text-state-layer-color: var(--watt-ripple-color);--mat-button-text-ripple-color: var(--watt-ripple-color)}watt-button .mdc-button watt-spinner{position:absolute}watt-button .mdc-button .mat-button-focus-overlay{background:transparent}watt-button .mdc-button .mdc-button__label{display:flex;justify-content:center;align-items:center}watt-button .mdc-button .mdc-button__label .content-wrapper{display:flex;gap:var(--watt-space-s);white-space:nowrap}watt-button .mdc-button .mdc-button__label .content-wrapper--loading{visibility:hidden}watt-button.watt-button-size--small .mdc-button.mat-mdc-button{height:var(--watt-space-l)}\n"], dependencies: [{ kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
67
|
+
`, isInline: true, styles: [":root{--watt-button-color: var(--watt-color-primary);--watt-button-text-hover-color: var(--watt-color-primary-dark);--watt-button-text-focus-color: var(--watt-color-primary);--watt-button-text-transform: none;--watt-button-primary-disabled-color: var(--watt-color-neutral-grey-500);--mat-button-text-with-icon-horizontal-padding: var(--watt-space-m)}watt-button{display:inline-block}watt-button.watt-button--primary.watt-button--disabled .mat-mdc-button.mat-primary{background-color:transparent;color:var(--watt-button-primary-disabled-color)}watt-button.watt-button--primary watt-spinner{--watt-spinner-circle-color: var(--watt-color-neutral-white)}watt-button.watt-button--primary .mat-mdc-button.mat-primary{color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);border:1px solid var(--watt-color-neutral-grey-300);--mat-button-text-label-text-color: var(--watt-color-primary-contrast)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-secondary)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:hover,watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark)}watt-button.watt-button--secondary.watt-button--disabled .mat-mdc-button.mat-secondary{background-color:transparent;border-color:var(--watt-color-neutral-grey-300);color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary{border:1px solid var(--watt-color-primary);color:var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light);outline:1px solid var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:hover,watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light)}watt-button.watt-button--text.watt-button--disabled .mat-mdc-button.mat-text{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--text .mat-mdc-button.mat-text{color:var(--watt-button-color);text-transform:var(--watt-button-text-transform);outline:2px solid transparent}watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color);outline:2px solid var(--watt-button-text-focus-color)}watt-button.watt-button--text .mat-mdc-button.mat-text:hover,watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color)}watt-button.watt-button--selection .mat-mdc-button.mat-selection{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;border-radius:4px;border:1px solid var(--watt-color-neutral-grey-500)}watt-button.watt-button--selection .mat-mdc-button.mat-selection:hover{background-color:var(--watt-color-neutral-grey-100)}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button{width:100%;height:56px}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label{justify-content:flex-end;align-items:start;width:100%}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper{width:100%;display:flex}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper watt-icon{order:2;margin-left:auto}watt-button.watt-button--icon.watt-button--disabled .mat-mdc-button.mat-icon{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--icon .mat-mdc-button.mat-icon{color:var(--watt-color-primary);padding:var(--watt-space-s)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-primary)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:hover,watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark)}watt-button.watt-button--icon .mat-mdc-button.mat-icon.mat-button{min-width:44px}watt-button .mdc-button{font-weight:600;font-size:1rem;line-height:1.5rem;padding:var(--watt-space-s) var(--watt-space-m)}watt-button .mdc-button.mat-mdc-button{min-width:44px;height:44px;--mat-button-text-label-text-tracking: 0;--mat-button-text-state-layer-color: var(--watt-ripple-color);--mat-button-text-ripple-color: var(--watt-ripple-color)}watt-button .mdc-button watt-spinner{position:absolute}watt-button .mdc-button .mat-button-focus-overlay{background:transparent}watt-button .mdc-button .mdc-button__label{display:flex;justify-content:center;align-items:center}watt-button .mdc-button .mdc-button__label .content-wrapper{display:flex;gap:var(--watt-space-s);white-space:nowrap}watt-button .mdc-button .mdc-button__label .content-wrapper .text-content{display:contents}watt-button .mdc-button .mdc-button__label .content-wrapper--loading{visibility:hidden}watt-button .mdc-button:has(.content-wrapper .text-content:empty){padding:0}watt-button .mdc-button:has(.content-wrapper .text-content:empty) .content-wrapper{gap:0}watt-button.watt-button-size--small .mdc-button.mat-mdc-button{height:var(--watt-space-l)}\n"], dependencies: [{ kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattSpinnerComponent, selector: "watt-spinner", inputs: ["diameter", "strokeWidth"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
68
68
|
}
|
|
69
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: WattButtonComponent, decorators: [{
|
|
70
70
|
type: Component,
|
|
@@ -89,11 +89,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
89
89
|
<watt-icon [name]="icon()" />
|
|
90
90
|
}
|
|
91
91
|
@if (variant() !== 'icon') {
|
|
92
|
-
<ng-content
|
|
92
|
+
<span class="text-content"><ng-content /></span>
|
|
93
93
|
}
|
|
94
94
|
</div>
|
|
95
95
|
</button>
|
|
96
|
-
`, styles: [":root{--watt-button-color: var(--watt-color-primary);--watt-button-text-hover-color: var(--watt-color-primary-dark);--watt-button-text-focus-color: var(--watt-color-primary);--watt-button-text-transform: none;--watt-button-primary-disabled-color: var(--watt-color-neutral-grey-500);--mat-button-text-with-icon-horizontal-padding: var(--watt-space-m)}watt-button{display:inline-block}watt-button.watt-button--primary.watt-button--disabled .mat-mdc-button.mat-primary{background-color:transparent;color:var(--watt-button-primary-disabled-color)}watt-button.watt-button--primary watt-spinner{--watt-spinner-circle-color: var(--watt-color-neutral-white)}watt-button.watt-button--primary .mat-mdc-button.mat-primary{color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);border:1px solid var(--watt-color-neutral-grey-300);--mat-button-text-label-text-color: var(--watt-color-primary-contrast)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-secondary)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:hover,watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark)}watt-button.watt-button--secondary.watt-button--disabled .mat-mdc-button.mat-secondary{background-color:transparent;border-color:var(--watt-color-neutral-grey-300);color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary{border:1px solid var(--watt-color-primary);color:var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light);outline:1px solid var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:hover,watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light)}watt-button.watt-button--text.watt-button--disabled .mat-mdc-button.mat-text{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--text .mat-mdc-button.mat-text{color:var(--watt-button-color);text-transform:var(--watt-button-text-transform);outline:2px solid transparent}watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color);outline:2px solid var(--watt-button-text-focus-color)}watt-button.watt-button--text .mat-mdc-button.mat-text:hover,watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color)}watt-button.watt-button--selection .mat-mdc-button.mat-selection{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;border-radius:4px;border:1px solid var(--watt-color-neutral-grey-500)}watt-button.watt-button--selection .mat-mdc-button.mat-selection:hover{background-color:var(--watt-color-neutral-grey-100)}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button{width:100%;height:56px}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label{justify-content:flex-end;align-items:start;width:100%}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper{width:100%;display:flex}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper watt-icon{order:2;margin-left:auto}watt-button.watt-button--icon.watt-button--disabled .mat-mdc-button.mat-icon{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--icon .mat-mdc-button.mat-icon{color:var(--watt-color-primary);padding:var(--watt-space-s)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-primary)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:hover,watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark)}watt-button.watt-button--icon .mat-mdc-button.mat-icon.mat-button{min-width:44px}watt-button .mdc-button{font-weight:600;font-size:1rem;line-height:1.5rem;padding:var(--watt-space-s) var(--watt-space-m)}watt-button .mdc-button.mat-mdc-button{min-width:44px;height:44px;--mat-button-text-label-text-tracking: 0;--mat-button-text-state-layer-color: var(--watt-ripple-color);--mat-button-text-ripple-color: var(--watt-ripple-color)}watt-button .mdc-button watt-spinner{position:absolute}watt-button .mdc-button .mat-button-focus-overlay{background:transparent}watt-button .mdc-button .mdc-button__label{display:flex;justify-content:center;align-items:center}watt-button .mdc-button .mdc-button__label .content-wrapper{display:flex;gap:var(--watt-space-s);white-space:nowrap}watt-button .mdc-button .mdc-button__label .content-wrapper--loading{visibility:hidden}watt-button.watt-button-size--small .mdc-button.mat-mdc-button{height:var(--watt-space-l)}\n"] }]
|
|
96
|
+
`, styles: [":root{--watt-button-color: var(--watt-color-primary);--watt-button-text-hover-color: var(--watt-color-primary-dark);--watt-button-text-focus-color: var(--watt-color-primary);--watt-button-text-transform: none;--watt-button-primary-disabled-color: var(--watt-color-neutral-grey-500);--mat-button-text-with-icon-horizontal-padding: var(--watt-space-m)}watt-button{display:inline-block}watt-button.watt-button--primary.watt-button--disabled .mat-mdc-button.mat-primary{background-color:transparent;color:var(--watt-button-primary-disabled-color)}watt-button.watt-button--primary watt-spinner{--watt-spinner-circle-color: var(--watt-color-neutral-white)}watt-button.watt-button--primary .mat-mdc-button.mat-primary{color:var(--watt-color-primary-contrast);background-color:var(--watt-color-primary);border:1px solid var(--watt-color-neutral-grey-300);--mat-button-text-label-text-color: var(--watt-color-primary-contrast)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-secondary)}watt-button.watt-button--primary .mat-mdc-button.mat-primary:hover,watt-button.watt-button--primary .mat-mdc-button.mat-primary:focus-visible{background:var(--watt-color-primary-dark)}watt-button.watt-button--secondary.watt-button--disabled .mat-mdc-button.mat-secondary{background-color:transparent;border-color:var(--watt-color-neutral-grey-300);color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary{border:1px solid var(--watt-color-primary);color:var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light);outline:1px solid var(--watt-color-primary)}watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:hover,watt-button.watt-button--secondary .mat-mdc-button.mat-secondary:focus-visible{background:var(--watt-color-primary-light)}watt-button.watt-button--text.watt-button--disabled .mat-mdc-button.mat-text{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--text .mat-mdc-button.mat-text{color:var(--watt-button-color);text-transform:var(--watt-button-text-transform);outline:2px solid transparent}watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color);outline:2px solid var(--watt-button-text-focus-color)}watt-button.watt-button--text .mat-mdc-button.mat-text:hover,watt-button.watt-button--text .mat-mdc-button.mat-text:focus-visible{color:var(--watt-button-text-hover-color)}watt-button.watt-button--selection .mat-mdc-button.mat-selection{font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;border-radius:4px;border:1px solid var(--watt-color-neutral-grey-500)}watt-button.watt-button--selection .mat-mdc-button.mat-selection:hover{background-color:var(--watt-color-neutral-grey-100)}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button{width:100%;height:56px}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label{justify-content:flex-end;align-items:start;width:100%}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper{width:100%;display:flex}watt-button.watt-button--selection .mat-mdc-button.mat-selection.mat-mdc-button .mdc-button__label .content-wrapper watt-icon{order:2;margin-left:auto}watt-button.watt-button--icon.watt-button--disabled .mat-mdc-button.mat-icon{background-color:transparent;color:var(--watt-color-neutral-grey-500)}watt-button.watt-button--icon .mat-mdc-button.mat-icon{color:var(--watt-color-primary);padding:var(--watt-space-s)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark);outline:2px solid var(--watt-color-primary)}watt-button.watt-button--icon .mat-mdc-button.mat-icon:hover,watt-button.watt-button--icon .mat-mdc-button.mat-icon:focus-visible{color:var(--watt-color-primary-dark)}watt-button.watt-button--icon .mat-mdc-button.mat-icon.mat-button{min-width:44px}watt-button .mdc-button{font-weight:600;font-size:1rem;line-height:1.5rem;padding:var(--watt-space-s) var(--watt-space-m)}watt-button .mdc-button.mat-mdc-button{min-width:44px;height:44px;--mat-button-text-label-text-tracking: 0;--mat-button-text-state-layer-color: var(--watt-ripple-color);--mat-button-text-ripple-color: var(--watt-ripple-color)}watt-button .mdc-button watt-spinner{position:absolute}watt-button .mdc-button .mat-button-focus-overlay{background:transparent}watt-button .mdc-button .mdc-button__label{display:flex;justify-content:center;align-items:center}watt-button .mdc-button .mdc-button__label .content-wrapper{display:flex;gap:var(--watt-space-s);white-space:nowrap}watt-button .mdc-button .mdc-button__label .content-wrapper .text-content{display:contents}watt-button .mdc-button .mdc-button__label .content-wrapper--loading{visibility:hidden}watt-button .mdc-button:has(.content-wrapper .text-content:empty){padding:0}watt-button .mdc-button:has(.content-wrapper .text-content:empty) .content-wrapper{gap:0}watt-button.watt-button-size--small .mdc-button.mat-mdc-button{height:var(--watt-space-l)}\n"] }]
|
|
97
97
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], formId: [{ type: i0.Input, args: [{ isSignal: true, alias: "formId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }] } });
|
|
98
98
|
|
|
99
99
|
//#region License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-button.mjs","sources":["../../../libs/watt/package/button/watt-button.component.ts","../../../libs/watt/package/button/index.ts","../../../libs/watt/package/button/energinet-watt-button.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 input,\n computed,\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport const WattButtonTypes = ['primary', 'secondary', 'text', 'icon', 'selection'] as const;\nexport type WattButtonVariant = (typeof WattButtonTypes)[number];\nexport type WattButtonType = 'button' | 'reset' | 'submit';\nexport type WattButtonSize = 'small' | 'medium';\n\n@Component({\n selector: 'watt-button',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./watt-button.component.scss'],\n host: {\n '[class]': 'classes()',\n '[class.watt-button--disabled]': 'disabled()',\n '[style.pointer-events]': 'pointerEvents()',\n },\n imports: [WattIconComponent, WattSpinnerComponent, MatButtonModule],\n template: `\n <button\n mat-button\n [disableRipple]=\"true\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [color]=\"variant()\"\n [attr.form]=\"type() === 'submit' ? formId() : null\"\n >\n @if (loading()) {\n <watt-spinner [diameter]=\"18\" />\n }\n <div [class.content-wrapper]=\"!loading()\" [class.content-wrapper--loading]=\"loading()\">\n @if (hasIcon()) {\n <watt-icon [name]=\"icon()\" />\n }\n @if (variant() !== 'icon') {\n <ng-content
|
|
1
|
+
{"version":3,"file":"energinet-watt-button.mjs","sources":["../../../libs/watt/package/button/watt-button.component.ts","../../../libs/watt/package/button/index.ts","../../../libs/watt/package/button/energinet-watt-button.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 input,\n computed,\n Component,\n ViewEncapsulation,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { WattSpinnerComponent } from '@energinet/watt/spinner';\nimport { WattIcon, WattIconComponent } from '@energinet/watt/icon';\n\nexport const WattButtonTypes = ['primary', 'secondary', 'text', 'icon', 'selection'] as const;\nexport type WattButtonVariant = (typeof WattButtonTypes)[number];\nexport type WattButtonType = 'button' | 'reset' | 'submit';\nexport type WattButtonSize = 'small' | 'medium';\n\n@Component({\n selector: 'watt-button',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./watt-button.component.scss'],\n host: {\n '[class]': 'classes()',\n '[class.watt-button--disabled]': 'disabled()',\n '[style.pointer-events]': 'pointerEvents()',\n },\n imports: [WattIconComponent, WattSpinnerComponent, MatButtonModule],\n template: `\n <button\n mat-button\n [disableRipple]=\"true\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [color]=\"variant()\"\n [attr.form]=\"type() === 'submit' ? formId() : null\"\n >\n @if (loading()) {\n <watt-spinner [diameter]=\"18\" />\n }\n <div [class.content-wrapper]=\"!loading()\" [class.content-wrapper--loading]=\"loading()\">\n @if (hasIcon()) {\n <watt-icon [name]=\"icon()\" />\n }\n @if (variant() !== 'icon') {\n <span class=\"text-content\"><ng-content /></span>\n }\n </div>\n </button>\n `,\n})\nexport class WattButtonComponent {\n icon = input<WattIcon>();\n variant = input<WattButtonVariant>('primary');\n size = input<WattButtonSize>('medium');\n type = input<WattButtonType>('button');\n formId = input<string | null>(null);\n disabled = input(false);\n loading = input(false);\n\n classes = computed(() => `watt-button--${this.variant()} watt-button-size--${this.size()}`);\n\n // Prevents emitting a click event in Chrome/Edge/Safari when a disabled button is clicked\n // WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=89041\n // Note: This solution is preferred (in this particular case) over adding styling to the Scss file\n // because the presence of inline styles can be tested with Vitest.\n pointerEvents = computed(() => (this.disabled() ? 'none' : 'auto'));\n\n /**\n * @ignore\n */\n hasIcon = computed(() => !!this.icon());\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 { WattButtonComponent } from './watt-button.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAYO,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAU;MAuChF,mBAAmB,CAAA;IAC9B,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAY;AACxB,IAAA,OAAO,GAAG,KAAK,CAAoB,SAAS,mDAAC;AAC7C,IAAA,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC;AACtC,IAAA,IAAI,GAAG,KAAK,CAAiB,QAAQ,gDAAC;AACtC,IAAA,MAAM,GAAG,KAAK,CAAgB,IAAI,kDAAC;AACnC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AACvB,IAAA,OAAO,GAAG,KAAK,CAAC,KAAK,mDAAC;AAEtB,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,gBAAgB,IAAI,CAAC,OAAO,EAAE,sBAAsB,IAAI,CAAC,IAAI,EAAE,CAAA,CAAE,mDAAC;;;;;IAM3F,aAAa,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SA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,CAAA;kBAlC/B,SAAS;+BACE,aAAa,EAAA,aAAA,EACR,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EAEzC;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,+BAA+B,EAAE,YAAY;AAC7C,wBAAA,wBAAwB,EAAE,iBAAiB;AAC5C,qBAAA,EAAA,OAAA,EACQ,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,CAAC,EAAA,QAAA,EACzD;;;;;;;;;;;;;;;;;;;;;AAqBT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,irKAAA,CAAA,EAAA;;;AClEH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
@@ -57,7 +57,6 @@ function truncate(value, maxLength) {
|
|
|
57
57
|
* Uses a character budget to limit output length, yielding tokens and
|
|
58
58
|
* returning the remaining budget via the generator return value.
|
|
59
59
|
*/
|
|
60
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
61
60
|
function* tokenize(value, budget) {
|
|
62
61
|
/** Creates a token and deducts its length from the budget. */
|
|
63
62
|
const token = (kind, value) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"energinet-watt-json-viewer.mjs","sources":["../../../libs/watt/package/json-viewer/watt-json.utils.ts","../../../libs/watt/package/json-viewer/watt-json-row.component.ts","../../../libs/watt/package/json-viewer/watt-json.component.ts","../../../libs/watt/package/json-viewer/watt-json-viewer.component.ts","../../../libs/watt/package/json-viewer/index.ts","../../../libs/watt/package/json-viewer/energinet-watt-json-viewer.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\n\n/** Compares two values. When deep is false, objects/arrays compare by type only. */\nexport function isEqual(a: unknown, b: unknown, { deep }: { deep: boolean }): boolean {\n try {\n if (typeof a !== typeof b) return false;\n if (typeof a !== 'object') return a === b;\n if (a === null || b === null) return a === b;\n const replacer = !deep ? (_: string, v: unknown) => (Array.isArray(v) ? [] : {}) : undefined;\n return JSON.stringify(a, replacer) === JSON.stringify(b, replacer);\n } catch {\n return a === b;\n }\n}\n\n/** Type guard that checks if a value is a non-empty array or object. */\nexport function isNonEmpty(value: unknown): value is Record<string, unknown> | unknown[] {\n return typeof value === 'object' && value !== null ? Object.keys(value).length > 0 : false;\n}\n\n/** Merges two arrays by alternating elements, preserving the order. */\nexport function interleave<T>(a: T[], b: T[]): T[] {\n return Array.from({ length: Math.max(a.length, b.length) })\n .flatMap((_, i) => [a[i], b[i]])\n .filter((k) => k !== undefined);\n}\n\n/** Truncates a string to maxLength, appending '…' if truncated. */\nexport function truncate(value: string, maxLength: number) {\n return value.length > maxLength ? value.slice(0, Math.max(maxLength - 1, 0)) + '…' : value;\n}\n\n/**\n * Generator that produces syntax-highlighted tokens for a JSON value.\n * Uses a character budget to limit output length, yielding tokens and\n * returning the remaining budget via the generator return value.\n */\n// eslint-disable-next-line sonarjs/cognitive-complexity\nexport function* tokenize(\n value: unknown,\n budget: number\n): Generator<{ kind: string; value: string }, number> {\n /** Creates a token and deducts its length from the budget. */\n const token = (kind: string, value: string) => {\n budget -= value.length;\n return { kind, value };\n };\n\n if (typeof value === 'string') yield token('string', JSON.stringify(truncate(value, budget)));\n else if (typeof value !== 'object') yield token(typeof value, String(value));\n else if (value === null) yield token('null', String(null));\n else {\n const [firstKey] = Object.keys(value);\n const isArray = Array.isArray(value);\n yield token('punctuation', isArray ? '[' : '{');\n\n for (const [key, child] of Object.entries(value)) {\n if (key !== firstKey) yield token('punctuation', ', ');\n if (budget <= 0) {\n yield token('punctuation', '…');\n break;\n }\n\n if (!isArray) {\n yield token('key', key);\n yield token('punctuation', ': ');\n }\n\n budget = yield* tokenize(child, budget);\n }\n\n yield token('punctuation', isArray ? ']' : '}');\n }\n\n return budget;\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 ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { isNonEmpty, tokenize } from './watt-json.utils';\n\n@Component({\n selector: 'watt-json-row',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattIconComponent],\n styles: `\n watt-json-row {\n position: relative;\n padding-left: calc(var(--watt-json-level) * 20px);\n padding-right: calc(var(--watt-json-level) * 20px);\n color: var(--watt-color-primary);\n }\n\n watt-json-row > watt-icon {\n position: absolute;\n top: 2px;\n transform: translateX(-100%);\n }\n\n .watt-json-row-added:not(:empty) {\n background-color: var(--watt-color-state-success-light);\n }\n\n .watt-json-row-removed:not(:empty) {\n background-color: var(--watt-color-state-danger-light);\n }\n\n .watt-json-function,\n .watt-json-undefined {\n color: var(--watt-on-light-low-emphasis);\n }\n\n .watt-json-punctuation {\n color: var(--watt-on-light-medium-emphasis);\n }\n\n .watt-json-key {\n color: var(--watt-color-primary);\n }\n\n .watt-json-string {\n color: var(--watt-color-state-success);\n }\n\n .watt-json-number {\n color: var(--watt-color-state-warning);\n }\n\n .watt-json-boolean,\n .watt-json-null {\n color: var(--watt-color-state-danger);\n }\n `,\n host: {\n '[class.watt-json-row-added]': '!isOriginal() && !isSame()',\n '[class.watt-json-row-removed]': 'isOriginal() && !isSame()',\n },\n template: `\n @if (value() !== undefined) {\n @if (expandable()) {\n <watt-icon size=\"s\" [name]=\"expanded() ? 'down' : 'right'\" />\n }\n <span>{{ label() }}: </span>\n <span [hidden]=\"expanded()\">\n @for (token of tokens(); track $index) {\n <span [class]=\"'watt-json-' + token.kind\">{{ token.value }}</span>\n }\n </span>\n }\n `,\n})\nexport class WattJsonRow {\n readonly label = input<string>();\n readonly isOriginal = input.required<boolean>();\n readonly isSame = input.required<boolean>();\n readonly expanded = input.required<boolean>();\n readonly value = input<unknown>();\n\n protected readonly expandable = computed(() => isNonEmpty(this.value()));\n protected readonly tokens = computed(() => [\n ...tokenize(this.value(), this.expandable() ? 80 : Infinity),\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 ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n linkedSignal,\n} from '@angular/core';\nimport { VATER } from '@energinet/watt/vater';\nimport { WattJsonRow } from './watt-json-row.component';\nimport { interleave, isNonEmpty, isEqual } from './watt-json.utils';\n\nexport type TreeState = {\n expanded: boolean;\n maxDepth: number;\n};\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'watt-json',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VATER, WattJsonRow],\n styles: `\n watt-json {\n cursor: default;\n }\n\n .watt-json-row {\n position: relative;\n }\n\n .watt-json-row::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: 4px;\n background-color: rgba(0, 0, 0, 0);\n pointer-events: none;\n }\n\n .watt-json-row:hover::after {\n background-color: rgba(0, 0, 0, 0.1);\n outline: 1px solid var(--watt-color-neutral-grey-500);\n outline-offset: -1px;\n }\n `,\n host: { '[style.--watt-json-level]': 'level()' },\n template: `\n @if (!isRoot()) {\n <vater-flex class=\"watt-json-row\" direction=\"row\" (click)=\"toggleExpanded()\">\n <watt-json-row\n [label]=\"label()\"\n [isOriginal]=\"true\"\n [isSame]=\"isSame()\"\n [expanded]=\"expanded()\"\n [value]=\"left()\"\n />\n @if (diff()) {\n <watt-json-row\n [label]=\"label()\"\n [isOriginal]=\"false\"\n [isSame]=\"isSame()\"\n [expanded]=\"expanded()\"\n [value]=\"right()\"\n />\n }\n </vater-flex>\n }\n @defer (when expanded()) {\n @for (child of children(); track child.key) {\n <watt-json\n [hidden]=\"!expanded()\"\n [label]=\"child.key\"\n [left]=\"child.left\"\n [right]=\"child.right\"\n [diff]=\"diff()\"\n [tree]=\"tree()\"\n [level]=\"level() + 1\"\n />\n }\n }\n `,\n})\nexport class WattJson {\n readonly label = input<string>();\n readonly left = input<unknown>();\n readonly right = input<unknown>();\n readonly diff = input(false);\n readonly tree = input.required<TreeState>();\n readonly level = input(0);\n\n protected readonly toMap = (v: unknown) => new Map(Object.entries(isNonEmpty(v) ? v : []));\n protected readonly children = computed(() => {\n const left = this.toMap(this.left());\n const right = this.toMap(this.right());\n const keys = new Set(interleave([...left.keys()], [...right.keys()]));\n return [...keys].map((key) => ({ key, left: left.get(key), right: right.get(key) }));\n });\n\n protected readonly isRoot = computed(() => this.level() === 0);\n protected readonly isSame = computed(() => {\n if (!this.diff()) return true;\n return isEqual(this.left(), this.right(), { deep: !this.expanded() });\n });\n\n protected readonly expandable = computed(() => this.children().length > 0);\n protected readonly expanded = linkedSignal({\n source: this.tree,\n computation: (t) =>\n this.level() < t.maxDepth && t.expanded ? this.expandable() : this.isRoot(),\n });\n\n protected readonly toggleExpanded = () =>\n // Prevent toggle when text is being selected\n this.expanded.update((e) => (getSelection()?.isCollapsed && this.expandable() ? !e : e));\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 { ChangeDetectionStrategy, Component, computed, input, linkedSignal } from '@angular/core';\nimport { TreeState, WattJson } from './watt-json.component';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'watt-json-viewer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WattJson],\n template: `\n <watt-json\n [left]=\"json()\"\n [right]=\"compare()\"\n [diff]=\"compare() !== undefined\"\n [tree]=\"tree()\"\n />\n `,\n})\nexport class WattJsonViewer {\n /**\n * The JSON data to display. Accepts any value that can be serialized by JSON.stringify.\n */\n readonly json = input.required<unknown>();\n\n /**\n * Optional value to compare against. When provided, enables diff mode with side-by-side view.\n */\n readonly compare = input<unknown>();\n\n /**\n * Maximum depth for `expandAll()`. Beyond this depth nodes start collapsed but can be\n * expanded manually. Useful when dealing with large objects or circular references.\n */\n readonly maxDepth = input(50);\n\n /**\n * Whether the tree starts expanded or collapsed.\n */\n readonly initialExpanded = input(false);\n\n /**\n * Expands all nodes up to `maxDepth`.\n */\n readonly expandAll = () => this.expanded.set(true);\n\n /**\n * Collapses all nodes.\n */\n readonly collapseAll = () => this.expanded.set(false);\n\n // Use equality function + computed object to always return a new reference, even\n // when `expanded` is \"updated\" to its current value. This ensures that \"Expand all\"\n // and \"Collapse all\" always works, regardless of the current state of `expanded`.\n protected readonly expanded = linkedSignal(this.initialExpanded, { equal: () => false });\n protected readonly tree = computed<TreeState>(() => ({\n expanded: this.expanded(),\n maxDepth: this.maxDepth(),\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 { WattJsonViewer } from './watt-json-viewer.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAEA;AACM,SAAU,OAAO,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE,IAAI,EAAqB,EAAA;AACzE,IAAA,IAAI;AACF,QAAA,IAAI,OAAO,CAAC,KAAK,OAAO,CAAC;AAAE,YAAA,OAAO,KAAK;QACvC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,KAAK,CAAC;AACzC,QAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,CAAC,KAAK,CAAC;AAC5C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAI,GAAG,CAAC,CAAS,EAAE,CAAU,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS;AAC5F,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC;IACpE;AAAE,I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AA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EATf;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EARS,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAUP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAd1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,kBAAkB;oBAC5B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,QAAQ,CAAC;AACnB,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;AACF,iBAAA;;;AClCD;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"energinet-watt-json-viewer.mjs","sources":["../../../libs/watt/package/json-viewer/watt-json.utils.ts","../../../libs/watt/package/json-viewer/watt-json-row.component.ts","../../../libs/watt/package/json-viewer/watt-json.component.ts","../../../libs/watt/package/json-viewer/watt-json-viewer.component.ts","../../../libs/watt/package/json-viewer/index.ts","../../../libs/watt/package/json-viewer/energinet-watt-json-viewer.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\n\n/** Compares two values. When deep is false, objects/arrays compare by type only. */\nexport function isEqual(a: unknown, b: unknown, { deep }: { deep: boolean }): boolean {\n try {\n if (typeof a !== typeof b) return false;\n if (typeof a !== 'object') return a === b;\n if (a === null || b === null) return a === b;\n const replacer = !deep ? (_: string, v: unknown) => (Array.isArray(v) ? [] : {}) : undefined;\n return JSON.stringify(a, replacer) === JSON.stringify(b, replacer);\n } catch {\n return a === b;\n }\n}\n\n/** Type guard that checks if a value is a non-empty array or object. */\nexport function isNonEmpty(value: unknown): value is Record<string, unknown> | unknown[] {\n return typeof value === 'object' && value !== null ? Object.keys(value).length > 0 : false;\n}\n\n/** Merges two arrays by alternating elements, preserving the order. */\nexport function interleave<T>(a: T[], b: T[]): T[] {\n return Array.from({ length: Math.max(a.length, b.length) })\n .flatMap((_, i) => [a[i], b[i]])\n .filter((k) => k !== undefined);\n}\n\n/** Truncates a string to maxLength, appending '…' if truncated. */\nexport function truncate(value: string, maxLength: number) {\n return value.length > maxLength ? value.slice(0, Math.max(maxLength - 1, 0)) + '…' : value;\n}\n\n/**\n * Generator that produces syntax-highlighted tokens for a JSON value.\n * Uses a character budget to limit output length, yielding tokens and\n * returning the remaining budget via the generator return value.\n */\nexport function* tokenize(\n value: unknown,\n budget: number\n): Generator<{ kind: string; value: string }, number> {\n /** Creates a token and deducts its length from the budget. */\n const token = (kind: string, value: string) => {\n budget -= value.length;\n return { kind, value };\n };\n\n if (typeof value === 'string') yield token('string', JSON.stringify(truncate(value, budget)));\n else if (typeof value !== 'object') yield token(typeof value, String(value));\n else if (value === null) yield token('null', String(null));\n else {\n const [firstKey] = Object.keys(value);\n const isArray = Array.isArray(value);\n yield token('punctuation', isArray ? '[' : '{');\n\n for (const [key, child] of Object.entries(value)) {\n if (key !== firstKey) yield token('punctuation', ', ');\n if (budget <= 0) {\n yield token('punctuation', '…');\n break;\n }\n\n if (!isArray) {\n yield token('key', key);\n yield token('punctuation', ': ');\n }\n\n budget = yield* tokenize(child, budget);\n }\n\n yield token('punctuation', isArray ? ']' : '}');\n }\n\n return budget;\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 ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { isNonEmpty, tokenize } from './watt-json.utils';\n\n@Component({\n selector: 'watt-json-row',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WattIconComponent],\n styles: `\n watt-json-row {\n position: relative;\n padding-left: calc(var(--watt-json-level) * 20px);\n padding-right: calc(var(--watt-json-level) * 20px);\n color: var(--watt-color-primary);\n }\n\n watt-json-row > watt-icon {\n position: absolute;\n top: 2px;\n transform: translateX(-100%);\n }\n\n .watt-json-row-added:not(:empty) {\n background-color: var(--watt-color-state-success-light);\n }\n\n .watt-json-row-removed:not(:empty) {\n background-color: var(--watt-color-state-danger-light);\n }\n\n .watt-json-function,\n .watt-json-undefined {\n color: var(--watt-on-light-low-emphasis);\n }\n\n .watt-json-punctuation {\n color: var(--watt-on-light-medium-emphasis);\n }\n\n .watt-json-key {\n color: var(--watt-color-primary);\n }\n\n .watt-json-string {\n color: var(--watt-color-state-success);\n }\n\n .watt-json-number {\n color: var(--watt-color-state-warning);\n }\n\n .watt-json-boolean,\n .watt-json-null {\n color: var(--watt-color-state-danger);\n }\n `,\n host: {\n '[class.watt-json-row-added]': '!isOriginal() && !isSame()',\n '[class.watt-json-row-removed]': 'isOriginal() && !isSame()',\n },\n template: `\n @if (value() !== undefined) {\n @if (expandable()) {\n <watt-icon size=\"s\" [name]=\"expanded() ? 'down' : 'right'\" />\n }\n <span>{{ label() }}: </span>\n <span [hidden]=\"expanded()\">\n @for (token of tokens(); track $index) {\n <span [class]=\"'watt-json-' + token.kind\">{{ token.value }}</span>\n }\n </span>\n }\n `,\n})\nexport class WattJsonRow {\n readonly label = input<string>();\n readonly isOriginal = input.required<boolean>();\n readonly isSame = input.required<boolean>();\n readonly expanded = input.required<boolean>();\n readonly value = input<unknown>();\n\n protected readonly expandable = computed(() => isNonEmpty(this.value()));\n protected readonly tokens = computed(() => [\n ...tokenize(this.value(), this.expandable() ? 80 : Infinity),\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 ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n linkedSignal,\n} from '@angular/core';\nimport { VATER } from '@energinet/watt/vater';\nimport { WattJsonRow } from './watt-json-row.component';\nimport { interleave, isNonEmpty, isEqual } from './watt-json.utils';\n\nexport type TreeState = {\n expanded: boolean;\n maxDepth: number;\n};\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'watt-json',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [VATER, WattJsonRow],\n styles: `\n watt-json {\n cursor: default;\n }\n\n .watt-json-row {\n position: relative;\n }\n\n .watt-json-row::after {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: 4px;\n background-color: rgba(0, 0, 0, 0);\n pointer-events: none;\n }\n\n .watt-json-row:hover::after {\n background-color: rgba(0, 0, 0, 0.1);\n outline: 1px solid var(--watt-color-neutral-grey-500);\n outline-offset: -1px;\n }\n `,\n host: { '[style.--watt-json-level]': 'level()' },\n template: `\n @if (!isRoot()) {\n <vater-flex class=\"watt-json-row\" direction=\"row\" (click)=\"toggleExpanded()\">\n <watt-json-row\n [label]=\"label()\"\n [isOriginal]=\"true\"\n [isSame]=\"isSame()\"\n [expanded]=\"expanded()\"\n [value]=\"left()\"\n />\n @if (diff()) {\n <watt-json-row\n [label]=\"label()\"\n [isOriginal]=\"false\"\n [isSame]=\"isSame()\"\n [expanded]=\"expanded()\"\n [value]=\"right()\"\n />\n }\n </vater-flex>\n }\n @defer (when expanded()) {\n @for (child of children(); track child.key) {\n <watt-json\n [hidden]=\"!expanded()\"\n [label]=\"child.key\"\n [left]=\"child.left\"\n [right]=\"child.right\"\n [diff]=\"diff()\"\n [tree]=\"tree()\"\n [level]=\"level() + 1\"\n />\n }\n }\n `,\n})\nexport class WattJson {\n readonly label = input<string>();\n readonly left = input<unknown>();\n readonly right = input<unknown>();\n readonly diff = input(false);\n readonly tree = input.required<TreeState>();\n readonly level = input(0);\n\n protected readonly toMap = (v: unknown) => new Map(Object.entries(isNonEmpty(v) ? v : []));\n protected readonly children = computed(() => {\n const left = this.toMap(this.left());\n const right = this.toMap(this.right());\n const keys = new Set(interleave([...left.keys()], [...right.keys()]));\n return [...keys].map((key) => ({ key, left: left.get(key), right: right.get(key) }));\n });\n\n protected readonly isRoot = computed(() => this.level() === 0);\n protected readonly isSame = computed(() => {\n if (!this.diff()) return true;\n return isEqual(this.left(), this.right(), { deep: !this.expanded() });\n });\n\n protected readonly expandable = computed(() => this.children().length > 0);\n protected readonly expanded = linkedSignal({\n source: this.tree,\n computation: (t) =>\n this.level() < t.maxDepth && t.expanded ? this.expandable() : this.isRoot(),\n });\n\n protected readonly toggleExpanded = () =>\n // Prevent toggle when text is being selected\n this.expanded.update((e) => (getSelection()?.isCollapsed && this.expandable() ? !e : e));\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 { ChangeDetectionStrategy, Component, computed, input, linkedSignal } from '@angular/core';\nimport { TreeState, WattJson } from './watt-json.component';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'watt-json-viewer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WattJson],\n template: `\n <watt-json\n [left]=\"json()\"\n [right]=\"compare()\"\n [diff]=\"compare() !== undefined\"\n [tree]=\"tree()\"\n />\n `,\n})\nexport class WattJsonViewer {\n /**\n * The JSON data to display. Accepts any value that can be serialized by JSON.stringify.\n */\n readonly json = input.required<unknown>();\n\n /**\n * Optional value to compare against. When provided, enables diff mode with side-by-side view.\n */\n readonly compare = input<unknown>();\n\n /**\n * Maximum depth for `expandAll()`. Beyond this depth nodes start collapsed but can be\n * expanded manually. Useful when dealing with large objects or circular references.\n */\n readonly maxDepth = input(50);\n\n /**\n * Whether the tree starts expanded or collapsed.\n */\n readonly initialExpanded = input(false);\n\n /**\n * Expands all nodes up to `maxDepth`.\n */\n readonly expandAll = () => this.expanded.set(true);\n\n /**\n * Collapses all nodes.\n */\n readonly collapseAll = () => this.expanded.set(false);\n\n // Use equality function + computed object to always return a new reference, even\n // when `expanded` is \"updated\" to its current value. This ensures that \"Expand all\"\n // and \"Collapse all\" always works, regardless of the current state of `expanded`.\n protected readonly expanded = linkedSignal(this.initialExpanded, { equal: () => false });\n protected readonly tree = computed<TreeState>(() => ({\n expanded: this.expanded(),\n maxDepth: this.maxDepth(),\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 { WattJsonViewer } from './watt-json-viewer.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAEA;AACM,SAAU,OAAO,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE,IAAI,EAAqB,EAAA;AACzE,IAAA,IAAI;AACF,QAAA,IAAI,OAAO,CAAC,KAAK,OAAO,CAAC;AAAE,YAAA,OAAO,KAAK;QACvC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO,CAAC,KAAK,CAAC;AACzC,QAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,CAAC,KAAK,CAAC;AAC5C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAI,GAAG,CAAC,CAAS,EAAE,CAAU,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS;AAC5F,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAA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