@kirbydesign/designsystem 11.1.0 → 11.2.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.
Files changed (128) hide show
  1. package/button/index.d.ts +7 -3
  2. package/button/index.d.ts.map +1 -1
  3. package/dropdown/index.d.ts +11 -3
  4. package/dropdown/index.d.ts.map +1 -1
  5. package/empty-state/index.d.ts +1 -0
  6. package/empty-state/index.d.ts.map +1 -1
  7. package/fab-sheet/index.d.ts.map +1 -1
  8. package/fesm2022/kirbydesign-designsystem-accordion.mjs +11 -11
  9. package/fesm2022/kirbydesign-designsystem-accordion.mjs.map +1 -1
  10. package/fesm2022/kirbydesign-designsystem-action-group.mjs +3 -3
  11. package/fesm2022/kirbydesign-designsystem-action-group.mjs.map +1 -1
  12. package/fesm2022/kirbydesign-designsystem-avatar.mjs +3 -3
  13. package/fesm2022/kirbydesign-designsystem-avatar.mjs.map +1 -1
  14. package/fesm2022/kirbydesign-designsystem-badge.mjs +4 -4
  15. package/fesm2022/kirbydesign-designsystem-badge.mjs.map +1 -1
  16. package/fesm2022/kirbydesign-designsystem-button.mjs +20 -11
  17. package/fesm2022/kirbydesign-designsystem-button.mjs.map +1 -1
  18. package/fesm2022/kirbydesign-designsystem-calendar.mjs +3 -3
  19. package/fesm2022/kirbydesign-designsystem-calendar.mjs.map +1 -1
  20. package/fesm2022/kirbydesign-designsystem-card.mjs +17 -17
  21. package/fesm2022/kirbydesign-designsystem-card.mjs.map +1 -1
  22. package/fesm2022/kirbydesign-designsystem-chart.mjs +22 -22
  23. package/fesm2022/kirbydesign-designsystem-chart.mjs.map +1 -1
  24. package/fesm2022/kirbydesign-designsystem-checkbox.mjs +3 -3
  25. package/fesm2022/kirbydesign-designsystem-checkbox.mjs.map +1 -1
  26. package/fesm2022/kirbydesign-designsystem-config.mjs.map +1 -1
  27. package/fesm2022/kirbydesign-designsystem-data-table.mjs +7 -7
  28. package/fesm2022/kirbydesign-designsystem-data-table.mjs.map +1 -1
  29. package/fesm2022/kirbydesign-designsystem-divider.mjs +3 -3
  30. package/fesm2022/kirbydesign-designsystem-divider.mjs.map +1 -1
  31. package/fesm2022/kirbydesign-designsystem-dropdown.mjs +145 -43
  32. package/fesm2022/kirbydesign-designsystem-dropdown.mjs.map +1 -1
  33. package/fesm2022/kirbydesign-designsystem-empty-state.mjs +10 -8
  34. package/fesm2022/kirbydesign-designsystem-empty-state.mjs.map +1 -1
  35. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs +5 -3
  36. package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs.map +1 -1
  37. package/fesm2022/kirbydesign-designsystem-flag.mjs +5 -5
  38. package/fesm2022/kirbydesign-designsystem-flag.mjs.map +1 -1
  39. package/fesm2022/kirbydesign-designsystem-form-field.mjs +41 -34
  40. package/fesm2022/kirbydesign-designsystem-form-field.mjs.map +1 -1
  41. package/fesm2022/kirbydesign-designsystem-header.mjs +19 -19
  42. package/fesm2022/kirbydesign-designsystem-header.mjs.map +1 -1
  43. package/fesm2022/kirbydesign-designsystem-helpers.mjs +30 -10
  44. package/fesm2022/kirbydesign-designsystem-helpers.mjs.map +1 -1
  45. package/fesm2022/kirbydesign-designsystem-icon.mjs +11 -10
  46. package/fesm2022/kirbydesign-designsystem-icon.mjs.map +1 -1
  47. package/fesm2022/kirbydesign-designsystem-item-group.mjs +3 -3
  48. package/fesm2022/kirbydesign-designsystem-item-group.mjs.map +1 -1
  49. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs +3 -3
  50. package/fesm2022/kirbydesign-designsystem-item-sliding.mjs.map +1 -1
  51. package/fesm2022/kirbydesign-designsystem-item.mjs +10 -10
  52. package/fesm2022/kirbydesign-designsystem-item.mjs.map +1 -1
  53. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs +7 -7
  54. package/fesm2022/kirbydesign-designsystem-kirby-app.mjs.map +1 -1
  55. package/fesm2022/kirbydesign-designsystem-list.mjs +40 -40
  56. package/fesm2022/kirbydesign-designsystem-list.mjs.map +1 -1
  57. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs +6 -6
  58. package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs.map +1 -1
  59. package/fesm2022/kirbydesign-designsystem-menu.mjs +8 -25
  60. package/fesm2022/kirbydesign-designsystem-menu.mjs.map +1 -1
  61. package/fesm2022/kirbydesign-designsystem-modal.mjs +45 -43
  62. package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
  63. package/fesm2022/kirbydesign-designsystem-page.mjs +40 -40
  64. package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
  65. package/fesm2022/kirbydesign-designsystem-popover.mjs +5 -7
  66. package/fesm2022/kirbydesign-designsystem-popover.mjs.map +1 -1
  67. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs +7 -7
  68. package/fesm2022/kirbydesign-designsystem-progress-circle.mjs.map +1 -1
  69. package/fesm2022/kirbydesign-designsystem-radio.mjs +10 -10
  70. package/fesm2022/kirbydesign-designsystem-radio.mjs.map +1 -1
  71. package/fesm2022/kirbydesign-designsystem-range.mjs +5 -5
  72. package/fesm2022/kirbydesign-designsystem-range.mjs.map +1 -1
  73. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs +3 -3
  74. package/fesm2022/kirbydesign-designsystem-reorder-list.mjs.map +1 -1
  75. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs +7 -7
  76. package/fesm2022/kirbydesign-designsystem-router-outlet.mjs.map +1 -1
  77. package/fesm2022/kirbydesign-designsystem-section-header.mjs +3 -3
  78. package/fesm2022/kirbydesign-designsystem-section-header.mjs.map +1 -1
  79. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs +18 -22
  80. package/fesm2022/kirbydesign-designsystem-shared-floating.mjs.map +1 -1
  81. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs +3 -3
  82. package/fesm2022/kirbydesign-designsystem-shared-portal.mjs.map +1 -1
  83. package/fesm2022/kirbydesign-designsystem-shared.mjs +18 -18
  84. package/fesm2022/kirbydesign-designsystem-shared.mjs.map +1 -1
  85. package/fesm2022/kirbydesign-designsystem-slide-button.mjs +3 -3
  86. package/fesm2022/kirbydesign-designsystem-slide-button.mjs.map +1 -1
  87. package/fesm2022/kirbydesign-designsystem-slide.mjs +13 -13
  88. package/fesm2022/kirbydesign-designsystem-slide.mjs.map +1 -1
  89. package/fesm2022/kirbydesign-designsystem-spinner.mjs +7 -7
  90. package/fesm2022/kirbydesign-designsystem-spinner.mjs.map +1 -1
  91. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs +10 -10
  92. package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs.map +1 -1
  93. package/fesm2022/kirbydesign-designsystem-tabs.mjs +13 -13
  94. package/fesm2022/kirbydesign-designsystem-tabs.mjs.map +1 -1
  95. package/fesm2022/kirbydesign-designsystem-testing-base.mjs +286 -286
  96. package/fesm2022/kirbydesign-designsystem-testing-base.mjs.map +1 -1
  97. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs +4 -4
  98. package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs.map +1 -1
  99. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs +4 -4
  100. package/fesm2022/kirbydesign-designsystem-testing-jest.mjs.map +1 -1
  101. package/fesm2022/kirbydesign-designsystem-testing.mjs +4 -4
  102. package/fesm2022/kirbydesign-designsystem-testing.mjs.map +1 -1
  103. package/fesm2022/kirbydesign-designsystem-toast.mjs +6 -6
  104. package/fesm2022/kirbydesign-designsystem-toast.mjs.map +1 -1
  105. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs +7 -7
  106. package/fesm2022/kirbydesign-designsystem-toggle-button.mjs.map +1 -1
  107. package/fesm2022/kirbydesign-designsystem-toggle.mjs +3 -3
  108. package/fesm2022/kirbydesign-designsystem-toggle.mjs.map +1 -1
  109. package/fesm2022/kirbydesign-designsystem-types.mjs +3 -3
  110. package/fesm2022/kirbydesign-designsystem-types.mjs.map +1 -1
  111. package/fesm2022/kirbydesign-designsystem.mjs +13 -13
  112. package/fesm2022/kirbydesign-designsystem.mjs.map +1 -1
  113. package/form-field/index.d.ts +4 -2
  114. package/form-field/index.d.ts.map +1 -1
  115. package/helpers/index.d.ts +6 -1
  116. package/helpers/index.d.ts.map +1 -1
  117. package/icon/index.d.ts.map +1 -1
  118. package/icons/svg/bank.svg +3 -0
  119. package/menu/index.d.ts +1 -3
  120. package/menu/index.d.ts.map +1 -1
  121. package/modal/index.d.ts +1 -0
  122. package/modal/index.d.ts.map +1 -1
  123. package/package.json +25 -26
  124. package/popover/index.d.ts +1 -0
  125. package/popover/index.d.ts.map +1 -1
  126. package/scss/components/_overlays.scss +1 -0
  127. package/shared/floating/index.d.ts +3 -3
  128. package/shared/floating/index.d.ts.map +1 -1
@@ -3,7 +3,7 @@ import { Injectable, EventEmitter, RendererStyleFlags2, ElementRef, TemplateRef,
3
3
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
4
  import * as i3 from '@kirbydesign/designsystem/card';
5
5
  import { CardComponent, CardModule } from '@kirbydesign/designsystem/card';
6
- import { UniqueIdGenerator, DesignTokenHelper } from '@kirbydesign/designsystem/helpers';
6
+ import { UniqueIdGenerator, DesignTokenHelper, StringSearchHelper } from '@kirbydesign/designsystem/helpers';
7
7
  import * as i5 from '@kirbydesign/designsystem/item';
8
8
  import { ItemComponent, ItemModule } from '@kirbydesign/designsystem/item';
9
9
  import { ListItemTemplateDirective, ListModule } from '@kirbydesign/designsystem/list';
@@ -69,10 +69,10 @@ class KeyboardHandlerService {
69
69
  }
70
70
  return newIndex;
71
71
  }
72
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
73
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardHandlerService, providedIn: 'root' }); }
72
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: KeyboardHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
73
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: KeyboardHandlerService, providedIn: 'root' }); }
74
74
  }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: KeyboardHandlerService, decorators: [{
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: KeyboardHandlerService, decorators: [{
76
76
  type: Injectable,
77
77
  args: [{
78
78
  providedIn: 'root',
@@ -148,17 +148,17 @@ class DropdownComponent {
148
148
  forwardAttributes(this.elementRef.nativeElement, this._attributesToForward, this.renderer, this.buttonElement.nativeElement);
149
149
  }
150
150
  set kirbyItemsSlotted(kirbyItems) {
151
- const hasSlottedItems = this.itemClickUnlisten?.length > 0;
151
+ const hasSlottedItems = this.disposeItemClickListeners?.length > 0;
152
152
  if (hasSlottedItems) {
153
153
  this.unlistenAllSlottedItems();
154
154
  }
155
155
  // Setup a click listener for each new slotted items
156
156
  kirbyItems.forEach((kirbyItem, index) => {
157
157
  this.renderer.setAttribute(kirbyItem.nativeElement, 'role', 'option');
158
- const unlisten = this.renderer.listen(kirbyItem.nativeElement, 'click', () => {
158
+ const disposeClickListener = this.renderer.listen(kirbyItem.nativeElement, 'click', () => {
159
159
  this.onItemSelect(index);
160
160
  });
161
- this.itemClickUnlisten.push(unlisten);
161
+ this.disposeItemClickListeners.push(disposeClickListener);
162
162
  });
163
163
  this._kirbyItemsSlotted = kirbyItems;
164
164
  }
@@ -181,7 +181,7 @@ class DropdownComponent {
181
181
  this._selectedIndex = -1;
182
182
  // _focusedIndex keeps track of which element has focus and will be selected
183
183
  // if it is activated (by pressing ENTER or SPACE key)
184
- this._focusedIndex = -1;
184
+ this._focusedIndex = 0;
185
185
  this.itemTextProperty = 'text';
186
186
  this.placeholder = 'Please select:';
187
187
  this.attentionLevel = '3';
@@ -205,16 +205,15 @@ class DropdownComponent {
205
205
  clicking outside of the dropdown.
206
206
  */
207
207
  this.clicked = false;
208
- this.itemClickUnlisten = [];
208
+ this.disposeItemClickListeners = [];
209
+ this.searchBuffer = '';
210
+ this.SEARCH_BUFFER_DELAY = 500; // ms
209
211
  this._onChange = () => { };
210
212
  this._onTouched = () => { };
211
213
  }
212
214
  onToggle(event) {
213
215
  event.stopPropagation();
214
216
  this.clicked = true;
215
- if (!this.isOpen) {
216
- this.elementRef.nativeElement.focus();
217
- }
218
217
  this.toggle();
219
218
  }
220
219
  toggle() {
@@ -223,10 +222,6 @@ class DropdownComponent {
223
222
  }
224
223
  this.isOpen ? this.close() : this.open();
225
224
  }
226
- onButtonMouseEvent(event) {
227
- // Prevent button focus;
228
- event.preventDefault();
229
- }
230
225
  /* Utility that makes it easier to set styles on card element
231
226
  when using popover*/
232
227
  setPopoverCardStyle(style, value) {
@@ -248,11 +243,8 @@ class DropdownComponent {
248
243
  }
249
244
  });
250
245
  }
251
- // Only call initializeAlignment if cardElement is defined
252
- if (this.cardElement && this.cardElement.nativeElement) {
253
- this.initializeAlignment();
254
- }
255
246
  this.forwardAriaLabelToDropdownButton();
247
+ this.initializeAlignment();
256
248
  }
257
249
  initializeAlignment() {
258
250
  if (this.usePopover)
@@ -326,8 +318,7 @@ class DropdownComponent {
326
318
  this.state = OpenState.opening;
327
319
  // ensures that the dropdown is opened in case the IntersectionObserverCallback isn't invoked
328
320
  this.showDropdownTimeoutId = setTimeout(() => this.showDropdown(), DropdownComponent.OPEN_DELAY_IN_MS);
329
- // Move focus to selected item (if any)
330
- // If no item is selected, focus the first item
321
+ // Move focus to selected item (if any) or first item
331
322
  this.focusedIndex = this.selectedIndex > -1 ? this.selectedIndex : 0;
332
323
  }
333
324
  }
@@ -335,7 +326,7 @@ class DropdownComponent {
335
326
  if (this.state === OpenState.opening) {
336
327
  this.state = OpenState.open;
337
328
  this.popover?.show();
338
- this.scrollItemIntoView(this.selectedIndex);
329
+ this.scrollItemIntoView(this.focusedIndex);
339
330
  this.changeDetectorRef.markForCheck();
340
331
  }
341
332
  }
@@ -421,9 +412,9 @@ class DropdownComponent {
421
412
  }
422
413
  }
423
414
  }
424
- _onTab(event) {
415
+ _onTab() {
425
416
  if (this.isOpen) {
426
- event.preventDefault();
417
+ this.selectItem(this.focusedIndex);
427
418
  this.close();
428
419
  }
429
420
  if (this.clicked) {
@@ -433,6 +424,112 @@ class DropdownComponent {
433
424
  this.clicked = false;
434
425
  }
435
426
  }
427
+ preventDefaultAndStopImmediatePropagation(event) {
428
+ event.stopImmediatePropagation();
429
+ event.preventDefault();
430
+ }
431
+ addToSearchBuffer(char) {
432
+ clearTimeout(this.searchBufferTimeout);
433
+ this.searchBuffer += char;
434
+ this.searchBufferTimeout = setTimeout(() => {
435
+ this.resetSearchBuffer();
436
+ }, this.SEARCH_BUFFER_DELAY);
437
+ }
438
+ resetSearchBuffer() {
439
+ this.searchBuffer = '';
440
+ }
441
+ _onKeydown(event) {
442
+ const key = event.key;
443
+ if (this.items.length === 0) {
444
+ console.warn('[Kirby] No items found within dropdown');
445
+ return;
446
+ }
447
+ if (this.disabled)
448
+ return;
449
+ if (StringSearchHelper.isPrintableCharacter(key)) {
450
+ this.handlePrintableCharacterKey(event, this.isOpen);
451
+ }
452
+ // ALT + ArrowDown: Open dropdown
453
+ if (key === 'ArrowDown' && event.altKey) {
454
+ this.preventDefaultAndStopImmediatePropagation(event);
455
+ if (!this.isOpen) {
456
+ this.open();
457
+ this.focusedIndex = this.selectedIndex > -1 ? this.selectedIndex : 0;
458
+ }
459
+ return;
460
+ }
461
+ // ALT + ArrowUp: Select focused item and close dropdown
462
+ if (key === 'ArrowUp' && event.altKey) {
463
+ this.preventDefaultAndStopImmediatePropagation(event);
464
+ if (this.focusedIndex > -1) {
465
+ this.selectItem(this.focusedIndex);
466
+ this.close();
467
+ }
468
+ }
469
+ // PageUp: Jump up 10 options or to first
470
+ if (key === 'PageUp') {
471
+ this.preventDefaultAndStopImmediatePropagation(event);
472
+ if (!this.isOpen) {
473
+ this.open();
474
+ }
475
+ this.focusedIndex = Math.max(0, this.focusedIndex - 10);
476
+ return;
477
+ }
478
+ // PageDown: Jump down 10 options or to last
479
+ if (key === 'PageDown') {
480
+ this.preventDefaultAndStopImmediatePropagation(event);
481
+ if (!this.isOpen) {
482
+ this.open();
483
+ }
484
+ this.focusedIndex = Math.min(this.items.length - 1, this.focusedIndex + 10);
485
+ return;
486
+ }
487
+ }
488
+ handlePrintableCharacterKey(event, isOpen) {
489
+ const key = event.key;
490
+ if (isOpen) {
491
+ this.preventDefaultAndStopImmediatePropagation(event);
492
+ }
493
+ else {
494
+ this.open();
495
+ }
496
+ // If the same character is typed twice, the search buffer should only contain that character once
497
+ if (this.searchBuffer.length === 1 &&
498
+ this.searchBuffer[0].toLowerCase() === key.toLowerCase()) {
499
+ this.searchBuffer = key;
500
+ }
501
+ else {
502
+ this.addToSearchBuffer(key);
503
+ }
504
+ const isMultiCharSearch = this.searchBuffer.length > 1;
505
+ let startIndex = 0;
506
+ if (!isMultiCharSearch && this.isOpen) {
507
+ startIndex = this.focusedIndex + 1;
508
+ }
509
+ let foundItemIndex = this.getIndexOfItemByFirstCharacter(this.searchBuffer, startIndex);
510
+ if (foundItemIndex === -1 && isMultiCharSearch) {
511
+ foundItemIndex = this.getIndexOfItemByFirstCharacter(key, startIndex);
512
+ }
513
+ if (foundItemIndex === -1 && !isMultiCharSearch && this.isOpen) {
514
+ foundItemIndex = this.getIndexOfItemByFirstCharacter(this.searchBuffer, 0);
515
+ }
516
+ if (foundItemIndex > -1) {
517
+ this.focusedIndex = foundItemIndex;
518
+ }
519
+ }
520
+ getIndexOfItemByFirstCharacter(char, startIndex = 0) {
521
+ let itemTexts;
522
+ // Prefer slotted/projected items if present
523
+ if (this.kirbyItemsSlotted && this.kirbyItemsSlotted.length) {
524
+ itemTexts = this.kirbyItemsSlotted
525
+ .toArray()
526
+ .map((ref) => ref.nativeElement.textContent?.trim() ?? '');
527
+ }
528
+ else {
529
+ itemTexts = this.items.map((item) => this.getTextFromItem(item) ?? '');
530
+ }
531
+ return StringSearchHelper.getIndexByFirstMatchingStartString(char, itemTexts, startIndex);
532
+ }
436
533
  _onMouseDown(event) {
437
534
  if (this.disabled) {
438
535
  event.preventDefault();
@@ -486,13 +583,13 @@ class DropdownComponent {
486
583
  event.preventDefault();
487
584
  this.open();
488
585
  // If no selected item then focus first or last item
489
- if (this.selectedIndex < 0) {
586
+ if (!event.altKey && this.selectedIndex < 0) {
490
587
  switch (event.key) {
491
588
  case 'ArrowUp':
492
- this.focusedIndex = this.items.length - 1;
589
+ this.focusedIndex = 0;
493
590
  break;
494
591
  case 'ArrowDown':
495
- this.focusedIndex = 0;
592
+ this.focusedIndex = this.items.length - 1;
496
593
  break;
497
594
  default:
498
595
  break;
@@ -509,8 +606,10 @@ class DropdownComponent {
509
606
  _onHomeEndKeys(event) {
510
607
  if (this.disabled)
511
608
  return;
512
- if (!this.isOpen)
513
- return;
609
+ if (!this.isOpen) {
610
+ event.preventDefault();
611
+ this.open();
612
+ }
514
613
  const newFocusedIndex = this.keyboardHandlerService.handle(event, this.focusedIndex, this.items.length - 1);
515
614
  if (newFocusedIndex > -1) {
516
615
  this.focusedIndex = newFocusedIndex;
@@ -518,9 +617,9 @@ class DropdownComponent {
518
617
  return false;
519
618
  }
520
619
  unlistenAllSlottedItems() {
521
- let unlistenItem;
522
- while ((unlistenItem = this.itemClickUnlisten.pop()) !== undefined) {
523
- unlistenItem();
620
+ let disposeClickListener;
621
+ while ((disposeClickListener = this.disposeItemClickListeners.pop()) !== undefined) {
622
+ disposeClickListener();
524
623
  }
525
624
  }
526
625
  ngOnDestroy() {
@@ -530,16 +629,16 @@ class DropdownComponent {
530
629
  this.intersectionObserverRef.disconnect();
531
630
  }
532
631
  }
533
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DropdownComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: KeyboardHandlerService }, { token: i2.ResizeObserverService }], target: i0.ɵɵFactoryTarget.Component }); }
534
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: DropdownComponent, isStandalone: false, selector: "kirby-dropdown", inputs: { items: "items", selectedIndex: "selectedIndex", focusedIndex: "focusedIndex", itemTextProperty: "itemTextProperty", placeholder: "placeholder", popout: "popout", attentionLevel: "attentionLevel", expand: "expand", disabled: "disabled", hasError: "hasError", size: "size", tabindex: "tabindex", usePopover: "usePopover" }, outputs: { change: "change" }, host: { listeners: { "keydown.tab": "_onTab($event)", "mousedown": "_onMouseDown($event)", "touchstart": "_onTouchStart($event)", "focus": "_onFocus()", "keydown.enter": "_onEnterOrSpace($event)", "keydown.escape": "_onEnterOrEscape()", "blur": "_onBlur($event)", "keydown.space": "_onEnterOrSpace($event)", "keydown.arrowup": "_onArrowKeys($event)", "keydown.arrowdown": "_onArrowKeys($event)", "keydown.arrowleft": "_onArrowKeys($event)", "keydown.arrowright": "_onArrowKeys($event)", "keydown.home": "_onHomeEndKeys($event)", "keydown.end": "_onHomeEndKeys($event)" }, properties: { "attr.disabled": "this._isDisabled", "class.error": "this.hasError", "class.with-popover": "this.usePopover", "attr.no-blur": "this._noBlurOnScroll", "class.expand": "this._isBlockLevel", "class.is-opening": "this._isOpening", "class.is-open": "this.isOpen", "class.popout-left": "this._popoutLeft", "class.popout-up": "this._popoutUp", "class.clicked": "this.clicked" } }, providers: [
632
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DropdownComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: KeyboardHandlerService }, { token: i2.ResizeObserverService }], target: i0.ɵɵFactoryTarget.Component }); }
633
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: DropdownComponent, isStandalone: false, selector: "kirby-dropdown", inputs: { items: "items", selectedIndex: "selectedIndex", focusedIndex: "focusedIndex", itemTextProperty: "itemTextProperty", placeholder: "placeholder", popout: "popout", attentionLevel: "attentionLevel", expand: "expand", disabled: "disabled", hasError: "hasError", size: "size", tabindex: "tabindex", usePopover: "usePopover" }, outputs: { change: "change" }, host: { listeners: { "keydown.tab": "_onTab()", "keydown": "_onKeydown($event)", "mousedown": "_onMouseDown($event)", "touchstart": "_onTouchStart($event)", "focus": "_onFocus()", "keydown.enter": "_onEnterOrSpace($event)", "keydown.escape": "_onEnterOrEscape()", "blur": "_onBlur($event)", "keydown.space": "_onEnterOrSpace($event)", "keydown.arrowup": "_onArrowKeys($event)", "keydown.arrowdown": "_onArrowKeys($event)", "keydown.arrowleft": "_onArrowKeys($event)", "keydown.arrowright": "_onArrowKeys($event)", "keydown.home": "_onHomeEndKeys($event)", "keydown.end": "_onHomeEndKeys($event)" }, properties: { "attr.disabled": "this._isDisabled", "class.error": "this.hasError", "class.with-popover": "this.usePopover", "attr.no-blur": "this._noBlurOnScroll", "class.expand": "this._isBlockLevel", "class.is-opening": "this._isOpening", "class.is-open": "this.isOpen", "class.popout-left": "this._popoutLeft", "class.popout-up": "this._popoutUp", "class.clicked": "this.clicked" } }, providers: [
535
634
  {
536
635
  provide: NG_VALUE_ACCESSOR,
537
636
  useExisting: forwardRef((() => DropdownComponent)),
538
637
  multi: true,
539
638
  },
540
- ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ListItemTemplateDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "slottedItems", predicate: ListItemTemplateDirective, read: ElementRef }, { propertyName: "kirbyItemsSlotted", predicate: ItemComponent, read: ElementRef }], viewQueries: [{ propertyName: "cardElement", first: true, predicate: CardComponent, descendants: true, read: ElementRef }, { propertyName: "popover", first: true, predicate: PopoverComponent, descendants: true }, { propertyName: "buttonElement", first: true, predicate: ButtonComponent, descendants: true, read: ElementRef, static: true }, { propertyName: "kirbyItemsDefault", predicate: ItemComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<button\n kirby-button\n type=\"button\"\n [attr.id]=\"_comboboxId\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"_listboxId\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-activedescendant]=\"_listboxId + '-item-' + focusedIndex\"\n [size]=\"size\"\n [attentionLevel]=\"attentionLevel\"\n (click)=\"onToggle($event)\"\n (mousedown)=\"onButtonMouseEvent($event)\"\n [disabled]=\"disabled\"\n>\n <span class=\"text\">{{ selectedText || placeholder }}</span>\n <kirby-icon [name]=\"isOpen ? 'arrow-up' : 'arrow-down'\"></kirby-icon>\n</button>\n\n<ng-container *ngTemplateOutlet=\"usePopover ? popoverTemplate : itemWrapperTemplate\"></ng-container>\n\n<ng-template #popoverTemplate>\n <kirby-popover\n [target]=\"buttonElement\"\n [popout]=\"popout\"\n (click)=\"_onPopoverClick()\"\n (willHide)=\"_onPopoverWillHide()\"\n >\n <ng-container *ngTemplateOutlet=\"itemWrapperTemplate\"></ng-container>\n </kirby-popover>\n</ng-template>\n\n<ng-template #itemWrapperTemplate>\n <kirby-card role=\"listbox\" [attr.id]=\"_listboxId\" [attr.aria-labelledby]=\"_comboboxId\">\n @for (item of items; track item; let i = $index) {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate || defaultItemTemplate;\n context: {\n $implicit: item,\n selected: i === selectedIndex,\n focused: i === focusedIndex,\n index: i,\n }\n \"\n ></ng-container>\n }\n </kirby-card>\n</ng-template>\n\n<ng-template\n #defaultItemTemplate\n let-item\n let-selected=\"selected\"\n let-index=\"index\"\n let-focused=\"focused\"\n>\n <kirby-item\n [selectable]=\"true\"\n [selected]=\"selected\"\n (click)=\"onItemSelect(index)\"\n [class.focused]=\"focused\"\n role=\"option\"\n [attr.id]=\"_listboxId + '-item-' + index\"\n [attr.aria-selected]=\"selected\"\n >\n <!-- Tabindex fixes issue with popover dropdown not working in safari -->\n <p class=\"kirby-item-title\">{{ getTextFromItem(item) }}</p>\n @if (selected) {\n <kirby-icon name=\"checkmark-selected\" slot=\"end\"></kirby-icon>\n }\n </kirby-item>\n</ng-template>\n", styles: ["@media (hover: hover) and (pointer: fine){:host{outline:none;border-radius:999px}:host:focus{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{display:inline-block;position:relative;max-width:calc(100vw - 32px)}:host.clicked{box-shadow:none}:host.expand{display:block}:host.expand kirby-card{width:100%;min-width:initial;max-width:initial}:host.error>button,:host.ng-touched.ng-invalid>button{border-color:var(--kirby-danger)}:host>button{position:relative;margin:0;outline:none;width:100%;min-width:0}:host>button.attention-level2{border:1px solid transparent}:host>button .text{overflow:hidden;text-overflow:ellipsis}:host kirby-card{display:none;opacity:0;position:absolute;z-index:800}:host.is-opening kirby-card{display:block}:host.is-open kirby-card{display:block;opacity:1}:host.is-open>button{box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26}:host.popout-left kirby-card{right:0}:host.popout-up kirby-card{top:0;margin-top:-4px;transform:translateY(-100%)}:host.popout-up.is-open>button{z-index:801}kirby-popover{--max-height: 352px}kirby-card{max-height:352px;margin-block:4px;overflow-y:auto;box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26;max-width:calc(100vw - 32px);min-width:288px}@media (min-width: 321px){kirby-card{min-width:343px}}@media (hover: hover){:host-context(kirby-calendar)>button:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer}}:host-context(kirby-calendar)>button:active,:host-context(kirby-calendar)>button.interaction-state-active{--state-layer-opacity: .16;--state-layer-background-color: var(--kirby-black)}:host-context(kirby-calendar)>button{border-color:transparent;font-weight:700;font-size:initial}:host-context(kirby-calendar).is-open>button{box-shadow:none}\n"], dependencies: [{ kind: "component", type: i3.CardComponent, selector: "kirby-card", inputs: ["title", "subtitle", "backgroundImageUrl", "hasPadding", "sizes", "variant"] }, { kind: "component", type: i4.IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "component", type: i5.ItemComponent, selector: "kirby-item", inputs: ["disabled", "selected", "disclosure", "selectable", "reorderable", "size", "href", "rotateIcon"] }, { kind: "component", type: i6.PopoverComponent, selector: "kirby-popover", inputs: ["popout", "target"], outputs: ["willHide"] }, { kind: "component", type: i7.ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "directive", type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
639
+ ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ListItemTemplateDirective, descendants: true, read: TemplateRef, static: true }, { propertyName: "slottedItems", predicate: ListItemTemplateDirective, read: ElementRef }, { propertyName: "kirbyItemsSlotted", predicate: ItemComponent, read: ElementRef }], viewQueries: [{ propertyName: "cardElement", first: true, predicate: CardComponent, descendants: true, read: ElementRef }, { propertyName: "popover", first: true, predicate: PopoverComponent, descendants: true }, { propertyName: "buttonElement", first: true, predicate: ButtonComponent, descendants: true, read: ElementRef, static: true }, { propertyName: "kirbyItemsDefault", predicate: ItemComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "<button\n kirby-button\n type=\"button\"\n [attr.id]=\"_comboboxId\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"_listboxId\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-activedescendant]=\"_listboxId + '-item-' + focusedIndex\"\n [size]=\"size\"\n [attentionLevel]=\"attentionLevel\"\n (click)=\"onToggle($event)\"\n [disabled]=\"disabled\"\n>\n <span class=\"text\">{{ selectedText || placeholder }}</span>\n <kirby-icon [name]=\"isOpen ? 'arrow-up' : 'arrow-down'\"></kirby-icon>\n</button>\n\n<ng-container *ngTemplateOutlet=\"usePopover ? popoverTemplate : itemWrapperTemplate\"></ng-container>\n\n<ng-template #popoverTemplate>\n <kirby-popover\n [target]=\"buttonElement\"\n [popout]=\"popout\"\n (click)=\"_onPopoverClick()\"\n (willHide)=\"_onPopoverWillHide()\"\n >\n <ng-container *ngTemplateOutlet=\"itemWrapperTemplate\"></ng-container>\n </kirby-popover>\n</ng-template>\n\n<ng-template #itemWrapperTemplate>\n <kirby-card role=\"listbox\" [attr.id]=\"_listboxId\" [attr.aria-labelledby]=\"_comboboxId\">\n @for (item of items; track item; let i = $index) {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate || defaultItemTemplate;\n context: {\n $implicit: item,\n selected: i === selectedIndex,\n focused: i === focusedIndex,\n index: i,\n }\n \"\n ></ng-container>\n }\n </kirby-card>\n</ng-template>\n\n<ng-template\n #defaultItemTemplate\n let-item\n let-selected=\"selected\"\n let-index=\"index\"\n let-focused=\"focused\"\n>\n <kirby-item\n [selectable]=\"true\"\n [selected]=\"selected\"\n (click)=\"onItemSelect(index)\"\n [class.focused]=\"focused\"\n role=\"option\"\n [attr.id]=\"_listboxId + '-item-' + index\"\n [attr.aria-selected]=\"selected\"\n >\n <!-- Tabindex fixes issue with popover dropdown not working in safari -->\n <p class=\"kirby-item-title\">{{ getTextFromItem(item) }}</p>\n @if (selected) {\n <kirby-icon name=\"checkmark-selected\" slot=\"end\"></kirby-icon>\n }\n </kirby-item>\n</ng-template>\n", styles: ["@media (hover: hover) and (pointer: fine){:host{outline:none;border-radius:999px}:host:focus{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{display:inline-block;position:relative;max-width:calc(100vw - 32px)}:host.clicked{box-shadow:none}:host.expand{display:block}:host.expand kirby-card{width:100%;min-width:initial;max-width:initial}:host.error>button,:host.ng-touched.ng-invalid>button{border-color:var(--kirby-danger)}:host>button{position:relative;margin:0;outline:none;width:100%;min-width:0}:host>button.attention-level2{border:1px solid transparent}:host>button .text{overflow:hidden;text-overflow:ellipsis}:host kirby-card{display:none;opacity:0;position:absolute;z-index:800}:host.is-opening kirby-card{display:block}:host.is-open kirby-card{display:block;opacity:1}:host.is-open>button{box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26}:host.popout-left kirby-card{right:0}:host.popout-up kirby-card{top:0;margin-top:-4px;transform:translateY(-100%)}:host.popout-up.is-open>button{z-index:801}kirby-popover{--max-height: 352px}kirby-card{max-height:352px;margin-block:4px;overflow-y:auto;box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26;max-width:calc(100vw - 32px);min-width:288px}@media (min-width: 321px){kirby-card{min-width:343px}}@media (hover: hover){:host-context(kirby-calendar)>button:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer}}:host-context(kirby-calendar)>button:active,:host-context(kirby-calendar)>button.interaction-state-active{--state-layer-opacity: .16;--state-layer-background-color: var(--kirby-black)}:host-context(kirby-calendar)>button{border-color:transparent;font-weight:700;font-size:initial}:host-context(kirby-calendar).is-open>button{box-shadow:none}\n"], dependencies: [{ kind: "component", type: i3.CardComponent, selector: "kirby-card", inputs: ["title", "subtitle", "backgroundImageUrl", "hasPadding", "sizes", "variant"] }, { kind: "component", type: i4.IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "component", type: i5.ItemComponent, selector: "kirby-item", inputs: ["disabled", "selected", "disclosure", "selectable", "reorderable", "size", "href", "rotateIcon"] }, { kind: "component", type: i6.PopoverComponent, selector: "kirby-popover", inputs: ["popout", "target"], outputs: ["willHide"] }, { kind: "component", type: i7.ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "directive", type: i8.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
541
640
  }
542
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DropdownComponent, decorators: [{
641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DropdownComponent, decorators: [{
543
642
  type: Component,
544
643
  args: [{ selector: 'kirby-dropdown', providers: [
545
644
  {
@@ -547,7 +646,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
547
646
  useExisting: forwardRef((() => DropdownComponent)),
548
647
  multi: true,
549
648
  },
550
- ], standalone: false, template: "<button\n kirby-button\n type=\"button\"\n [attr.id]=\"_comboboxId\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"_listboxId\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-activedescendant]=\"_listboxId + '-item-' + focusedIndex\"\n [size]=\"size\"\n [attentionLevel]=\"attentionLevel\"\n (click)=\"onToggle($event)\"\n (mousedown)=\"onButtonMouseEvent($event)\"\n [disabled]=\"disabled\"\n>\n <span class=\"text\">{{ selectedText || placeholder }}</span>\n <kirby-icon [name]=\"isOpen ? 'arrow-up' : 'arrow-down'\"></kirby-icon>\n</button>\n\n<ng-container *ngTemplateOutlet=\"usePopover ? popoverTemplate : itemWrapperTemplate\"></ng-container>\n\n<ng-template #popoverTemplate>\n <kirby-popover\n [target]=\"buttonElement\"\n [popout]=\"popout\"\n (click)=\"_onPopoverClick()\"\n (willHide)=\"_onPopoverWillHide()\"\n >\n <ng-container *ngTemplateOutlet=\"itemWrapperTemplate\"></ng-container>\n </kirby-popover>\n</ng-template>\n\n<ng-template #itemWrapperTemplate>\n <kirby-card role=\"listbox\" [attr.id]=\"_listboxId\" [attr.aria-labelledby]=\"_comboboxId\">\n @for (item of items; track item; let i = $index) {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate || defaultItemTemplate;\n context: {\n $implicit: item,\n selected: i === selectedIndex,\n focused: i === focusedIndex,\n index: i,\n }\n \"\n ></ng-container>\n }\n </kirby-card>\n</ng-template>\n\n<ng-template\n #defaultItemTemplate\n let-item\n let-selected=\"selected\"\n let-index=\"index\"\n let-focused=\"focused\"\n>\n <kirby-item\n [selectable]=\"true\"\n [selected]=\"selected\"\n (click)=\"onItemSelect(index)\"\n [class.focused]=\"focused\"\n role=\"option\"\n [attr.id]=\"_listboxId + '-item-' + index\"\n [attr.aria-selected]=\"selected\"\n >\n <!-- Tabindex fixes issue with popover dropdown not working in safari -->\n <p class=\"kirby-item-title\">{{ getTextFromItem(item) }}</p>\n @if (selected) {\n <kirby-icon name=\"checkmark-selected\" slot=\"end\"></kirby-icon>\n }\n </kirby-item>\n</ng-template>\n", styles: ["@media (hover: hover) and (pointer: fine){:host{outline:none;border-radius:999px}:host:focus{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{display:inline-block;position:relative;max-width:calc(100vw - 32px)}:host.clicked{box-shadow:none}:host.expand{display:block}:host.expand kirby-card{width:100%;min-width:initial;max-width:initial}:host.error>button,:host.ng-touched.ng-invalid>button{border-color:var(--kirby-danger)}:host>button{position:relative;margin:0;outline:none;width:100%;min-width:0}:host>button.attention-level2{border:1px solid transparent}:host>button .text{overflow:hidden;text-overflow:ellipsis}:host kirby-card{display:none;opacity:0;position:absolute;z-index:800}:host.is-opening kirby-card{display:block}:host.is-open kirby-card{display:block;opacity:1}:host.is-open>button{box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26}:host.popout-left kirby-card{right:0}:host.popout-up kirby-card{top:0;margin-top:-4px;transform:translateY(-100%)}:host.popout-up.is-open>button{z-index:801}kirby-popover{--max-height: 352px}kirby-card{max-height:352px;margin-block:4px;overflow-y:auto;box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26;max-width:calc(100vw - 32px);min-width:288px}@media (min-width: 321px){kirby-card{min-width:343px}}@media (hover: hover){:host-context(kirby-calendar)>button:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer}}:host-context(kirby-calendar)>button:active,:host-context(kirby-calendar)>button.interaction-state-active{--state-layer-opacity: .16;--state-layer-background-color: var(--kirby-black)}:host-context(kirby-calendar)>button{border-color:transparent;font-weight:700;font-size:initial}:host-context(kirby-calendar).is-open>button{box-shadow:none}\n"] }]
649
+ ], standalone: false, template: "<button\n kirby-button\n type=\"button\"\n [attr.id]=\"_comboboxId\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"_listboxId\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-activedescendant]=\"_listboxId + '-item-' + focusedIndex\"\n [size]=\"size\"\n [attentionLevel]=\"attentionLevel\"\n (click)=\"onToggle($event)\"\n [disabled]=\"disabled\"\n>\n <span class=\"text\">{{ selectedText || placeholder }}</span>\n <kirby-icon [name]=\"isOpen ? 'arrow-up' : 'arrow-down'\"></kirby-icon>\n</button>\n\n<ng-container *ngTemplateOutlet=\"usePopover ? popoverTemplate : itemWrapperTemplate\"></ng-container>\n\n<ng-template #popoverTemplate>\n <kirby-popover\n [target]=\"buttonElement\"\n [popout]=\"popout\"\n (click)=\"_onPopoverClick()\"\n (willHide)=\"_onPopoverWillHide()\"\n >\n <ng-container *ngTemplateOutlet=\"itemWrapperTemplate\"></ng-container>\n </kirby-popover>\n</ng-template>\n\n<ng-template #itemWrapperTemplate>\n <kirby-card role=\"listbox\" [attr.id]=\"_listboxId\" [attr.aria-labelledby]=\"_comboboxId\">\n @for (item of items; track item; let i = $index) {\n <ng-container\n *ngTemplateOutlet=\"\n itemTemplate || defaultItemTemplate;\n context: {\n $implicit: item,\n selected: i === selectedIndex,\n focused: i === focusedIndex,\n index: i,\n }\n \"\n ></ng-container>\n }\n </kirby-card>\n</ng-template>\n\n<ng-template\n #defaultItemTemplate\n let-item\n let-selected=\"selected\"\n let-index=\"index\"\n let-focused=\"focused\"\n>\n <kirby-item\n [selectable]=\"true\"\n [selected]=\"selected\"\n (click)=\"onItemSelect(index)\"\n [class.focused]=\"focused\"\n role=\"option\"\n [attr.id]=\"_listboxId + '-item-' + index\"\n [attr.aria-selected]=\"selected\"\n >\n <!-- Tabindex fixes issue with popover dropdown not working in safari -->\n <p class=\"kirby-item-title\">{{ getTextFromItem(item) }}</p>\n @if (selected) {\n <kirby-icon name=\"checkmark-selected\" slot=\"end\"></kirby-icon>\n }\n </kirby-item>\n</ng-template>\n", styles: ["@media (hover: hover) and (pointer: fine){:host{outline:none;border-radius:999px}:host:focus{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}:host:focus:not(:focus-visible){box-shadow:0 0 0 0 transparent}:host:focus-visible{transition:all 80ms linear 0ms;box-shadow:0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}}:host{display:inline-block;position:relative;max-width:calc(100vw - 32px)}:host.clicked{box-shadow:none}:host.expand{display:block}:host.expand kirby-card{width:100%;min-width:initial;max-width:initial}:host.error>button,:host.ng-touched.ng-invalid>button{border-color:var(--kirby-danger)}:host>button{position:relative;margin:0;outline:none;width:100%;min-width:0}:host>button.attention-level2{border:1px solid transparent}:host>button .text{overflow:hidden;text-overflow:ellipsis}:host kirby-card{display:none;opacity:0;position:absolute;z-index:800}:host.is-opening kirby-card{display:block}:host.is-open kirby-card{display:block;opacity:1}:host.is-open>button{box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26}:host.popout-left kirby-card{right:0}:host.popout-up kirby-card{top:0;margin-top:-4px;transform:translateY(-100%)}:host.popout-up.is-open>button{z-index:801}kirby-popover{--max-height: 352px}kirby-card{max-height:352px;margin-block:4px;overflow-y:auto;box-shadow:0 0 5px #1c1c1c0a,0 10px 15px -10px #1c1c1c26;max-width:calc(100vw - 32px);min-width:288px}@media (min-width: 321px){kirby-card{min-width:343px}}@media (hover: hover){:host-context(kirby-calendar)>button:hover{--state-layer-opacity: .08;--state-layer-background-color: var(--kirby-black);cursor:pointer}}:host-context(kirby-calendar)>button:active,:host-context(kirby-calendar)>button.interaction-state-active{--state-layer-opacity: .16;--state-layer-background-color: var(--kirby-black)}:host-context(kirby-calendar)>button{border-color:transparent;font-weight:700;font-size:initial}:host-context(kirby-calendar).is-open>button{box-shadow:none}\n"] }]
551
650
  }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: KeyboardHandlerService }, { type: i2.ResizeObserverService }], propDecorators: { items: [{
552
651
  type: Input
553
652
  }], selectedIndex: [{
@@ -629,7 +728,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
629
728
  args: [ItemComponent, { read: ElementRef }]
630
729
  }], _onTab: [{
631
730
  type: HostListener,
632
- args: ['keydown.tab', ['$event']]
731
+ args: ['keydown.tab']
732
+ }], _onKeydown: [{
733
+ type: HostListener,
734
+ args: ['keydown', ['$event']]
633
735
  }], _onMouseDown: [{
634
736
  type: HostListener,
635
737
  args: ['mousedown', ['$event']]
@@ -676,8 +778,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
676
778
 
677
779
  const declarations = [DropdownComponent];
678
780
  class DropdownModule {
679
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
680
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.7", ngImport: i0, type: DropdownModule, declarations: [DropdownComponent], imports: [CardModule,
781
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
782
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DropdownModule, declarations: [DropdownComponent], imports: [CardModule,
681
783
  IconModule,
682
784
  ItemModule,
683
785
  FormFieldModule,
@@ -685,7 +787,7 @@ class DropdownModule {
685
787
  ButtonComponent,
686
788
  CommonModule,
687
789
  ListModule], exports: [DropdownComponent, ListItemTemplateDirective] }); }
688
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DropdownModule, providers: [KeyboardHandlerService], imports: [CardModule,
790
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DropdownModule, providers: [KeyboardHandlerService], imports: [CardModule,
689
791
  IconModule,
690
792
  ItemModule,
691
793
  FormFieldModule,
@@ -694,7 +796,7 @@ class DropdownModule {
694
796
  CommonModule,
695
797
  ListModule] }); }
696
798
  }
697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: DropdownModule, decorators: [{
799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DropdownModule, decorators: [{
698
800
  type: NgModule,
699
801
  args: [{
700
802
  imports: [