@danske/sapphire-angular 3.5.0 → 3.6.0

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.
@@ -0,0 +1,3 @@
1
+ import { MessageDictionary } from '@internationalized/message';
2
+ declare const translations: MessageDictionary;
3
+ export default translations;
@@ -1,4 +1,4 @@
1
- import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, DoCheck, EventEmitter } from '@angular/core';
1
+ import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, DoCheck, EventEmitter, TemplateRef } from '@angular/core';
2
2
  import { ListboxValueChangeEvent } from '@angular/cdk/listbox';
3
3
  import { OptionComponent } from './option.component';
4
4
  import { ControlValueAccessor } from '@angular/forms';
@@ -6,9 +6,11 @@ import { BooleanInput } from '@angular/cdk/coercion';
6
6
  import { ListboxChild } from './listbox-child';
7
7
  import { SectionDirective } from './section.directive';
8
8
  import { ListboxInputDirective } from './listbox-input.directive';
9
+ import { TranslateService } from '../../common/translate.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class ListboxComponent implements ControlValueAccessor, AfterViewInit, AfterViewChecked, DoCheck {
11
12
  private changeDetectorRef;
13
+ private t;
12
14
  /**
13
15
  * The list of selected values (`value`s of selected sp-options).
14
16
  * It's always an array, regardless of {@property multiple} being true or not.
@@ -37,6 +39,12 @@ export declare class ListboxComponent implements ControlValueAccessor, AfterView
37
39
  ariaLabel: string;
38
40
  ariaLabelledBy?: string;
39
41
  id?: string;
42
+ /**
43
+ * Used to provide custom empty state content.
44
+ * When not provided, the default "No results" (in given language) message is shown.
45
+ * Passing `null` will hide the empty state message.
46
+ */
47
+ emptyState?: TemplateRef<unknown> | string | null;
40
48
  /**
41
49
  * Emits whenever an option is selected, regardless of if it's already selected.
42
50
  */
@@ -49,6 +57,7 @@ export declare class ListboxComponent implements ControlValueAccessor, AfterView
49
57
  * or passed as input.
50
58
  */
51
59
  get options(): Iterable<ListboxChild>;
60
+ get isEmpty(): boolean;
52
61
  private cdkListbox?;
53
62
  private cdkOptions?;
54
63
  private connectedInput?;
@@ -69,7 +78,7 @@ export declare class ListboxComponent implements ControlValueAccessor, AfterView
69
78
  * option.
70
79
  */
71
80
  _forceEnableNavigationWrap: boolean;
72
- constructor(changeDetectorRef: ChangeDetectorRef);
81
+ constructor(changeDetectorRef: ChangeDetectorRef, t: TranslateService);
73
82
  /**
74
83
  * Connects the listbox to an input, for combobox-like use cases.
75
84
  * Returns a keydown event handler to be used on the connected input.
@@ -121,6 +130,9 @@ export declare class ListboxComponent implements ControlValueAccessor, AfterView
121
130
  * @private
122
131
  */
123
132
  _isConnectedToInput(): boolean;
133
+ _isString(input: unknown): boolean;
134
+ _getEmptyState(): string | TemplateRef<unknown> | null;
135
+ _getEmptyStateTemplate(): TemplateRef<unknown> | null;
124
136
  static ɵfac: i0.ɵɵFactoryDeclaration<ListboxComponent, never>;
125
- static ɵcmp: i0.ɵɵComponentDeclaration<ListboxComponent, "sp-listbox", ["spListbox"], { "selectedValues": "selectedValues"; "_itemsInput": "spListboxItems"; "disabled": "disabled"; "multiple": "multiple"; "navigationWrapDisabled": "navigationWrapDisabled"; "ariaLabel": "aria-label"; "ariaLabelledBy": "aria-labelledby"; "id": "id"; }, { "selectedValuesChange": "selectedValuesChange"; "selected": "selected"; }, ["itemsInContent"], never, false, never>;
137
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListboxComponent, "sp-listbox", ["spListbox"], { "selectedValues": "selectedValues"; "_itemsInput": "spListboxItems"; "disabled": "disabled"; "multiple": "multiple"; "navigationWrapDisabled": "navigationWrapDisabled"; "ariaLabel": "aria-label"; "ariaLabelledBy": "aria-labelledby"; "id": "id"; "emptyState": "emptyState"; }, { "selectedValuesChange": "selectedValuesChange"; "selected": "selected"; }, ["itemsInContent"], never, false, never>;
126
138
  }
@@ -47,6 +47,12 @@ export declare abstract class SelectComponentBase implements ControlValueAccesso
47
47
  ariaLabel: string | null;
48
48
  ariaLabelledby?: string | null;
49
49
  selectionText?: SelectionTextDirective;
50
+ /**
51
+ * Used to provide custom empty state content.
52
+ * When not provided, the default "No results" (in given language) message is shown.
53
+ * Passing `null` will hide the popover with the empty state message.
54
+ */
55
+ emptyState?: ListboxComponent['emptyState'];
50
56
  /**
51
57
  * Used to work around ExpressionChangedAfterItHasBeenCheckedError error thrown from HiddenSelect,
52
58
  * when the select component is rendered from a template (e.g. with *ngIf). It's set to true
@@ -107,5 +113,5 @@ export declare abstract class SelectComponentBase implements ControlValueAccesso
107
113
  protected getNextEnabledOptionValue(direction?: 'left' | 'right'): string | undefined;
108
114
  protected initKeyManager(): void;
109
115
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponentBase, never>;
110
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectComponentBase, never, never, { "disabled": "disabled"; "id": "id"; "name": "name"; "autocomplete": "autocomplete"; "placeholder": "placeholder"; "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; }, { "opened": "opened"; "closed": "closed"; "selected": "selected"; }, ["selectionText", "options", "listboxChildren"], never, false, never>;
116
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectComponentBase, never, never, { "disabled": "disabled"; "id": "id"; "name": "name"; "autocomplete": "autocomplete"; "placeholder": "placeholder"; "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; "emptyState": "emptyState"; }, { "opened": "opened"; "closed": "closed"; "selected": "selected"; }, ["selectionText", "options", "listboxChildren"], never, false, never>;
111
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danske/sapphire-angular",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "The Angular implementation of the Sapphire Design System from Danske Bank A/S",
6
6
  "module": "fesm2015/danske-sapphire-angular.mjs",
@@ -16,12 +16,12 @@
16
16
  "@danske/sapphire-icons": "^3.1.0"
17
17
  },
18
18
  "dependencies": {
19
- "@danske/sapphire-css": "^44.0.0",
19
+ "@danske/sapphire-css": "^45.0.0",
20
20
  "@internationalized/message": "^3.1.5",
21
21
  "dompurify": "^3.2.6",
22
22
  "tslib": "^2.3.0"
23
23
  },
24
- "gitHead": "8e444e6b304060b29ba5ba3485086b0eddae52e1",
24
+ "gitHead": "956d65c795c2bffc1e4cc153c7721e94c35827c9",
25
25
  "es2020": "fesm2020/danske-sapphire-angular.mjs",
26
26
  "esm2020": "esm2020/danske-sapphire-angular.mjs",
27
27
  "fesm2020": "fesm2020/danske-sapphire-angular.mjs",