@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
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
2
|
+
import "@digdir/designsystemet-web";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { TemplateRef } from "@angular/core";
|
|
5
|
+
import * as i1 from "@ks-digital/designsystem-angular/__internals";
|
|
6
|
+
export declare class SuggestionListEmpty {
|
|
7
|
+
/**
|
|
8
|
+
* Hack to get the content from parent component so that we can
|
|
9
|
+
* keep the dom structure needed without additional host elements
|
|
10
|
+
*/
|
|
11
|
+
templateRef: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SuggestionListEmpty, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SuggestionListEmpty, "ksd-suggestion-list-empty", never, {}, {}, never, ["*"], true, never>;
|
|
14
|
+
}
|
|
15
|
+
export declare class SuggestionListOption {
|
|
16
|
+
/**
|
|
17
|
+
* Hack to get the content from parent component so that we can
|
|
18
|
+
* keep the dom structure needed without additional host elements
|
|
19
|
+
*/
|
|
20
|
+
templateRef: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
21
|
+
value: import("@angular/core").InputSignal<string>;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SuggestionListOption, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SuggestionListOption, "ksd-suggestion-list-option", never, {
|
|
24
|
+
"value": {
|
|
25
|
+
"alias": "value";
|
|
26
|
+
"required": true;
|
|
27
|
+
"isSignal": true;
|
|
28
|
+
};
|
|
29
|
+
}, {}, never, ["*"], true, never>;
|
|
30
|
+
}
|
|
31
|
+
export declare class SuggestionList {
|
|
32
|
+
/**
|
|
33
|
+
* Screen reader announcement template for singular result count.
|
|
34
|
+
*
|
|
35
|
+
* @default '%d forslag'
|
|
36
|
+
*/
|
|
37
|
+
readonly singular: import("@angular/core").InputSignal<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Screen reader announcement template for plural result count.
|
|
40
|
+
*
|
|
41
|
+
* @default '%d forslag'
|
|
42
|
+
*/
|
|
43
|
+
readonly plural: import("@angular/core").InputSignal<string>;
|
|
44
|
+
readonly options: import("@angular/core").Signal<readonly SuggestionListOption[]>;
|
|
45
|
+
readonly empty: import("@angular/core").Signal<SuggestionListEmpty | undefined>;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SuggestionList, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SuggestionList, "ksd-suggestion-list", never, {
|
|
48
|
+
"singular": {
|
|
49
|
+
"alias": "singular";
|
|
50
|
+
"required": false;
|
|
51
|
+
"isSignal": true;
|
|
52
|
+
};
|
|
53
|
+
"plural": {
|
|
54
|
+
"alias": "plural";
|
|
55
|
+
"required": false;
|
|
56
|
+
"isSignal": true;
|
|
57
|
+
};
|
|
58
|
+
}, {}, ["options", "empty"], never, true, never>;
|
|
59
|
+
}
|
|
60
|
+
type SuggestionItem = {
|
|
61
|
+
label: string;
|
|
62
|
+
value: string;
|
|
63
|
+
};
|
|
64
|
+
/** Value of the `value` model and Angular signal forms. Always primitive. */
|
|
65
|
+
type SuggestionValue = string | string[] | undefined;
|
|
66
|
+
/** Accepted by `[selected]`; items and raw option values are both allowed. */
|
|
67
|
+
type SuggestionSelectedInput = SuggestionItem | SuggestionItem[] | string | string[] | null | undefined;
|
|
68
|
+
/** Emitted by `(selectedChange)`. Always resolved items. */
|
|
69
|
+
type SuggestionSelected = SuggestionItem | SuggestionItem[] | undefined;
|
|
70
|
+
type SuggestionFilterArgs = {
|
|
71
|
+
index: number;
|
|
72
|
+
label: string;
|
|
73
|
+
text: string;
|
|
74
|
+
value: string;
|
|
75
|
+
optionElement: HTMLOptionElement;
|
|
76
|
+
input: HTMLInputElement;
|
|
77
|
+
};
|
|
78
|
+
type SuggestionFilter = (args: SuggestionFilterArgs) => boolean;
|
|
79
|
+
declare const UNSET: unique symbol;
|
|
80
|
+
export declare class Suggestion implements FormValueControl<SuggestionValue> {
|
|
81
|
+
/**
|
|
82
|
+
* Allows the user to select multiple items
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
multiple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* Allows the user to create new items
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
creatable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* Filter options; boolean or a custom callback.
|
|
95
|
+
*
|
|
96
|
+
* @default true
|
|
97
|
+
*/
|
|
98
|
+
filter: import("@angular/core").InputSignal<boolean | SuggestionFilter>;
|
|
99
|
+
/**
|
|
100
|
+
* Current value, as primitive option values. Bound by Angular signal forms.
|
|
101
|
+
*
|
|
102
|
+
* @default undefined
|
|
103
|
+
*/
|
|
104
|
+
readonly value: import("@angular/core").ModelSignal<SuggestionValue>;
|
|
105
|
+
/**
|
|
106
|
+
* Controlled selection. Accepts items or raw option values.
|
|
107
|
+
*
|
|
108
|
+
* @default undefined
|
|
109
|
+
*/
|
|
110
|
+
readonly selected: import("@angular/core").InputSignal<SuggestionSelectedInput | typeof UNSET>;
|
|
111
|
+
/**
|
|
112
|
+
* Emits the resolved selection whenever the user changes it.
|
|
113
|
+
*/
|
|
114
|
+
readonly selectedChange: import("@angular/core").OutputEmitterRef<SuggestionSelected>;
|
|
115
|
+
/**
|
|
116
|
+
* Form-control dirty state.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
readonly dirty: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the control has been touched. Bound by Angular signal forms.
|
|
123
|
+
*
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
127
|
+
/**
|
|
128
|
+
* Emits when focus leaves the control, marking the bound form field as touched.
|
|
129
|
+
*/
|
|
130
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
131
|
+
protected selectedArray: import("@angular/core").Signal<import("@ks-digital/designsystem-angular/suggestion").SuggestionItem[]>;
|
|
132
|
+
private readonly suggestionElement;
|
|
133
|
+
private readonly labels;
|
|
134
|
+
private readonly query;
|
|
135
|
+
protected readonly suggestionList: import("@angular/core").Signal<SuggestionList | undefined>;
|
|
136
|
+
constructor();
|
|
137
|
+
protected onSelect(event: Event): void;
|
|
138
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
139
|
+
protected onInput(event: Event): void;
|
|
140
|
+
private setValue;
|
|
141
|
+
private learnLabels;
|
|
142
|
+
private syncOptions;
|
|
143
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Suggestion, never>;
|
|
144
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Suggestion, "ksd-suggestion", never, {
|
|
145
|
+
"multiple": {
|
|
146
|
+
"alias": "multiple";
|
|
147
|
+
"required": false;
|
|
148
|
+
"isSignal": true;
|
|
149
|
+
};
|
|
150
|
+
"creatable": {
|
|
151
|
+
"alias": "creatable";
|
|
152
|
+
"required": false;
|
|
153
|
+
"isSignal": true;
|
|
154
|
+
};
|
|
155
|
+
"filter": {
|
|
156
|
+
"alias": "filter";
|
|
157
|
+
"required": false;
|
|
158
|
+
"isSignal": true;
|
|
159
|
+
};
|
|
160
|
+
"value": {
|
|
161
|
+
"alias": "value";
|
|
162
|
+
"required": false;
|
|
163
|
+
"isSignal": true;
|
|
164
|
+
};
|
|
165
|
+
"selected": {
|
|
166
|
+
"alias": "selected";
|
|
167
|
+
"required": false;
|
|
168
|
+
"isSignal": true;
|
|
169
|
+
};
|
|
170
|
+
"dirty": {
|
|
171
|
+
"alias": "dirty";
|
|
172
|
+
"required": false;
|
|
173
|
+
"isSignal": true;
|
|
174
|
+
};
|
|
175
|
+
"touched": {
|
|
176
|
+
"alias": "touched";
|
|
177
|
+
"required": false;
|
|
178
|
+
"isSignal": true;
|
|
179
|
+
};
|
|
180
|
+
}, {
|
|
181
|
+
"value": "valueChange";
|
|
182
|
+
"selectedChange": "selectedChange";
|
|
183
|
+
"touch": "touch";
|
|
184
|
+
}, ["suggestionList"], ["*"], true, [{
|
|
185
|
+
directive: typeof i1.HostSize;
|
|
186
|
+
inputs: {
|
|
187
|
+
"data-size": "data-size";
|
|
188
|
+
};
|
|
189
|
+
outputs: {};
|
|
190
|
+
}, {
|
|
191
|
+
directive: typeof i1.HostColor;
|
|
192
|
+
inputs: {
|
|
193
|
+
"data-color": "data-color";
|
|
194
|
+
};
|
|
195
|
+
outputs: {};
|
|
196
|
+
}]>;
|
|
197
|
+
}
|
|
198
|
+
export type { SuggestionFilter, SuggestionFilterArgs, SuggestionItem, SuggestionSelected, SuggestionSelectedInput, SuggestionValue };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class Table {
|
|
3
|
+
/**
|
|
4
|
+
* Will give the table a hover effect on rows
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
readonly hover: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Will give the table a rounded border
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
readonly border: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Will make the table header sticky
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
readonly stickyHeader: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Will give the table zebra striping
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
readonly zebra: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Table, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Table, "table[ksd-table]", never, {
|
|
25
|
+
"hover": {
|
|
26
|
+
"alias": "data-hover";
|
|
27
|
+
"required": false;
|
|
28
|
+
"isSignal": true;
|
|
29
|
+
};
|
|
30
|
+
"border": {
|
|
31
|
+
"alias": "data-border";
|
|
32
|
+
"required": false;
|
|
33
|
+
"isSignal": true;
|
|
34
|
+
};
|
|
35
|
+
"stickyHeader": {
|
|
36
|
+
"alias": "data-sticky-header";
|
|
37
|
+
"required": false;
|
|
38
|
+
"isSignal": true;
|
|
39
|
+
};
|
|
40
|
+
"zebra": {
|
|
41
|
+
"alias": "data-zebra";
|
|
42
|
+
"required": false;
|
|
43
|
+
"isSignal": true;
|
|
44
|
+
};
|
|
45
|
+
}, {}, never, ["*"], true, never>;
|
|
46
|
+
}
|
|
47
|
+
export declare class TableHeaderCell {
|
|
48
|
+
/**
|
|
49
|
+
* If 'none' | 'ascending' | 'descending' will add a button to the header cell and change aria-sort and icon
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
readonly sort: import("@angular/core").InputSignal<"none" | "ascending" | "descending" | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Emitted when the sort button is clicked
|
|
55
|
+
* @emits void
|
|
56
|
+
*/
|
|
57
|
+
readonly sortChange: import("@angular/core").OutputEmitterRef<void>;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableHeaderCell, never>;
|
|
59
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableHeaderCell, "th[ksd-header-cell]", never, {
|
|
60
|
+
"sort": {
|
|
61
|
+
"alias": "aria-sort";
|
|
62
|
+
"required": false;
|
|
63
|
+
"isSignal": true;
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
"sortChange": "sortChange";
|
|
67
|
+
}, never, ["*"], true, never>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import "@digdir/designsystemet-web/ds-tabs";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { TemplateRef } from "@angular/core";
|
|
4
|
+
import * as i1 from "@ks-digital/designsystem-angular/__internals";
|
|
5
|
+
/**
|
|
6
|
+
* Payload emitted from `tabClicked` on both `ksd-tabs` and `ksd-tabs-tab`.
|
|
7
|
+
*/
|
|
8
|
+
interface TabClickEvent {
|
|
9
|
+
/**
|
|
10
|
+
* Zero-based index of the clicked tab in its current render order.
|
|
11
|
+
*/
|
|
12
|
+
index: number;
|
|
13
|
+
/**
|
|
14
|
+
* Consumer-provided stable tab identifier from `tabId`.
|
|
15
|
+
*
|
|
16
|
+
* `undefined` when `tabId` is not provided.
|
|
17
|
+
*/
|
|
18
|
+
tabId: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare class TabsTab {
|
|
21
|
+
/**
|
|
22
|
+
* Stable identifier for this tab.
|
|
23
|
+
*
|
|
24
|
+
* Recommended for logic such as analytics, routing and persisted state.
|
|
25
|
+
*
|
|
26
|
+
* If omitted, `tabClicked` emits `tabId: undefined`.
|
|
27
|
+
*/
|
|
28
|
+
readonly tabId: import("@angular/core").InputSignal<string | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Marks this tab as the selected tab, forwarded to the underlying `ds-tab`.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
readonly ariaSelected: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Emits tab click details when this tab is clicked.
|
|
37
|
+
*/
|
|
38
|
+
readonly tabClicked: import("@angular/core").OutputEmitterRef<TabClickEvent>;
|
|
39
|
+
/**
|
|
40
|
+
* Hack to get the content of the tab from outside so that we can
|
|
41
|
+
* keep the dom structure needed without additional host elements
|
|
42
|
+
*/
|
|
43
|
+
templateRef: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
44
|
+
emitTabClicked(event: TabClickEvent): void;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsTab, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabsTab, "ksd-tabs-tab", never, {
|
|
47
|
+
"tabId": {
|
|
48
|
+
"alias": "tabId";
|
|
49
|
+
"required": false;
|
|
50
|
+
"isSignal": true;
|
|
51
|
+
};
|
|
52
|
+
"ariaSelected": {
|
|
53
|
+
"alias": "aria-selected";
|
|
54
|
+
"required": false;
|
|
55
|
+
"isSignal": true;
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
"tabClicked": "tabClicked";
|
|
59
|
+
}, never, ["*"], true, [{
|
|
60
|
+
directive: typeof i1.HostSize;
|
|
61
|
+
inputs: {
|
|
62
|
+
"data-size": "data-size";
|
|
63
|
+
};
|
|
64
|
+
outputs: {};
|
|
65
|
+
}, {
|
|
66
|
+
directive: typeof i1.HostColor;
|
|
67
|
+
inputs: {
|
|
68
|
+
"data-color": "data-color";
|
|
69
|
+
};
|
|
70
|
+
outputs: {};
|
|
71
|
+
}]>;
|
|
72
|
+
}
|
|
73
|
+
export declare class Tabs {
|
|
74
|
+
/**
|
|
75
|
+
* Emits tab click details when any tab is clicked.
|
|
76
|
+
*/
|
|
77
|
+
readonly tabClicked: import("@angular/core").OutputEmitterRef<TabClickEvent>;
|
|
78
|
+
readonly tabs: import("@angular/core").Signal<readonly TabsTab[]>;
|
|
79
|
+
protected onTabClick(index: number, tab: TabsTab): void;
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Tabs, never>;
|
|
81
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Tabs, "ksd-tabs", never, {}, {
|
|
82
|
+
"tabClicked": "tabClicked";
|
|
83
|
+
}, ["tabs"], ["ksd-tabs-panel"], true, [{
|
|
84
|
+
directive: typeof i1.HostSize;
|
|
85
|
+
inputs: {
|
|
86
|
+
"data-size": "data-size";
|
|
87
|
+
};
|
|
88
|
+
outputs: {};
|
|
89
|
+
}, {
|
|
90
|
+
directive: typeof i1.HostColor;
|
|
91
|
+
inputs: {
|
|
92
|
+
"data-color": "data-color";
|
|
93
|
+
};
|
|
94
|
+
outputs: {};
|
|
95
|
+
}]>;
|
|
96
|
+
}
|
|
97
|
+
export declare class TabsList {
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsList, never>;
|
|
99
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabsList, "ksd-tabs-list", never, {}, {}, never, ["*"], true, never>;
|
|
100
|
+
}
|
|
101
|
+
export declare class TabsPanel {
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsPanel, never>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabsPanel, "ksd-tabs-panel", never, {}, {}, never, ["*"], true, never>;
|
|
104
|
+
}
|
|
105
|
+
export type { TabClickEvent };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@ks-digital/designsystem-angular/__internals";
|
|
3
|
+
export declare class Tag {
|
|
4
|
+
/**
|
|
5
|
+
* The visual variant of the tag
|
|
6
|
+
*
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
9
|
+
readonly variant: import("@angular/core").InputSignal<"default" | "outline">;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Tag, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Tag, "ksd-tag", never, {
|
|
12
|
+
"variant": {
|
|
13
|
+
"alias": "data-variant";
|
|
14
|
+
"required": false;
|
|
15
|
+
"isSignal": true;
|
|
16
|
+
};
|
|
17
|
+
}, {}, never, ["*"], true, [{
|
|
18
|
+
directive: typeof i1.HostSize;
|
|
19
|
+
inputs: {
|
|
20
|
+
"data-size": "data-size";
|
|
21
|
+
};
|
|
22
|
+
outputs: {};
|
|
23
|
+
}, {
|
|
24
|
+
directive: typeof i1.HostColor;
|
|
25
|
+
inputs: {
|
|
26
|
+
"data-color": "data-color";
|
|
27
|
+
};
|
|
28
|
+
outputs: {};
|
|
29
|
+
}]>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ValidationMessage {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationMessage, never>;
|
|
4
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValidationMessage, "[ksd-validation-message]", never, {}, {}, never, never, true, never>;
|
|
5
|
+
}
|
package/dist/README.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# 🚧 KS Digital Designsystem for Angular
|
|
2
|
-
|
|
3
|
-
> This is an experimental POC as for now
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
## Installation (WIP)
|
|
8
|
-
|
|
9
|
-
Install the required packages using your preferred package manager:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pnpm add @ks-digital/designsystem-angular @ks-digital/designsystem-themes
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Setup
|
|
16
|
-
|
|
17
|
-
### 1. Include the Inter Font
|
|
18
|
-
|
|
19
|
-
Add the Inter font to your `index.html`. This API supports the same parameters as the Google Fonts API, allowing you to customize the font weights as needed:
|
|
20
|
-
|
|
21
|
-
```html
|
|
22
|
-
<link
|
|
23
|
-
href="https://static.fiks.ks.no/googlefonts/googleapis/css2?family=Inter&display=swap"
|
|
24
|
-
rel="stylesheet"
|
|
25
|
-
/>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 2. Import Base Styles and Themes
|
|
29
|
-
|
|
30
|
-
Import the base styles and the theme you want to use in your application:
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
import '@ks-digital/designsystem-themes/base.css'
|
|
34
|
-
import '@ks-digital/designsystem-themes/ledsagerbevis.css'
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 3. Use Components
|
|
38
|
-
|
|
39
|
-
To be written.
|
|
40
|
-
|
|
41
|
-
## Example
|
|
42
|
-
|
|
43
|
-
A complete example setup is available in the `angular-demo` located under the `apps` folder.
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Directive, model, Component, contentChild, signal, afterNextRender, isDevMode } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/* eslint-disable @angular-eslint/no-input-rename */
|
|
5
|
-
/**
|
|
6
|
-
* We use input aliasing to bridge the gap between Angular's camelCase property naming convention and our HTML data attributes.
|
|
7
|
-
* This approach allows us to use valid HTML data attributes as documented by Designsystemet while maintaining
|
|
8
|
-
* proper TypeScript intellisense support.
|
|
9
|
-
*/
|
|
10
|
-
class CommonInputs {
|
|
11
|
-
/**
|
|
12
|
-
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
13
|
-
* @attribute data-size
|
|
14
|
-
*/
|
|
15
|
-
dataSize = input(undefined, { alias: 'data-size' });
|
|
16
|
-
/**
|
|
17
|
-
* Changes color for descendant Designsystemet components.
|
|
18
|
-
* Select from predefined colors and colors defined using theme.designsystemet.no.
|
|
19
|
-
* @attribute data-color
|
|
20
|
-
*/
|
|
21
|
-
dataColor = input(undefined, { alias: 'data-color' });
|
|
22
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CommonInputs, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
23
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.3", type: CommonInputs, isStandalone: true, inputs: { dataSize: { classPropertyName: "dataSize", publicName: "data-size", isSignal: true, isRequired: false, transformFunction: null }, dataColor: { classPropertyName: "dataColor", publicName: "data-color", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
24
|
-
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CommonInputs, decorators: [{
|
|
26
|
-
type: Directive
|
|
27
|
-
}] });
|
|
28
|
-
|
|
29
|
-
class Checkbox {
|
|
30
|
-
id = model();
|
|
31
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Checkbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.3", type: Checkbox, isStandalone: true, selector: "input[ksd-checkbox]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { id: "idChange" }, host: { attributes: { "type": "checkbox" }, properties: { "attr.id": "id()" }, classAttribute: "ds-input" }, hostDirectives: [{ directive: CommonInputs, inputs: ["data-size", "data-size", "data-color", "data-color"] }], ngImport: i0, template: ``, isInline: true });
|
|
33
|
-
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Checkbox, decorators: [{
|
|
35
|
-
type: Component,
|
|
36
|
-
args: [{
|
|
37
|
-
selector: 'input[ksd-checkbox]',
|
|
38
|
-
hostDirectives: [{
|
|
39
|
-
directive: CommonInputs,
|
|
40
|
-
inputs: ['data-size', 'data-color']
|
|
41
|
-
}],
|
|
42
|
-
host: {
|
|
43
|
-
type: 'checkbox',
|
|
44
|
-
class: 'ds-input',
|
|
45
|
-
'[attr.id]': 'id()',
|
|
46
|
-
},
|
|
47
|
-
template: ``,
|
|
48
|
-
}]
|
|
49
|
-
}] });
|
|
50
|
-
|
|
51
|
-
const randomId = () => {
|
|
52
|
-
return Math.random().toString(36).slice(2, 7);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
class Label {
|
|
56
|
-
for = model();
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Label, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.3", type: Label, isStandalone: true, selector: "ksd-label", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { for: "forChange" }, hostDirectives: [{ directive: CommonInputs, inputs: ["data-size", "data-size", "data-color", "data-color"] }], ngImport: i0, template: `<label class="ds-label" [for]="for()"><ng-content /></label>`, isInline: true });
|
|
59
|
-
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Label, decorators: [{
|
|
61
|
-
type: Component,
|
|
62
|
-
args: [{
|
|
63
|
-
selector: 'ksd-label',
|
|
64
|
-
hostDirectives: [{
|
|
65
|
-
directive: CommonInputs,
|
|
66
|
-
inputs: ['data-size', 'data-color']
|
|
67
|
-
}],
|
|
68
|
-
template: `<label class="ds-label" [for]="for()"><ng-content /></label>`,
|
|
69
|
-
}]
|
|
70
|
-
}] });
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Use the Field component to connect inputs and labels
|
|
74
|
-
*/
|
|
75
|
-
class Field {
|
|
76
|
-
/**
|
|
77
|
-
* Position of toggle inputs (radio, checkbox, switch) in field
|
|
78
|
-
* @default start
|
|
79
|
-
*/
|
|
80
|
-
position = input('start');
|
|
81
|
-
input = contentChild(Checkbox);
|
|
82
|
-
label = contentChild(Label);
|
|
83
|
-
id = signal(randomId());
|
|
84
|
-
constructor() {
|
|
85
|
-
afterNextRender(() => {
|
|
86
|
-
if (isDevMode() && (!this.label() || !this.input())) {
|
|
87
|
-
console.error('[Field] Missing required elements: ksd-label and ksd-input must be provided as children');
|
|
88
|
-
}
|
|
89
|
-
this.input()?.id.set(this.id());
|
|
90
|
-
this.label()?.for.set(this.id());
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Field, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
94
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.3", type: Field, isStandalone: true, selector: "ksd-field", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.dataPosition": "position()" }, classAttribute: "ds-field" }, queries: [{ propertyName: "input", first: true, predicate: Checkbox, descendants: true, isSignal: true }, { propertyName: "label", first: true, predicate: Label, descendants: true, isSignal: true }], hostDirectives: [{ directive: CommonInputs, inputs: ["data-size", "data-size", "data-color", "data-color"] }], ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
95
|
-
}
|
|
96
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Field, decorators: [{
|
|
97
|
-
type: Component,
|
|
98
|
-
args: [{
|
|
99
|
-
selector: 'ksd-field',
|
|
100
|
-
hostDirectives: [
|
|
101
|
-
{
|
|
102
|
-
directive: CommonInputs,
|
|
103
|
-
inputs: ['data-size', 'data-color'],
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
host: {
|
|
107
|
-
class: 'ds-field',
|
|
108
|
-
'[attr.dataPosition]': 'position()',
|
|
109
|
-
},
|
|
110
|
-
template: ` <ng-content /> `,
|
|
111
|
-
}]
|
|
112
|
-
}], ctorParameters: () => [] });
|
|
113
|
-
|
|
114
|
-
class Fieldset {
|
|
115
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Fieldset, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: Fieldset, isStandalone: true, selector: "fieldset[ksd-fieldset]", host: { attributes: { "role": "fieldset" }, classAttribute: "ds-fieldset" }, ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
117
|
-
}
|
|
118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Fieldset, decorators: [{
|
|
119
|
-
type: Component,
|
|
120
|
-
args: [{
|
|
121
|
-
selector: 'fieldset[ksd-fieldset]',
|
|
122
|
-
host: {
|
|
123
|
-
role: 'fieldset',
|
|
124
|
-
class: 'ds-fieldset',
|
|
125
|
-
},
|
|
126
|
-
template: ` <ng-content /> `,
|
|
127
|
-
}]
|
|
128
|
-
}] });
|
|
129
|
-
|
|
130
|
-
class FieldsetDescription {
|
|
131
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FieldsetDescription, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
132
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: FieldsetDescription, isStandalone: true, selector: "p[ksd-fieldset-description]", ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
133
|
-
}
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FieldsetDescription, decorators: [{
|
|
135
|
-
type: Component,
|
|
136
|
-
args: [{
|
|
137
|
-
selector: 'p[ksd-fieldset-description]',
|
|
138
|
-
template: `<ng-content />`,
|
|
139
|
-
host: {}
|
|
140
|
-
}]
|
|
141
|
-
}] });
|
|
142
|
-
|
|
143
|
-
class FieldsetLegend {
|
|
144
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FieldsetLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: FieldsetLegend, isStandalone: true, selector: "legend[ksd-fieldset-legend]", host: { attributes: { "role": "legend" }, classAttribute: "ds-label" }, ngImport: i0, template: ` <ng-content /> `, isInline: true });
|
|
146
|
-
}
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FieldsetLegend, decorators: [{
|
|
148
|
-
type: Component,
|
|
149
|
-
args: [{
|
|
150
|
-
selector: 'legend[ksd-fieldset-legend]',
|
|
151
|
-
host: {
|
|
152
|
-
role: 'legend',
|
|
153
|
-
class: 'ds-label',
|
|
154
|
-
},
|
|
155
|
-
template: ` <ng-content /> `,
|
|
156
|
-
}]
|
|
157
|
-
}] });
|
|
158
|
-
|
|
159
|
-
class Paragraph {
|
|
160
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Paragraph, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
161
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: Paragraph, isStandalone: true, selector: "ksd-paragraph", host: { classAttribute: "ds-paragraph" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
162
|
-
}
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: Paragraph, decorators: [{
|
|
164
|
-
type: Component,
|
|
165
|
-
args: [{
|
|
166
|
-
selector: 'ksd-paragraph',
|
|
167
|
-
template: `<ng-content />`,
|
|
168
|
-
host: {
|
|
169
|
-
class: 'ds-paragraph',
|
|
170
|
-
},
|
|
171
|
-
}]
|
|
172
|
-
}] });
|
|
173
|
-
|
|
174
|
-
class ValidationMessage {
|
|
175
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ValidationMessage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
176
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: ValidationMessage, isStandalone: true, selector: "p[ksd-validation-message]", host: { attributes: { "data-field": "validation" }, classAttribute: "ds-validation-message" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
177
|
-
}
|
|
178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ValidationMessage, decorators: [{
|
|
179
|
-
type: Component,
|
|
180
|
-
args: [{
|
|
181
|
-
selector: 'p[ksd-validation-message]',
|
|
182
|
-
template: `<ng-content />`,
|
|
183
|
-
host: {
|
|
184
|
-
class: 'ds-validation-message',
|
|
185
|
-
'data-field': 'validation',
|
|
186
|
-
},
|
|
187
|
-
}]
|
|
188
|
-
}] });
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Generated bundle index. Do not edit.
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
export { Checkbox, CommonInputs, Field, Fieldset, FieldsetDescription, FieldsetLegend, Label, Paragraph, ValidationMessage };
|
|
195
|
-
//# sourceMappingURL=ks-digital-designsystem-angular.mjs.map
|