@ks-digital/designsystem-angular 0.0.1-alpha.63 → 0.0.1-alpha.65
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@ks-digital/designsystem-angular/__internals';
|
|
4
|
-
import { HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
4
|
+
import { logIfDevMode, HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
5
5
|
|
|
6
6
|
class Spinner {
|
|
7
7
|
/**
|
|
@@ -13,18 +13,30 @@ class Spinner {
|
|
|
13
13
|
*/
|
|
14
14
|
ariaHidden = input(undefined, { ...(ngDevMode ? { debugName: "ariaHidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
|
|
15
15
|
alias: 'aria-hidden' });
|
|
16
|
+
constructor() {
|
|
17
|
+
effect(() => {
|
|
18
|
+
if (this.ariaLabel() === undefined && !this.ariaHidden()) {
|
|
19
|
+
logIfDevMode({
|
|
20
|
+
component: 'ksd-spinner',
|
|
21
|
+
message: 'Either `aria-label` or `aria-hidden` must be provided.',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
16
26
|
/**
|
|
17
27
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
18
28
|
* @attribute data-size
|
|
19
29
|
*/
|
|
20
30
|
dataSize = input(undefined, { ...(ngDevMode ? { debugName: "dataSize" } : /* istanbul ignore next */ {}), alias: 'data-size' });
|
|
21
31
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: Spinner, isStandalone: true, selector: "ksd-spinner", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null }, dataSize: { classPropertyName: "dataSize", publicName: "data-size", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
32
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: Spinner, isStandalone: true, selector: "ksd-spinner", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null }, dataSize: { classPropertyName: "dataSize", publicName: "data-size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-label": "null", "attr.aria-hidden": "null" } }, hostDirectives: [{ directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
23
33
|
<svg
|
|
24
34
|
class="ds-spinner"
|
|
25
35
|
role="img"
|
|
26
36
|
viewBox="0 0 50 50"
|
|
27
37
|
[attr.data-size]="dataSize()"
|
|
38
|
+
[attr.aria-label]="ariaLabel()"
|
|
39
|
+
[attr.aria-hidden]="ariaHidden() || undefined"
|
|
28
40
|
>
|
|
29
41
|
<circle
|
|
30
42
|
class="ds-spinner__background"
|
|
@@ -53,6 +65,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
53
65
|
role="img"
|
|
54
66
|
viewBox="0 0 50 50"
|
|
55
67
|
[attr.data-size]="dataSize()"
|
|
68
|
+
[attr.aria-label]="ariaLabel()"
|
|
69
|
+
[attr.aria-hidden]="ariaHidden() || undefined"
|
|
56
70
|
>
|
|
57
71
|
<circle
|
|
58
72
|
class="ds-spinner__background"
|
|
@@ -71,13 +85,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
71
85
|
stroke-width="5"
|
|
72
86
|
/>
|
|
73
87
|
</svg>
|
|
74
|
-
`,
|
|
88
|
+
`, host: {
|
|
89
|
+
'[attr.aria-label]': 'null',
|
|
90
|
+
'[attr.aria-hidden]': 'null',
|
|
91
|
+
}, hostDirectives: [
|
|
75
92
|
{
|
|
76
93
|
directive: HostColor,
|
|
77
94
|
inputs: ['data-color'],
|
|
78
95
|
},
|
|
79
96
|
], styles: [":host{display:contents}\n"] }]
|
|
80
|
-
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], dataSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-size", required: false }] }] } });
|
|
97
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], dataSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-size", required: false }] }] } });
|
|
81
98
|
|
|
82
99
|
/**
|
|
83
100
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-spinner.mjs","sources":["../../../../packages/angular/spinner/src/spinner.ts","../../../../packages/angular/spinner/src/ks-digital-designsystem-angular-spinner.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\nimport {
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-spinner.mjs","sources":["../../../../packages/angular/spinner/src/spinner.ts","../../../../packages/angular/spinner/src/ks-digital-designsystem-angular-spinner.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n effect,\n input,\n} from '@angular/core'\nimport {\n HostColor,\n logIfDevMode,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { SpinnerSize } from './spinner-sizes'\n\n@Component({\n selector: 'ksd-spinner',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: `\n :host {\n display: contents;\n }\n `,\n template: `\n <svg\n class=\"ds-spinner\"\n role=\"img\"\n viewBox=\"0 0 50 50\"\n [attr.data-size]=\"dataSize()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-hidden]=\"ariaHidden() || undefined\"\n >\n <circle\n class=\"ds-spinner__background\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n />\n <circle\n class=\"ds-spinner__circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n />\n </svg>\n `,\n host: {\n '[attr.aria-label]': 'null',\n '[attr.aria-hidden]': 'null',\n },\n hostDirectives: [\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n})\nexport class Spinner {\n /**\n * Aria-label for the spinner\n */\n readonly ariaLabel = input<string>(undefined, { alias: 'aria-label' })\n\n /**\n * Aria-hidden for the spinner\n */\n readonly ariaHidden = input(undefined, {\n transform: booleanAttribute,\n alias: 'aria-hidden',\n })\n\n constructor() {\n effect(() => {\n if (this.ariaLabel() === undefined && !this.ariaHidden()) {\n logIfDevMode({\n component: 'ksd-spinner',\n message: 'Either `aria-label` or `aria-hidden` must be provided.',\n })\n }\n })\n }\n\n /**\n * Changes size for descendant Designsystemet components. Select from predefined sizes.\n * @attribute data-size\n */\n readonly dataSize = input<SpinnerSize>(undefined, {\n alias: 'data-size',\n })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA2Da,OAAO,CA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AA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAtCR;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAYU,OAAO,EAAA,UAAA,EAAA,CAAA;kBA9CnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,eAAA,EACN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAMrC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BT,EAAA,IAAA,EACK;AACJ,wBAAA,mBAAmB,EAAE,MAAM;AAC3B,wBAAA,oBAAoB,EAAE,MAAM;qBAC7B,EAAA,cAAA,EACe;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,SAAS;4BACpB,MAAM,EAAE,CAAC,YAAY,CAAC;AACvB,yBAAA;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;ACzDH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ declare class Spinner {
|
|
|
10
10
|
* Aria-hidden for the spinner
|
|
11
11
|
*/
|
|
12
12
|
readonly ariaHidden: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
13
|
+
constructor();
|
|
13
14
|
/**
|
|
14
15
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
15
16
|
* @attribute data-size
|