@ks-digital/designsystem-angular 0.0.1-alpha.75 → 0.0.1-alpha.76

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.
Files changed (77) hide show
  1. package/.npmignore +25 -0
  2. package/fesm2022/ks-digital-designsystem-angular-__internals.mjs +148 -78
  3. package/fesm2022/ks-digital-designsystem-angular-__internals.mjs.map +1 -1
  4. package/fesm2022/ks-digital-designsystem-angular-alert.mjs +59 -33
  5. package/fesm2022/ks-digital-designsystem-angular-alert.mjs.map +1 -1
  6. package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs +79 -43
  7. package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs.map +1 -1
  8. package/fesm2022/ks-digital-designsystem-angular-button.mjs +187 -61
  9. package/fesm2022/ks-digital-designsystem-angular-button.mjs.map +1 -1
  10. package/fesm2022/ks-digital-designsystem-angular-card.mjs +136 -86
  11. package/fesm2022/ks-digital-designsystem-angular-card.mjs.map +1 -1
  12. package/fesm2022/ks-digital-designsystem-angular-chip.mjs +76 -42
  13. package/fesm2022/ks-digital-designsystem-angular-chip.mjs.map +1 -1
  14. package/fesm2022/ks-digital-designsystem-angular-details.mjs +148 -64
  15. package/fesm2022/ks-digital-designsystem-angular-details.mjs.map +1 -1
  16. package/fesm2022/ks-digital-designsystem-angular-dialog.mjs +106 -48
  17. package/fesm2022/ks-digital-designsystem-angular-dialog.mjs.map +1 -1
  18. package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs +147 -45
  19. package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs.map +1 -1
  20. package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs +83 -48
  21. package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs.map +1 -1
  22. package/fesm2022/ks-digital-designsystem-angular-forms.mjs +495 -210
  23. package/fesm2022/ks-digital-designsystem-angular-forms.mjs.map +1 -1
  24. package/fesm2022/ks-digital-designsystem-angular-heading.mjs +69 -39
  25. package/fesm2022/ks-digital-designsystem-angular-heading.mjs.map +1 -1
  26. package/fesm2022/ks-digital-designsystem-angular-link.mjs +59 -30
  27. package/fesm2022/ks-digital-designsystem-angular-link.mjs.map +1 -1
  28. package/fesm2022/ks-digital-designsystem-angular-pagination.mjs +324 -157
  29. package/fesm2022/ks-digital-designsystem-angular-pagination.mjs.map +1 -1
  30. package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs +41 -24
  31. package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs.map +1 -1
  32. package/fesm2022/ks-digital-designsystem-angular-popover.mjs +147 -45
  33. package/fesm2022/ks-digital-designsystem-angular-popover.mjs.map +1 -1
  34. package/fesm2022/ks-digital-designsystem-angular-search.mjs +266 -144
  35. package/fesm2022/ks-digital-designsystem-angular-search.mjs.map +1 -1
  36. package/fesm2022/ks-digital-designsystem-angular-skeleton.mjs +78 -34
  37. package/fesm2022/ks-digital-designsystem-angular-skeleton.mjs.map +1 -1
  38. package/fesm2022/ks-digital-designsystem-angular-spinner.mjs +132 -53
  39. package/fesm2022/ks-digital-designsystem-angular-spinner.mjs.map +1 -1
  40. package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs +561 -297
  41. package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs.map +1 -1
  42. package/fesm2022/ks-digital-designsystem-angular-table.mjs +219 -76
  43. package/fesm2022/ks-digital-designsystem-angular-table.mjs.map +1 -1
  44. package/fesm2022/ks-digital-designsystem-angular-tabs.mjs +269 -120
  45. package/fesm2022/ks-digital-designsystem-angular-tabs.mjs.map +1 -1
  46. package/fesm2022/ks-digital-designsystem-angular-tag.mjs +84 -37
  47. package/fesm2022/ks-digital-designsystem-angular-tag.mjs.map +1 -1
  48. package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs +42 -24
  49. package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs.map +1 -1
  50. package/fesm2022/ks-digital-designsystem-angular.mjs +1 -6
  51. package/fesm2022/ks-digital-designsystem-angular.mjs.map +1 -1
  52. package/package.json +6 -5
  53. package/types/ks-digital-designsystem-angular-__internals.d.ts +51 -37
  54. package/types/ks-digital-designsystem-angular-alert.d.ts +18 -9
  55. package/types/ks-digital-designsystem-angular-breadcrumbs.d.ts +29 -13
  56. package/types/ks-digital-designsystem-angular-button.d.ts +67 -32
  57. package/types/ks-digital-designsystem-angular-card.d.ts +38 -23
  58. package/types/ks-digital-designsystem-angular-chip.d.ts +30 -15
  59. package/types/ks-digital-designsystem-angular-details.d.ts +32 -18
  60. package/types/ks-digital-designsystem-angular-dialog.d.ts +40 -18
  61. package/types/ks-digital-designsystem-angular-dropdown.d.ts +44 -13
  62. package/types/ks-digital-designsystem-angular-error-summary.d.ts +17 -14
  63. package/types/ks-digital-designsystem-angular-forms.d.ts +136 -71
  64. package/types/ks-digital-designsystem-angular-heading.d.ts +22 -19
  65. package/types/ks-digital-designsystem-angular-link.d.ts +18 -9
  66. package/types/ks-digital-designsystem-angular-pagination.d.ts +131 -75
  67. package/types/ks-digital-designsystem-angular-paragraph.d.ts +5 -8
  68. package/types/ks-digital-designsystem-angular-popover.d.ts +44 -13
  69. package/types/ks-digital-designsystem-angular-search.d.ts +62 -38
  70. package/types/ks-digital-designsystem-angular-skeleton.d.ts +18 -15
  71. package/types/ks-digital-designsystem-angular-spinner.d.ts +42 -23
  72. package/types/ks-digital-designsystem-angular-suggestion.d.ts +182 -116
  73. package/types/ks-digital-designsystem-angular-table.d.ts +67 -42
  74. package/types/ks-digital-designsystem-angular-tabs.d.ts +85 -56
  75. package/types/ks-digital-designsystem-angular-tag.d.ts +30 -15
  76. package/types/ks-digital-designsystem-angular-validation-message.d.ts +5 -8
  77. package/types/ks-digital-designsystem-angular.d.ts +2 -2
@@ -1,74 +1,200 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import * as i1 from '@ks-digital/designsystem-angular/__internals';
4
- import { HostSize, HostColor } from '@ks-digital/designsystem-angular/__internals';
5
- import { Spinner } from '@ks-digital/designsystem-angular/spinner';
6
-
7
- class Button {
8
- /**
9
- * Specify which variant to use
10
- * @default 'primary'
11
- */
12
- variant = input('primary', { ...(ngDevMode ? { debugName: "variant" } : /* istanbul ignore next */ {}), alias: 'data-variant' });
13
- /**
14
- * Toggle loading state.
15
- * Pass an element if you want to display a custom loader.
16
- *
17
- * @default false
18
- */
19
- loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
20
- /**
21
- * Disables element
22
- */
23
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
24
- /**
25
- * If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon.
26
- * @deprecated Use `data-icon` instead.
27
- */
28
- icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
29
- /** If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon. */
30
- dataIcon = input(false, { ...(ngDevMode ? { debugName: "dataIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
31
- alias: 'data-icon' });
32
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
33
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Button, isStandalone: true, selector: "button[ksd-button], a[ksd-button]", inputs: { variant: { classPropertyName: "variant", publicName: "data-variant", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, dataIcon: { classPropertyName: "dataIcon", publicName: "data-icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-variant": "variant()", "attr.data-icon": "icon() || dataIcon() || null", "attr.disabled": "disabled() ? true : null", "attr.aria-busy": "loading() ? true : null" }, classAttribute: "ds-button" }, hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, booleanAttribute, input } from "@angular/core";
3
+ import * as i1 from "@ks-digital/designsystem-angular/__internals";
4
+ import { HostColor, HostSize } from "@ks-digital/designsystem-angular/__internals";
5
+ import { Spinner } from "@ks-digital/designsystem-angular/spinner";
6
+ var Button = class Button {
7
+ variant = input("primary", {
8
+ ...ngDevMode ? { debugName: "variant" } : /* istanbul ignore next */ {},
9
+ alias: "data-variant"
10
+ });
11
+ loading = input(false, {
12
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
13
+ transform: booleanAttribute
14
+ });
15
+ disabled = input(false, {
16
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
17
+ transform: booleanAttribute
18
+ });
19
+ icon = input(false, {
20
+ ...ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {},
21
+ transform: booleanAttribute
22
+ });
23
+ dataIcon = input(false, {
24
+ ...ngDevMode ? { debugName: "dataIcon" } : /* istanbul ignore next */ {},
25
+ transform: booleanAttribute,
26
+ alias: "data-icon"
27
+ });
28
+ static ɵfac = i0.ɵɵngDeclareFactory({
29
+ minVersion: "12.0.0",
30
+ version: "22.2.0",
31
+ ngImport: i0,
32
+ type: Button,
33
+ deps: [],
34
+ target: i0.ɵɵFactoryTarget.Component
35
+ });
36
+ static ɵcmp = i0.ɵɵngDeclareComponent({
37
+ minVersion: "17.0.0",
38
+ version: "22.2.0",
39
+ type: Button,
40
+ isStandalone: true,
41
+ selector: "button[ksd-button], a[ksd-button]",
42
+ inputs: {
43
+ variant: {
44
+ classPropertyName: "variant",
45
+ publicName: "data-variant",
46
+ isSignal: true,
47
+ isRequired: false,
48
+ transformFunction: null
49
+ },
50
+ loading: {
51
+ classPropertyName: "loading",
52
+ publicName: "loading",
53
+ isSignal: true,
54
+ isRequired: false,
55
+ transformFunction: null
56
+ },
57
+ disabled: {
58
+ classPropertyName: "disabled",
59
+ publicName: "disabled",
60
+ isSignal: true,
61
+ isRequired: false,
62
+ transformFunction: null
63
+ },
64
+ icon: {
65
+ classPropertyName: "icon",
66
+ publicName: "icon",
67
+ isSignal: true,
68
+ isRequired: false,
69
+ transformFunction: null
70
+ },
71
+ dataIcon: {
72
+ classPropertyName: "dataIcon",
73
+ publicName: "data-icon",
74
+ isSignal: true,
75
+ isRequired: false,
76
+ transformFunction: null
77
+ }
78
+ },
79
+ host: {
80
+ properties: {
81
+ "attr.data-variant": "variant()",
82
+ "attr.data-icon": "icon() || dataIcon() || null",
83
+ "attr.disabled": "disabled() ? true : null",
84
+ "attr.aria-busy": "loading() ? true : null"
85
+ },
86
+ classAttribute: "ds-button"
87
+ },
88
+ hostDirectives: [{
89
+ directive: i1.HostSize,
90
+ inputs: ["data-size", "data-size"]
91
+ }, {
92
+ directive: i1.HostColor,
93
+ inputs: ["data-color", "data-color"]
94
+ }],
95
+ ngImport: i0,
96
+ template: `
34
97
  @if (loading()) {
35
98
  <ksd-spinner aria-hidden="true" />
36
99
  }
37
100
  @if (!(loading() && (icon() || dataIcon()))) {
38
101
  <ng-content />
39
102
  }
40
- `, isInline: true, styles: [":host ::ng-deep>*{display:inline-flex}:host ::ng-deep ng-icon{font-size:var(--ng-icon-size, 1.3em)}\n"], dependencies: [{ kind: "component", type: Spinner, selector: "ksd-spinner", inputs: ["aria-label", "aria-hidden", "data-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Button, decorators: [{
43
- type: Component,
44
- args: [{ selector: 'button[ksd-button], a[ksd-button]', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
45
- {
46
- directive: HostSize,
47
- inputs: ['data-size'],
48
- },
49
- {
50
- directive: HostColor,
51
- inputs: ['data-color'],
52
- },
53
- ], imports: [Spinner], host: {
54
- class: 'ds-button',
55
- '[attr.data-variant]': 'variant()',
56
- '[attr.data-icon]': 'icon() || dataIcon() || null',
57
- '[attr.disabled]': 'disabled() ? true : null',
58
- '[attr.aria-busy]': 'loading() ? true : null',
59
- }, template: `
103
+ `,
104
+ isInline: true,
105
+ styles: [":host ::ng-deep>*{display:inline-flex}:host ::ng-deep ng-icon{font-size:var(--ng-glyph__size, 1.3em)}\n"],
106
+ dependencies: [{
107
+ kind: "component",
108
+ type: Spinner,
109
+ selector: "ksd-spinner",
110
+ inputs: [
111
+ "aria-label",
112
+ "aria-hidden",
113
+ "data-size"
114
+ ]
115
+ }],
116
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
117
+ });
118
+ };
119
+ i0.ɵɵngDeclareClassMetadata({
120
+ minVersion: "12.0.0",
121
+ version: "22.2.0",
122
+ ngImport: i0,
123
+ type: Button,
124
+ decorators: [{
125
+ type: Component,
126
+ args: [{
127
+ selector: "button[ksd-button], a[ksd-button]",
128
+ changeDetection: ChangeDetectionStrategy.OnPush,
129
+ hostDirectives: [{
130
+ directive: HostSize,
131
+ inputs: ["data-size"]
132
+ }, {
133
+ directive: HostColor,
134
+ inputs: ["data-color"]
135
+ }],
136
+ imports: [Spinner],
137
+ host: {
138
+ class: "ds-button",
139
+ "[attr.data-variant]": "variant()",
140
+ "[attr.data-icon]": "icon() || dataIcon() || null",
141
+ "[attr.disabled]": "disabled() ? true : null",
142
+ "[attr.aria-busy]": "loading() ? true : null"
143
+ },
144
+ template: `
60
145
  @if (loading()) {
61
146
  <ksd-spinner aria-hidden="true" />
62
147
  }
63
148
  @if (!(loading() && (icon() || dataIcon()))) {
64
149
  <ng-content />
65
150
  }
66
- `, styles: [":host ::ng-deep>*{display:inline-flex}:host ::ng-deep ng-icon{font-size:var(--ng-icon-size, 1.3em)}\n"] }]
67
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-variant", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], dataIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-icon", required: false }] }] } });
68
-
69
- /**
70
- * Generated bundle index. Do not edit.
71
- */
72
-
151
+ `,
152
+ styles: [":host ::ng-deep>*{display:inline-flex}:host ::ng-deep ng-icon{font-size:var(--ng-glyph__size, 1.3em)}\n"]
153
+ }]
154
+ }],
155
+ propDecorators: {
156
+ variant: [{
157
+ type: i0.Input,
158
+ args: [{
159
+ isSignal: true,
160
+ alias: "data-variant",
161
+ required: false
162
+ }]
163
+ }],
164
+ loading: [{
165
+ type: i0.Input,
166
+ args: [{
167
+ isSignal: true,
168
+ alias: "loading",
169
+ required: false
170
+ }]
171
+ }],
172
+ disabled: [{
173
+ type: i0.Input,
174
+ args: [{
175
+ isSignal: true,
176
+ alias: "disabled",
177
+ required: false
178
+ }]
179
+ }],
180
+ icon: [{
181
+ type: i0.Input,
182
+ args: [{
183
+ isSignal: true,
184
+ alias: "icon",
185
+ required: false
186
+ }]
187
+ }],
188
+ dataIcon: [{
189
+ type: i0.Input,
190
+ args: [{
191
+ isSignal: true,
192
+ alias: "data-icon",
193
+ required: false
194
+ }]
195
+ }]
196
+ }
197
+ });
73
198
  export { Button };
74
- //# sourceMappingURL=ks-digital-designsystem-angular-button.mjs.map
199
+
200
+ //# sourceMappingURL=ks-digital-designsystem-angular-button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ks-digital-designsystem-angular-button.mjs","sources":["../../../../packages/angular/button/src/button.ts","../../../../packages/angular/button/src/ks-digital-designsystem-angular-button.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { Spinner } from '@ks-digital/designsystem-angular/spinner'\n\n@Component({\n selector: 'button[ksd-button], a[ksd-button]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n imports: [Spinner],\n host: {\n class: 'ds-button',\n '[attr.data-variant]': 'variant()',\n '[attr.data-icon]': 'icon() || dataIcon() || null',\n '[attr.disabled]': 'disabled() ? true : null',\n '[attr.aria-busy]': 'loading() ? true : null',\n },\n styles: `\n /* Ensure transcluded icons are aligned properly */\n :host ::ng-deep > * {\n display: inline-flex;\n }\n\n :host ::ng-deep ng-icon {\n font-size: var(--ng-icon-size, 1.3em);\n }\n `,\n\n template: `\n @if (loading()) {\n <ksd-spinner aria-hidden=\"true\" />\n }\n @if (!(loading() && (icon() || dataIcon()))) {\n <ng-content />\n }\n `,\n})\nexport class Button {\n /**\n * Specify which variant to use\n * @default 'primary'\n */\n readonly variant = input<'primary' | 'secondary' | 'tertiary'>('primary', {\n alias: 'data-variant',\n })\n\n /**\n * Toggle loading state.\n * Pass an element if you want to display a custom loader.\n *\n * @default false\n */\n readonly loading = input(false, { transform: booleanAttribute })\n\n /**\n * Disables element\n */\n readonly disabled = input(false, { transform: booleanAttribute })\n\n /**\n * If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon.\n * @deprecated Use `data-icon` instead.\n */\n readonly icon = input(false, { transform: booleanAttribute })\n\n /** If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon. */\n readonly dataIcon = input(false, {\n transform: booleanAttribute,\n alias: 'data-icon',\n })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAqDa,MAAM,CAAA;AACjB;;;AAGG;IACM,OAAO,GAAG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,EAC/B;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,QAAQ;4BACnB,MAAM,EAAE,CAAC,WAAW,CAAC;AACtB,yBAAA;AACD,wBAAA;AACE,4BAAA,SAAS,EAAE,SAAS;4BACpB,MAAM,EAAE,CAAC,YAAY,CAAC;AACvB,yBAAA;qBACF,EAAA,OAAA,EACQ,CAAC,OAAO,CAAC,EAAA,IAAA,EACZ;AACJ,wBAAA,KAAK,EAAE,WAAW;AAClB,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,kBAAkB,EAAE,8BAA8B;AAClD,wBAAA,iBAAiB,EAAE,0BAA0B;AAC7C,wBAAA,kBAAkB,EAAE,yBAAyB;qBAC9C,EAAA,QAAA,EAYS;;;;;;;AAOT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,uGAAA,CAAA,EAAA;;;ACnDH;;AAEG;;;;"}
1
+ {"version":3,"file":"ks-digital-designsystem-angular-button.mjs","names":[],"sources":["../../../../packages/angular/button/src/button.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { Spinner } from '@ks-digital/designsystem-angular/spinner'\n\n@Component({\n selector: 'button[ksd-button], a[ksd-button]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n imports: [Spinner],\n host: {\n class: 'ds-button',\n '[attr.data-variant]': 'variant()',\n '[attr.data-icon]': 'icon() || dataIcon() || null',\n '[attr.disabled]': 'disabled() ? true : null',\n '[attr.aria-busy]': 'loading() ? true : null',\n },\n styles: `\n /* Ensure transcluded icons are aligned properly */\n :host ::ng-deep > * {\n display: inline-flex;\n }\n\n :host ::ng-deep ng-icon {\n font-size: var(--ng-glyph__size, 1.3em);\n }\n `,\n\n template: `\n @if (loading()) {\n <ksd-spinner aria-hidden=\"true\" />\n }\n @if (!(loading() && (icon() || dataIcon()))) {\n <ng-content />\n }\n `,\n})\nexport class Button {\n /**\n * Specify which variant to use\n * @default 'primary'\n */\n readonly variant = input<'primary' | 'secondary' | 'tertiary'>('primary', {\n alias: 'data-variant',\n })\n\n /**\n * Toggle loading state.\n * Pass an element if you want to display a custom loader.\n *\n * @default false\n */\n readonly loading = input(false, { transform: booleanAttribute })\n\n /**\n * Disables element\n */\n readonly disabled = input(false, { transform: booleanAttribute })\n\n /**\n * If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon.\n * @deprecated Use `data-icon` instead.\n */\n readonly icon = input(false, { transform: booleanAttribute })\n\n /** If this is a button with only an icon. When combined with loading, a spinner will be shown instead of the icon. */\n readonly dataIcon = input(false, {\n transform: booleanAttribute,\n alias: 'data-icon',\n })\n}\n"],"mappings":";;;;;AAqDA,IAAa,SAAb,MAAa,OAAM;CAKR,UAAU,MAA4C,WAAS;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EACtE,OAAO;CAAc,CAAA;CASd,UAAU,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAKpD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAMrD,OAAO,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAGjD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAC7B,WAAW;EACX,OAAO;CAAW,CAAA;CA/BT,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAM,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAN,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Q,CAAC,OAAO;GAAC,MACZ;IACJ,OAAO;IACP,uBAAuB;IACvB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;GACrB;GAAA,UAYS;;;;;;;;GAOT,QAAA,CAAA,yGAAA;EAAA,CAAA"}
@@ -1,87 +1,137 @@
1
- import * as i0 from '@angular/core';
2
- import { input, inject, ElementRef, DestroyRef, afterNextRender, Directive, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import '@digdir/designsystemet-web/clickdelegatefor';
4
- import * as i1 from '@ks-digital/designsystem-angular/__internals';
5
- import { randomId, HostSize, HostColor } from '@ks-digital/designsystem-angular/__internals';
6
-
7
- const ATTR_CLICKDELEGATE = 'data-clickdelegatefor';
8
- const SELECTOR_LINK = ':is(h1,h2,h3,h4,h5,h6) a';
9
- const SELECTOR_SKIP = 'a,button,label,details,dialog,[role="button"],[popover],[contenteditable]';
10
- class Card {
11
- /**
12
- * Change the background color of the card
13
- * @default 'default'
14
- */
15
- variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
16
- el = inject(ElementRef);
17
- destroyRef = inject(DestroyRef);
18
- generatedId = `ksd-card-link-${randomId()}`;
19
- originalId = null;
20
- constructor() {
21
- afterNextRender(() => {
22
- const card = this.el.nativeElement;
23
- const link = card.querySelector(SELECTOR_LINK);
24
- const skip = !link || link.parentElement?.closest(SELECTOR_SKIP);
25
- if (card.hasAttribute(ATTR_CLICKDELEGATE) || skip)
26
- return;
27
- this.originalId = link.id || null;
28
- link.id = link.id || this.generatedId;
29
- card.setAttribute(ATTR_CLICKDELEGATE, link.id);
30
- this.destroyRef.onDestroy(() => {
31
- if (this.originalId) {
32
- link.id = this.originalId;
33
- }
34
- else {
35
- link.removeAttribute('id');
36
- }
37
- card.removeAttribute(ATTR_CLICKDELEGATE);
38
- });
39
- });
40
- }
41
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Card, deps: [], target: i0.ɵɵFactoryTarget.Directive });
42
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: Card, isStandalone: true, selector: "[ksd-card]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-variant": "variant()" }, classAttribute: "ds-card" }, hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0 });
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Card, decorators: [{
45
- type: Directive,
46
- args: [{
47
- // eslint-disable-next-line @angular-eslint/directive-selector
48
- selector: '[ksd-card]',
49
- hostDirectives: [
50
- {
51
- directive: HostSize,
52
- inputs: ['data-size'],
53
- },
54
- {
55
- directive: HostColor,
56
- inputs: ['data-color'],
57
- },
58
- ],
59
- host: {
60
- class: 'ds-card',
61
- '[attr.data-variant]': 'variant()',
62
- },
63
- }]
64
- }], ctorParameters: () => [], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
65
-
66
- class CardBlock {
67
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardBlock, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: CardBlock, isStandalone: true, selector: "[ksd-card-block]", host: { classAttribute: "ds-card__block" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
- }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardBlock, decorators: [{
71
- type: Component,
72
- args: [{
73
- selector: '[ksd-card-block]',
74
- changeDetection: ChangeDetectionStrategy.OnPush,
75
- host: {
76
- class: 'ds-card__block',
77
- },
78
- template: `<ng-content />`,
79
- }]
80
- }] });
81
-
82
- /**
83
- * Generated bundle index. Do not edit.
84
- */
85
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, afterNextRender, inject, input } from "@angular/core";
3
+ import "@digdir/designsystemet-web/clickdelegatefor";
4
+ import * as i1 from "@ks-digital/designsystem-angular/__internals";
5
+ import { HostColor, HostSize, randomId } from "@ks-digital/designsystem-angular/__internals";
6
+ const ATTR_CLICKDELEGATE = "data-clickdelegatefor";
7
+ const SELECTOR_LINK = ":is(h1,h2,h3,h4,h5,h6) a";
8
+ const SELECTOR_SKIP = "a,button,label,details,dialog,[role=\"button\"],[popover],[contenteditable]";
9
+ var Card = class Card {
10
+ variant = input("default", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
11
+ el = inject(ElementRef);
12
+ destroyRef = inject(DestroyRef);
13
+ generatedId = `ksd-card-link-${randomId()}`;
14
+ originalId = null;
15
+ constructor() {
16
+ afterNextRender(() => {
17
+ const card = this.el.nativeElement;
18
+ const link = card.querySelector(SELECTOR_LINK);
19
+ const skip = !link || link.parentElement?.closest(SELECTOR_SKIP);
20
+ if (card.hasAttribute(ATTR_CLICKDELEGATE) || skip) return;
21
+ this.originalId = link.id || null;
22
+ link.id = link.id || this.generatedId;
23
+ card.setAttribute(ATTR_CLICKDELEGATE, link.id);
24
+ this.destroyRef.onDestroy(() => {
25
+ if (this.originalId) link.id = this.originalId;
26
+ else link.removeAttribute("id");
27
+ card.removeAttribute(ATTR_CLICKDELEGATE);
28
+ });
29
+ });
30
+ }
31
+ static ɵfac = i0.ɵɵngDeclareFactory({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.0",
34
+ ngImport: i0,
35
+ type: Card,
36
+ deps: [],
37
+ target: i0.ɵɵFactoryTarget.Directive
38
+ });
39
+ static ɵdir = i0.ɵɵngDeclareDirective({
40
+ minVersion: "17.1.0",
41
+ version: "22.2.0",
42
+ type: Card,
43
+ isStandalone: true,
44
+ selector: "[ksd-card]",
45
+ inputs: { variant: {
46
+ classPropertyName: "variant",
47
+ publicName: "variant",
48
+ isSignal: true,
49
+ isRequired: false,
50
+ transformFunction: null
51
+ } },
52
+ host: {
53
+ properties: { "attr.data-variant": "variant()" },
54
+ classAttribute: "ds-card"
55
+ },
56
+ hostDirectives: [{
57
+ directive: i1.HostSize,
58
+ inputs: ["data-size", "data-size"]
59
+ }, {
60
+ directive: i1.HostColor,
61
+ inputs: ["data-color", "data-color"]
62
+ }],
63
+ ngImport: i0
64
+ });
65
+ };
66
+ i0.ɵɵngDeclareClassMetadata({
67
+ minVersion: "12.0.0",
68
+ version: "22.2.0",
69
+ ngImport: i0,
70
+ type: Card,
71
+ decorators: [{
72
+ type: Directive,
73
+ args: [{
74
+ selector: "[ksd-card]",
75
+ hostDirectives: [{
76
+ directive: HostSize,
77
+ inputs: ["data-size"]
78
+ }, {
79
+ directive: HostColor,
80
+ inputs: ["data-color"]
81
+ }],
82
+ host: {
83
+ class: "ds-card",
84
+ "[attr.data-variant]": "variant()"
85
+ }
86
+ }]
87
+ }],
88
+ ctorParameters: () => [],
89
+ propDecorators: { variant: [{
90
+ type: i0.Input,
91
+ args: [{
92
+ isSignal: true,
93
+ alias: "variant",
94
+ required: false
95
+ }]
96
+ }] }
97
+ });
98
+ var CardBlock = class CardBlock {
99
+ static ɵfac = i0.ɵɵngDeclareFactory({
100
+ minVersion: "12.0.0",
101
+ version: "22.2.0",
102
+ ngImport: i0,
103
+ type: CardBlock,
104
+ deps: [],
105
+ target: i0.ɵɵFactoryTarget.Component
106
+ });
107
+ static ɵcmp = i0.ɵɵngDeclareComponent({
108
+ minVersion: "14.0.0",
109
+ version: "22.2.0",
110
+ type: CardBlock,
111
+ isStandalone: true,
112
+ selector: "[ksd-card-block]",
113
+ host: { classAttribute: "ds-card__block" },
114
+ ngImport: i0,
115
+ template: `<ng-content />`,
116
+ isInline: true,
117
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
118
+ });
119
+ };
120
+ i0.ɵɵngDeclareClassMetadata({
121
+ minVersion: "12.0.0",
122
+ version: "22.2.0",
123
+ ngImport: i0,
124
+ type: CardBlock,
125
+ decorators: [{
126
+ type: Component,
127
+ args: [{
128
+ selector: "[ksd-card-block]",
129
+ changeDetection: ChangeDetectionStrategy.OnPush,
130
+ host: { class: "ds-card__block" },
131
+ template: `<ng-content />`
132
+ }]
133
+ }]
134
+ });
86
135
  export { Card, CardBlock };
87
- //# sourceMappingURL=ks-digital-designsystem-angular-card.mjs.map
136
+
137
+ //# sourceMappingURL=ks-digital-designsystem-angular-card.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ks-digital-designsystem-angular-card.mjs","sources":["../../../../packages/angular/card/src/card.ts","../../../../packages/angular/card/src/card-block.ts","../../../../packages/angular/card/src/ks-digital-designsystem-angular-card.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n} from '@angular/core'\nimport '@digdir/designsystemet-web/clickdelegatefor'\nimport {\n HostColor,\n HostSize,\n randomId,\n} from '@ks-digital/designsystem-angular/__internals'\n\nconst ATTR_CLICKDELEGATE = 'data-clickdelegatefor'\nconst SELECTOR_LINK = ':is(h1,h2,h3,h4,h5,h6) a'\nconst SELECTOR_SKIP =\n 'a,button,label,details,dialog,[role=\"button\"],[popover],[contenteditable]'\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[ksd-card]',\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n host: {\n class: 'ds-card',\n '[attr.data-variant]': 'variant()',\n },\n})\nexport class Card {\n /**\n * Change the background color of the card\n * @default 'default'\n */\n public variant = input<'tinted' | 'default'>('default')\n private el = inject<ElementRef<HTMLElement>>(ElementRef)\n private destroyRef = inject(DestroyRef)\n private generatedId = `ksd-card-link-${randomId()}`\n private originalId: string | null = null\n\n constructor() {\n afterNextRender(() => {\n const card = this.el.nativeElement\n const link = card.querySelector<HTMLAnchorElement>(SELECTOR_LINK)\n const skip = !link || link.parentElement?.closest(SELECTOR_SKIP)\n\n if (card.hasAttribute(ATTR_CLICKDELEGATE) || skip) return\n\n this.originalId = link.id || null\n link.id = link.id || this.generatedId\n card.setAttribute(ATTR_CLICKDELEGATE, link.id)\n\n this.destroyRef.onDestroy(() => {\n if (this.originalId) {\n link.id = this.originalId\n } else {\n link.removeAttribute('id')\n }\n card.removeAttribute(ATTR_CLICKDELEGATE)\n })\n })\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: '[ksd-card-block]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ds-card__block',\n },\n template: `<ng-content />`,\n})\nexport class CardBlock {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAeA,MAAM,kBAAkB,GAAG,uBAAuB;AAClD,MAAM,aAAa,GAAG,0BAA0B;AAChD,MAAM,aAAa,GACjB,2EAA2E;MAoBhE,IAAI,CAAA;AACf;;;AAGG;AACI,IAAA,OAAO,GAAG,KAAK,CAAuB,SAAS,8EAAC;AAC/C,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;AAChD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,WAAW,GAAG,CAAA,cAAA,EAAiB,QAAQ,EAAE,EAAE;IAC3C,UAAU,GAAkB,IAAI;AAExC,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;AACnB,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa;YAClC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAoB,aAAa,CAAC;AACjE,YAAA,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC;AAEhE,YAAA,IAA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angular/card/src/card.ts","../../../../packages/angular/card/src/card-block.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n} from '@angular/core'\nimport '@digdir/designsystemet-web/clickdelegatefor'\nimport {\n HostColor,\n HostSize,\n randomId,\n} from '@ks-digital/designsystem-angular/__internals'\n\nconst ATTR_CLICKDELEGATE = 'data-clickdelegatefor'\nconst SELECTOR_LINK = ':is(h1,h2,h3,h4,h5,h6) a'\nconst SELECTOR_SKIP =\n 'a,button,label,details,dialog,[role=\"button\"],[popover],[contenteditable]'\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[ksd-card]',\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n host: {\n class: 'ds-card',\n '[attr.data-variant]': 'variant()',\n },\n})\nexport class Card {\n /**\n * Change the background color of the card\n * @default 'default'\n */\n public variant = input<'tinted' | 'default'>('default')\n private el = inject<ElementRef<HTMLElement>>(ElementRef)\n private destroyRef = inject(DestroyRef)\n private generatedId = `ksd-card-link-${randomId()}`\n private originalId: string | null = null\n\n constructor() {\n afterNextRender(() => {\n const card = this.el.nativeElement\n const link = card.querySelector<HTMLAnchorElement>(SELECTOR_LINK)\n const skip = !link || link.parentElement?.closest(SELECTOR_SKIP)\n\n if (card.hasAttribute(ATTR_CLICKDELEGATE) || skip) return\n\n this.originalId = link.id || null\n link.id = link.id || this.generatedId\n card.setAttribute(ATTR_CLICKDELEGATE, link.id)\n\n this.destroyRef.onDestroy(() => {\n if (this.originalId) {\n link.id = this.originalId\n } else {\n link.removeAttribute('id')\n }\n card.removeAttribute(ATTR_CLICKDELEGATE)\n })\n })\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: '[ksd-card-block]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'ds-card__block',\n },\n template: `<ng-content />`,\n})\nex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