@ks-digital/designsystem-angular 0.0.1-alpha.6 → 0.0.1-alpha.60
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 +23 -11
- 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 +82 -0
- package/fesm2022/ks-digital-designsystem-angular-__internals.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-alert.mjs +40 -0
- package/fesm2022/ks-digital-designsystem-angular-alert.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs +51 -0
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-button.mjs +75 -0
- package/fesm2022/ks-digital-designsystem-angular-button.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-card.mjs +86 -0
- package/fesm2022/ks-digital-designsystem-angular-card.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs +43 -0
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-details.mjs +64 -0
- package/fesm2022/ks-digital-designsystem-angular-details.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-dialog.mjs +48 -0
- package/fesm2022/ks-digital-designsystem-angular-dialog.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs +46 -0
- package/fesm2022/ks-digital-designsystem-angular-dropdown.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs +49 -0
- package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs +227 -0
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs +40 -0
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-link.mjs +31 -0
- package/fesm2022/ks-digital-designsystem-angular-link.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs +143 -0
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs +25 -0
- package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs +46 -0
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-search.mjs +183 -0
- package/fesm2022/ks-digital-designsystem-angular-search.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs +87 -0
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs +281 -0
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-table.mjs +105 -0
- package/fesm2022/ks-digital-designsystem-angular-table.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs +148 -0
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs +38 -0
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs +25 -0
- package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs.map +1 -0
- package/fesm2022/ks-digital-designsystem-angular.mjs +7 -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 +108 -26
- 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/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 +50 -0
- package/types/ks-digital-designsystem-angular-alert.d.ts +12 -0
- package/types/ks-digital-designsystem-angular-breadcrumbs.d.ts +13 -0
- package/types/ks-digital-designsystem-angular-button.d.ts +32 -0
- package/types/ks-digital-designsystem-angular-card.d.ts +24 -0
- package/types/ks-digital-designsystem-angular-chip.d.ts +15 -0
- package/types/ks-digital-designsystem-angular-details.d.ts +20 -0
- package/types/ks-digital-designsystem-angular-dialog.d.ts +18 -0
- package/types/ks-digital-designsystem-angular-dropdown.d.ts +13 -0
- package/types/ks-digital-designsystem-angular-error-summary.d.ts +14 -0
- package/types/ks-digital-designsystem-angular-forms.d.ts +81 -0
- package/types/ks-digital-designsystem-angular-heading.d.ts +19 -0
- package/types/ks-digital-designsystem-angular-link.d.ts +9 -0
- package/types/ks-digital-designsystem-angular-pagination.d.ts +58 -0
- package/types/ks-digital-designsystem-angular-paragraph.d.ts +8 -0
- package/types/ks-digital-designsystem-angular-popover.d.ts +13 -0
- package/types/ks-digital-designsystem-angular-search.d.ts +84 -0
- package/types/ks-digital-designsystem-angular-spinner.d.ts +22 -0
- package/types/ks-digital-designsystem-angular-suggestion.d.ts +97 -0
- package/types/ks-digital-designsystem-angular-table.d.ts +43 -0
- package/types/ks-digital-designsystem-angular-tabs.d.ts +65 -0
- package/types/ks-digital-designsystem-angular-tag.d.ts +15 -0
- package/types/ks-digital-designsystem-angular-validation-message.d.ts +8 -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,143 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, numberAttribute, output, computed, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Component, inject, ElementRef, DestroyRef, Directive } from '@angular/core';
|
|
3
|
+
import { pagination } from '@digdir/designsystemet-web';
|
|
4
|
+
import * as i1 from '@ks-digital/designsystem-angular/__internals';
|
|
5
|
+
import { HostSize, HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
6
|
+
|
|
7
|
+
class Pagination {
|
|
8
|
+
/**
|
|
9
|
+
* The current page
|
|
10
|
+
*/
|
|
11
|
+
current = input.required({ ...(ngDevMode ? { debugName: "current" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
12
|
+
/**
|
|
13
|
+
* The total number of pages
|
|
14
|
+
*/
|
|
15
|
+
total = input.required({ ...(ngDevMode ? { debugName: "total" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
16
|
+
/**
|
|
17
|
+
* Sets the screen reader label for the pagination
|
|
18
|
+
*/
|
|
19
|
+
ariaLabel = input('Bla i sider', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
20
|
+
/**
|
|
21
|
+
* How many pages to show. Default is 7
|
|
22
|
+
*/
|
|
23
|
+
show = input(7, { ...(ngDevMode ? { debugName: "show" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
24
|
+
/**
|
|
25
|
+
* E.g if "?page=%d" all the links will set href to "?page=1", "?page=2".
|
|
26
|
+
*/
|
|
27
|
+
href = input(...(ngDevMode ? [undefined, { debugName: "href" }] : /* istanbul ignore next */ []));
|
|
28
|
+
/**
|
|
29
|
+
* Emits the page number when a page is clicked
|
|
30
|
+
*/
|
|
31
|
+
pageClicked = output();
|
|
32
|
+
/**
|
|
33
|
+
* Exposes pagination data for consumer use
|
|
34
|
+
*/
|
|
35
|
+
pages = computed(() => {
|
|
36
|
+
const result = pagination({
|
|
37
|
+
current: this.current(),
|
|
38
|
+
total: this.total(),
|
|
39
|
+
show: this.show(),
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
pages: result.pages.map((p) => ({
|
|
43
|
+
page: p.page,
|
|
44
|
+
current: p.current === 'page',
|
|
45
|
+
key: p.key,
|
|
46
|
+
})),
|
|
47
|
+
prev: result.prev,
|
|
48
|
+
next: result.next,
|
|
49
|
+
};
|
|
50
|
+
}, ...(ngDevMode ? [{ debugName: "pages" }] : /* istanbul ignore next */ []));
|
|
51
|
+
onClick(e) {
|
|
52
|
+
const target = e.target.closest('[aria-label]');
|
|
53
|
+
if (!target)
|
|
54
|
+
return;
|
|
55
|
+
const label = target.getAttribute('aria-label');
|
|
56
|
+
if (!label)
|
|
57
|
+
return;
|
|
58
|
+
const page = Number(label);
|
|
59
|
+
if (!isNaN(page) && page !== this.current()) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
this.pageClicked.emit(page);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Pagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
65
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: Pagination, isStandalone: true, selector: "ksd-pagination", inputs: { current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: true, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageClicked: "pageClicked" }, hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
66
|
+
<ds-pagination
|
|
67
|
+
class="ds-pagination"
|
|
68
|
+
[attr.data-current]="current()"
|
|
69
|
+
[attr.data-total]="total()"
|
|
70
|
+
[attr.data-href]="href()"
|
|
71
|
+
[attr.aria-label]="ariaLabel()"
|
|
72
|
+
(click)="onClick($event)"
|
|
73
|
+
>
|
|
74
|
+
<ng-content />
|
|
75
|
+
</ds-pagination>
|
|
76
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Pagination, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{
|
|
81
|
+
selector: 'ksd-pagination',
|
|
82
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
83
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
84
|
+
template: `
|
|
85
|
+
<ds-pagination
|
|
86
|
+
class="ds-pagination"
|
|
87
|
+
[attr.data-current]="current()"
|
|
88
|
+
[attr.data-total]="total()"
|
|
89
|
+
[attr.data-href]="href()"
|
|
90
|
+
[attr.aria-label]="ariaLabel()"
|
|
91
|
+
(click)="onClick($event)"
|
|
92
|
+
>
|
|
93
|
+
<ng-content />
|
|
94
|
+
</ds-pagination>
|
|
95
|
+
`,
|
|
96
|
+
hostDirectives: [
|
|
97
|
+
{
|
|
98
|
+
directive: HostSize,
|
|
99
|
+
inputs: ['data-size'],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
directive: HostColor,
|
|
103
|
+
inputs: ['data-color'],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
}]
|
|
107
|
+
}], propDecorators: { current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: true }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], pageClicked: [{ type: i0.Output, args: ["pageClicked"] }] } });
|
|
108
|
+
|
|
109
|
+
class PaginationButton {
|
|
110
|
+
el = inject(ElementRef);
|
|
111
|
+
destroyRef = inject(DestroyRef);
|
|
112
|
+
constructor() {
|
|
113
|
+
const observer = new MutationObserver(() => this.updateVariant());
|
|
114
|
+
observer.observe(this.el.nativeElement, {
|
|
115
|
+
attributes: true,
|
|
116
|
+
attributeFilter: ['aria-current'],
|
|
117
|
+
});
|
|
118
|
+
this.updateVariant();
|
|
119
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
120
|
+
}
|
|
121
|
+
updateVariant() {
|
|
122
|
+
const isCurrent = this.el.nativeElement.getAttribute('aria-current') === 'true';
|
|
123
|
+
this.el.nativeElement.setAttribute('data-variant', isCurrent ? 'primary' : 'tertiary');
|
|
124
|
+
}
|
|
125
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PaginationButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
126
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: PaginationButton, isStandalone: true, selector: "[ksdPaginationButton]", host: { classAttribute: "ds-button" }, ngImport: i0 });
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PaginationButton, decorators: [{
|
|
129
|
+
type: Directive,
|
|
130
|
+
args: [{
|
|
131
|
+
selector: '[ksdPaginationButton]',
|
|
132
|
+
host: {
|
|
133
|
+
class: 'ds-button',
|
|
134
|
+
},
|
|
135
|
+
}]
|
|
136
|
+
}], ctorParameters: () => [] });
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Generated bundle index. Do not edit.
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
export { Pagination, PaginationButton };
|
|
143
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-pagination.mjs","sources":["../../../../packages/angular/pagination/src/pagination.ts","../../../../packages/angular/pagination/src/pagination.button.ts","../../../../packages/angular/pagination/src/ks-digital-designsystem-angular-pagination.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n numberAttribute,\n output,\n} from '@angular/core'\nimport { pagination } from '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\nexport interface PaginationPage {\n page: number\n current: boolean\n key: string\n}\n\nexport interface PaginationPages {\n pages: PaginationPage[]\n prev: number\n next: number\n}\n\n@Component({\n selector: 'ksd-pagination',\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <ds-pagination\n class=\"ds-pagination\"\n [attr.data-current]=\"current()\"\n [attr.data-total]=\"total()\"\n [attr.data-href]=\"href()\"\n [attr.aria-label]=\"ariaLabel()\"\n (click)=\"onClick($event)\"\n >\n <ng-content />\n </ds-pagination>\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 Pagination {\n /**\n * The current page\n */\n readonly current = input.required<number, string | number>({\n transform: numberAttribute,\n })\n\n /**\n * The total number of pages\n */\n readonly total = input.required<number, string | number>({\n transform: numberAttribute,\n })\n\n /**\n * Sets the screen reader label for the pagination\n */\n readonly ariaLabel = input<string>('Bla i sider', { alias: 'aria-label' })\n\n /**\n * How many pages to show. Default is 7\n */\n readonly show = input(7, { transform: numberAttribute })\n\n /**\n * E.g if \"?page=%d\" all the links will set href to \"?page=1\", \"?page=2\".\n */\n readonly href = input<string>()\n\n /**\n * Emits the page number when a page is clicked\n */\n readonly pageClicked = output<number>()\n\n /**\n * Exposes pagination data for consumer use\n */\n readonly pages = computed<PaginationPages>(() => {\n const result = pagination({\n current: this.current(),\n total: this.total(),\n show: this.show(),\n })\n return {\n pages: result.pages.map((p) => ({\n page: p.page,\n current: p.current === 'page',\n key: p.key,\n })),\n prev: result.prev,\n next: result.next,\n }\n })\n\n protected onClick(e: Event) {\n const target = (e.target as HTMLElement).closest('[aria-label]')\n if (!target) return\n\n const label = target.getAttribute('aria-label')\n if (!label) return\n\n const page = Number(label)\n if (!isNaN(page) && page !== this.current()) {\n e.preventDefault()\n this.pageClicked.emit(page)\n }\n }\n}\n","import { DestroyRef, Directive, ElementRef, inject } from '@angular/core'\n\n@Directive({\n selector: '[ksdPaginationButton]',\n host: {\n class: 'ds-button',\n },\n})\nexport class PaginationButton {\n private el = inject<ElementRef<HTMLElement>>(ElementRef)\n private destroyRef = inject(DestroyRef)\n\n constructor() {\n const observer = new MutationObserver(() => this.updateVariant())\n observer.observe(this.el.nativeElement, {\n attributes: true,\n attributeFilter: ['aria-current'],\n })\n this.updateVariant()\n\n this.destroyRef.onDestroy(() => observer.disconnect())\n }\n\n private updateVariant() {\n const isCurrent =\n this.el.nativeElement.getAttribute('aria-current') === 'true'\n this.el.nativeElement.setAttribute(\n 'data-variant',\n isCurrent ? 'primary' : 'tertiary',\n )\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsDa,UAAU,CAAA;AACrB;;AAEG;IACM,OAAO,GAAG,KAAK,CAAC,QAAQ,8EAC/B,SAAS,EAAE,eAAe,EAAA,CAC1B;AAEF;;AAEG;IACM,KAAK,GAAG,KAAK,CAAC,QAAQ,4EAC7B,SAAS,EAAE,eAAe,EAAA,CAC1B;AAEF;;AAEG;IACM,SAAS,GAAG,KAAK,CAAS,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AChB,eAAe,EAAE,CAAC,cAAc,CAAC;AAClC,SAAA,CAAC;QACF,IAAI,CAAC,aAAa,EAAE;AAEpB,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;IACxD;IAEQ,aAAa,GAAA;AACnB,QAAA,MAAM,SAAS,GACb,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,MAAM;AAC/D,QAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,YAAY,CAChC,cAAc,EACd,SAAS,GAAG,SAAS,GAAG,UAAU,CACnC;IACH;uGAtBW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,WAAW;AACnB,qBAAA;AACF,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class Paragraph {
|
|
5
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Paragraph, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: Paragraph, isStandalone: true, selector: "p[ksd-paragraph]", host: { classAttribute: "ds-paragraph" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7
|
+
}
|
|
8
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Paragraph, decorators: [{
|
|
9
|
+
type: Component,
|
|
10
|
+
args: [{
|
|
11
|
+
selector: 'p[ksd-paragraph]',
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
template: `<ng-content />`,
|
|
14
|
+
host: {
|
|
15
|
+
class: 'ds-paragraph',
|
|
16
|
+
},
|
|
17
|
+
}]
|
|
18
|
+
}] });
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Generated bundle index. Do not edit.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export { Paragraph };
|
|
25
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-paragraph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-paragraph.mjs","sources":["../../../../packages/angular/paragraph/src/paragraph.ts","../../../../packages/angular/paragraph/src/ks-digital-designsystem-angular-paragraph.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: 'p[ksd-paragraph]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />`,\n host: {\n class: 'ds-paragraph',\n },\n})\nexport class Paragraph {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAUa,SAAS,CAAA;uGAAT,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,sHALV,CAAA,cAAA,CAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKf,SAAS,EAAA,UAAA,EAAA,CAAA;kBARrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kBAAkB;oBAC5B,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,CAAA,cAAA,CAAgB;AAC1B,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;AACF,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, Directive } from '@angular/core';
|
|
3
|
+
import '@digdir/designsystemet-web';
|
|
4
|
+
import * as i1 from '@ks-digital/designsystem-angular/__internals';
|
|
5
|
+
import { HostSize, HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
6
|
+
|
|
7
|
+
class Popover {
|
|
8
|
+
autoPlacement = input(true, { ...(ngDevMode ? { debugName: "autoPlacement" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9
|
+
variant = input('default', { ...(ngDevMode ? { debugName: "variant" } : /* istanbul ignore next */ {}), alias: 'data-variant' });
|
|
10
|
+
// Todo: replace with centralized types
|
|
11
|
+
placement = input('top', { ...(ngDevMode ? { debugName: "placement" } : /* istanbul ignore next */ {}), alias: 'data-placement' });
|
|
12
|
+
popover = input('auto', { ...(ngDevMode ? { debugName: "popover" } : /* istanbul ignore next */ {}), alias: 'popover' });
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Popover, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
14
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: Popover, isStandalone: true, selector: "[ksd-popover]", inputs: { autoPlacement: { classPropertyName: "autoPlacement", publicName: "autoPlacement", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "data-variant", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "data-placement", isSignal: true, isRequired: false, transformFunction: null }, popover: { classPropertyName: "popover", publicName: "popover", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-variant": "variant()", "attr.data-placement": "placement()", "attr.data-autoplacement": "autoPlacement()", "attr.popover": "popover()" }, classAttribute: "ds-popover" }, hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0 });
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Popover, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
20
|
+
selector: '[ksd-popover]',
|
|
21
|
+
hostDirectives: [
|
|
22
|
+
{
|
|
23
|
+
directive: HostSize,
|
|
24
|
+
inputs: ['data-size'],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
directive: HostColor,
|
|
28
|
+
inputs: ['data-color'],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
host: {
|
|
32
|
+
class: 'ds-popover',
|
|
33
|
+
'[attr.data-variant]': 'variant()',
|
|
34
|
+
'[attr.data-placement]': 'placement()',
|
|
35
|
+
'[attr.data-autoplacement]': 'autoPlacement()',
|
|
36
|
+
'[attr.popover]': 'popover()',
|
|
37
|
+
},
|
|
38
|
+
}]
|
|
39
|
+
}], propDecorators: { autoPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoPlacement", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-variant", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-placement", required: false }] }], popover: [{ type: i0.Input, args: [{ isSignal: true, alias: "popover", required: false }] }] } });
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generated bundle index. Do not edit.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
export { Popover };
|
|
46
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-popover.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-popover.mjs","sources":["../../../../packages/angular/popover/src/popover.ts","../../../../packages/angular/popover/src/ks-digital-designsystem-angular-popover.ts"],"sourcesContent":["import { booleanAttribute, Directive, input } from '@angular/core'\nimport '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[ksd-popover]',\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-popover',\n '[attr.data-variant]': 'variant()',\n '[attr.data-placement]': 'placement()',\n '[attr.data-autoplacement]': 'autoPlacement()',\n '[attr.popover]': 'popover()',\n },\n})\nexport class Popover {\n readonly autoPlacement = input(true, { transform: booleanAttribute })\n readonly variant = input<'tinted' | 'default'>('default', {\n alias: 'data-variant',\n })\n\n // Todo: replace with centralized types\n readonly placement = input<\n | 'bottom'\n | 'bottom-end'\n | 'bottom-start'\n | 'left'\n | 'left-end'\n | 'left-start'\n | 'right'\n | 'right-end'\n | 'right-start'\n | 'top'\n | 'top-end'\n | 'top-start'\n >('top', { alias: 'data-placement' })\n\n readonly popover = input<'auto' | 'manual'>('auto', { alias: 'popover' })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA4Ba,OAAO,CAAA;IACT,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI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A,EAAA,SAAA,EAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,SAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBArBnB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,cAAc,EAAE;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;AACF,qBAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,YAAY;AACnB,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,uBAAuB,EAAE,aAAa;AACtC,wBAAA,2BAA2B,EAAE,iBAAiB;AAC9C,wBAAA,gBAAgB,EAAE,WAAW;AAC9B,qBAAA;AACF,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, contentChild, afterNextRender, ChangeDetectionStrategy, Component, input, output } from '@angular/core';
|
|
3
|
+
import * as i1 from '@ks-digital/designsystem-angular/__internals';
|
|
4
|
+
import { logIfDevMode, HostSize, HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Search input
|
|
8
|
+
*
|
|
9
|
+
* Used within Search to provide a search input.
|
|
10
|
+
*/
|
|
11
|
+
class SearchInput {
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: SearchInput, isStandalone: true, selector: "input[ksd-search-input]", host: { attributes: { "type": "search", "placeholder": "" }, classAttribute: "ds-input" }, ngImport: i0 });
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchInput, decorators: [{
|
|
16
|
+
type: Directive,
|
|
17
|
+
args: [{
|
|
18
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
19
|
+
selector: 'input[ksd-search-input]',
|
|
20
|
+
host: {
|
|
21
|
+
class: 'ds-input',
|
|
22
|
+
type: 'search',
|
|
23
|
+
placeholder: '', // Need empty placeholder to enable show/hide for clear button
|
|
24
|
+
},
|
|
25
|
+
}]
|
|
26
|
+
}] });
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Search Component
|
|
30
|
+
*
|
|
31
|
+
* Use to contain the search input and buttons.
|
|
32
|
+
* Only `SearchInput` is required, while `SearchClear` and `SearchButton` are optional.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <div ksd-search>
|
|
36
|
+
* <input ksd-search-input />
|
|
37
|
+
* <button ksd-search-clear></button>
|
|
38
|
+
* <button ksd-search-button></button>
|
|
39
|
+
* </div>
|
|
40
|
+
*/
|
|
41
|
+
class Search {
|
|
42
|
+
input = contentChild(SearchInput, ...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
|
|
43
|
+
constructor() {
|
|
44
|
+
afterNextRender(() => {
|
|
45
|
+
if (!this.input()) {
|
|
46
|
+
logIfDevMode({
|
|
47
|
+
component: 'Search',
|
|
48
|
+
message: 'Missing required elements: ksd-search-input must be provided as child. Check imports and markup.',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Search, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: Search, isStandalone: true, selector: "ksd-search", host: { classAttribute: "ds-search" }, queries: [{ propertyName: "input", first: true, predicate: SearchInput, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
55
|
+
<ng-content select="[ksd-search-input]" />
|
|
56
|
+
<ng-content select="[ksd-search-clear]" />
|
|
57
|
+
<ng-content select="[ksd-search-button]" />
|
|
58
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Search, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{
|
|
63
|
+
selector: 'ksd-search',
|
|
64
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
65
|
+
template: `
|
|
66
|
+
<ng-content select="[ksd-search-input]" />
|
|
67
|
+
<ng-content select="[ksd-search-clear]" />
|
|
68
|
+
<ng-content select="[ksd-search-button]" />
|
|
69
|
+
`,
|
|
70
|
+
host: {
|
|
71
|
+
class: 'ds-search',
|
|
72
|
+
},
|
|
73
|
+
hostDirectives: [
|
|
74
|
+
{
|
|
75
|
+
directive: HostSize,
|
|
76
|
+
inputs: ['data-size'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
directive: HostColor,
|
|
80
|
+
inputs: ['data-color'],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
}]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { input: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SearchInput), { isSignal: true }] }] } });
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Search button
|
|
88
|
+
*
|
|
89
|
+
* Used within Search to provide a submit button.
|
|
90
|
+
*
|
|
91
|
+
* @param {('primary' | 'secondary')} [variant] - Specify which button variant to use
|
|
92
|
+
* @param {string} [aria-label] - Aria label for the button
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
class SearchButton {
|
|
96
|
+
/**
|
|
97
|
+
* Specify which button variant to use
|
|
98
|
+
*
|
|
99
|
+
* @default 'primary'
|
|
100
|
+
*/
|
|
101
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
102
|
+
/**
|
|
103
|
+
* Aria label for the button
|
|
104
|
+
*/
|
|
105
|
+
ariaLabel = input('', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
107
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: SearchButton, isStandalone: true, selector: "button[ksd-search-button]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "submit" }, properties: { "attr.aria-label": "this.ariaLabel()", "attr.data-variant": "this.variant()" }, classAttribute: "ds-button" }, ngImport: i0 });
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchButton, decorators: [{
|
|
110
|
+
type: Directive,
|
|
111
|
+
args: [{
|
|
112
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
113
|
+
selector: 'button[ksd-search-button]',
|
|
114
|
+
host: {
|
|
115
|
+
class: 'ds-button',
|
|
116
|
+
type: 'submit',
|
|
117
|
+
'[attr.aria-label]': 'this.ariaLabel()',
|
|
118
|
+
'[attr.data-variant]': 'this.variant()',
|
|
119
|
+
},
|
|
120
|
+
}]
|
|
121
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Search clear button
|
|
125
|
+
*
|
|
126
|
+
* Used within Search to provide a clear button.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} [aria-label] - Aria label for the button.
|
|
129
|
+
*
|
|
130
|
+
* @event clearInput - Emitted when the clear button is clicked.
|
|
131
|
+
* Use this to notify controlled forms that the input should be cleared.
|
|
132
|
+
*
|
|
133
|
+
*/
|
|
134
|
+
class SearchClear {
|
|
135
|
+
/**
|
|
136
|
+
* Aria label for the button
|
|
137
|
+
* @default 'Tøm'
|
|
138
|
+
*/
|
|
139
|
+
ariaLabel = input('Tøm', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
140
|
+
/**
|
|
141
|
+
* Output to notify controlled forms that input should be cleared
|
|
142
|
+
*/
|
|
143
|
+
clearInput = output();
|
|
144
|
+
handleClear(e) {
|
|
145
|
+
const target = e.target;
|
|
146
|
+
let inputElement = null;
|
|
147
|
+
if (target instanceof HTMLElement) {
|
|
148
|
+
inputElement = target.closest('.ds-search')?.querySelector('input');
|
|
149
|
+
}
|
|
150
|
+
if (!inputElement)
|
|
151
|
+
throw new Error('Input is missing');
|
|
152
|
+
if (!(inputElement instanceof HTMLInputElement)) {
|
|
153
|
+
throw new Error('Input is not an input element');
|
|
154
|
+
}
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
inputElement.value = '';
|
|
157
|
+
this.clearInput.emit();
|
|
158
|
+
inputElement.focus();
|
|
159
|
+
}
|
|
160
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchClear, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
161
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: SearchClear, isStandalone: true, selector: "button[ksd-search-clear]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clearInput: "clearInput" }, host: { attributes: { "type": "reset" }, listeners: { "click": "handleClear($event)" }, properties: { "attr.data-variant": "'tertiary'", "attr.aria-label": "this.ariaLabel()" }, classAttribute: "ds-button" }, ngImport: i0 });
|
|
162
|
+
}
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SearchClear, decorators: [{
|
|
164
|
+
type: Directive,
|
|
165
|
+
args: [{
|
|
166
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
167
|
+
selector: 'button[ksd-search-clear]',
|
|
168
|
+
host: {
|
|
169
|
+
class: 'ds-button',
|
|
170
|
+
type: 'reset',
|
|
171
|
+
'[attr.data-variant]': "'tertiary'",
|
|
172
|
+
'[attr.aria-label]': 'this.ariaLabel()',
|
|
173
|
+
'(click)': 'handleClear($event)',
|
|
174
|
+
},
|
|
175
|
+
}]
|
|
176
|
+
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], clearInput: [{ type: i0.Output, args: ["clearInput"] }] } });
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Generated bundle index. Do not edit.
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
export { Search, SearchButton, SearchClear, SearchInput };
|
|
183
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-search.mjs","sources":["../../../../packages/angular/search/src/search-input.ts","../../../../packages/angular/search/src/search.ts","../../../../packages/angular/search/src/search-button.ts","../../../../packages/angular/search/src/search-clear.ts","../../../../packages/angular/search/src/ks-digital-designsystem-angular-search.ts"],"sourcesContent":["import { Directive } from '@angular/core'\n\n/**\n * Search input\n *\n * Used within Search to provide a search input.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'input[ksd-search-input]',\n host: {\n class: 'ds-input',\n type: 'search',\n placeholder: '', // Need empty placeholder to enable show/hide for clear button\n },\n})\nexport class SearchInput {}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n} from '@angular/core'\nimport {\n HostColor,\n HostSize,\n logIfDevMode,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { SearchInput } from './search-input'\n\n/**\n * Search Component\n *\n * Use to contain the search input and buttons.\n * Only `SearchInput` is required, while `SearchClear` and `SearchButton` are optional.\n *\n * @example\n * <div ksd-search>\n * <input ksd-search-input />\n * <button ksd-search-clear></button>\n * <button ksd-search-button></button>\n * </div>\n */\n@Component({\n selector: 'ksd-search',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <ng-content select=\"[ksd-search-input]\" />\n <ng-content select=\"[ksd-search-clear]\" />\n <ng-content select=\"[ksd-search-button]\" />\n `,\n host: {\n class: 'ds-search',\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 Search {\n private readonly input = contentChild(SearchInput)\n\n constructor() {\n afterNextRender(() => {\n if (!this.input()) {\n logIfDevMode({\n component: 'Search',\n message:\n 'Missing required elements: ksd-search-input must be provided as child. Check imports and markup.',\n })\n }\n })\n }\n}\n","import { Directive, input } from '@angular/core'\n\n/**\n * Search button\n *\n * Used within Search to provide a submit button.\n *\n * @param {('primary' | 'secondary')} [variant] - Specify which button variant to use\n * @param {string} [aria-label] - Aria label for the button\n *\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'button[ksd-search-button]',\n host: {\n class: 'ds-button',\n type: 'submit',\n '[attr.aria-label]': 'this.ariaLabel()',\n '[attr.data-variant]': 'this.variant()',\n },\n})\nexport class SearchButton {\n /**\n * Specify which button variant to use\n *\n * @default 'primary'\n */\n readonly variant = input<'primary' | 'secondary'>('primary')\n\n /**\n * Aria label for the button\n */\n readonly ariaLabel = input('', { alias: 'aria-label' })\n}\n","import { Directive, input, output } from '@angular/core'\n\n/**\n * Search clear button\n *\n * Used within Search to provide a clear button.\n *\n * @param {string} [aria-label] - Aria label for the button.\n *\n * @event clearInput - Emitted when the clear button is clicked.\n * Use this to notify controlled forms that the input should be cleared.\n *\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'button[ksd-search-clear]',\n host: {\n class: 'ds-button',\n type: 'reset',\n '[attr.data-variant]': \"'tertiary'\",\n '[attr.aria-label]': 'this.ariaLabel()',\n '(click)': 'handleClear($event)',\n },\n})\nexport class SearchClear {\n /**\n * Aria label for the button\n * @default 'Tøm'\n */\n readonly ariaLabel = input('Tøm', { alias: 'aria-label' })\n\n /**\n * Output to notify controlled forms that input should be cleared\n */\n clearInput = output<void>()\n\n handleClear(e: Event): void {\n const target = e.target as HTMLButtonElement\n let inputElement: HTMLElement | null | undefined = null\n\n if (target instanceof HTMLElement) {\n inputElement = target.closest('.ds-search')?.querySelector('input')\n }\n\n if (!inputElement) throw new Error('Input is missing')\n\n if (!(inputElement instanceof HTMLInputElement)) {\n throw new Error('Input is not an input element')\n }\n\n e.preventDefault()\n inputElement.value = ''\n this.clearInput.emit()\n inputElement.focus()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEA;;;;AAIG;MAUU,WAAW,CAAA;uGAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,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,EAAE;AACJ,wBAAA,KAAK,EAAE,WAAW;AAClB,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,qBAAqB,EAAE,YAAY;AACnC,wBAAA,mBAAmB,EAAE,kBAAkB;AACvC,wBAAA,SAAS,EAAE,qBAAqB;AACjC,qBAAA;AACF,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { HostColor } from '@ks-digital/designsystem-angular/__internals';
|
|
5
|
+
|
|
6
|
+
class Spinner {
|
|
7
|
+
/**
|
|
8
|
+
* Aria-label for the spinner
|
|
9
|
+
*/
|
|
10
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
11
|
+
/**
|
|
12
|
+
* Aria-hidden for the spinner
|
|
13
|
+
*/
|
|
14
|
+
ariaHidden = input(undefined, { ...(ngDevMode ? { debugName: "ariaHidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
|
|
15
|
+
alias: 'aria-hidden' });
|
|
16
|
+
/**
|
|
17
|
+
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
18
|
+
* @attribute data-size
|
|
19
|
+
*/
|
|
20
|
+
dataSize = input(undefined, { ...(ngDevMode ? { debugName: "dataSize" } : /* istanbul ignore next */ {}), alias: 'data-size' });
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: Spinner, isStandalone: true, selector: "ksd-spinner", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null }, dataSize: { classPropertyName: "dataSize", publicName: "data-size", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
23
|
+
<svg
|
|
24
|
+
class="ds-spinner"
|
|
25
|
+
role="img"
|
|
26
|
+
viewBox="0 0 50 50"
|
|
27
|
+
[attr.data-size]="dataSize()"
|
|
28
|
+
>
|
|
29
|
+
<circle
|
|
30
|
+
class="ds-spinner__background"
|
|
31
|
+
cx="25"
|
|
32
|
+
cy="25"
|
|
33
|
+
r="20"
|
|
34
|
+
fill="none"
|
|
35
|
+
stroke-width="5"
|
|
36
|
+
/>
|
|
37
|
+
<circle
|
|
38
|
+
class="ds-spinner__circle"
|
|
39
|
+
cx="25"
|
|
40
|
+
cy="25"
|
|
41
|
+
r="20"
|
|
42
|
+
fill="none"
|
|
43
|
+
stroke-width="5"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
`, isInline: true, styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Spinner, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'ksd-spinner', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
51
|
+
<svg
|
|
52
|
+
class="ds-spinner"
|
|
53
|
+
role="img"
|
|
54
|
+
viewBox="0 0 50 50"
|
|
55
|
+
[attr.data-size]="dataSize()"
|
|
56
|
+
>
|
|
57
|
+
<circle
|
|
58
|
+
class="ds-spinner__background"
|
|
59
|
+
cx="25"
|
|
60
|
+
cy="25"
|
|
61
|
+
r="20"
|
|
62
|
+
fill="none"
|
|
63
|
+
stroke-width="5"
|
|
64
|
+
/>
|
|
65
|
+
<circle
|
|
66
|
+
class="ds-spinner__circle"
|
|
67
|
+
cx="25"
|
|
68
|
+
cy="25"
|
|
69
|
+
r="20"
|
|
70
|
+
fill="none"
|
|
71
|
+
stroke-width="5"
|
|
72
|
+
/>
|
|
73
|
+
</svg>
|
|
74
|
+
`, hostDirectives: [
|
|
75
|
+
{
|
|
76
|
+
directive: HostColor,
|
|
77
|
+
inputs: ['data-color'],
|
|
78
|
+
},
|
|
79
|
+
], styles: [":host{display:contents}\n"] }]
|
|
80
|
+
}], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], dataSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "data-size", required: false }] }] } });
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Generated bundle index. Do not edit.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
export { Spinner };
|
|
87
|
+
//# sourceMappingURL=ks-digital-designsystem-angular-spinner.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-spinner.mjs","sources":["../../../../packages/angular/spinner/src/spinner.ts","../../../../packages/angular/spinner/src/ks-digital-designsystem-angular-spinner.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\nimport { HostColor } from '@ks-digital/designsystem-angular/__internals'\nimport { SpinnerSize } from './spinner-sizes'\n\n@Component({\n selector: 'ksd-spinner',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: `\n :host {\n display: contents;\n }\n `,\n template: `\n <svg\n class=\"ds-spinner\"\n role=\"img\"\n viewBox=\"0 0 50 50\"\n [attr.data-size]=\"dataSize()\"\n >\n <circle\n class=\"ds-spinner__background\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n />\n <circle\n class=\"ds-spinner__circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n fill=\"none\"\n stroke-width=\"5\"\n />\n </svg>\n `,\n hostDirectives: [\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n})\nexport class Spinner {\n /**\n * Aria-label for the spinner\n */\n readonly ariaLabel = input<string>(undefined, { alias: 'aria-label' })\n\n /**\n * Aria-hidden for the spinner\n */\n readonly ariaHidden = input(undefined, {\n transform: booleanAttribute,\n alias: 'aria-hidden',\n })\n\n /**\n * Changes size for descendant Designsystemet components. Select from predefined sizes.\n * @attribute data-size\n */\n readonly dataSize = input<SpinnerSize>(undefined, {\n alias: 'data-size',\n })\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAiDa,OAAO,CAAA;AAClB;;AAEG;IACM,SAAS,GAAG,KAAK,CAAS,SAAS,iFAAI,KAAK,EAAE,YAAY,EAAA,CAAG;AAEtE;;AAEG;AACM,IAAA,UAAU,GAAG,KAAK,CAAC,SAAS,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,YAAA,EAAA,8BAAA,EAAA,CAAA,EACnC,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,aAAa,EAAA,CACpB;AAEF;;;AAGG;IACM,QAAQ,GAAG,KAAK,CAAc,SAAS,gFAC9C,KAAK,EAAE,WAAW,EAAA,CAClB;uGApBS,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,E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