@ks-digital/designsystem-angular 0.0.1-alpha.53 → 0.0.1-alpha.56
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/dialog/README.md +3 -0
- package/fesm2022/ks-digital-designsystem-angular-__internals.mjs +12 -12
- package/fesm2022/ks-digital-designsystem-angular-__internals.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-alert.mjs +3 -3
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs +6 -14
- package/fesm2022/ks-digital-designsystem-angular-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-button.mjs +15 -12
- package/fesm2022/ks-digital-designsystem-angular-button.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-card.mjs +7 -7
- package/fesm2022/ks-digital-designsystem-angular-card.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs +4 -4
- package/fesm2022/ks-digital-designsystem-angular-chip.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-details.mjs +10 -10
- package/fesm2022/ks-digital-designsystem-angular-details.mjs.map +1 -1
- 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-error-summary.mjs +5 -5
- package/fesm2022/ks-digital-designsystem-angular-error-summary.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs +29 -29
- package/fesm2022/ks-digital-designsystem-angular-forms.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs +5 -5
- package/fesm2022/ks-digital-designsystem-angular-heading.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-link.mjs +3 -3
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs +12 -12
- package/fesm2022/ks-digital-designsystem-angular-pagination.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-paragraph.mjs +3 -3
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs +7 -7
- package/fesm2022/ks-digital-designsystem-angular-popover.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-search.mjs +16 -16
- package/fesm2022/ks-digital-designsystem-angular-search.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs +6 -6
- package/fesm2022/ks-digital-designsystem-angular-spinner.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs +26 -26
- package/fesm2022/ks-digital-designsystem-angular-suggestion.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-table.mjs +11 -11
- package/fesm2022/ks-digital-designsystem-angular-table.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs +15 -15
- package/fesm2022/ks-digital-designsystem-angular-tabs.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs +4 -4
- package/fesm2022/ks-digital-designsystem-angular-tag.mjs.map +1 -1
- package/fesm2022/ks-digital-designsystem-angular-validation-message.mjs +3 -3
- package/package.json +8 -4
- package/types/ks-digital-designsystem-angular-__internals.d.ts +2 -3
- package/types/ks-digital-designsystem-angular-button.d.ts +4 -2
- package/types/ks-digital-designsystem-angular-dialog.d.ts +18 -0
|
@@ -1 +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,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,UAAU;AACjB,wBAAA,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,EAAE;AAChB,qBAAA;AACF,iBAAA;;;ACFD;;;;;;;;;;;;AAYG;MAuBU,MAAM,CAAA;AACA,IAAA,KAAK,GAAG,YAAY,CAAC,WAAW,
|
|
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,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,aAAA,EAAA,EAAA,EAAA,EAAA,cAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,UAAU;AACjB,wBAAA,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,EAAE;AAChB,qBAAA;AACF,iBAAA;;;ACFD;;;;;;;;;;;;AAYG;MAuBU,MAAM,CAAA;AACA,IAAA,KAAK,GAAG,YAAY,CAAC,WAAW,4EAAC;AAElD,IAAA,WAAA,GAAA;QACE,eAAe,CAAC,MAAK;AACnB,YAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE;AACjB,gBAAA,YAAY,CAAC;AACX,oBAAA,SAAS,EAAE,QAAQ;AACnB,oBAAA,OAAO,EACL,kGAAkG;AACrG,iBAAA,CAAC;YACJ;AACF,QAAA,CAAC,CAAC;IACJ;uGAbW,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAN,MAAM,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,Y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iBAAA,EAAA,kBAAA,EAAA,EAAA,cAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAXvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,IAAI,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;;;;"}
|
|
@@ -7,19 +7,19 @@ class Spinner {
|
|
|
7
7
|
/**
|
|
8
8
|
* Aria-label for the spinner
|
|
9
9
|
*/
|
|
10
|
-
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
10
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
11
11
|
/**
|
|
12
12
|
* Aria-hidden for the spinner
|
|
13
13
|
*/
|
|
14
|
-
ariaHidden = input(undefined, { ...(ngDevMode ? { debugName: "ariaHidden" } : {}), transform: booleanAttribute,
|
|
14
|
+
ariaHidden = input(undefined, { ...(ngDevMode ? { debugName: "ariaHidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute,
|
|
15
15
|
alias: 'aria-hidden' });
|
|
16
16
|
/**
|
|
17
17
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
18
18
|
* @attribute data-size
|
|
19
19
|
*/
|
|
20
|
-
dataSize = input(undefined, { ...(ngDevMode ? { debugName: "dataSize" } : {}), alias: 'data-size' });
|
|
21
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
22
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
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
23
|
<svg
|
|
24
24
|
class="ds-spinner"
|
|
25
25
|
role="img"
|
|
@@ -45,7 +45,7 @@ class Spinner {
|
|
|
45
45
|
</svg>
|
|
46
46
|
`, isInline: true, styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
47
|
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Spinner, decorators: [{
|
|
49
49
|
type: Component,
|
|
50
50
|
args: [{ selector: 'ksd-spinner', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
51
51
|
<svg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-spinner.mjs","sources":["../../../../packages/angular/spinner/src/spinner.ts","../../../../packages/angular/spinner/src/ks-digital-designsystem-angular-spinner.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\nimport { 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,
|
|
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,E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AE,SAAS;4BACpB,MAAM,EAAE,CAAC,YAAY,CAAC;AACvB,yBAAA;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,2BAAA,CAAA,EAAA;;;AC/CH;;AAEG;;;;"}
|
|
@@ -10,11 +10,11 @@ class SuggestionListEmpty {
|
|
|
10
10
|
* Hack to get the content from parent component so that we can
|
|
11
11
|
* keep the dom structure needed without additional host elements
|
|
12
12
|
*/
|
|
13
|
-
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : []));
|
|
14
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
15
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
13
|
+
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionListEmpty, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: SuggestionListEmpty, isStandalone: true, selector: "ksd-suggestion-list-empty", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], ngImport: i0, template: ` <ng-template #tpl><ng-content /></ng-template> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionListEmpty, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
19
|
args: [{
|
|
20
20
|
selector: 'ksd-suggestion-list-empty',
|
|
@@ -28,12 +28,12 @@ class SuggestionListOption {
|
|
|
28
28
|
* Hack to get the content from parent component so that we can
|
|
29
29
|
* keep the dom structure needed without additional host elements
|
|
30
30
|
*/
|
|
31
|
-
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : []));
|
|
32
|
-
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
33
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
34
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
31
|
+
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
32
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionListOption, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: SuggestionListOption, isStandalone: true, selector: "ksd-suggestion-list-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], ngImport: i0, template: ` <ng-template #tpl><ng-content /></ng-template> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
35
35
|
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionListOption, decorators: [{
|
|
37
37
|
type: Component,
|
|
38
38
|
args: [{
|
|
39
39
|
selector: 'ksd-suggestion-list-option',
|
|
@@ -50,17 +50,17 @@ class SuggestionList {
|
|
|
50
50
|
*
|
|
51
51
|
* @default '%d forslag'
|
|
52
52
|
*/
|
|
53
|
-
singular = input('%d forslag', ...(ngDevMode ? [{ debugName: "singular" }] : []));
|
|
53
|
+
singular = input('%d forslag', ...(ngDevMode ? [{ debugName: "singular" }] : /* istanbul ignore next */ []));
|
|
54
54
|
/**
|
|
55
55
|
* Screen reader announcement template for plural result count.
|
|
56
56
|
*
|
|
57
57
|
* @default '%d forslag'
|
|
58
58
|
*/
|
|
59
|
-
plural = input('%d forslag', ...(ngDevMode ? [{ debugName: "plural" }] : []));
|
|
60
|
-
options = contentChildren(SuggestionListOption, { ...(ngDevMode ? { debugName: "options" } : {}), descendants: true });
|
|
61
|
-
empty = contentChild(SuggestionListEmpty, ...(ngDevMode ? [{ debugName: "empty" }] : []));
|
|
62
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
63
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
59
|
+
plural = input('%d forslag', ...(ngDevMode ? [{ debugName: "plural" }] : /* istanbul ignore next */ []));
|
|
60
|
+
options = contentChildren(SuggestionListOption, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), descendants: true });
|
|
61
|
+
empty = contentChild(SuggestionListEmpty, ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
|
|
62
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
63
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SuggestionList, isStandalone: true, selector: "ksd-suggestion-list", inputs: { singular: { classPropertyName: "singular", publicName: "singular", isSignal: true, isRequired: false, transformFunction: null }, plural: { classPropertyName: "plural", publicName: "plural", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents;" }, queries: [{ propertyName: "options", predicate: SuggestionListOption, descendants: true, isSignal: true }, { propertyName: "empty", first: true, predicate: SuggestionListEmpty, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
64
64
|
<u-datalist
|
|
65
65
|
data-nofilter
|
|
66
66
|
[attr.data-sr-singular]="singular()"
|
|
@@ -79,7 +79,7 @@ class SuggestionList {
|
|
|
79
79
|
</u-datalist>
|
|
80
80
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SuggestionList, decorators: [{
|
|
83
83
|
type: Component,
|
|
84
84
|
args: [{
|
|
85
85
|
selector: 'ksd-suggestion-list',
|
|
@@ -135,28 +135,28 @@ class Suggestion {
|
|
|
135
135
|
*
|
|
136
136
|
* @default false
|
|
137
137
|
*/
|
|
138
|
-
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
138
|
+
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
139
139
|
/**
|
|
140
140
|
* Allows the user to create new items
|
|
141
141
|
*
|
|
142
142
|
* @default false
|
|
143
143
|
*/
|
|
144
|
-
creatable = input(false, { ...(ngDevMode ? { debugName: "creatable" } : {}), transform: booleanAttribute });
|
|
144
|
+
creatable = input(false, { ...(ngDevMode ? { debugName: "creatable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
145
145
|
/**
|
|
146
146
|
* Filter options; boolean or a custom callback.
|
|
147
147
|
*
|
|
148
148
|
* @default true
|
|
149
149
|
*/
|
|
150
|
-
filter = input(true, ...(ngDevMode ? [{ debugName: "filter" }] : []));
|
|
150
|
+
filter = input(true, ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
151
151
|
/**
|
|
152
152
|
* Model for the selected item(s).
|
|
153
153
|
*
|
|
154
154
|
* @default undefined
|
|
155
155
|
*/
|
|
156
|
-
selected = model(undefined, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
157
|
-
selectedArray = computed(() => sanitizeItems(this.selected()), ...(ngDevMode ? [{ debugName: "selectedArray" }] : []));
|
|
158
|
-
suggestionElement = viewChild('suggestionElement', ...(ngDevMode ? [{ debugName: "suggestionElement" }] : []));
|
|
159
|
-
suggestionList = contentChild(SuggestionList, ...(ngDevMode ? [{ debugName: "suggestionList" }] : []));
|
|
156
|
+
selected = model(undefined, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
157
|
+
selectedArray = computed(() => sanitizeItems(this.selected()), ...(ngDevMode ? [{ debugName: "selectedArray" }] : /* istanbul ignore next */ []));
|
|
158
|
+
suggestionElement = viewChild('suggestionElement', ...(ngDevMode ? [{ debugName: "suggestionElement" }] : /* istanbul ignore next */ []));
|
|
159
|
+
suggestionList = contentChild(SuggestionList, ...(ngDevMode ? [{ debugName: "suggestionList" }] : /* istanbul ignore next */ []));
|
|
160
160
|
constructor() {
|
|
161
161
|
afterNextRender(() => this.syncOptions(null));
|
|
162
162
|
effect(() => {
|
|
@@ -219,8 +219,8 @@ class Suggestion {
|
|
|
219
219
|
}
|
|
220
220
|
emptyOption.setAttribute('hidden', '');
|
|
221
221
|
}
|
|
222
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
223
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
222
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Suggestion, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Suggestion, isStandalone: true, selector: "ksd-suggestion", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, creatable: { classPropertyName: "creatable", publicName: "creatable", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, queries: [{ propertyName: "suggestionList", first: true, predicate: SuggestionList, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "suggestionElement", first: true, predicate: ["suggestionElement"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
224
224
|
<ds-suggestion
|
|
225
225
|
#suggestionElement
|
|
226
226
|
class="ds-suggestion"
|
|
@@ -237,7 +237,7 @@ class Suggestion {
|
|
|
237
237
|
</ds-suggestion>
|
|
238
238
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
239
239
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Suggestion, decorators: [{
|
|
241
241
|
type: Component,
|
|
242
242
|
args: [{
|
|
243
243
|
selector: 'ksd-suggestion',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-suggestion.mjs","sources":["../../../../packages/angular/suggestion/src/suggestion-list-empty.ts","../../../../packages/angular/suggestion/src/suggestion-list-option.ts","../../../../packages/angular/suggestion/src/suggestion-list.ts","../../../../packages/angular/suggestion/src/suggestion.utils.ts","../../../../packages/angular/suggestion/src/suggestion.ts","../../../../packages/angular/suggestion/src/ks-digital-designsystem-angular-suggestion.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n viewChild,\n} from '@angular/core'\n\n@Component({\n selector: 'ksd-suggestion-list-empty',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n})\nexport class SuggestionListEmpty {\n /**\n * Hack to get the content from parent component so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core'\n\n@Component({\n selector: 'ksd-suggestion-list-option',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n imports: [],\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n})\nexport class SuggestionListOption {\n /**\n * Hack to get the content from parent component so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n\n value = input.required<string>()\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n} from '@angular/core'\nimport { SuggestionListEmpty } from './suggestion-list-empty'\nimport { SuggestionListOption } from './suggestion-list-option'\n\n@Component({\n selector: 'ksd-suggestion-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n imports: [NgTemplateOutlet],\n host: {\n style: 'display: contents;',\n },\n template: `\n <u-datalist\n data-nofilter\n [attr.data-sr-singular]=\"singular()\"\n [attr.data-sr-plural]=\"plural()\"\n >\n @for (option of options(); track option) {\n <u-option [value]=\"option.value()\">\n <ng-container *ngTemplateOutlet=\"option.templateRef()\" />\n </u-option>\n }\n @if (empty()?.templateRef()) {\n <u-option data-empty value=\"\" hidden>\n <ng-container *ngTemplateOutlet=\"empty()?.templateRef()\" />\n </u-option>\n }\n </u-datalist>\n `,\n})\nexport class SuggestionList {\n /**\n * Screen reader announcement template for singular result count.\n *\n * @default '%d forslag'\n */\n readonly singular = input('%d forslag')\n\n /**\n * Screen reader announcement template for plural result count.\n *\n * @default '%d forslag'\n */\n readonly plural = input('%d forslag')\n\n readonly options = contentChildren(SuggestionListOption, {\n descendants: true,\n })\n\n protected readonly empty = contentChild(SuggestionListEmpty)\n}\n","import type { SuggestionItem, SuggestionModelValue } from './suggestion.types'\n\nexport const sanitizeItems = (\n values: SuggestionModelValue,\n): SuggestionItem[] =>\n !values ? [] : Array.isArray(values) ? values : [values]\n\nconst toItem = (data: HTMLDataElement): SuggestionItem => ({\n label: data.textContent?.trim() || data.value,\n value: data.value,\n})\n\nexport const nextSelected = (\n data: HTMLDataElement,\n previous: SuggestionModelValue,\n multiple: boolean,\n): SuggestionItem | SuggestionItem[] | undefined => {\n const item = toItem(data)\n\n if (!multiple) {\n return data.isConnected ? undefined : item\n }\n\n const prevItems = sanitizeItems(previous)\n return data.isConnected\n ? prevItems.filter(({ value }) => value !== item.value)\n : [...prevItems, item]\n}\n","import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n input,\n model,\n viewChild,\n} from '@angular/core'\nimport '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { SuggestionList } from './suggestion-list'\nimport type {\n SuggestionFilter,\n SuggestionFilterArgs,\n SuggestionItem,\n} from './suggestion.types'\nimport { nextSelected, sanitizeItems } from './suggestion.utils'\n\nconst defaultFilter = ({ label, input }: SuggestionFilterArgs) =>\n label.toLowerCase().includes(input.value.trim().toLowerCase())\n\n@Component({\n selector: 'ksd-suggestion',\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 schemas: [CUSTOM_ELEMENTS_SCHEMA],\n host: {},\n template: `\n <ds-suggestion\n #suggestionElement\n class=\"ds-suggestion\"\n [attr.data-multiple]=\"multiple() || undefined\"\n [attr.data-creatable]=\"creatable() || undefined\"\n (comboboxbeforeselect)=\"onSelect($event)\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n >\n @for (option of selectedArray(); track option.value) {\n <data [attr.value]=\"option.value\">{{ option.label }}</data>\n }\n <ng-content />\n </ds-suggestion>\n `,\n})\nexport class Suggestion {\n /**\n * Allows the user to select multiple items\n *\n * @default false\n */\n multiple = input(false, { transform: booleanAttribute })\n\n /**\n * Allows the user to create new items\n *\n * @default false\n */\n creatable = input(false, { transform: booleanAttribute })\n\n /**\n * Filter options; boolean or a custom callback.\n *\n * @default true\n */\n filter = input<boolean | SuggestionFilter>(true)\n\n /**\n * Model for the selected item(s).\n *\n * @default undefined\n */\n selected = model<SuggestionItem | SuggestionItem[] | undefined>(undefined)\n\n protected selectedArray = computed(() => sanitizeItems(this.selected()))\n private readonly suggestionElement =\n viewChild<ElementRef<HTMLElement>>('suggestionElement')\n private readonly suggestionList = contentChild(SuggestionList)\n\n constructor() {\n afterNextRender(() => this.syncOptions(null))\n\n effect(() => {\n this.suggestionList()?.options()\n queueMicrotask(() => this.syncOptions(null))\n })\n }\n\n protected onSelect(event: Event) {\n const customEvent = event as CustomEvent<HTMLDataElement | undefined>\n customEvent.preventDefault()\n\n const data = customEvent.detail\n if (!data) return\n\n this.selected.set(nextSelected(data, this.selected(), this.multiple()))\n }\n\n protected onKeyDown(event: Event) {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key !== 'Escape') return\n\n event.preventDefault()\n }\n\n protected onInput(event: Event) {\n const inputElement = event.target as HTMLInputElement | null\n setTimeout(() => this.syncOptions(inputElement))\n }\n\n private syncOptions(inputElement: HTMLInputElement | null) {\n const suggestionElement = this.suggestionElement()?.nativeElement\n if (!suggestionElement) return\n\n const input =\n inputElement ?? suggestionElement.querySelector<HTMLInputElement>('input')\n\n const options = Array.from(\n suggestionElement.querySelectorAll<HTMLOptionElement>(\n 'u-option:not([data-empty])',\n ),\n )\n\n const filter = this.filter()\n const filterFn = filter === true ? defaultFilter : filter\n\n if (filterFn && input) {\n let index = 0\n for (const option of options) {\n option.disabled = !filterFn({\n index,\n input,\n label: option.label,\n optionElement: option,\n text: option.text,\n value: option.value,\n })\n index++\n }\n } else {\n for (const option of options) {\n option.disabled = false\n }\n }\n\n const visibleOptions = options.filter(\n (option) => !option.disabled && !option.hidden,\n )\n const emptyOption = suggestionElement.querySelector<HTMLOptionElement>(\n 'u-option[data-empty]',\n )\n\n if (!emptyOption) return\n\n if (visibleOptions.length === 0) {\n emptyOption.removeAttribute('hidden')\n return\n }\n\n emptyOption.setAttribute('hidden', '')\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAYa,mBAAmB,CAAA;AAC9B;;;AAGG;AACH,IAAA,WAAW,GAAG,SAAS,CAAuB,KAAK,uDAAC;uGALzC,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,yMAFpB,CAAA,gDAAA,CAAkD,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEjD,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE,CAAA,gDAAA,CAAkD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,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,mBAAmB,+FACT,cAAc,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC9F/D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-suggestion.mjs","sources":["../../../../packages/angular/suggestion/src/suggestion-list-empty.ts","../../../../packages/angular/suggestion/src/suggestion-list-option.ts","../../../../packages/angular/suggestion/src/suggestion-list.ts","../../../../packages/angular/suggestion/src/suggestion.utils.ts","../../../../packages/angular/suggestion/src/suggestion.ts","../../../../packages/angular/suggestion/src/ks-digital-designsystem-angular-suggestion.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n viewChild,\n} from '@angular/core'\n\n@Component({\n selector: 'ksd-suggestion-list-empty',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n})\nexport class SuggestionListEmpty {\n /**\n * Hack to get the content from parent component so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core'\n\n@Component({\n selector: 'ksd-suggestion-list-option',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n imports: [],\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n})\nexport class SuggestionListOption {\n /**\n * Hack to get the content from parent component so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n\n value = input.required<string>()\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n} from '@angular/core'\nimport { SuggestionListEmpty } from './suggestion-list-empty'\nimport { SuggestionListOption } from './suggestion-list-option'\n\n@Component({\n selector: 'ksd-suggestion-list',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n imports: [NgTemplateOutlet],\n host: {\n style: 'display: contents;',\n },\n template: `\n <u-datalist\n data-nofilter\n [attr.data-sr-singular]=\"singular()\"\n [attr.data-sr-plural]=\"plural()\"\n >\n @for (option of options(); track option) {\n <u-option [value]=\"option.value()\">\n <ng-container *ngTemplateOutlet=\"option.templateRef()\" />\n </u-option>\n }\n @if (empty()?.templateRef()) {\n <u-option data-empty value=\"\" hidden>\n <ng-container *ngTemplateOutlet=\"empty()?.templateRef()\" />\n </u-option>\n }\n </u-datalist>\n `,\n})\nexport class SuggestionList {\n /**\n * Screen reader announcement template for singular result count.\n *\n * @default '%d forslag'\n */\n readonly singular = input('%d forslag')\n\n /**\n * Screen reader announcement template for plural result count.\n *\n * @default '%d forslag'\n */\n readonly plural = input('%d forslag')\n\n readonly options = contentChildren(SuggestionListOption, {\n descendants: true,\n })\n\n protected readonly empty = contentChild(SuggestionListEmpty)\n}\n","import type { SuggestionItem, SuggestionModelValue } from './suggestion.types'\n\nexport const sanitizeItems = (\n values: SuggestionModelValue,\n): SuggestionItem[] =>\n !values ? [] : Array.isArray(values) ? values : [values]\n\nconst toItem = (data: HTMLDataElement): SuggestionItem => ({\n label: data.textContent?.trim() || data.value,\n value: data.value,\n})\n\nexport const nextSelected = (\n data: HTMLDataElement,\n previous: SuggestionModelValue,\n multiple: boolean,\n): SuggestionItem | SuggestionItem[] | undefined => {\n const item = toItem(data)\n\n if (!multiple) {\n return data.isConnected ? undefined : item\n }\n\n const prevItems = sanitizeItems(previous)\n return data.isConnected\n ? prevItems.filter(({ value }) => value !== item.value)\n : [...prevItems, item]\n}\n","import {\n afterNextRender,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n input,\n model,\n viewChild,\n} from '@angular/core'\nimport '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { SuggestionList } from './suggestion-list'\nimport type {\n SuggestionFilter,\n SuggestionFilterArgs,\n SuggestionItem,\n} from './suggestion.types'\nimport { nextSelected, sanitizeItems } from './suggestion.utils'\n\nconst defaultFilter = ({ label, input }: SuggestionFilterArgs) =>\n label.toLowerCase().includes(input.value.trim().toLowerCase())\n\n@Component({\n selector: 'ksd-suggestion',\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 schemas: [CUSTOM_ELEMENTS_SCHEMA],\n host: {},\n template: `\n <ds-suggestion\n #suggestionElement\n class=\"ds-suggestion\"\n [attr.data-multiple]=\"multiple() || undefined\"\n [attr.data-creatable]=\"creatable() || undefined\"\n (comboboxbeforeselect)=\"onSelect($event)\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n >\n @for (option of selectedArray(); track option.value) {\n <data [attr.value]=\"option.value\">{{ option.label }}</data>\n }\n <ng-content />\n </ds-suggestion>\n `,\n})\nexport class Suggestion {\n /**\n * Allows the user to select multiple items\n *\n * @default false\n */\n multiple = input(false, { transform: booleanAttribute })\n\n /**\n * Allows the user to create new items\n *\n * @default false\n */\n creatable = input(false, { transform: booleanAttribute })\n\n /**\n * Filter options; boolean or a custom callback.\n *\n * @default true\n */\n filter = input<boolean | SuggestionFilter>(true)\n\n /**\n * Model for the selected item(s).\n *\n * @default undefined\n */\n selected = model<SuggestionItem | SuggestionItem[] | undefined>(undefined)\n\n protected selectedArray = computed(() => sanitizeItems(this.selected()))\n private readonly suggestionElement =\n viewChild<ElementRef<HTMLElement>>('suggestionElement')\n private readonly suggestionList = contentChild(SuggestionList)\n\n constructor() {\n afterNextRender(() => this.syncOptions(null))\n\n effect(() => {\n this.suggestionList()?.options()\n queueMicrotask(() => this.syncOptions(null))\n })\n }\n\n protected onSelect(event: Event) {\n const customEvent = event as CustomEvent<HTMLDataElement | undefined>\n customEvent.preventDefault()\n\n const data = customEvent.detail\n if (!data) return\n\n this.selected.set(nextSelected(data, this.selected(), this.multiple()))\n }\n\n protected onKeyDown(event: Event) {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key !== 'Escape') return\n\n event.preventDefault()\n }\n\n protected onInput(event: Event) {\n const inputElement = event.target as HTMLInputElement | null\n setTimeout(() => this.syncOptions(inputElement))\n }\n\n private syncOptions(inputElement: HTMLInputElement | null) {\n const suggestionElement = this.suggestionElement()?.nativeElement\n if (!suggestionElement) return\n\n const input =\n inputElement ?? suggestionElement.querySelector<HTMLInputElement>('input')\n\n const options = Array.from(\n suggestionElement.querySelectorAll<HTMLOptionElement>(\n 'u-option:not([data-empty])',\n ),\n )\n\n const filter = this.filter()\n const filterFn = filter === true ? defaultFilter : filter\n\n if (filterFn && input) {\n let index = 0\n for (const option of options) {\n option.disabled = !filterFn({\n index,\n input,\n label: option.label,\n optionElement: option,\n text: option.text,\n value: option.value,\n })\n index++\n }\n } else {\n for (const option of options) {\n option.disabled = false\n }\n }\n\n const visibleOptions = options.filter(\n (option) => !option.disabled && !option.hidden,\n )\n const emptyOption = suggestionElement.querySelector<HTMLOptionElement>(\n 'u-option[data-empty]',\n )\n\n if (!emptyOption) return\n\n if (visibleOptions.length === 0) {\n emptyOption.removeAttribute('hidden')\n return\n }\n\n emptyOption.setAttribute('hidden', '')\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAYa,mBAAmB,CAAA;AAC9B;;;AAGG;AACH,IAAA,WAAW,GAAG,SAAS,CAAuB,KAAK,kFAAC;uGALzC,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,yMAFpB,CAAA,gDAAA,CAAkD,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAEjD,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,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AAA,EAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,mBAAmB,+FACT,cAAc,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC9F/D;;AAEG;;;;"}
|
|
@@ -7,30 +7,30 @@ class Table {
|
|
|
7
7
|
* Will give the table a hover effect on rows
|
|
8
8
|
* @default false
|
|
9
9
|
*/
|
|
10
|
-
hover = input(false, { ...(ngDevMode ? { debugName: "hover" } : {}), alias: 'data-hover',
|
|
10
|
+
hover = input(false, { ...(ngDevMode ? { debugName: "hover" } : /* istanbul ignore next */ {}), alias: 'data-hover',
|
|
11
11
|
transform: booleanAttribute });
|
|
12
12
|
/**
|
|
13
13
|
* Will give the table a rounded border
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
|
-
border = input(false, { ...(ngDevMode ? { debugName: "border" } : {}), alias: 'data-border',
|
|
16
|
+
border = input(false, { ...(ngDevMode ? { debugName: "border" } : /* istanbul ignore next */ {}), alias: 'data-border',
|
|
17
17
|
transform: booleanAttribute });
|
|
18
18
|
/**
|
|
19
19
|
* Will make the table header sticky
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
|
-
stickyHeader = input(false, { ...(ngDevMode ? { debugName: "stickyHeader" } : {}), alias: 'data-sticky-header',
|
|
22
|
+
stickyHeader = input(false, { ...(ngDevMode ? { debugName: "stickyHeader" } : /* istanbul ignore next */ {}), alias: 'data-sticky-header',
|
|
23
23
|
transform: booleanAttribute });
|
|
24
24
|
/**
|
|
25
25
|
* Will give the table zebra striping
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
|
-
zebra = input(false, { ...(ngDevMode ? { debugName: "zebra" } : {}), alias: 'data-zebra',
|
|
28
|
+
zebra = input(false, { ...(ngDevMode ? { debugName: "zebra" } : /* istanbul ignore next */ {}), alias: 'data-zebra',
|
|
29
29
|
transform: booleanAttribute });
|
|
30
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: Table, isStandalone: true, selector: "table[ksd-table]", inputs: { hover: { classPropertyName: "hover", publicName: "data-hover", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "data-border", isSignal: true, isRequired: false, transformFunction: null }, stickyHeader: { classPropertyName: "stickyHeader", publicName: "data-sticky-header", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "data-zebra", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-hover": "hover() || undefined", "attr.data-border": "border() || undefined", "attr.data-sticky-header": "stickyHeader() || undefined", "attr.data-zebra": "zebra() || undefined" }, classAttribute: "ds-table" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Table, decorators: [{
|
|
34
34
|
type: Component,
|
|
35
35
|
args: [{
|
|
36
36
|
selector: 'table[ksd-table]',
|
|
@@ -51,14 +51,14 @@ class TableHeaderCell {
|
|
|
51
51
|
* If 'none' | 'ascending' | 'descending' will add a button to the header cell and change aria-sort and icon
|
|
52
52
|
* @default undefined
|
|
53
53
|
*/
|
|
54
|
-
sort = input(undefined, { ...(ngDevMode ? { debugName: "sort" } : {}), alias: 'aria-sort' });
|
|
54
|
+
sort = input(undefined, { ...(ngDevMode ? { debugName: "sort" } : /* istanbul ignore next */ {}), alias: 'aria-sort' });
|
|
55
55
|
/**
|
|
56
56
|
* Emitted when the sort button is clicked
|
|
57
57
|
* @emits void
|
|
58
58
|
*/
|
|
59
59
|
sortChange = output();
|
|
60
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
61
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableHeaderCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableHeaderCell, isStandalone: true, selector: "th[ksd-header-cell]", inputs: { sort: { classPropertyName: "sort", publicName: "aria-sort", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortChange: "sortChange" }, host: { properties: { "attr.aria-sort": "sort()" } }, ngImport: i0, template: `
|
|
62
62
|
@if (sort()) {
|
|
63
63
|
<button
|
|
64
64
|
type="button"
|
|
@@ -75,7 +75,7 @@ class TableHeaderCell {
|
|
|
75
75
|
</ng-template>
|
|
76
76
|
`, isInline: true, styles: ["button{padding:var(--dsc-table-padding)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableHeaderCell, decorators: [{
|
|
79
79
|
type: Component,
|
|
80
80
|
args: [{ selector: 'th[ksd-header-cell]', changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
81
81
|
@if (sort()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-table.mjs","sources":["../../../../packages/angular/table/src/table.ts","../../../../packages/angular/table/src/table-header-cell.ts","../../../../packages/angular/table/src/ks-digital-designsystem-angular-table.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\n\n@Component({\n selector: 'table[ksd-table]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />`,\n host: {\n class: 'ds-table',\n '[attr.data-hover]': 'hover() || undefined',\n '[attr.data-border]': 'border() || undefined',\n '[attr.data-sticky-header]': 'stickyHeader() || undefined',\n '[attr.data-zebra]': 'zebra() || undefined',\n },\n})\nexport class Table {\n /**\n * Will give the table a hover effect on rows\n * @default false\n */\n readonly hover = input(false, {\n alias: 'data-hover',\n transform: booleanAttribute,\n })\n /**\n * Will give the table a rounded border\n * @default false\n */\n readonly border = input(false, {\n alias: 'data-border',\n transform: booleanAttribute,\n })\n /**\n * Will make the table header sticky\n * @default false\n */\n readonly stickyHeader = input(false, {\n alias: 'data-sticky-header',\n transform: booleanAttribute,\n })\n /**\n * Will give the table zebra striping\n * @default false\n */\n readonly zebra = input(false, {\n alias: 'data-zebra',\n transform: booleanAttribute,\n })\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core'\n@Component({\n selector: 'th[ksd-header-cell]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (sort()) {\n <button\n type=\"button\"\n (click)=\"sortChange.emit(); $event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"headerTitle\"></ng-container>\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"headerTitle\"></ng-container>\n }\n\n <ng-template #headerTitle>\n <ng-content />\n </ng-template>\n `,\n imports: [NgTemplateOutlet],\n host: {\n '[attr.aria-sort]': 'sort()',\n },\n styles: `\n button {\n padding: var(--dsc-table-padding);\n }\n `,\n})\nexport class TableHeaderCell {\n /**\n * If 'none' | 'ascending' | 'descending' will add a button to the header cell and change aria-sort and icon\n * @default undefined\n */\n readonly sort = input<'none' | 'ascending' | 'descending'>(undefined, {\n alias: 'aria-sort',\n })\n /**\n * Emitted when the sort button is clicked\n * @emits void\n */\n readonly sortChange = output()\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,KAAK,CAAA;AAChB;;;AAGG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-table.mjs","sources":["../../../../packages/angular/table/src/table.ts","../../../../packages/angular/table/src/table-header-cell.ts","../../../../packages/angular/table/src/ks-digital-designsystem-angular-table.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n input,\n} from '@angular/core'\n\n@Component({\n selector: 'table[ksd-table]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `<ng-content />`,\n host: {\n class: 'ds-table',\n '[attr.data-hover]': 'hover() || undefined',\n '[attr.data-border]': 'border() || undefined',\n '[attr.data-sticky-header]': 'stickyHeader() || undefined',\n '[attr.data-zebra]': 'zebra() || undefined',\n },\n})\nexport class Table {\n /**\n * Will give the table a hover effect on rows\n * @default false\n */\n readonly hover = input(false, {\n alias: 'data-hover',\n transform: booleanAttribute,\n })\n /**\n * Will give the table a rounded border\n * @default false\n */\n readonly border = input(false, {\n alias: 'data-border',\n transform: booleanAttribute,\n })\n /**\n * Will make the table header sticky\n * @default false\n */\n readonly stickyHeader = input(false, {\n alias: 'data-sticky-header',\n transform: booleanAttribute,\n })\n /**\n * Will give the table zebra striping\n * @default false\n */\n readonly zebra = input(false, {\n alias: 'data-zebra',\n transform: booleanAttribute,\n })\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n input,\n output,\n} from '@angular/core'\n@Component({\n selector: 'th[ksd-header-cell]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (sort()) {\n <button\n type=\"button\"\n (click)=\"sortChange.emit(); $event.stopPropagation()\"\n >\n <ng-container *ngTemplateOutlet=\"headerTitle\"></ng-container>\n </button>\n } @else {\n <ng-container *ngTemplateOutlet=\"headerTitle\"></ng-container>\n }\n\n <ng-template #headerTitle>\n <ng-content />\n </ng-template>\n `,\n imports: [NgTemplateOutlet],\n host: {\n '[attr.aria-sort]': 'sort()',\n },\n styles: `\n button {\n padding: var(--dsc-table-padding);\n }\n `,\n})\nexport class TableHeaderCell {\n /**\n * If 'none' | 'ascending' | 'descending' will add a button to the header cell and change aria-sort and icon\n * @default undefined\n */\n readonly sort = input<'none' | 'ascending' | 'descending'>(undefined, {\n alias: 'aria-sort',\n })\n /**\n * Emitted when the sort button is clicked\n * @emits void\n */\n readonly sortChange = output()\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,KAAK,CAAA;AAChB;;;AAGG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAC1B,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACF;;;AAGG;AACM,IAAA,MAAM,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,CAAA,EAC3B,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACF;;;AAGG;AACM,IAAA,YAAY,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,cAAA,EAAA,8BAAA,EAAA,CAAA,EACjC,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,gBAAgB,EAAA,CAC3B;AACF;;;AAGG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAC1B,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,gBAAgB,EAAA,CAC3B;uGAhCS,KAAK,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAL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EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA1BhB;;;;;;;;;;;;;;;AAeT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,4CAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACS,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAUf,eAAe,EAAA,UAAA,EAAA,CAAA;kBA7B3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,eAAA,EACd,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;;;;;;;;;GAeT,EAAA,OAAA,EACQ,CAAC,gBAAgB,CAAC,EAAA,IAAA,EACrB;AACJ,wBAAA,kBAAkB,EAAE,QAAQ;AAC7B,qBAAA,EAAA,MAAA,EAAA,CAAA,4CAAA,CAAA,EAAA;;;AC7BH;;AAEG;;;;"}
|
|
@@ -13,7 +13,7 @@ class TabsTab {
|
|
|
13
13
|
*
|
|
14
14
|
* If omitted, `tabClicked` emits `tabId: undefined`.
|
|
15
15
|
*/
|
|
16
|
-
tabId = input(...(ngDevMode ? [undefined, { debugName: "tabId" }] : []));
|
|
16
|
+
tabId = input(...(ngDevMode ? [undefined, { debugName: "tabId" }] : /* istanbul ignore next */ []));
|
|
17
17
|
/**
|
|
18
18
|
* Emits tab click details when this tab is clicked.
|
|
19
19
|
*/
|
|
@@ -22,15 +22,15 @@ class TabsTab {
|
|
|
22
22
|
* Hack to get the content of the tab from outside so that we can
|
|
23
23
|
* keep the dom structure needed without additional host elements
|
|
24
24
|
*/
|
|
25
|
-
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : []));
|
|
25
|
+
templateRef = viewChild('tpl', ...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
26
26
|
/* Exposed function so Tabs can emit tab click events */
|
|
27
27
|
emitTabClicked(event) {
|
|
28
28
|
this.tabClicked.emit(event);
|
|
29
29
|
}
|
|
30
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: TabsTab, isStandalone: true, selector: "ksd-tabs-tab", inputs: { tabId: { classPropertyName: "tabId", publicName: "tabId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tabClicked: "tabClicked" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["tpl"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: ` <ng-template #tpl><ng-content /></ng-template> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsTab, decorators: [{
|
|
34
34
|
type: Component,
|
|
35
35
|
args: [{
|
|
36
36
|
selector: `ksd-tabs-tab`,
|
|
@@ -56,7 +56,7 @@ class Tabs {
|
|
|
56
56
|
* Emits tab click details when any tab is clicked.
|
|
57
57
|
*/
|
|
58
58
|
tabClicked = output();
|
|
59
|
-
tabs = contentChildren(TabsTab, { ...(ngDevMode ? { debugName: "tabs" } : {}), descendants: true });
|
|
59
|
+
tabs = contentChildren(TabsTab, { ...(ngDevMode ? { debugName: "tabs" } : /* istanbul ignore next */ {}), descendants: true });
|
|
60
60
|
onTabClick(index, tab) {
|
|
61
61
|
const event = {
|
|
62
62
|
index,
|
|
@@ -65,8 +65,8 @@ class Tabs {
|
|
|
65
65
|
this.tabClicked.emit(event);
|
|
66
66
|
tab.emitTabClicked(event);
|
|
67
67
|
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
69
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Tabs, isStandalone: true, selector: "ksd-tabs", outputs: { tabClicked: "tabClicked" }, queries: [{ propertyName: "tabs", predicate: TabsTab, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.HostSize, inputs: ["data-size", "data-size"] }, { directive: i1.HostColor, inputs: ["data-color", "data-color"] }], ngImport: i0, template: `
|
|
70
70
|
<ds-tabs class="ds-tabs">
|
|
71
71
|
<ds-tablist>
|
|
72
72
|
@for (tab of tabs(); track tab; let index = $index) {
|
|
@@ -79,7 +79,7 @@ class Tabs {
|
|
|
79
79
|
</ds-tabs>
|
|
80
80
|
`, isInline: true, styles: [":host ::ng-deep :is(.ds-tabs [role=tab],.ds-tabs ds-tab,.ds-tabs u-tab)>:where(ng-icon,svg,img){font-size:1.25em;width:1em;height:1em}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Tabs, decorators: [{
|
|
83
83
|
type: Component,
|
|
84
84
|
args: [{ selector: `ksd-tabs`, imports: [NgTemplateOutlet], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: `
|
|
85
85
|
<ds-tabs class="ds-tabs">
|
|
@@ -105,10 +105,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
105
105
|
}], propDecorators: { tabClicked: [{ type: i0.Output, args: ["tabClicked"] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TabsTab), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
106
106
|
|
|
107
107
|
class TabsList {
|
|
108
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.
|
|
108
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
109
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: TabsList, isStandalone: true, selector: "ksd-tabs-list", ngImport: i0, template: `<ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
110
110
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsList, decorators: [{
|
|
112
112
|
type: Component,
|
|
113
113
|
args: [{
|
|
114
114
|
selector: `ksd-tabs-list`,
|
|
@@ -118,14 +118,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
118
118
|
}] });
|
|
119
119
|
|
|
120
120
|
class TabsPanel {
|
|
121
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
122
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: TabsPanel, isStandalone: true, selector: "ksd-tabs-panel", ngImport: i0, template: `
|
|
123
123
|
<ds-tabpanel>
|
|
124
124
|
<ng-content />
|
|
125
125
|
</ds-tabpanel>
|
|
126
126
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TabsPanel, decorators: [{
|
|
129
129
|
type: Component,
|
|
130
130
|
args: [{
|
|
131
131
|
selector: `ksd-tabs-panel`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks-digital-designsystem-angular-tabs.mjs","sources":["../../../../packages/angular/tabs/src/tabs-tab.ts","../../../../packages/angular/tabs/src/tabs.ts","../../../../packages/angular/tabs/src/tabs-list.ts","../../../../packages/angular/tabs/src/tabs-panel.ts","../../../../packages/angular/tabs/src/ks-digital-designsystem-angular-tabs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\n/**\n * Payload emitted from `tabClicked` on both `ksd-tabs` and `ksd-tabs-tab`.\n */\nexport interface TabClickEvent {\n /**\n * Zero-based index of the clicked tab in its current render order.\n */\n index: number\n\n /**\n * Consumer-provided stable tab identifier from `tabId`.\n *\n * `undefined` when `tabId` is not provided.\n */\n tabId: string | undefined\n}\n\n@Component({\n selector: `ksd-tabs-tab`,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n})\nexport class TabsTab {\n /**\n * Stable identifier for this tab.\n *\n * Recommended for logic such as analytics, routing and persisted state.\n *\n * If omitted, `tabClicked` emits `tabId: undefined`.\n */\n readonly tabId = input<string>()\n\n /**\n * Emits tab click details when this tab is clicked.\n */\n readonly tabClicked = output<TabClickEvent>()\n\n /**\n * Hack to get the content of the tab from outside so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n\n /* Exposed function so Tabs can emit tab click events */\n emitTabClicked(event: TabClickEvent) {\n this.tabClicked.emit(event)\n }\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n output,\n} from '@angular/core'\nimport '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { TabClickEvent, TabsTab } from './tabs-tab'\n\n@Component({\n selector: `ksd-tabs`,\n imports: [NgTemplateOutlet],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ds-tabs class=\"ds-tabs\">\n <ds-tablist>\n @for (tab of tabs(); track tab; let index = $index) {\n <ds-tab (click)=\"onTabClick(index, tab)\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef()\" />\n </ds-tab>\n }\n </ds-tablist>\n <ng-content select=\"ksd-tabs-panel\" />\n </ds-tabs>\n `,\n styles: `\n :host\n ::ng-deep\n :is(.ds-tabs [role='tab'], .ds-tabs ds-tab, .ds-tabs u-tab)\n > :where(ng-icon, svg, img) {\n font-size: calc(1em * 1.25);\n width: 1em;\n height: 1em;\n }\n `,\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})\nexport class Tabs {\n /**\n * Emits tab click details when any tab is clicked.\n */\n readonly tabClicked = output<TabClickEvent>()\n\n readonly tabs = contentChildren(TabsTab, { descendants: true })\n\n protected onTabClick(index: number, tab: TabsTab) {\n const event: TabClickEvent = {\n index,\n tabId: tab.tabId(),\n }\n\n this.tabClicked.emit(event)\n tab.emitTabClicked(event)\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: `ksd-tabs-list`,\n template: `<ng-content /> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsList {}\n","import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n} from '@angular/core'\n\n@Component({\n selector: `ksd-tabs-panel`,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ds-tabpanel>\n <ng-content />\n </ds-tabpanel>\n `,\n host: {},\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsPanel {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAgDa,OAAO,CAAA;AAClB;;;;;;AAMG;IACM,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ks-digital-designsystem-angular-tabs.mjs","sources":["../../../../packages/angular/tabs/src/tabs-tab.ts","../../../../packages/angular/tabs/src/tabs.ts","../../../../packages/angular/tabs/src/tabs-list.ts","../../../../packages/angular/tabs/src/tabs-panel.ts","../../../../packages/angular/tabs/src/ks-digital-designsystem-angular-tabs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n input,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\n\n/**\n * Payload emitted from `tabClicked` on both `ksd-tabs` and `ksd-tabs-tab`.\n */\nexport interface TabClickEvent {\n /**\n * Zero-based index of the clicked tab in its current render order.\n */\n index: number\n\n /**\n * Consumer-provided stable tab identifier from `tabId`.\n *\n * `undefined` when `tabId` is not provided.\n */\n tabId: string | undefined\n}\n\n@Component({\n selector: `ksd-tabs-tab`,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: ` <ng-template #tpl><ng-content /></ng-template> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n hostDirectives: [\n {\n directive: HostSize,\n inputs: ['data-size'],\n },\n {\n directive: HostColor,\n inputs: ['data-color'],\n },\n ],\n})\nexport class TabsTab {\n /**\n * Stable identifier for this tab.\n *\n * Recommended for logic such as analytics, routing and persisted state.\n *\n * If omitted, `tabClicked` emits `tabId: undefined`.\n */\n readonly tabId = input<string>()\n\n /**\n * Emits tab click details when this tab is clicked.\n */\n readonly tabClicked = output<TabClickEvent>()\n\n /**\n * Hack to get the content of the tab from outside so that we can\n * keep the dom structure needed without additional host elements\n */\n templateRef = viewChild<TemplateRef<unknown>>('tpl')\n\n /* Exposed function so Tabs can emit tab click events */\n emitTabClicked(event: TabClickEvent) {\n this.tabClicked.emit(event)\n }\n}\n","import { NgTemplateOutlet } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n output,\n} from '@angular/core'\nimport '@digdir/designsystemet-web'\nimport {\n HostColor,\n HostSize,\n} from '@ks-digital/designsystem-angular/__internals'\nimport { TabClickEvent, TabsTab } from './tabs-tab'\n\n@Component({\n selector: `ksd-tabs`,\n imports: [NgTemplateOutlet],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ds-tabs class=\"ds-tabs\">\n <ds-tablist>\n @for (tab of tabs(); track tab; let index = $index) {\n <ds-tab (click)=\"onTabClick(index, tab)\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef()\" />\n </ds-tab>\n }\n </ds-tablist>\n <ng-content select=\"ksd-tabs-panel\" />\n </ds-tabs>\n `,\n styles: `\n :host\n ::ng-deep\n :is(.ds-tabs [role='tab'], .ds-tabs ds-tab, .ds-tabs u-tab)\n > :where(ng-icon, svg, img) {\n font-size: calc(1em * 1.25);\n width: 1em;\n height: 1em;\n }\n `,\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})\nexport class Tabs {\n /**\n * Emits tab click details when any tab is clicked.\n */\n readonly tabClicked = output<TabClickEvent>()\n\n readonly tabs = contentChildren(TabsTab, { descendants: true })\n\n protected onTabClick(index: number, tab: TabsTab) {\n const event: TabClickEvent = {\n index,\n tabId: tab.tabId(),\n }\n\n this.tabClicked.emit(event)\n tab.emitTabClicked(event)\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core'\n\n@Component({\n selector: `ksd-tabs-list`,\n template: `<ng-content /> `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsList {}\n","import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n} from '@angular/core'\n\n@Component({\n selector: `ksd-tabs-panel`,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <ds-tabpanel>\n <ng-content />\n </ds-tabpanel>\n `,\n host: {},\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabsPanel {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAgDa,OAAO,CAAA;AAClB;;;;;;AAMG;IACM,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAEhC;;AAEG;IACM,UAAU,GAAG,MAAM,EAAiB;AAE7C;;;AAGG;AACH,IAAA,WAAW,GAAG,SAAS,CAAuB,KAAK,kFAAC;;AAGpD,IAAA,cAAc,CAAC,KAAoB,EAAA;AACjC,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7B;uGAxBW,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,4fAdR,CAAA,gDAAA,CAAkD,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAcjD,OAAO,EAAA,UAAA,EAAA,CAAA;kBAjBnB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,CAAA,YAAA,CAAc;oBACxB,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE,CAAA,gDAAA,CAAkD;oBAC5D,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/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