@ks-digital/designsystem-angular 0.0.1-alpha.8 → 0.0.1-alpha.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -12
- package/__internals/README.md +3 -0
- package/alert/README.md +3 -0
- package/breadcrumbs/README.md +3 -0
- package/button/README.md +3 -0
- package/card/README.md +3 -0
- package/details/README.md +3 -0
- package/dialog/README.md +3 -0
- package/dropdown/README.md +3 -0
- package/error-summary/README.md +3 -0
- package/fesm2022/ks-digital-designsystem-angular-__internals.mjs +152 -0
- package/fesm2022/ks-digital-designsystem-angular-__internals.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-alert.mjs +60 -0
- package/fesm2022/ks-digital-designsystem-angular-alert.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs +87 -0
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-button.mjs +200 -0
- package/fesm2022/ks-digital-designsystem-angular-button.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-card.mjs +137 -0
- package/fesm2022/ks-digital-designsystem-angular-card.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs +77 -0
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-details.mjs +149 -0
- package/fesm2022/ks-digital-designsystem-angular-details.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-dialog.mjs +107 -0
- package/fesm2022/ks-digital-designsystem-angular-dialog.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs +148 -0
- package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs +84 -0
- package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs +514 -0
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs +70 -0
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-link.mjs +60 -0
- package/fesm2022/ks-digital-designsystem-angular-link.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs +471 -0
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs +42 -0
- package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs +148 -0
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-search.mjs +281 -0
- package/fesm2022/ks-digital-designsystem-angular-search.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-skeleton.mjs +79 -0
- package/fesm2022/ks-digital-designsystem-angular-skeleton.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs +183 -0
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs +639 -0
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-table.mjs +248 -0
- package/fesm2022/ks-digital-designsystem-angular-table.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs +325 -0
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs +85 -0
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs +43 -0
- package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular.mjs +2 -0
- package/fesm2022/ks-digital-designsystem-angular.mjs.map +1 -0
- package/forms/README.md +3 -0
- package/heading/README.md +3 -0
- package/link/README.md +3 -0
- package/package.json +114 -28
- package/pagination/README.md +3 -0
- package/paragraph/README.md +3 -0
- package/popover/README.md +3 -0
- package/search/README.md +3 -0
- package/skeleton/README.md +3 -0
- package/spinner/README.md +3 -0
- package/suggestion/README.md +3 -0
- package/table/README.md +3 -0
- package/tabs/README.md +3 -0
- package/tag/README.md +3 -0
- package/types/ks-digital-designsystem-angular-__internals.d.ts +64 -0
- package/types/ks-digital-designsystem-angular-alert.d.ts +21 -0
- package/types/ks-digital-designsystem-angular-breadcrumbs.d.ts +29 -0
- package/types/ks-digital-designsystem-angular-button.d.ts +67 -0
- package/types/ks-digital-designsystem-angular-card.d.ts +39 -0
- package/types/ks-digital-designsystem-angular-chip.d.ts +30 -0
- package/types/ks-digital-designsystem-angular-details.d.ts +34 -0
- package/types/ks-digital-designsystem-angular-dialog.d.ts +40 -0
- package/types/ks-digital-designsystem-angular-dropdown.d.ts +44 -0
- package/types/ks-digital-designsystem-angular-error-summary.d.ts +17 -0
- package/types/ks-digital-designsystem-angular-forms.d.ts +146 -0
- package/types/ks-digital-designsystem-angular-heading.d.ts +22 -0
- package/types/ks-digital-designsystem-angular-link.d.ts +18 -0
- package/types/ks-digital-designsystem-angular-pagination.d.ts +141 -0
- package/types/ks-digital-designsystem-angular-paragraph.d.ts +5 -0
- package/types/ks-digital-designsystem-angular-popover.d.ts +44 -0
- package/types/ks-digital-designsystem-angular-search.d.ts +100 -0
- package/types/ks-digital-designsystem-angular-skeleton.d.ts +21 -0
- package/types/ks-digital-designsystem-angular-spinner.d.ts +42 -0
- package/types/ks-digital-designsystem-angular-suggestion.d.ts +198 -0
- package/types/ks-digital-designsystem-angular-table.d.ts +68 -0
- package/types/ks-digital-designsystem-angular-tabs.d.ts +105 -0
- package/types/ks-digital-designsystem-angular-tag.d.ts +30 -0
- package/types/ks-digital-designsystem-angular-validation-message.d.ts +5 -0
- package/types/ks-digital-designsystem-angular.d.ts +2 -0
- package/validation-message/README.md +3 -0
- package/dist/README.md +0 -43
- package/dist/fesm2022/ks-digital-designsystem-angular.mjs +0 -195
- package/dist/fesm2022/ks-digital-designsystem-angular.mjs.map +0 -1
- package/dist/index.d.ts +0 -75
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# KS Digital Designsystem for Angular
|
|
2
2
|
|
|
3
|
-
> This is
|
|
3
|
+
> ⚠ This library is currently experimental. However, we actively use and test it in internal applications, and we strive to keep it stable at all times.
|
|
4
4
|
|
|
5
5
|
This library provides Angular components for KS Digital, designed to align closely with the components from [Designsystemet.no](https://www.designsystemet.no/komponenter).
|
|
6
6
|
|
|
7
|
-
## Installation
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
Install the required packages using your preferred package manager:
|
|
10
10
|
|
|
@@ -16,28 +16,45 @@ pnpm add @ks-digital/designsystem-angular @ks-digital/designsystem-themes
|
|
|
16
16
|
|
|
17
17
|
### 1. Include the Inter Font
|
|
18
18
|
|
|
19
|
-
Add the Inter font to your `index.html
|
|
19
|
+
Add the Inter font to your `index.html`:
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
|
-
<link
|
|
23
|
-
href="https://static.fiks.ks.no/googlefonts/googleapis/css2?family=Inter&display=swap"
|
|
24
|
-
rel="stylesheet"
|
|
25
|
-
/>
|
|
22
|
+
<link rel="stylesheet" href="https://static.fiks.ks.no/fonts/inter/4.1/inter.css" integrity="sha384-OcHzc/By/OPw9uJREawUCjP2inbOGKtKb4A/I2iXxmknUfog2H8Adx71tWVZRscD" crossorigin="anonymous" />
|
|
26
23
|
```
|
|
27
24
|
|
|
28
25
|
### 2. Import Base Styles and Themes
|
|
29
26
|
|
|
30
27
|
Import the base styles and the theme you want to use in your application:
|
|
31
28
|
|
|
32
|
-
```
|
|
33
|
-
import '@ks-digital/designsystem-themes/base.css'
|
|
34
|
-
import '@ks-digital/designsystem-themes/
|
|
29
|
+
```css
|
|
30
|
+
@import url('@ks-digital/designsystem-themes/base.css');
|
|
31
|
+
@import url('@ks-digital/designsystem-themes/ksdigital.css');
|
|
35
32
|
```
|
|
36
33
|
|
|
37
34
|
### 3. Use Components
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
```ts
|
|
37
|
+
import { Button } from '@ks-digital/designsystem-angular'
|
|
38
|
+
|
|
39
|
+
@Component({
|
|
40
|
+
imports: [Button],
|
|
41
|
+
template: `
|
|
42
|
+
<button ksd-button>
|
|
43
|
+
Click me
|
|
44
|
+
</button>
|
|
45
|
+
`,
|
|
46
|
+
})
|
|
47
|
+
```
|
|
40
48
|
|
|
41
49
|
## Example
|
|
42
50
|
|
|
43
51
|
A complete example setup is available in the `angular-demo` located under the `apps` folder.
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
`pnpm nx run @ks-digital/designsystem-angular:storybook`
|
|
56
|
+
|
|
57
|
+
## Update snapshots
|
|
58
|
+
|
|
59
|
+
In folder `apps/angular-demo-e2e`:
|
|
60
|
+
`docker compose run --rm update-snapshots`
|
package/alert/README.md
ADDED
package/button/README.md
ADDED
package/card/README.md
ADDED
package/dialog/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Directive, input, isDevMode } from "@angular/core";
|
|
3
|
+
var HostSize = class HostSize {
|
|
4
|
+
dataSize = input(void 0, {
|
|
5
|
+
...ngDevMode ? { debugName: "dataSize" } : /* istanbul ignore next */ {},
|
|
6
|
+
alias: "data-size"
|
|
7
|
+
});
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
9
|
+
minVersion: "12.0.0",
|
|
10
|
+
version: "22.2.2",
|
|
11
|
+
ngImport: i0,
|
|
12
|
+
type: HostSize,
|
|
13
|
+
deps: [],
|
|
14
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
15
|
+
});
|
|
16
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
17
|
+
minVersion: "17.1.0",
|
|
18
|
+
version: "22.2.2",
|
|
19
|
+
type: HostSize,
|
|
20
|
+
isStandalone: true,
|
|
21
|
+
inputs: { dataSize: {
|
|
22
|
+
classPropertyName: "dataSize",
|
|
23
|
+
publicName: "data-size",
|
|
24
|
+
isSignal: true,
|
|
25
|
+
isRequired: false,
|
|
26
|
+
transformFunction: null
|
|
27
|
+
} },
|
|
28
|
+
host: { properties: { "attr.data-size": "dataSize() || null" } },
|
|
29
|
+
ngImport: i0
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
33
|
+
minVersion: "12.0.0",
|
|
34
|
+
version: "22.2.2",
|
|
35
|
+
ngImport: i0,
|
|
36
|
+
type: HostSize,
|
|
37
|
+
decorators: [{
|
|
38
|
+
type: Directive,
|
|
39
|
+
args: [{ host: { "[attr.data-size]": "dataSize() || null" } }]
|
|
40
|
+
}],
|
|
41
|
+
propDecorators: { dataSize: [{
|
|
42
|
+
type: i0.Input,
|
|
43
|
+
args: [{
|
|
44
|
+
isSignal: true,
|
|
45
|
+
alias: "data-size",
|
|
46
|
+
required: false
|
|
47
|
+
}]
|
|
48
|
+
}] }
|
|
49
|
+
});
|
|
50
|
+
var HostColor = class HostColor {
|
|
51
|
+
dataColor = input(void 0, {
|
|
52
|
+
...ngDevMode ? { debugName: "dataColor" } : /* istanbul ignore next */ {},
|
|
53
|
+
alias: "data-color"
|
|
54
|
+
});
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
56
|
+
minVersion: "12.0.0",
|
|
57
|
+
version: "22.2.2",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: HostColor,
|
|
60
|
+
deps: [],
|
|
61
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
62
|
+
});
|
|
63
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
64
|
+
minVersion: "17.1.0",
|
|
65
|
+
version: "22.2.2",
|
|
66
|
+
type: HostColor,
|
|
67
|
+
isStandalone: true,
|
|
68
|
+
inputs: { dataColor: {
|
|
69
|
+
classPropertyName: "dataColor",
|
|
70
|
+
publicName: "data-color",
|
|
71
|
+
isSignal: true,
|
|
72
|
+
isRequired: false,
|
|
73
|
+
transformFunction: null
|
|
74
|
+
} },
|
|
75
|
+
host: { properties: { "attr.data-color": "dataColor() || null" } },
|
|
76
|
+
ngImport: i0
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
80
|
+
minVersion: "12.0.0",
|
|
81
|
+
version: "22.2.2",
|
|
82
|
+
ngImport: i0,
|
|
83
|
+
type: HostColor,
|
|
84
|
+
decorators: [{
|
|
85
|
+
type: Directive,
|
|
86
|
+
args: [{ host: { "[attr.data-color]": "dataColor() || null" } }]
|
|
87
|
+
}],
|
|
88
|
+
propDecorators: { dataColor: [{
|
|
89
|
+
type: i0.Input,
|
|
90
|
+
args: [{
|
|
91
|
+
isSignal: true,
|
|
92
|
+
alias: "data-color",
|
|
93
|
+
required: false
|
|
94
|
+
}]
|
|
95
|
+
}] }
|
|
96
|
+
});
|
|
97
|
+
var HostSeverityColors = class HostSeverityColors {
|
|
98
|
+
dataColor = input(void 0, {
|
|
99
|
+
...ngDevMode ? { debugName: "dataColor" } : /* istanbul ignore next */ {},
|
|
100
|
+
alias: "data-color"
|
|
101
|
+
});
|
|
102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
103
|
+
minVersion: "12.0.0",
|
|
104
|
+
version: "22.2.2",
|
|
105
|
+
ngImport: i0,
|
|
106
|
+
type: HostSeverityColors,
|
|
107
|
+
deps: [],
|
|
108
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
109
|
+
});
|
|
110
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
111
|
+
minVersion: "17.1.0",
|
|
112
|
+
version: "22.2.2",
|
|
113
|
+
type: HostSeverityColors,
|
|
114
|
+
isStandalone: true,
|
|
115
|
+
inputs: { dataColor: {
|
|
116
|
+
classPropertyName: "dataColor",
|
|
117
|
+
publicName: "data-color",
|
|
118
|
+
isSignal: true,
|
|
119
|
+
isRequired: false,
|
|
120
|
+
transformFunction: null
|
|
121
|
+
} },
|
|
122
|
+
host: { properties: { "attr.data-color": "dataColor() || null" } },
|
|
123
|
+
ngImport: i0
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
127
|
+
minVersion: "12.0.0",
|
|
128
|
+
version: "22.2.2",
|
|
129
|
+
ngImport: i0,
|
|
130
|
+
type: HostSeverityColors,
|
|
131
|
+
decorators: [{
|
|
132
|
+
type: Directive,
|
|
133
|
+
args: [{ host: { "[attr.data-color]": "dataColor() || null" } }]
|
|
134
|
+
}],
|
|
135
|
+
propDecorators: { dataColor: [{
|
|
136
|
+
type: i0.Input,
|
|
137
|
+
args: [{
|
|
138
|
+
isSignal: true,
|
|
139
|
+
alias: "data-color",
|
|
140
|
+
required: false
|
|
141
|
+
}]
|
|
142
|
+
}] }
|
|
143
|
+
});
|
|
144
|
+
const logIfDevMode = ({ component, message }) => {
|
|
145
|
+
if (isDevMode()) console.log(`[${component}] ${message}`);
|
|
146
|
+
};
|
|
147
|
+
const randomId = () => {
|
|
148
|
+
return `${Math.random().toString(36).slice(2, 7)}`;
|
|
149
|
+
};
|
|
150
|
+
export { HostColor, HostSeverityColors, HostSize, logIfDevMode, randomId };
|
|
151
|
+
|
|
152
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-__internals.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-__internals.mjs","names":[],"sources":["../../../../packages/angular/__internals/src/host-directives.ts","../../../../packages/angular/__internals/src/log-if-devmode.ts","../../../../packages/angular/__internals/src/random-id.ts"],"sourcesContent":["import { Directive, input } from '@angular/core'\nimport {\n ColorDefinitions,\n SeverityColorDefinitions,\n Size,\n} from '@ks-digital/designsystem-themes/types'\n\n/**\n * Applies data-size attribute to host-element.\n */\n@Directive({\n host: {\n '[attr.data-size]': 'dataSize() || null',\n },\n})\nexport class HostSize {\n /**\n * Changes size for descendant Designsystemet components. Select from predefined sizes.\n * @attribute data-size\n */\n readonly dataSize = input<Size>(undefined, {\n alias: 'data-size',\n })\n}\n\n/**\n * Applies data-color attribute to host-element for all colors, including severity colors.\n */\n@Directive({\n host: {\n '[attr.data-color]': 'dataColor() || null',\n },\n})\nexport class HostColor {\n /**\n * Changes color for descendant Designsystemet components.\n * Select from predefined colors and colors defined in theme.\n * @attribute data-color\n */\n readonly dataColor = input<\n keyof ColorDefinitions | keyof SeverityColorDefinitions\n >(undefined, { alias: 'data-color' })\n}\n\n/**\n * Applies data-color attribute to host-element for severity colors.\n */\n@Directive({\n host: {\n '[attr.data-color]': 'dataColor() || null',\n },\n})\nexport class HostSeverityColors {\n /**\n * Changes color for descendant Designsystemet components.\n * Select from predefined colors and colors defined in theme.\n * @attribute data-color\n */\n readonly dataColor = input<keyof SeverityColorDefinitions>(undefined, {\n alias: 'data-color',\n })\n}\n","import { isDevMode } from '@angular/core'\n\nexport const logIfDevMode = ({\n component,\n message,\n}: {\n component: string\n message: string\n}) => {\n if (isDevMode()) {\n console.log(`[${component}] ${message}`)\n }\n}\n","export const randomId = () => {\n return `${Math.random().toString(36).slice(2, 7)}`\n}\n"],"mappings":";;AAeA,IAAa,WAAb,MAAa,SAAQ;CAKV,WAAW,MAAY,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EACvC,OAAO;CAAW,CAAA;CANT,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAQ,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAR,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAQ,cAAA;EAAA,QAAA,EAAA,UAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,qBAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAR,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EALpB,MAAA;EAAU,MAAA,CAAA,EACT,MAAM,EACJ,oBAAoB,qBACrB,EACF,CAAA;;;;;;;;;;;AAmBD,IAAa,YAAb,MAAa,UAAS;CAMX,YAAY,MAEnB,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,OAAO;CAAY,CAAA;CARvB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,QAAA,EAAA,WAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,mBAAA,sBAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAT,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EALrB,MAAA;EAAU,MAAA,CAAA,EACT,MAAM,EACJ,qBAAqB,sBACtB,EACF,CAAA;;;;;;;;;;;AAoBD,IAAa,qBAAb,MAAa,mBAAkB;CAMpB,YAAY,MAAsC,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAClE,OAAO;CAAY,CAAA;CAPV,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAkB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAlB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAkB,cAAA;EAAA,QAAA,EAAA,WAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,mBAAA,sBAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAlB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EAL9B,MAAA;EAAU,MAAA,CAAA,EACT,MAAM,EACJ,qBAAqB,sBACtB,EACF,CAAA;;;;;;;;;;;ACjDD,MAAa,gBAAgB,EAC3B,WACA,cAIG;CACH,IAAI,UAAS,GACX,QAAQ,IAAI,IAAI,UAAS,IAAK,SAAS;AAE3C;ACZA,MAAa,iBAAgB;CAC3B,OAAO,GAAG,KAAK,OAAM,CAAE,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AACjD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
3
|
+
import * as i1 from "@ks-digital/designsystem-angular/__internals";
|
|
4
|
+
import { HostSeverityColors, HostSize } from "@ks-digital/designsystem-angular/__internals";
|
|
5
|
+
var Alert = class Alert {
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7
|
+
minVersion: "12.0.0",
|
|
8
|
+
version: "22.2.2",
|
|
9
|
+
ngImport: i0,
|
|
10
|
+
type: Alert,
|
|
11
|
+
deps: [],
|
|
12
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
13
|
+
});
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
15
|
+
minVersion: "14.0.0",
|
|
16
|
+
version: "22.2.2",
|
|
17
|
+
type: Alert,
|
|
18
|
+
isStandalone: true,
|
|
19
|
+
selector: "ksd-alert",
|
|
20
|
+
host: { classAttribute: "ds-alert" },
|
|
21
|
+
hostDirectives: [{
|
|
22
|
+
directive: i1.HostSize,
|
|
23
|
+
inputs: ["data-size", "data-size"]
|
|
24
|
+
}, {
|
|
25
|
+
directive: i1.HostSeverityColors,
|
|
26
|
+
inputs: ["data-color", "data-color"]
|
|
27
|
+
}],
|
|
28
|
+
ngImport: i0,
|
|
29
|
+
template: ` <ng-content />`,
|
|
30
|
+
isInline: true,
|
|
31
|
+
styles: [":host{display:block}\n"],
|
|
32
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
36
|
+
minVersion: "12.0.0",
|
|
37
|
+
version: "22.2.2",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
type: Alert,
|
|
40
|
+
decorators: [{
|
|
41
|
+
type: Component,
|
|
42
|
+
args: [{
|
|
43
|
+
selector: "ksd-alert",
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
template: ` <ng-content />`,
|
|
46
|
+
host: { class: "ds-alert" },
|
|
47
|
+
hostDirectives: [{
|
|
48
|
+
directive: HostSize,
|
|
49
|
+
inputs: ["data-size"]
|
|
50
|
+
}, {
|
|
51
|
+
directive: HostSeverityColors,
|
|
52
|
+
inputs: ["data-color"]
|
|
53
|
+
}],
|
|
54
|
+
styles: [":host{display:block}\n"]
|
|
55
|
+
}]
|
|
56
|
+
}]
|
|
57
|
+
});
|
|
58
|
+
export { Alert };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-alert.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-alert.mjs","names":[],"sources":["../../../../packages/angular/alert/src/alert.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core'\nimport {\n HostSeverityColors,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\n/**\n * Alerts are used to inform users about important information, warnings, errors, or success.\n */\n@Component({\n selector: 'ksd-alert',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <ng-content />`,\n host: {\n class: 'ds-alert',\n },\n styles: `\n :host {\n display: block;\n }\n `,\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostSeverityColors,\n inputs: ['data-color'],\n },\n ],\n})\nexport class Alert {}\n"],"mappings":";;;;AAgCA,IAAa,QAAb,MAAa,MAAK;CAAL,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAK,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAL,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAK,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,gBAAA,WAAA;EAAA,gBAAA,CAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,aAAA,WAAA;EAAA,GAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,cAAA,YAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UApBN;EAAiB,UAAA;EAAA,QAAA,CAAA,wBAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAoBhB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAK,YAAA,CAAA;EAvBjB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,iBACJ,wBAAwB;GAAM,UACrC;GAAiB,MACrB,EACJ,OAAO,WACR;GAAA,gBAMe,CACd;IACE,WAAW;IACX,QAAQ,CAAC,WAAW;GACrB,GACD;IACE,WAAW;IACX,QAAQ,CAAC,YAAY;GACtB,CACF;GAAA,QAAA,CAAA,wBAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
3
|
+
import "@digdir/designsystemet-web/ds-breadcrumbs";
|
|
4
|
+
import * as i1 from "@ks-digital/designsystem-angular/__internals";
|
|
5
|
+
import { HostColor, HostSize } from "@ks-digital/designsystem-angular/__internals";
|
|
6
|
+
var Breadcrumbs = class Breadcrumbs {
|
|
7
|
+
ariaLabel = input("Du er her:", {
|
|
8
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
9
|
+
alias: "aria-label"
|
|
10
|
+
});
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.2",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: Breadcrumbs,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
18
|
+
});
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
20
|
+
minVersion: "17.1.0",
|
|
21
|
+
version: "22.2.2",
|
|
22
|
+
type: Breadcrumbs,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "ksd-breadcrumbs",
|
|
25
|
+
inputs: { ariaLabel: {
|
|
26
|
+
classPropertyName: "ariaLabel",
|
|
27
|
+
publicName: "aria-label",
|
|
28
|
+
isSignal: true,
|
|
29
|
+
isRequired: false,
|
|
30
|
+
transformFunction: null
|
|
31
|
+
} },
|
|
32
|
+
host: { properties: { "attr.aria-label": "null" } },
|
|
33
|
+
hostDirectives: [{
|
|
34
|
+
directive: i1.HostSize,
|
|
35
|
+
inputs: ["data-size", "data-size"]
|
|
36
|
+
}, {
|
|
37
|
+
directive: i1.HostColor,
|
|
38
|
+
inputs: ["data-color", "data-color"]
|
|
39
|
+
}],
|
|
40
|
+
ngImport: i0,
|
|
41
|
+
template: `
|
|
42
|
+
<ds-breadcrumbs class="ds-breadcrumbs" [attr.aria-label]="ariaLabel()">
|
|
43
|
+
<ng-content />
|
|
44
|
+
</ds-breadcrumbs>
|
|
45
|
+
`,
|
|
46
|
+
isInline: true,
|
|
47
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
51
|
+
minVersion: "12.0.0",
|
|
52
|
+
version: "22.2.2",
|
|
53
|
+
ngImport: i0,
|
|
54
|
+
type: Breadcrumbs,
|
|
55
|
+
decorators: [{
|
|
56
|
+
type: Component,
|
|
57
|
+
args: [{
|
|
58
|
+
selector: "ksd-breadcrumbs",
|
|
59
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
61
|
+
template: `
|
|
62
|
+
<ds-breadcrumbs class="ds-breadcrumbs" [attr.aria-label]="ariaLabel()">
|
|
63
|
+
<ng-content />
|
|
64
|
+
</ds-breadcrumbs>
|
|
65
|
+
`,
|
|
66
|
+
host: { "[attr.aria-label]": "null" },
|
|
67
|
+
hostDirectives: [{
|
|
68
|
+
directive: HostSize,
|
|
69
|
+
inputs: ["data-size"]
|
|
70
|
+
}, {
|
|
71
|
+
directive: HostColor,
|
|
72
|
+
inputs: ["data-color"]
|
|
73
|
+
}]
|
|
74
|
+
}]
|
|
75
|
+
}],
|
|
76
|
+
propDecorators: { ariaLabel: [{
|
|
77
|
+
type: i0.Input,
|
|
78
|
+
args: [{
|
|
79
|
+
isSignal: true,
|
|
80
|
+
alias: "aria-label",
|
|
81
|
+
required: false
|
|
82
|
+
}]
|
|
83
|
+
}] }
|
|
84
|
+
});
|
|
85
|
+
export { Breadcrumbs };
|
|
86
|
+
|
|
87
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-breadcrumbs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-breadcrumbs.mjs","names":[],"sources":["../../../../packages/angular/breadcrumbs/src/breadcrumbs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n} from '@angular/core'\nimport '@digdir/designsystemet-web/ds-breadcrumbs'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\n@Component({\n selector: 'ksd-breadcrumbs',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ds-breadcrumbs class=\"ds-breadcrumbs\" [attr.aria-label]=\"ariaLabel()\">\n <ng-content />\n </ds-breadcrumbs>\n `,\n host: {\n '[attr.aria-label]': 'null',\n },\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n})\nexport class Breadcrumbs {\n /**\n * Sets the screen reader label for the pagination\n */\n readonly ariaLabel = input<string>('Du er her:', { alias: 'aria-label' })\n}\n"],"mappings":";;;;;AAmCA,IAAa,cAAb,MAAa,YAAW;CAIb,YAAY,MAAc,cAAY;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,OAAO;CAAY,CAAA;CAJ3D,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAW,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAX,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAW,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,WAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA,EAAA,mBAAA,OAAA,EAAA;EAAA,gBAAA,CAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,aAAA,WAAA;EAAA,GAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,cAAA,YAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UAnBZ;;;;;EAIT,UAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAeU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAW,YAAA,CAAA;EAvBvB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,iBAAiB,wBAAwB;GACzC,SAAS,CAAC,sBAAsB;GAChC,UAAU;;;;;GAKV,MAAM,EACJ,qBAAqB,OACtB;GACD,gBAAgB,CACd;IACE,WAAW;IACX,QAAQ,CAAC,WAAW;GACrB,GACD;IACE,WAAW;IACX,QAAQ,CAAC,YAAY;GACtB,CACF;EACF,CAAA"}
|
|
@@ -0,0 +1,200 @@
|
|
|
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.2",
|
|
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.2",
|
|
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: `
|
|
97
|
+
@if (loading()) {
|
|
98
|
+
<ksd-spinner aria-hidden="true" />
|
|
99
|
+
}
|
|
100
|
+
@if (!(loading() && (icon() || dataIcon()))) {
|
|
101
|
+
<ng-content />
|
|
102
|
+
}
|
|
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.2",
|
|
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: `
|
|
145
|
+
@if (loading()) {
|
|
146
|
+
<ksd-spinner aria-hidden="true" />
|
|
147
|
+
}
|
|
148
|
+
@if (!(loading() && (icon() || dataIcon()))) {
|
|
149
|
+
<ng-content />
|
|
150
|
+
}
|
|
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
|
+
});
|
|
198
|
+
export { Button };
|
|
199
|
+
|
|
200
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAM,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,qBAAA;IAAA,kBAAA;IAAA,iBAAA;IAAA,kBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,gBAAA,CAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,aAAA,WAAA;EAAA,GAAA;GAAA,WAAA,GAAA;GAAA,QAAA,CAAA,cAAA,YAAA;EAAA,CAAA;EAAA,UAAA;EAAA,UATP;;;;;;;;EAOT,UAAA;EAAA,QAAA,CAAA,yGAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MA1BS;GAAO,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA4BN,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAzClB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmC,iBAC5B,wBAAwB;GAAM,gBAC/B,CACd;IACE,WAAW;IACX,QAAQ,CAAC,WAAW;GACrB,GACD;IACE,WAAW;IACX,QAAQ,CAAC,YAAY;GACtB,CACF;GAAA,SACQ,CAAC,OAAO;GAAC,MACZ;IACJ,OAAO;IACP,uBAAuB;IACvB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;GACrB;GAAA,UAYS;;;;;;;;GAOT,QAAA,CAAA,yGAAA;EAAA,CAAA"}
|