@energinet/watt 4.5.2 → 4.5.3
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.
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { WattIconComponent } from '@energinet/watt/icon';
|
|
4
|
+
|
|
5
|
+
//#region License
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
//#endregion
|
|
23
|
+
/**
|
|
24
|
+
* Usage:
|
|
25
|
+
* `import { WattExpandableLinkComponent } from '@energinet/watt/expandable-link';`
|
|
26
|
+
*
|
|
27
|
+
* A lightweight inline collapsible/disclosure styled as a link. Unlike
|
|
28
|
+
* `WattExpandableCardComponent`, this component renders no card chrome,
|
|
29
|
+
* only a clickable link-styled label row with a chevron and the projected
|
|
30
|
+
* content below.
|
|
31
|
+
*/
|
|
32
|
+
class WattExpandableLinkComponent {
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
* Counter for unique `contentId` generation. Matches the static-counter
|
|
36
|
+
* pattern used by other Watt form components (see `WattDatepickerComponent`,
|
|
37
|
+
* `WattTimepickerComponent`). The IDs are not SSR-hydration-safe; if Watt
|
|
38
|
+
* ever enables SSR this needs to switch to Angular's `_IdGenerator` or
|
|
39
|
+
* deferred assignment.
|
|
40
|
+
*/
|
|
41
|
+
static nextId = 0;
|
|
42
|
+
/** Whether the expandable is expanded. Supports two-way binding via `[(expanded)]`. */
|
|
43
|
+
expanded = model(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Label shown when the content is collapsed (e.g. "Vis indhold"). */
|
|
45
|
+
labelCollapsed = input.required(...(ngDevMode ? [{ debugName: "labelCollapsed" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/**
|
|
47
|
+
* Label shown when the content is expanded (e.g. "Skjul indhold").
|
|
48
|
+
* Optional. If omitted, the collapsed label is shown in both states, leaving the
|
|
49
|
+
* chevron rotation as the only visual state cue (screen readers still get
|
|
50
|
+
* `aria-expanded` for state).
|
|
51
|
+
*/
|
|
52
|
+
labelExpanded = input(...(ngDevMode ? [undefined, { debugName: "labelExpanded" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/**
|
|
54
|
+
* @ignore
|
|
55
|
+
*/
|
|
56
|
+
instanceId = WattExpandableLinkComponent.nextId++;
|
|
57
|
+
/**
|
|
58
|
+
* @ignore
|
|
59
|
+
*/
|
|
60
|
+
triggerId = `watt-expandable-link-trigger-${this.instanceId}`;
|
|
61
|
+
/**
|
|
62
|
+
* @ignore
|
|
63
|
+
*/
|
|
64
|
+
contentId = `watt-expandable-link-content-${this.instanceId}`;
|
|
65
|
+
/**
|
|
66
|
+
* @ignore
|
|
67
|
+
*/
|
|
68
|
+
currentLabel = computed(() => this.expanded() ? (this.labelExpanded() ?? this.labelCollapsed()) : this.labelCollapsed(), ...(ngDevMode ? [{ debugName: "currentLabel" }] : /* istanbul ignore next */ []));
|
|
69
|
+
/**
|
|
70
|
+
* @ignore
|
|
71
|
+
*/
|
|
72
|
+
toggle() {
|
|
73
|
+
this.expanded.update((value) => !value);
|
|
74
|
+
}
|
|
75
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattExpandableLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.5", type: WattExpandableLinkComponent, isStandalone: true, selector: "watt-expandable-link", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, labelCollapsed: { classPropertyName: "labelCollapsed", publicName: "labelCollapsed", isSignal: true, isRequired: true, transformFunction: null }, labelExpanded: { classPropertyName: "labelExpanded", publicName: "labelExpanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, host: { properties: { "class.watt-expandable-link--expanded": "expanded()" }, classAttribute: "watt-expandable-link" }, ngImport: i0, template: `
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
[id]="triggerId"
|
|
80
|
+
class="watt-expandable-link__header"
|
|
81
|
+
[attr.aria-expanded]="expanded()"
|
|
82
|
+
[attr.aria-controls]="contentId"
|
|
83
|
+
(click)="toggle()"
|
|
84
|
+
>
|
|
85
|
+
<watt-icon
|
|
86
|
+
name="down"
|
|
87
|
+
size="s"
|
|
88
|
+
class="watt-expandable-link__chevron"
|
|
89
|
+
[attr.aria-hidden]="true"
|
|
90
|
+
/>
|
|
91
|
+
<span class="watt-expandable-link__label">{{ currentLabel() }}</span>
|
|
92
|
+
</button>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
[id]="contentId"
|
|
96
|
+
class="watt-expandable-link__body"
|
|
97
|
+
[class.watt-expandable-link__body--expanded]="expanded()"
|
|
98
|
+
[attr.inert]="expanded() ? null : ''"
|
|
99
|
+
[attr.aria-hidden]="expanded() ? null : true"
|
|
100
|
+
[attr.aria-labelledby]="triggerId"
|
|
101
|
+
role="region"
|
|
102
|
+
>
|
|
103
|
+
<div class="watt-expandable-link__body-inner">
|
|
104
|
+
<ng-content />
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
`, isInline: true, styles: [":host{display:block}.watt-expandable-link__header{color:var(--watt-typography-link-color);font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;text-decoration:underline;cursor:pointer;font-size:.875rem;line-height:1.25rem;text-decoration:none;display:inline-flex;align-items:center;gap:var(--watt-space-xs);padding:0;background:transparent;border:none;text-align:left}.watt-expandable-link__label{text-decoration:underline}.watt-expandable-link__header:focus-visible{outline:2px solid var(--watt-color-primary);outline-offset:2px}.watt-expandable-link__chevron{transition:transform var(--watt-time-short) var(--watt-move-inside-screen)}:host(.watt-expandable-link--expanded) .watt-expandable-link__chevron{transform:rotate(180deg)}.watt-expandable-link__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--watt-time-short) var(--watt-move-inside-screen)}.watt-expandable-link__body--expanded{grid-template-rows:1fr}.watt-expandable-link__body-inner{min-height:0;overflow:hidden}@media(prefers-reduced-motion:reduce){.watt-expandable-link__chevron,.watt-expandable-link__body{transition:none}}\n"], dependencies: [{ kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: WattExpandableLinkComponent, decorators: [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{ selector: 'watt-expandable-link', changeDetection: ChangeDetectionStrategy.OnPush, imports: [WattIconComponent], template: `
|
|
112
|
+
<button
|
|
113
|
+
type="button"
|
|
114
|
+
[id]="triggerId"
|
|
115
|
+
class="watt-expandable-link__header"
|
|
116
|
+
[attr.aria-expanded]="expanded()"
|
|
117
|
+
[attr.aria-controls]="contentId"
|
|
118
|
+
(click)="toggle()"
|
|
119
|
+
>
|
|
120
|
+
<watt-icon
|
|
121
|
+
name="down"
|
|
122
|
+
size="s"
|
|
123
|
+
class="watt-expandable-link__chevron"
|
|
124
|
+
[attr.aria-hidden]="true"
|
|
125
|
+
/>
|
|
126
|
+
<span class="watt-expandable-link__label">{{ currentLabel() }}</span>
|
|
127
|
+
</button>
|
|
128
|
+
|
|
129
|
+
<div
|
|
130
|
+
[id]="contentId"
|
|
131
|
+
class="watt-expandable-link__body"
|
|
132
|
+
[class.watt-expandable-link__body--expanded]="expanded()"
|
|
133
|
+
[attr.inert]="expanded() ? null : ''"
|
|
134
|
+
[attr.aria-hidden]="expanded() ? null : true"
|
|
135
|
+
[attr.aria-labelledby]="triggerId"
|
|
136
|
+
role="region"
|
|
137
|
+
>
|
|
138
|
+
<div class="watt-expandable-link__body-inner">
|
|
139
|
+
<ng-content />
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
`, host: {
|
|
143
|
+
class: 'watt-expandable-link',
|
|
144
|
+
'[class.watt-expandable-link--expanded]': 'expanded()',
|
|
145
|
+
}, styles: [":host{display:block}.watt-expandable-link__header{color:var(--watt-typography-link-color);font-size:1rem;line-height:1.5rem;font-weight:400;text-transform:none;letter-spacing:0;text-decoration:underline;cursor:pointer;font-size:.875rem;line-height:1.25rem;text-decoration:none;display:inline-flex;align-items:center;gap:var(--watt-space-xs);padding:0;background:transparent;border:none;text-align:left}.watt-expandable-link__label{text-decoration:underline}.watt-expandable-link__header:focus-visible{outline:2px solid var(--watt-color-primary);outline-offset:2px}.watt-expandable-link__chevron{transition:transform var(--watt-time-short) var(--watt-move-inside-screen)}:host(.watt-expandable-link--expanded) .watt-expandable-link__chevron{transform:rotate(180deg)}.watt-expandable-link__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--watt-time-short) var(--watt-move-inside-screen)}.watt-expandable-link__body--expanded{grid-template-rows:1fr}.watt-expandable-link__body-inner{min-height:0;overflow:hidden}@media(prefers-reduced-motion:reduce){.watt-expandable-link__chevron,.watt-expandable-link__body{transition:none}}\n"] }]
|
|
146
|
+
}], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }, { type: i0.Output, args: ["expandedChange"] }], labelCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelCollapsed", required: true }] }], labelExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelExpanded", required: false }] }] } });
|
|
147
|
+
|
|
148
|
+
//#region License
|
|
149
|
+
/**
|
|
150
|
+
* @license
|
|
151
|
+
* Copyright 2020 Energinet DataHub A/S
|
|
152
|
+
*
|
|
153
|
+
* Licensed under the Apache License, Version 2.0 (the "License2");
|
|
154
|
+
* you may not use this file except in compliance with the License.
|
|
155
|
+
* You may obtain a copy of the License at
|
|
156
|
+
*
|
|
157
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
158
|
+
*
|
|
159
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
160
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
161
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
162
|
+
* See the License for the specific language governing permissions and
|
|
163
|
+
* limitations under the License.
|
|
164
|
+
*/
|
|
165
|
+
//#endregion
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Generated bundle index. Do not edit.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
export { WattExpandableLinkComponent };
|
|
172
|
+
//# sourceMappingURL=energinet-watt-expandable-link.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"energinet-watt-expandable-link.mjs","sources":["../../../libs/watt/package/expandable-link/watt-expandable-link.component.ts","../../../libs/watt/package/expandable-link/index.ts","../../../libs/watt/package/expandable-link/energinet-watt-expandable-link.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, computed, input, model } from '@angular/core';\nimport { WattIconComponent } from '@energinet/watt/icon';\n\n/**\n * Usage:\n * `import { WattExpandableLinkComponent } from '@energinet/watt/expandable-link';`\n *\n * A lightweight inline collapsible/disclosure styled as a link. Unlike\n * `WattExpandableCardComponent`, this component renders no card chrome,\n * only a clickable link-styled label row with a chevron and the projected\n * content below.\n */\n@Component({\n selector: 'watt-expandable-link',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WattIconComponent],\n styleUrl: './watt-expandable-link.component.scss',\n template: `\n <button\n type=\"button\"\n [id]=\"triggerId\"\n class=\"watt-expandable-link__header\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <watt-icon\n name=\"down\"\n size=\"s\"\n class=\"watt-expandable-link__chevron\"\n [attr.aria-hidden]=\"true\"\n />\n <span class=\"watt-expandable-link__label\">{{ currentLabel() }}</span>\n </button>\n\n <div\n [id]=\"contentId\"\n class=\"watt-expandable-link__body\"\n [class.watt-expandable-link__body--expanded]=\"expanded()\"\n [attr.inert]=\"expanded() ? null : ''\"\n [attr.aria-hidden]=\"expanded() ? null : true\"\n [attr.aria-labelledby]=\"triggerId\"\n role=\"region\"\n >\n <div class=\"watt-expandable-link__body-inner\">\n <ng-content />\n </div>\n </div>\n `,\n host: {\n class: 'watt-expandable-link',\n '[class.watt-expandable-link--expanded]': 'expanded()',\n },\n})\nexport class WattExpandableLinkComponent {\n /**\n * @ignore\n * Counter for unique `contentId` generation. Matches the static-counter\n * pattern used by other Watt form components (see `WattDatepickerComponent`,\n * `WattTimepickerComponent`). The IDs are not SSR-hydration-safe; if Watt\n * ever enables SSR this needs to switch to Angular's `_IdGenerator` or\n * deferred assignment.\n */\n private static nextId = 0;\n\n /** Whether the expandable is expanded. Supports two-way binding via `[(expanded)]`. */\n expanded = model(false);\n\n /** Label shown when the content is collapsed (e.g. \"Vis indhold\"). */\n labelCollapsed = input.required<string>();\n\n /**\n * Label shown when the content is expanded (e.g. \"Skjul indhold\").\n * Optional. If omitted, the collapsed label is shown in both states, leaving the\n * chevron rotation as the only visual state cue (screen readers still get\n * `aria-expanded` for state).\n */\n labelExpanded = input<string>();\n\n /**\n * @ignore\n */\n private readonly instanceId = WattExpandableLinkComponent.nextId++;\n\n /**\n * @ignore\n */\n readonly triggerId = `watt-expandable-link-trigger-${this.instanceId}`;\n\n /**\n * @ignore\n */\n readonly contentId = `watt-expandable-link-content-${this.instanceId}`;\n\n /**\n * @ignore\n */\n currentLabel = computed(() =>\n this.expanded() ? (this.labelExpanded() ?? this.labelCollapsed()) : this.labelCollapsed()\n );\n\n /**\n * @ignore\n */\n toggle(): void {\n this.expanded.update((value) => !value);\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 { WattExpandableLinkComponent } from './watt-expandable-link.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;AAIA;;;;;;;;AAQG;MA2CU,2BAA2B,CAAA;AACtC;;;;;;;AAOG;AACK,IAAA,OAAO,MAAM,GAAG,CAAC;;AAGzB,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;;AAGvB,IAAA,c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|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@energinet/watt",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.3",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -91,6 +91,10 @@
|
|
|
91
91
|
"types": "./types/energinet-watt-expandable-card.d.ts",
|
|
92
92
|
"default": "./fesm2022/energinet-watt-expandable-card.mjs"
|
|
93
93
|
},
|
|
94
|
+
"./expandable-link": {
|
|
95
|
+
"types": "./types/energinet-watt-expandable-link.d.ts",
|
|
96
|
+
"default": "./fesm2022/energinet-watt-expandable-link.mjs"
|
|
97
|
+
},
|
|
94
98
|
"./field": {
|
|
95
99
|
"types": "./types/energinet-watt-field.d.ts",
|
|
96
100
|
"default": "./fesm2022/energinet-watt-field.mjs"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Usage:
|
|
5
|
+
* `import { WattExpandableLinkComponent } from '@energinet/watt/expandable-link';`
|
|
6
|
+
*
|
|
7
|
+
* A lightweight inline collapsible/disclosure styled as a link. Unlike
|
|
8
|
+
* `WattExpandableCardComponent`, this component renders no card chrome,
|
|
9
|
+
* only a clickable link-styled label row with a chevron and the projected
|
|
10
|
+
* content below.
|
|
11
|
+
*/
|
|
12
|
+
declare class WattExpandableLinkComponent {
|
|
13
|
+
/**
|
|
14
|
+
* @ignore
|
|
15
|
+
* Counter for unique `contentId` generation. Matches the static-counter
|
|
16
|
+
* pattern used by other Watt form components (see `WattDatepickerComponent`,
|
|
17
|
+
* `WattTimepickerComponent`). The IDs are not SSR-hydration-safe; if Watt
|
|
18
|
+
* ever enables SSR this needs to switch to Angular's `_IdGenerator` or
|
|
19
|
+
* deferred assignment.
|
|
20
|
+
*/
|
|
21
|
+
private static nextId;
|
|
22
|
+
/** Whether the expandable is expanded. Supports two-way binding via `[(expanded)]`. */
|
|
23
|
+
expanded: _angular_core.ModelSignal<boolean>;
|
|
24
|
+
/** Label shown when the content is collapsed (e.g. "Vis indhold"). */
|
|
25
|
+
labelCollapsed: _angular_core.InputSignal<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Label shown when the content is expanded (e.g. "Skjul indhold").
|
|
28
|
+
* Optional. If omitted, the collapsed label is shown in both states, leaving the
|
|
29
|
+
* chevron rotation as the only visual state cue (screen readers still get
|
|
30
|
+
* `aria-expanded` for state).
|
|
31
|
+
*/
|
|
32
|
+
labelExpanded: _angular_core.InputSignal<string | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
private readonly instanceId;
|
|
37
|
+
/**
|
|
38
|
+
* @ignore
|
|
39
|
+
*/
|
|
40
|
+
readonly triggerId: string;
|
|
41
|
+
/**
|
|
42
|
+
* @ignore
|
|
43
|
+
*/
|
|
44
|
+
readonly contentId: string;
|
|
45
|
+
/**
|
|
46
|
+
* @ignore
|
|
47
|
+
*/
|
|
48
|
+
currentLabel: _angular_core.Signal<string>;
|
|
49
|
+
/**
|
|
50
|
+
* @ignore
|
|
51
|
+
*/
|
|
52
|
+
toggle(): void;
|
|
53
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WattExpandableLinkComponent, never>;
|
|
54
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WattExpandableLinkComponent, "watt-expandable-link", never, { "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "labelCollapsed": { "alias": "labelCollapsed"; "required": true; "isSignal": true; }; "labelExpanded": { "alias": "labelExpanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, ["*"], true, never>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { WattExpandableLinkComponent };
|