@kirbydesign/designsystem 11.11.2 → 12.0.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.
- package/fesm2022/kirbydesign-designsystem-accordion.mjs +246 -135
- package/fesm2022/kirbydesign-designsystem-accordion.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-action-group.mjs +229 -134
- package/fesm2022/kirbydesign-designsystem-action-group.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-avatar.mjs +98 -55
- package/fesm2022/kirbydesign-designsystem-avatar.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-badge.mjs +85 -42
- package/fesm2022/kirbydesign-designsystem-badge.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-button.mjs +203 -170
- package/fesm2022/kirbydesign-designsystem-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-calendar.mjs +524 -516
- package/fesm2022/kirbydesign-designsystem-calendar.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-card.mjs +407 -205
- package/fesm2022/kirbydesign-designsystem-card.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-chart.mjs +1388 -1469
- package/fesm2022/kirbydesign-designsystem-chart.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-checkbox.mjs +215 -176
- package/fesm2022/kirbydesign-designsystem-checkbox.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-config.mjs +50 -96
- package/fesm2022/kirbydesign-designsystem-config.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-data-table.mjs +180 -83
- package/fesm2022/kirbydesign-designsystem-data-table.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-divider.mjs +46 -19
- package/fesm2022/kirbydesign-designsystem-divider.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-dropdown.mjs +878 -752
- package/fesm2022/kirbydesign-designsystem-dropdown.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-empty-state.mjs +164 -91
- package/fesm2022/kirbydesign-designsystem-empty-state.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs +213 -85
- package/fesm2022/kirbydesign-designsystem-fab-sheet.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-flag.mjs +67 -33
- package/fesm2022/kirbydesign-designsystem-flag.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-form-field.mjs +1260 -891
- package/fesm2022/kirbydesign-designsystem-form-field.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-gesture.mjs +38 -23
- package/fesm2022/kirbydesign-designsystem-gesture.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-header.mjs +422 -182
- package/fesm2022/kirbydesign-designsystem-header.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs +16 -14
- package/fesm2022/kirbydesign-designsystem-helpers-scss.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-helpers.mjs +251 -361
- package/fesm2022/kirbydesign-designsystem-helpers.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-icon.mjs +881 -296
- package/fesm2022/kirbydesign-designsystem-icon.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item-group.mjs +52 -23
- package/fesm2022/kirbydesign-designsystem-item-group.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item-sliding.mjs +147 -43
- package/fesm2022/kirbydesign-designsystem-item-sliding.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-item.mjs +395 -151
- package/fesm2022/kirbydesign-designsystem-item.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-kirby-app.mjs +136 -54
- package/fesm2022/kirbydesign-designsystem-kirby-app.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-list.mjs +1182 -697
- package/fesm2022/kirbydesign-designsystem-list.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs +166 -76
- package/fesm2022/kirbydesign-designsystem-loading-overlay.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-menu.mjs +420 -311
- package/fesm2022/kirbydesign-designsystem-menu.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-modal.mjs +2467 -1912
- package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-page.mjs +1505 -905
- package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-popover.mjs +204 -169
- package/fesm2022/kirbydesign-designsystem-popover.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-progress-circle.mjs +209 -158
- package/fesm2022/kirbydesign-designsystem-progress-circle.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-radio.mjs +537 -365
- package/fesm2022/kirbydesign-designsystem-radio.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-range.mjs +207 -150
- package/fesm2022/kirbydesign-designsystem-range.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-reorder-list.mjs +217 -104
- package/fesm2022/kirbydesign-designsystem-reorder-list.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-router-outlet.mjs +113 -38
- package/fesm2022/kirbydesign-designsystem-router-outlet.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-section-header.mjs +56 -18
- package/fesm2022/kirbydesign-designsystem-section-header.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-segmented-control.mjs +276 -232
- package/fesm2022/kirbydesign-designsystem-segmented-control.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared-floating.mjs +319 -382
- package/fesm2022/kirbydesign-designsystem-shared-floating.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared-portal.mjs +73 -84
- package/fesm2022/kirbydesign-designsystem-shared-portal.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-shared.mjs +665 -531
- package/fesm2022/kirbydesign-designsystem-shared.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-slide-button.mjs +140 -91
- package/fesm2022/kirbydesign-designsystem-slide-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-slide.mjs +360 -157
- package/fesm2022/kirbydesign-designsystem-slide.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-spinner.mjs +90 -32
- package/fesm2022/kirbydesign-designsystem-spinner.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs +348 -181
- package/fesm2022/kirbydesign-designsystem-tab-navigation.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-tabs.mjs +286 -121
- package/fesm2022/kirbydesign-designsystem-tabs.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-base.mjs +6232 -3164
- package/fesm2022/kirbydesign-designsystem-testing-base.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs +118 -95
- package/fesm2022/kirbydesign-designsystem-testing-jasmine.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing-jest.mjs +128 -101
- package/fesm2022/kirbydesign-designsystem-testing-jest.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-testing.mjs +236 -243
- package/fesm2022/kirbydesign-designsystem-testing.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toast.mjs +98 -62
- package/fesm2022/kirbydesign-designsystem-toast.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toggle-button.mjs +155 -127
- package/fesm2022/kirbydesign-designsystem-toggle-button.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-toggle.mjs +180 -150
- package/fesm2022/kirbydesign-designsystem-toggle.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-types.mjs +39 -24
- package/fesm2022/kirbydesign-designsystem-types.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem.mjs +516 -407
- package/fesm2022/kirbydesign-designsystem.mjs.map +1 -1
- package/icons/svg/megaphone.svg +3 -0
- package/icons/svg/person-blocked.svg +3 -0
- package/icons/svg/person-check.svg +3 -0
- package/icons/svg/person-close.svg +3 -0
- package/icons/svg/person-cloud.svg +3 -0
- package/icons/svg/person-power.svg +3 -0
- package/icons/svg/person-warning.svg +3 -0
- package/icons/svg/phone-device-pin.svg +3 -0
- package/icons/svg/phone-device.svg +3 -2
- package/package.json +11 -11
- package/readme.md +37 -0
- package/types/kirbydesign-designsystem-accordion.d.ts +72 -39
- package/types/kirbydesign-designsystem-accordion.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-action-group.d.ts +46 -39
- package/types/kirbydesign-designsystem-action-group.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-avatar.d.ts +58 -26
- package/types/kirbydesign-designsystem-avatar.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-badge.d.ts +30 -19
- package/types/kirbydesign-designsystem-badge.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-button.d.ts +70 -45
- package/types/kirbydesign-designsystem-button.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-calendar.d.ts +193 -132
- package/types/kirbydesign-designsystem-calendar.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-card.d.ts +120 -66
- package/types/kirbydesign-designsystem-card.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-chart.d.ts +198 -172
- package/types/kirbydesign-designsystem-chart.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-checkbox.d.ts +96 -68
- package/types/kirbydesign-designsystem-checkbox.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-config.d.ts +17 -21
- package/types/kirbydesign-designsystem-config.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-data-table.d.ts +46 -26
- package/types/kirbydesign-designsystem-data-table.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-divider.d.ts +11 -9
- package/types/kirbydesign-designsystem-divider.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-dropdown.d.ts +219 -166
- package/types/kirbydesign-designsystem-dropdown.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-empty-state.d.ts +47 -35
- package/types/kirbydesign-designsystem-empty-state.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-fab-sheet.d.ts +34 -28
- package/types/kirbydesign-designsystem-fab-sheet.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-flag.d.ts +18 -13
- package/types/kirbydesign-designsystem-flag.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-form-field.d.ts +409 -242
- package/types/kirbydesign-designsystem-form-field.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-gesture.d.ts +41 -46
- package/types/kirbydesign-designsystem-gesture.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-header.d.ts +102 -64
- package/types/kirbydesign-designsystem-header.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-helpers-scss.d.ts +6 -8
- package/types/kirbydesign-designsystem-helpers-scss.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-helpers.d.ts +83 -97
- package/types/kirbydesign-designsystem-helpers.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-icon.d.ts +63 -59
- package/types/kirbydesign-designsystem-icon.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-item-group.d.ts +6 -9
- package/types/kirbydesign-designsystem-item-group.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-item-sliding.d.ts +30 -26
- package/types/kirbydesign-designsystem-item-sliding.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-item.d.ts +93 -54
- package/types/kirbydesign-designsystem-item.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-kirby-app.d.ts +18 -19
- package/types/kirbydesign-designsystem-kirby-app.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-list.d.ts +382 -263
- package/types/kirbydesign-designsystem-list.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-loading-overlay.d.ts +35 -24
- package/types/kirbydesign-designsystem-loading-overlay.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-menu.d.ts +119 -69
- package/types/kirbydesign-designsystem-menu.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-modal.d.ts +577 -455
- package/types/kirbydesign-designsystem-modal.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-page.d.ts +304 -226
- package/types/kirbydesign-designsystem-page.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-popover.d.ts +48 -40
- package/types/kirbydesign-designsystem-popover.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-progress-circle.d.ts +59 -61
- package/types/kirbydesign-designsystem-progress-circle.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-radio.d.ts +147 -98
- package/types/kirbydesign-designsystem-radio.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-range.d.ts +90 -45
- package/types/kirbydesign-designsystem-range.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-reorder-list.d.ts +44 -32
- package/types/kirbydesign-designsystem-reorder-list.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-router-outlet.d.ts +23 -18
- package/types/kirbydesign-designsystem-router-outlet.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-section-header.d.ts +5 -8
- package/types/kirbydesign-designsystem-section-header.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-segmented-control.d.ts +123 -100
- package/types/kirbydesign-designsystem-segmented-control.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-shared-floating.d.ts +183 -128
- package/types/kirbydesign-designsystem-shared-floating.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-shared-portal.d.ts +29 -28
- package/types/kirbydesign-designsystem-shared-portal.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-shared.d.ts +143 -139
- package/types/kirbydesign-designsystem-shared.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-slide-button.d.ts +43 -34
- package/types/kirbydesign-designsystem-slide-button.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-slide.d.ts +80 -59
- package/types/kirbydesign-designsystem-slide.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-spinner.d.ts +13 -14
- package/types/kirbydesign-designsystem-spinner.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-tab-navigation.d.ts +78 -55
- package/types/kirbydesign-designsystem-tab-navigation.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-tabs.d.ts +50 -45
- package/types/kirbydesign-designsystem-tabs.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-testing-base.d.ts +2430 -815
- package/types/kirbydesign-designsystem-testing-base.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-testing-jasmine.d.ts +9 -10
- package/types/kirbydesign-designsystem-testing-jasmine.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-testing-jest.d.ts +9 -10
- package/types/kirbydesign-designsystem-testing-jest.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-testing.d.ts +52 -58
- package/types/kirbydesign-designsystem-testing.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-toast.d.ts +25 -31
- package/types/kirbydesign-designsystem-toast.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-toggle-button.d.ts +62 -56
- package/types/kirbydesign-designsystem-toggle-button.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-toggle.d.ts +71 -63
- package/types/kirbydesign-designsystem-toggle.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-types.d.ts +15 -22
- package/types/kirbydesign-designsystem-types.d.ts.map +1 -1
- package/types/kirbydesign-designsystem.d.ts +135 -123
- package/types/kirbydesign-designsystem.d.ts.map +1 -1
- package/accordion/package.json +0 -4
- package/action-group/package.json +0 -4
- package/avatar/package.json +0 -4
- package/badge/package.json +0 -4
- package/button/package.json +0 -4
- package/calendar/package.json +0 -4
- package/card/package.json +0 -4
- package/chart/package.json +0 -4
- package/checkbox/package.json +0 -4
- package/config/package.json +0 -4
- package/data-table/package.json +0 -4
- package/divider/package.json +0 -4
- package/dropdown/package.json +0 -4
- package/empty-state/package.json +0 -4
- package/fab-sheet/package.json +0 -4
- package/flag/package.json +0 -4
- package/form-field/package.json +0 -4
- package/gesture/package.json +0 -4
- package/header/package.json +0 -4
- package/helpers/package.json +0 -4
- package/helpers/scss/package.json +0 -4
- package/icon/package.json +0 -4
- package/item/package.json +0 -4
- package/item-group/package.json +0 -4
- package/item-sliding/package.json +0 -4
- package/kirby-app/package.json +0 -4
- package/list/package.json +0 -4
- package/loading-overlay/package.json +0 -4
- package/menu/package.json +0 -4
- package/modal/package.json +0 -4
- package/page/package.json +0 -4
- package/popover/package.json +0 -4
- package/progress-circle/package.json +0 -4
- package/radio/package.json +0 -4
- package/range/package.json +0 -4
- package/reorder-list/package.json +0 -4
- package/router-outlet/package.json +0 -4
- package/section-header/package.json +0 -4
- package/segmented-control/package.json +0 -4
- package/shared/floating/package.json +0 -4
- package/shared/package.json +0 -4
- package/shared/portal/package.json +0 -4
- package/slide/package.json +0 -4
- package/slide-button/package.json +0 -4
- package/spinner/package.json +0 -4
- package/tab-navigation/package.json +0 -4
- package/tabs/package.json +0 -4
- package/testing/package.json +0 -4
- package/testing-base/package.json +0 -4
- package/testing-jasmine/package.json +0 -4
- package/testing-jest/package.json +0 -4
- package/toast/package.json +0 -4
- package/toggle/package.json +0 -4
- package/toggle-button/package.json +0 -4
- package/types/package.json +0 -4
|
@@ -1,135 +1,230 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonComponent } from
|
|
4
|
-
import { ItemComponent } from
|
|
5
|
-
import { MenuComponent } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ContentChildren, ElementRef, HostBinding, Inject, InjectionToken, Input, Optional, ViewChild } from "@angular/core";
|
|
3
|
+
import { ButtonComponent } from "@kirbydesign/designsystem/button";
|
|
4
|
+
import { ItemComponent } from "@kirbydesign/designsystem/item";
|
|
5
|
+
import { MenuComponent } from "@kirbydesign/designsystem/menu";
|
|
6
|
+
const ACTIONGROUP_CONFIG = new InjectionToken("action-group.config");
|
|
7
|
+
var ActionGroupComponent = class ActionGroupComponent {
|
|
8
|
+
get _align() {
|
|
9
|
+
return "align-" + this.align;
|
|
10
|
+
}
|
|
11
|
+
constructor(elementRef, renderer, config) {
|
|
12
|
+
this.elementRef = elementRef;
|
|
13
|
+
this.renderer = renderer;
|
|
14
|
+
this.config = config;
|
|
15
|
+
this.align = "end";
|
|
16
|
+
this._collapsedActions = [];
|
|
17
|
+
this.collapseThreshold = 2;
|
|
18
|
+
}
|
|
19
|
+
ngAfterContentInit() {
|
|
20
|
+
if (this.visibleActions < this.collapseThreshold) this.collapseThreshold = this.visibleActions;
|
|
21
|
+
this.initializeFromConfig();
|
|
22
|
+
if (this.visibleActions !== void 0) this.initializeCollapsing();
|
|
23
|
+
}
|
|
24
|
+
ngOnChanges(changes) {
|
|
25
|
+
if (changes.visibleActions && !changes.visibleActions.firstChange) {
|
|
26
|
+
if (this.config?.maxVisibleActions === void 0 || this.config?.maxVisibleActions === null || changes.visibleActions.currentValue <= this.config?.maxVisibleActions) this.initializeCollapsing();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
onActionSelect(action) {
|
|
30
|
+
const event = new PointerEvent("click", {
|
|
31
|
+
bubbles: true,
|
|
32
|
+
cancelable: true,
|
|
33
|
+
view: window
|
|
34
|
+
});
|
|
35
|
+
action.button.dispatchEvent(event);
|
|
36
|
+
}
|
|
37
|
+
initializeFromConfig() {
|
|
38
|
+
if (!this.config) return;
|
|
39
|
+
if (this.visibleActions === void 0 && this.config.defaultVisibleActions !== void 0) this.visibleActions = this.config.defaultVisibleActions;
|
|
40
|
+
if (this.config.maxVisibleActions !== void 0) {
|
|
41
|
+
if (!(this.visibleActions < this.config.maxVisibleActions)) this.visibleActions = this.config.maxVisibleActions;
|
|
42
|
+
}
|
|
43
|
+
if (this.config.isCondensed) this.buttons?.forEach((button) => button.showIconOnly = true);
|
|
44
|
+
}
|
|
45
|
+
initializeCollapsing() {
|
|
46
|
+
if (this.buttonElements.length <= this.collapseThreshold) return;
|
|
47
|
+
this.moveButtons();
|
|
48
|
+
this.populateMenu();
|
|
49
|
+
this.toggleMenu();
|
|
50
|
+
}
|
|
51
|
+
moveButtons() {
|
|
52
|
+
[...this.buttonElements].slice(0, this.visibleActions).filter((btn) => btn.nativeElement.parentElement === this.hiddenLayer.nativeElement).forEach((button) => {
|
|
53
|
+
this.renderer.insertBefore(this.elementRef.nativeElement, button.nativeElement, this.menuElement.nativeElement);
|
|
54
|
+
});
|
|
55
|
+
[...this.buttonElements].slice(this.visibleActions).forEach((button) => {
|
|
56
|
+
this.renderer.appendChild(this.hiddenLayer.nativeElement, button.nativeElement);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
toggleMenu() {
|
|
60
|
+
const hasHiddenButtons = this.hiddenLayer.nativeElement.childElementCount > 0;
|
|
61
|
+
this._isCollapsed = hasHiddenButtons;
|
|
62
|
+
}
|
|
63
|
+
populateMenu() {
|
|
64
|
+
const hiddenButtons = Array.from(this.hiddenLayer.nativeElement.children);
|
|
65
|
+
this._collapsedActions = hiddenButtons.map((button) => ({
|
|
66
|
+
button,
|
|
67
|
+
text: button.textContent.trim()
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
static {
|
|
71
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
72
|
+
minVersion: "12.0.0",
|
|
73
|
+
version: "22.2.2",
|
|
74
|
+
ngImport: i0,
|
|
75
|
+
type: ActionGroupComponent,
|
|
76
|
+
deps: [
|
|
77
|
+
{ token: i0.ElementRef },
|
|
78
|
+
{ token: i0.Renderer2 },
|
|
79
|
+
{
|
|
80
|
+
token: ACTIONGROUP_CONFIG,
|
|
81
|
+
optional: true
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
static {
|
|
88
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
89
|
+
minVersion: "17.0.0",
|
|
90
|
+
version: "22.2.2",
|
|
91
|
+
type: ActionGroupComponent,
|
|
92
|
+
isStandalone: true,
|
|
93
|
+
selector: "kirby-action-group",
|
|
94
|
+
inputs: {
|
|
95
|
+
visibleActions: "visibleActions",
|
|
96
|
+
align: "align"
|
|
97
|
+
},
|
|
98
|
+
host: { properties: {
|
|
99
|
+
"class.is-collapsed": "this._isCollapsed",
|
|
100
|
+
"class": "this._align"
|
|
101
|
+
} },
|
|
102
|
+
queries: [{
|
|
103
|
+
propertyName: "buttonElements",
|
|
104
|
+
predicate: ButtonComponent,
|
|
105
|
+
read: ElementRef
|
|
106
|
+
}, {
|
|
107
|
+
propertyName: "buttons",
|
|
108
|
+
predicate: ButtonComponent
|
|
109
|
+
}],
|
|
110
|
+
viewQueries: [{
|
|
111
|
+
propertyName: "hiddenLayer",
|
|
112
|
+
first: true,
|
|
113
|
+
predicate: ["hiddenLayer"],
|
|
114
|
+
descendants: true,
|
|
115
|
+
read: ElementRef,
|
|
116
|
+
static: true
|
|
117
|
+
}, {
|
|
118
|
+
propertyName: "menuElement",
|
|
119
|
+
first: true,
|
|
120
|
+
predicate: MenuComponent,
|
|
121
|
+
descendants: true,
|
|
122
|
+
read: ElementRef,
|
|
123
|
+
static: true
|
|
124
|
+
}],
|
|
125
|
+
usesOnChanges: true,
|
|
126
|
+
ngImport: i0,
|
|
127
|
+
template: "<ng-content select=\"button[kirby-button]\"></ng-content>\n\n<kirby-menu [placement]=\"'bottom-end'\">\n @for (action of _collapsedActions; track action.text) {\n <kirby-item\n [selectable]=\"true\"\n [disabled]=\"action.button?.disabled\"\n (click)=\"onActionSelect(action)\"\n >\n {{ action.text }}\n </kirby-item>\n }\n</kirby-menu>\n\n<div class=\"hidden-layer\" #hiddenLayer></div>\n",
|
|
128
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-wrap:wrap;position:relative;gap:var(--kirby-spacing-xxs)}:host(.align-end){justify-content:flex-end}:host(.align-end) .hidden-layer{order:-1}@media(max-width:767px){:host-context(kirby-header .actions.emphasize){justify-content:flex-start}}.hidden-layer{display:none;visibility:hidden}kirby-menu{display:none;z-index:1}:host(.is-collapsed) kirby-menu{display:inline-block}\n"],
|
|
129
|
+
dependencies: [{
|
|
130
|
+
kind: "component",
|
|
131
|
+
type: ItemComponent,
|
|
132
|
+
selector: "kirby-item",
|
|
133
|
+
inputs: [
|
|
134
|
+
"disabled",
|
|
135
|
+
"selected",
|
|
136
|
+
"disclosure",
|
|
137
|
+
"selectable",
|
|
138
|
+
"reorderable",
|
|
139
|
+
"size",
|
|
140
|
+
"href",
|
|
141
|
+
"rotateIcon"
|
|
142
|
+
]
|
|
143
|
+
}, {
|
|
144
|
+
kind: "component",
|
|
145
|
+
type: MenuComponent,
|
|
146
|
+
selector: "kirby-menu",
|
|
147
|
+
inputs: [
|
|
148
|
+
"isDisabled",
|
|
149
|
+
"buttonSize",
|
|
150
|
+
"placement",
|
|
151
|
+
"attentionLevel",
|
|
152
|
+
"triggers",
|
|
153
|
+
"DOMPortalOutlet",
|
|
154
|
+
"portalOutletConfig",
|
|
155
|
+
"autoPlacement",
|
|
156
|
+
"closeOnSelect",
|
|
157
|
+
"closeOnEscapeKey",
|
|
158
|
+
"closeOnBackdrop",
|
|
159
|
+
"shift",
|
|
160
|
+
"minWidth"
|
|
161
|
+
]
|
|
162
|
+
}],
|
|
163
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
168
|
+
minVersion: "12.0.0",
|
|
169
|
+
version: "22.2.2",
|
|
170
|
+
ngImport: i0,
|
|
171
|
+
type: ActionGroupComponent,
|
|
172
|
+
decorators: [{
|
|
173
|
+
type: Component,
|
|
174
|
+
args: [{
|
|
175
|
+
selector: "kirby-action-group",
|
|
176
|
+
imports: [ItemComponent, MenuComponent],
|
|
177
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
178
|
+
template: "<ng-content select=\"button[kirby-button]\"></ng-content>\n\n<kirby-menu [placement]=\"'bottom-end'\">\n @for (action of _collapsedActions; track action.text) {\n <kirby-item\n [selectable]=\"true\"\n [disabled]=\"action.button?.disabled\"\n (click)=\"onActionSelect(action)\"\n >\n {{ action.text }}\n </kirby-item>\n }\n</kirby-menu>\n\n<div class=\"hidden-layer\" #hiddenLayer></div>\n",
|
|
179
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{display:flex;flex-wrap:wrap;position:relative;gap:var(--kirby-spacing-xxs)}:host(.align-end){justify-content:flex-end}:host(.align-end) .hidden-layer{order:-1}@media(max-width:767px){:host-context(kirby-header .actions.emphasize){justify-content:flex-start}}.hidden-layer{display:none;visibility:hidden}kirby-menu{display:none;z-index:1}:host(.is-collapsed) kirby-menu{display:inline-block}\n"]
|
|
180
|
+
}]
|
|
181
|
+
}],
|
|
182
|
+
ctorParameters: () => [
|
|
183
|
+
{ type: i0.ElementRef },
|
|
184
|
+
{ type: i0.Renderer2 },
|
|
185
|
+
{
|
|
186
|
+
type: void 0,
|
|
187
|
+
decorators: [{ type: Optional }, {
|
|
188
|
+
type: Inject,
|
|
189
|
+
args: [ACTIONGROUP_CONFIG]
|
|
190
|
+
}]
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
propDecorators: {
|
|
194
|
+
visibleActions: [{ type: Input }],
|
|
195
|
+
align: [{ type: Input }],
|
|
196
|
+
buttonElements: [{
|
|
197
|
+
type: ContentChildren,
|
|
198
|
+
args: [ButtonComponent, { read: ElementRef }]
|
|
199
|
+
}],
|
|
200
|
+
buttons: [{
|
|
201
|
+
type: ContentChildren,
|
|
202
|
+
args: [ButtonComponent]
|
|
203
|
+
}],
|
|
204
|
+
hiddenLayer: [{
|
|
205
|
+
type: ViewChild,
|
|
206
|
+
args: ["hiddenLayer", {
|
|
207
|
+
read: ElementRef,
|
|
208
|
+
static: true
|
|
209
|
+
}]
|
|
210
|
+
}],
|
|
211
|
+
menuElement: [{
|
|
212
|
+
type: ViewChild,
|
|
213
|
+
args: [MenuComponent, {
|
|
214
|
+
read: ElementRef,
|
|
215
|
+
static: true
|
|
216
|
+
}]
|
|
217
|
+
}],
|
|
218
|
+
_isCollapsed: [{
|
|
219
|
+
type: HostBinding,
|
|
220
|
+
args: ["class.is-collapsed"]
|
|
221
|
+
}],
|
|
222
|
+
_align: [{
|
|
223
|
+
type: HostBinding,
|
|
224
|
+
args: ["class"]
|
|
225
|
+
}]
|
|
226
|
+
}
|
|
227
|
+
});
|
|
134
228
|
export { ACTIONGROUP_CONFIG, ActionGroupComponent };
|
|
135
|
-
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=kirbydesign-designsystem-action-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kirbydesign-designsystem-action-group.mjs","sources":["../../action-group/src/action-group.component.ts","../../action-group/src/action-group.component.html","../../action-group/src/kirbydesign-designsystem-action-group.ts"],"sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n HostBinding,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n Optional,\n QueryList,\n Renderer2,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { ItemComponent } from '@kirbydesign/designsystem/item';\nimport { MenuComponent } from '@kirbydesign/designsystem/menu';\n\nexport type ActionGroupConfig = {\n isCondensed?: boolean;\n defaultVisibleActions?: number;\n maxVisibleActions?: number;\n};\nexport const ACTIONGROUP_CONFIG = new InjectionToken<ActionGroupConfig>('action-group.config');\n\ntype CollapsedAction = { button: HTMLButtonElement; text: string };\n\n@Component({\n selector: 'kirby-action-group',\n imports: [ItemComponent, MenuComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './action-group.component.html',\n styleUrls: ['./action-group.component.scss'],\n})\nexport class ActionGroupComponent implements AfterContentInit, OnChanges {\n @Input() visibleActions?: number;\n\n @Input()\n align: 'start' | 'end' = 'end';\n\n @ContentChildren(ButtonComponent, { read: ElementRef }) private buttonElements?: QueryList<\n ElementRef<HTMLButtonElement>\n >;\n @ContentChildren(ButtonComponent) private buttons?: QueryList<ButtonComponent>;\n @ViewChild('hiddenLayer', { read: ElementRef, static: true })\n private hiddenLayer!: ElementRef<HTMLElement>;\n\n @ViewChild(MenuComponent, { read: ElementRef, static: true })\n private menuElement!: ElementRef<HTMLElement>;\n\n @HostBinding('class.is-collapsed')\n _isCollapsed: boolean;\n _collapsedActions: CollapsedAction[] = [];\n\n @HostBinding('class')\n get _align() {\n return 'align-' + this.align;\n }\n\n private collapseThreshold = 2;\n\n constructor(\n private elementRef: ElementRef<HTMLElement>,\n private renderer: Renderer2,\n @Optional() @Inject(ACTIONGROUP_CONFIG) private config: ActionGroupConfig\n ) {}\n\n ngAfterContentInit(): void {\n // Ensure we collapse according to visibleActions if lower than our default threshold (2).\n // I.e. if there are 2 buttons and visibleActions = 1 we'll collapse the 2nd button into the menu:\n if (this.visibleActions < this.collapseThreshold) {\n this.collapseThreshold = this.visibleActions;\n }\n\n this.initializeFromConfig();\n\n if (this.visibleActions !== undefined) {\n this.initializeCollapsing();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.visibleActions && !changes.visibleActions.firstChange) {\n const satifiesMaxVisibleActions =\n this.config?.maxVisibleActions === undefined ||\n this.config?.maxVisibleActions === null ||\n changes.visibleActions.currentValue <= this.config?.maxVisibleActions;\n if (satifiesMaxVisibleActions) {\n this.initializeCollapsing();\n }\n }\n }\n\n onActionSelect(action: CollapsedAction) {\n const event = new PointerEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n });\n\n action.button.dispatchEvent(event);\n }\n\n private initializeFromConfig() {\n if (!this.config) return;\n\n if (this.visibleActions === undefined && this.config.defaultVisibleActions !== undefined) {\n this.visibleActions = this.config.defaultVisibleActions;\n }\n\n if (this.config.maxVisibleActions !== undefined) {\n // Don't overwrite visibleActions value if configured lower than maxVisibleActions:\n if (!(this.visibleActions < this.config.maxVisibleActions)) {\n this.visibleActions = this.config.maxVisibleActions;\n }\n }\n\n if (this.config.isCondensed) {\n this.buttons?.forEach((button) => (button.showIconOnly = true));\n }\n }\n\n private initializeCollapsing() {\n if (this.buttonElements.length <= this.collapseThreshold) return;\n\n this.moveButtons();\n this.populateMenu();\n this.toggleMenu();\n }\n\n private moveButtons() {\n const buttonsToShow = [...this.buttonElements]\n .slice(0, this.visibleActions)\n .filter((btn) => btn.nativeElement.parentElement === this.hiddenLayer.nativeElement);\n buttonsToShow.forEach((button) => {\n this.renderer.insertBefore(\n this.elementRef.nativeElement,\n button.nativeElement,\n this.menuElement.nativeElement\n );\n });\n\n const buttonsToHide = [...this.buttonElements].slice(this.visibleActions);\n buttonsToHide.forEach((button) => {\n this.renderer.appendChild(this.hiddenLayer.nativeElement, button.nativeElement);\n });\n }\n\n private toggleMenu() {\n const hasHiddenButtons = this.hiddenLayer.nativeElement.childElementCount > 0;\n this._isCollapsed = hasHiddenButtons;\n }\n\n private populateMenu() {\n const hiddenButtons = Array.from(\n this.hiddenLayer.nativeElement.children\n ) as HTMLButtonElement[];\n\n this._collapsedActions = hiddenButtons.map((button) => ({\n button,\n text: button.textContent.trim(),\n }));\n }\n}\n","<ng-content select=\"button[kirby-button]\"></ng-content>\n\n<kirby-menu [placement]=\"'bottom-end'\">\n @for (action of _collapsedActions; track action.text) {\n <kirby-item\n [selectable]=\"true\"\n [disabled]=\"action.button?.disabled\"\n (click)=\"onActionSelect(action)\"\n >\n {{ action.text }}\n </kirby-item>\n }\n</kirby-menu>\n\n<div class=\"hidden-layer\" #hiddenLayer></div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MA0Ba,kBAAkB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;MAWhF,oBAAoB,CAAA;AAoB/B,IAAA,IACI,MAAM,GAAA;AACR,QAAA,OAAO,QAAQ,GAAG,IAAI,CAAC,KAAK;IAC9B;AAIA,IAAA,WAAA,CACU,UAAmC,EACnC,QAAmB,EACqB,MAAyB,EAAA;QAFjE,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACgC,IAAA,CAAA,MAAM,GAAN,MAAM;QA1BxD,IAAA,CAAA,KAAK,GAAoB,KAAK;QAc9B,IAAA,CAAA,iBAAiB,GAAsB,EAAE;QAOjC,IAAA,CAAA,iBAAiB,GAAG,CAAC;IAM1B;IAEH,kBAAkB,GAAA;;;QAGhB,IAAI,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE;AAChD,YAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc;QAC9C;QAEA,IAAI,CAAC,oBAAoB,EAAE;AAE3B,QAAA,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;YACrC,IAAI,CAAC,oBAAoB,EAAE;QAC7B;IACF;AAEA,IAAA,WAAW,CAAC,OAAsB,EAAA;QAChC,IAAI,OAAO,CAAC,cAAc,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE;YACjE,MAAM,yBAAyB,GAC7B,IAAI,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS;AAC5C,gBAAA,IAAI,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI;gBACvC,OAAO,CAAC,cAAc,CAAC,YAAY,IAAI,IAAI,CAAC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,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAK3B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;+BACE,oBAAoB,EAAA,OAAA,EACrB,CAAC,aAAa,EAAE,aAAa,CAAC,EAAA,eAAA,EACtB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qaAAA,EAAA,MAAA,EAAA,CAAA,wfAAA,CAAA,EAAA;;0BAkC5C;;0BAAY,MAAM;2BAAC,kBAAkB;;sBA7BvC;;sBAEA;;sBAGA,eAAe;AAAC,gBAAA,IAAA,EAAA,CAAA,eAAe,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;;sBAGrD,eAAe;uBAAC,eAAe;;sBAC/B,SAAS;uBAAC,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAG3D,SAAS;uBAAC,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;;sBAG3D,WAAW;uBAAC,oBAAoB;;sBAIhC,WAAW;uBAAC,OAAO;;;AEzDtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"kirbydesign-designsystem-action-group.mjs","names":[],"sources":["../../action-group/src/action-group.component.ts","../../action-group/src/action-group.component.html"],"sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n ElementRef,\n HostBinding,\n Inject,\n InjectionToken,\n Input,\n OnChanges,\n Optional,\n QueryList,\n Renderer2,\n SimpleChanges,\n ViewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { ItemComponent } from '@kirbydesign/designsystem/item';\nimport { MenuComponent } from '@kirbydesign/designsystem/menu';\n\nexport type ActionGroupConfig = {\n isCondensed?: boolean;\n defaultVisibleActions?: number;\n maxVisibleActions?: number;\n};\nexport const ACTIONGROUP_CONFIG = new InjectionToken<ActionGroupConfig>('action-group.config');\n\ntype CollapsedAction = { button: HTMLButtonElement; text: string };\n\n@Component({\n selector: 'kirby-action-group',\n imports: [ItemComponent, MenuComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './action-group.component.html',\n styleUrls: ['./action-group.component.scss'],\n})\nexport class ActionGroupComponent implements AfterContentInit, OnChanges {\n @Input() visibleActions?: number;\n\n @Input()\n align: 'start' | 'end' = 'end';\n\n @ContentChildren(ButtonComponent, { read: ElementRef }) private buttonElements?: QueryList<\n ElementRef<HTMLButtonElement>\n >;\n @ContentChildren(ButtonComponent) private buttons?: QueryList<ButtonComponent>;\n @ViewChild('hiddenLayer', { read: ElementRef, static: true })\n private hiddenLayer!: ElementRef<HTMLElement>;\n\n @ViewChild(MenuComponent, { read: ElementRef, static: true })\n private menuElement!: ElementRef<HTMLElement>;\n\n @HostBinding('class.is-collapsed')\n _isCollapsed: boolean;\n _collapsedActions: CollapsedAction[] = [];\n\n @HostBinding('class')\n get _align() {\n return 'align-' + this.align;\n }\n\n private collapseThreshold = 2;\n\n constructor(\n private elementRef: ElementRef<HTMLElement>,\n private renderer: Renderer2,\n @Optional() @Inject(ACTIONGROUP_CONFIG) private config: ActionGroupConfig\n ) {}\n\n ngAfterContentInit(): void {\n // Ensure we collapse according to visibleActions if lower than our default threshold (2).\n // I.e. if there are 2 buttons and visibleActions = 1 we'll collapse the 2nd button into the menu:\n if (this.visibleActions < this.collapseThreshold) {\n this.collapseThreshold = this.visibleActions;\n }\n\n this.initializeFromConfig();\n\n if (this.visibleActions !== undefined) {\n this.initializeCollapsing();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.visibleActions && !changes.visibleActions.firstChange) {\n const satifiesMaxVisibleActions =\n this.config?.maxVisibleActions === undefined ||\n this.config?.maxVisibleActions === null ||\n changes.visibleActions.currentValue <= this.config?.maxVisibleActions;\n if (satifiesMaxVisibleActions) {\n this.initializeCollapsing();\n }\n }\n }\n\n onActionSelect(action: CollapsedAction) {\n const event = new PointerEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n });\n\n action.button.dispatchEvent(event);\n }\n\n private initializeFromConfig() {\n if (!this.config) return;\n\n if (this.visibleActions === undefined && this.config.defaultVisibleActions !== undefined) {\n this.visibleActions = this.config.defaultVisibleActions;\n }\n\n if (this.config.maxVisibleActions !== undefined) {\n // Don't overwrite visibleActions value if configured lower than maxVisibleActions:\n if (!(this.visibleActions < this.config.maxVisibleActions)) {\n this.visibleActions = this.config.maxVisibleActions;\n }\n }\n\n if (this.config.isCondensed) {\n this.buttons?.forEach((button) => (button.showIconOnly = true));\n }\n }\n\n private initializeCollapsing() {\n if (this.buttonElements.length <= this.collapseThreshold) return;\n\n this.moveButtons();\n this.populateMenu();\n this.toggleMenu();\n }\n\n private moveButtons() {\n const buttonsToShow = [...this.buttonElements]\n .slice(0, this.visibleActions)\n .filter((btn) => btn.nativeElement.parentElement === this.hiddenLayer.nativeElement);\n buttonsToShow.forEach((button) => {\n this.renderer.insertBefore(\n this.elementRef.nativeElement,\n button.nativeElement,\n this.menuElement.nativeElement\n );\n });\n\n const buttonsToHide = [...this.buttonElements].slice(this.visibleActions);\n buttonsToHide.forEach((button) => {\n this.renderer.appendChild(this.hiddenLayer.nativeElement, button.nativeElement);\n });\n }\n\n private toggleMenu() {\n const hasHiddenButtons = this.hiddenLayer.nativeElement.childElementCount > 0;\n this._isCollapsed = hasHiddenButtons;\n }\n\n private populateMenu() {\n const hiddenButtons = Array.from(\n this.hiddenLayer.nativeElement.children\n ) as HTMLButtonElement[];\n\n this._collapsedActions = hiddenButtons.map((button) => ({\n button,\n text: button.textContent.trim(),\n }));\n }\n}\n","<ng-content select=\"button[kirby-button]\"></ng-content>\n\n<kirby-menu [placement]=\"'bottom-end'\">\n @for (action of _collapsedActions; track action.text) {\n <kirby-item\n [selectable]=\"true\"\n [disabled]=\"action.button?.disabled\"\n (click)=\"onActionSelect(action)\"\n >\n {{ action.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A,eAAe;IAAE,MAAM;IAAY,QAAQ;GAAI,CAAE;;;GAG3D,MAAA;GAAU,MAAA,CAAA,eAAe;IAAE,MAAM;IAAY,QAAQ;GAAI,CAAE;;;GAG3D,MAAA;GAAY,MAAA,CAAA,oBAAoB;;;GAIhC,MAAA;GAAY,MAAA,CAAA,OAAO"}
|
|
@@ -1,58 +1,101 @@
|
|
|
1
|
-
import * as i1 from
|
|
2
|
-
import { CommonModule } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import * as i1 from "@angular/common";
|
|
2
|
+
import { CommonModule } from "@angular/common";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from "@angular/core";
|
|
6
5
|
var AvatarSize;
|
|
7
|
-
(function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
(function(AvatarSize) {
|
|
7
|
+
AvatarSize["XS"] = "xs";
|
|
8
|
+
AvatarSize["SM"] = "sm";
|
|
9
|
+
AvatarSize["MD"] = "md";
|
|
10
|
+
AvatarSize["LG"] = "lg";
|
|
12
11
|
})(AvatarSize || (AvatarSize = {}));
|
|
13
|
-
class AvatarComponent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
12
|
+
var AvatarComponent = class AvatarComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.size = AvatarSize.SM;
|
|
15
|
+
this.imageError = new EventEmitter();
|
|
16
|
+
}
|
|
17
|
+
get _cssClass() {
|
|
18
|
+
return [this.themeColor, this.size].filter((cssClass) => !!cssClass);
|
|
19
|
+
}
|
|
20
|
+
onImageError($event) {
|
|
21
|
+
this.imageError.emit($event);
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.2",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: AvatarComponent,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
static {
|
|
34
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
35
|
+
minVersion: "17.0.0",
|
|
36
|
+
version: "22.2.2",
|
|
37
|
+
type: AvatarComponent,
|
|
38
|
+
isStandalone: true,
|
|
39
|
+
selector: "kirby-avatar",
|
|
40
|
+
inputs: {
|
|
41
|
+
imageSrc: "imageSrc",
|
|
42
|
+
imageLoading: "imageLoading",
|
|
43
|
+
altText: "altText",
|
|
44
|
+
stroke: "stroke",
|
|
45
|
+
text: "text",
|
|
46
|
+
overlay: "overlay",
|
|
47
|
+
size: "size",
|
|
48
|
+
themeColor: "themeColor"
|
|
49
|
+
},
|
|
50
|
+
outputs: { imageError: "imageError" },
|
|
51
|
+
host: { properties: { "class": "this._cssClass" } },
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
template: "<div class=\"avatar\" [ngClass]=\"{ overlay: overlay, stroke: stroke }\">\n @if (imageSrc) {\n <img\n [src]=\"imageSrc\"\n [attr.alt]=\"altText\"\n [attr.loading]=\"imageLoading\"\n (error)=\"onImageError($event)\"\n />\n }\n @if (!text) {\n <ng-content select=\"kirby-icon\"></ng-content>\n }\n @if (text) {\n <span class=\"avatar-text\">{{ text }}</span>\n }\n</div>\n<ng-content select=\"kirby-badge\"></ng-content>\n",
|
|
54
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{--kirby-badge-position: absolute;--kirby-badge-right: calc(6px - .5rem) ;--kirby-badge-top: calc(6px - .5rem) ;--kirby-badge-z-index: var(--kirby-z-index-avatar-badge);position:relative}.avatar{width:40px;height:40px;border-radius:var(--kirby-border-radius-circle);overflow:hidden;position:relative;z-index:1;display:flex;justify-content:center;align-items:center;background-color:var(--kirby-avatar-background-color, var(--kirby-white));color:var(--kirby-avatar-color, var(--kirby-light-contrast))}.avatar.stroke{border:1px solid var(--kirby-semi-light)}.avatar.overlay:before{content:\"\";background-color:var(--kirby-black);opacity:.05;width:100%;height:100%;position:absolute;top:0;left:0}.avatar img{object-fit:cover;max-width:100%;height:100%;width:100%}:host(.xs) .avatar{--kirby-icon-font-size: 24px;width:32px;height:32px;border-radius:8px}:host(.xs) .avatar .avatar-text{font-size:var(--kirby-font-size-s)}:host-context(kirby-progress-circle.sm) .avatar,:host(.sm) .avatar{--kirby-icon-font-size: 24px;width:40px;height:40px}:host-context(kirby-progress-circle.sm) .avatar .avatar-text,:host(.sm) .avatar .avatar-text{font-size:var(--kirby-font-size-s)}:host-context(kirby-progress-circle.md),:host(.md){--kirby-badge-right: calc(8px - .5rem) ;--kirby-badge-top: calc(8px - .5rem) }:host-context(kirby-progress-circle.md) .avatar,:host(.md) .avatar{--kirby-icon-font-size: 32px;width:56px;height:56px}:host-context(kirby-progress-circle.md) .avatar .avatar-text,:host(.md) .avatar .avatar-text{font-size:var(--kirby-font-size-m)}:host-context(kirby-progress-circle.lg),:host(.lg){--kirby-badge-right: calc(14px - .5rem) ;--kirby-badge-top: calc(14px - .5rem) }:host-context(kirby-progress-circle.lg) .avatar,:host(.lg) .avatar{--kirby-icon-font-size: 56px;width:96px;height:96px}:host-context(kirby-progress-circle.lg) .avatar .avatar-text,:host(.lg) .avatar .avatar-text{font-size:var(--kirby-font-size-xl)}:host-context(kirby-item)[slot=start]{margin-inline-end:var(--kirby-spacing-xs)}:host-context(kirby-item)[slot=start].xs{margin-inline-end:var(--kirby-spacing-s)}:host(.primary){--kirby-avatar-background-color: var(--kirby-primary);--kirby-avatar-color: var(--kirby-primary-contrast)}:host(.secondary){--kirby-avatar-background-color: var(--kirby-secondary);--kirby-avatar-color: var(--kirby-secondary-contrast)}:host(.tertiary){--kirby-avatar-background-color: var(--kirby-tertiary);--kirby-avatar-color: var(--kirby-tertiary-contrast)}:host(.success){--kirby-avatar-background-color: var(--kirby-success);--kirby-avatar-color: var(--kirby-success-contrast)}:host(.warning){--kirby-avatar-background-color: var(--kirby-warning);--kirby-avatar-color: var(--kirby-warning-contrast)}:host(.danger){--kirby-avatar-background-color: var(--kirby-danger);--kirby-avatar-color: var(--kirby-danger-contrast)}:host(.white-overlay){--kirby-avatar-background-color: var(--kirby-white-overlay);--kirby-avatar-color: var(--kirby-white-overlay-contrast)}:host(.light){--kirby-avatar-background-color: var(--kirby-light);--kirby-avatar-color: var(--kirby-light-contrast)}:host(.medium){--kirby-avatar-background-color: var(--kirby-medium);--kirby-avatar-color: var(--kirby-medium-contrast)}:host(.dark){--kirby-avatar-background-color: var(--kirby-dark);--kirby-avatar-color: var(--kirby-dark-contrast)}:host(.dark-overlay){--kirby-avatar-background-color: var(--kirby-dark-overlay);--kirby-avatar-color: var(--kirby-dark-overlay-contrast)}:host(.white){--kirby-avatar-background-color: var(--kirby-white);--kirby-avatar-color: var(--kirby-white-contrast)}:host(.semi-light){--kirby-avatar-background-color: var(--kirby-semi-light);--kirby-avatar-color: var(--kirby-semi-light-contrast)}\n"],
|
|
55
|
+
dependencies: [{
|
|
56
|
+
kind: "ngmodule",
|
|
57
|
+
type: CommonModule
|
|
58
|
+
}, {
|
|
59
|
+
kind: "directive",
|
|
60
|
+
type: i1.NgClass,
|
|
61
|
+
selector: "[ngClass]",
|
|
62
|
+
inputs: ["class", "ngClass"]
|
|
63
|
+
}],
|
|
64
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.2.2",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: AvatarComponent,
|
|
73
|
+
decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{
|
|
76
|
+
imports: [CommonModule],
|
|
77
|
+
selector: "kirby-avatar",
|
|
78
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
79
|
+
template: "<div class=\"avatar\" [ngClass]=\"{ overlay: overlay, stroke: stroke }\">\n @if (imageSrc) {\n <img\n [src]=\"imageSrc\"\n [attr.alt]=\"altText\"\n [attr.loading]=\"imageLoading\"\n (error)=\"onImageError($event)\"\n />\n }\n @if (!text) {\n <ng-content select=\"kirby-icon\"></ng-content>\n }\n @if (text) {\n <span class=\"avatar-text\">{{ text }}</span>\n }\n</div>\n<ng-content select=\"kirby-badge\"></ng-content>\n",
|
|
80
|
+
styles: [".kirby-line-clamp{display:-webkit-box;-webkit-line-clamp:var(--line-clamp, none);-webkit-box-orient:vertical;overflow:hidden}:host{--kirby-badge-position: absolute;--kirby-badge-right: calc(6px - .5rem) ;--kirby-badge-top: calc(6px - .5rem) ;--kirby-badge-z-index: var(--kirby-z-index-avatar-badge);position:relative}.avatar{width:40px;height:40px;border-radius:var(--kirby-border-radius-circle);overflow:hidden;position:relative;z-index:1;display:flex;justify-content:center;align-items:center;background-color:var(--kirby-avatar-background-color, var(--kirby-white));color:var(--kirby-avatar-color, var(--kirby-light-contrast))}.avatar.stroke{border:1px solid var(--kirby-semi-light)}.avatar.overlay:before{content:\"\";background-color:var(--kirby-black);opacity:.05;width:100%;height:100%;position:absolute;top:0;left:0}.avatar img{object-fit:cover;max-width:100%;height:100%;width:100%}:host(.xs) .avatar{--kirby-icon-font-size: 24px;width:32px;height:32px;border-radius:8px}:host(.xs) .avatar .avatar-text{font-size:var(--kirby-font-size-s)}:host-context(kirby-progress-circle.sm) .avatar,:host(.sm) .avatar{--kirby-icon-font-size: 24px;width:40px;height:40px}:host-context(kirby-progress-circle.sm) .avatar .avatar-text,:host(.sm) .avatar .avatar-text{font-size:var(--kirby-font-size-s)}:host-context(kirby-progress-circle.md),:host(.md){--kirby-badge-right: calc(8px - .5rem) ;--kirby-badge-top: calc(8px - .5rem) }:host-context(kirby-progress-circle.md) .avatar,:host(.md) .avatar{--kirby-icon-font-size: 32px;width:56px;height:56px}:host-context(kirby-progress-circle.md) .avatar .avatar-text,:host(.md) .avatar .avatar-text{font-size:var(--kirby-font-size-m)}:host-context(kirby-progress-circle.lg),:host(.lg){--kirby-badge-right: calc(14px - .5rem) ;--kirby-badge-top: calc(14px - .5rem) }:host-context(kirby-progress-circle.lg) .avatar,:host(.lg) .avatar{--kirby-icon-font-size: 56px;width:96px;height:96px}:host-context(kirby-progress-circle.lg) .avatar .avatar-text,:host(.lg) .avatar .avatar-text{font-size:var(--kirby-font-size-xl)}:host-context(kirby-item)[slot=start]{margin-inline-end:var(--kirby-spacing-xs)}:host-context(kirby-item)[slot=start].xs{margin-inline-end:var(--kirby-spacing-s)}:host(.primary){--kirby-avatar-background-color: var(--kirby-primary);--kirby-avatar-color: var(--kirby-primary-contrast)}:host(.secondary){--kirby-avatar-background-color: var(--kirby-secondary);--kirby-avatar-color: var(--kirby-secondary-contrast)}:host(.tertiary){--kirby-avatar-background-color: var(--kirby-tertiary);--kirby-avatar-color: var(--kirby-tertiary-contrast)}:host(.success){--kirby-avatar-background-color: var(--kirby-success);--kirby-avatar-color: var(--kirby-success-contrast)}:host(.warning){--kirby-avatar-background-color: var(--kirby-warning);--kirby-avatar-color: var(--kirby-warning-contrast)}:host(.danger){--kirby-avatar-background-color: var(--kirby-danger);--kirby-avatar-color: var(--kirby-danger-contrast)}:host(.white-overlay){--kirby-avatar-background-color: var(--kirby-white-overlay);--kirby-avatar-color: var(--kirby-white-overlay-contrast)}:host(.light){--kirby-avatar-background-color: var(--kirby-light);--kirby-avatar-color: var(--kirby-light-contrast)}:host(.medium){--kirby-avatar-background-color: var(--kirby-medium);--kirby-avatar-color: var(--kirby-medium-contrast)}:host(.dark){--kirby-avatar-background-color: var(--kirby-dark);--kirby-avatar-color: var(--kirby-dark-contrast)}:host(.dark-overlay){--kirby-avatar-background-color: var(--kirby-dark-overlay);--kirby-avatar-color: var(--kirby-dark-overlay-contrast)}:host(.white){--kirby-avatar-background-color: var(--kirby-white);--kirby-avatar-color: var(--kirby-white-contrast)}:host(.semi-light){--kirby-avatar-background-color: var(--kirby-semi-light);--kirby-avatar-color: var(--kirby-semi-light-contrast)}\n"]
|
|
81
|
+
}]
|
|
82
|
+
}],
|
|
83
|
+
propDecorators: {
|
|
84
|
+
imageSrc: [{ type: Input }],
|
|
85
|
+
imageLoading: [{ type: Input }],
|
|
86
|
+
altText: [{ type: Input }],
|
|
87
|
+
stroke: [{ type: Input }],
|
|
88
|
+
text: [{ type: Input }],
|
|
89
|
+
overlay: [{ type: Input }],
|
|
90
|
+
size: [{ type: Input }],
|
|
91
|
+
themeColor: [{ type: Input }],
|
|
92
|
+
imageError: [{ type: Output }],
|
|
93
|
+
_cssClass: [{
|
|
94
|
+
type: HostBinding,
|
|
95
|
+
args: ["class"]
|
|
96
|
+
}]
|
|
97
|
+
}
|
|
98
|
+
});
|
|
57
99
|
export { AvatarComponent, AvatarSize };
|
|
58
|
-
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=kirbydesign-designsystem-avatar.mjs.map
|