@infineon/infineon-design-system-stencil 30.9.1--canary.1663.04cb986ccd7894a97ab77b9bea18e02ca81adbee.0 → 30.9.2--canary.1640.55f6082d40b32de317977a352b37983c1f14902c.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/dist/cjs/ifx-accordion_2.cjs.entry.js +2 -2
- package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-modal.cjs.entry.js +8 -8
- package/dist/cjs/ifx-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js +5 -5
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-search-bar.cjs.entry.js +5 -5
- package/dist/cjs/ifx-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js +9 -9
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +79 -3
- package/dist/collection/components/accordion/accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/accordionItem.js +4 -4
- package/dist/collection/components/accordion/accordionItem.js.map +1 -1
- package/dist/collection/components/alert/alert.stories.js +45 -12
- package/dist/collection/components/alert/alert.stories.js.map +1 -1
- package/dist/collection/components/badge/badge.stories.js +28 -7
- package/dist/collection/components/badge/badge.stories.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +66 -7
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js.map +1 -1
- package/dist/collection/components/button/button.stories.js +104 -9
- package/dist/collection/components/button/button.stories.js.map +1 -1
- package/dist/collection/components/card/card.stories.js +85 -2
- package/dist/collection/components/card/card.stories.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +75 -14
- package/dist/collection/components/checkbox/checkbox.stories.js.map +1 -1
- package/dist/collection/components/content-switcher/content-switcher.stories.js +65 -3
- package/dist/collection/components/content-switcher/content-switcher.stories.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.stories.js +73 -6
- package/dist/collection/components/date-picker/date-picker.stories.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.stories.js +161 -64
- package/dist/collection/components/dropdown/dropdown.stories.js.map +1 -1
- package/dist/collection/components/footer/footer.stories.js +7 -1
- package/dist/collection/components/footer/footer.stories.js.map +1 -1
- package/dist/collection/components/icon/infineonIconStencil.stories.js +7 -2
- package/dist/collection/components/icon/infineonIconStencil.stories.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.stories.js +61 -5
- package/dist/collection/components/icon-button/icon-button.stories.js.map +1 -1
- package/dist/collection/components/link/link.stories.js +56 -4
- package/dist/collection/components/link/link.stories.js.map +1 -1
- package/dist/collection/components/modal/modal.js +10 -10
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/modal/modal.stories.js +96 -19
- package/dist/collection/components/modal/modal.stories.js.map +1 -1
- package/dist/collection/components/navigation/navbar/navbar.stories.js +203 -12
- package/dist/collection/components/navigation/navbar/navbar.stories.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar-item.js +11 -11
- package/dist/collection/components/navigation/sidebar/sidebar-item.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js +110 -17
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js.map +1 -1
- package/dist/collection/components/notification/notification.stories.js +51 -4
- package/dist/collection/components/notification/notification.stories.js.map +1 -1
- package/dist/collection/components/number-indicator/number-indicator.stories.js +19 -0
- package/dist/collection/components/number-indicator/number-indicator.stories.js.map +1 -1
- package/dist/collection/components/pagination/pagination.stories.js +30 -3
- package/dist/collection/components/pagination/pagination.stories.js.map +1 -1
- package/dist/collection/components/progress-bar/progress-bar.stories.js +31 -8
- package/dist/collection/components/progress-bar/progress-bar.stories.js.map +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.js +66 -13
- package/dist/collection/components/radio-button/radio-button.stories.js.map +1 -1
- package/dist/collection/components/search-bar/search-bar.js +6 -6
- package/dist/collection/components/search-bar/search-bar.js.map +1 -1
- package/dist/collection/components/search-bar/search-bar.stories.js +58 -9
- package/dist/collection/components/search-bar/search-bar.stories.js.map +1 -1
- package/dist/collection/components/search-field/search-field.stories.js +43 -7
- package/dist/collection/components/search-field/search-field.stories.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.js +6 -6
- package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.stories.js +131 -5
- package/dist/collection/components/select/multi-select/multiselect.stories.js.map +1 -1
- package/dist/collection/components/select/single-select/select.stories.js +83 -26
- package/dist/collection/components/select/single-select/select.stories.js.map +1 -1
- package/dist/collection/components/slider/slider.stories.js +97 -13
- package/dist/collection/components/slider/slider.stories.js.map +1 -1
- package/dist/collection/components/spinner/spinner.stories.js +34 -2
- package/dist/collection/components/spinner/spinner.stories.js.map +1 -1
- package/dist/collection/components/status/status.stories.js +24 -1
- package/dist/collection/components/status/status.stories.js.map +1 -1
- package/dist/collection/components/stepper/stepper.stories.js +33 -16
- package/dist/collection/components/stepper/stepper.stories.js.map +1 -1
- package/dist/collection/components/switch/switch.stories.js +54 -4
- package/dist/collection/components/switch/switch.stories.js.map +1 -1
- package/dist/collection/components/table-advanced-version/table.stories.js +71 -11
- package/dist/collection/components/table-advanced-version/table.stories.js.map +1 -1
- package/dist/collection/components/table-basic-version/table.stories.js +17 -1
- package/dist/collection/components/table-basic-version/table.stories.js.map +1 -1
- package/dist/collection/components/tabs/tabs.stories.js +89 -23
- package/dist/collection/components/tabs/tabs.stories.js.map +1 -1
- package/dist/collection/components/tag/tag.stories.js +18 -0
- package/dist/collection/components/tag/tag.stories.js.map +1 -1
- package/dist/collection/components/text-field/text-field.stories.js +104 -13
- package/dist/collection/components/text-field/text-field.stories.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.stories.js +48 -4
- package/dist/collection/components/tooltip/tooltip.stories.js.map +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-faq.js +1 -1
- package/dist/components/ifx-modal.js +8 -8
- package/dist/components/ifx-modal.js.map +1 -1
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-search-bar.js +5 -5
- package/dist/components/ifx-search-bar.js.map +1 -1
- package/dist/components/ifx-set-filter.js +1 -1
- package/dist/components/ifx-sidebar-item.js +11 -11
- package/dist/components/ifx-sidebar-item.js.map +1 -1
- package/dist/components/{p-b2439194.js → p-62c6aeb2.js} +4 -4
- package/dist/components/{p-b2439194.js.map → p-62c6aeb2.js.map} +1 -1
- package/dist/components/{p-04b73e62.js → p-cf8fd0f4.js} +6 -6
- package/dist/components/p-cf8fd0f4.js.map +1 -0
- package/dist/esm/ifx-accordion_2.entry.js +2 -2
- package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
- package/dist/esm/ifx-modal.entry.js +8 -8
- package/dist/esm/ifx-modal.entry.js.map +1 -1
- package/dist/esm/ifx-multiselect_2.entry.js +5 -5
- package/dist/esm/ifx-multiselect_2.entry.js.map +1 -1
- package/dist/esm/ifx-search-bar.entry.js +5 -5
- package/dist/esm/ifx-search-bar.entry.js.map +1 -1
- package/dist/esm/ifx-sidebar-item.entry.js +9 -9
- package/dist/esm/ifx-sidebar-item.entry.js.map +1 -1
- package/dist/esm/infineon-design-system-stencil.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
- package/dist/infineon-design-system-stencil/p-60dcd508.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-60dcd508.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-6a274db4.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-6a274db4.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-bc8a4226.entry.js → p-d93eb561.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-d93eb561.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js.map +1 -0
- package/dist/types/components/accordion/accordion.stories.d.ts +67 -1
- package/dist/types/components/accordion/accordionItem.d.ts +1 -1
- package/dist/types/components/alert/alert.stories.d.ts +38 -11
- package/dist/types/components/badge/badge.stories.d.ts +23 -3
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +66 -1
- package/dist/types/components/button/button.stories.d.ts +95 -16
- package/dist/types/components/card/card.stories.d.ts +95 -1
- package/dist/types/components/checkbox/checkbox.stories.d.ts +68 -10
- package/dist/types/components/content-switcher/content-switcher.stories.d.ts +66 -0
- package/dist/types/components/date-picker/date-picker.stories.d.ts +67 -2
- package/dist/types/components/dropdown/dropdown.stories.d.ts +111 -27
- package/dist/types/components/footer/footer.stories.d.ts +4 -0
- package/dist/types/components/icon/infineonIconStencil.stories.d.ts +5 -0
- package/dist/types/components/icon-button/icon-button.stories.d.ts +56 -8
- package/dist/types/components/link/link.stories.d.ts +52 -6
- package/dist/types/components/modal/modal.d.ts +2 -2
- package/dist/types/components/modal/modal.stories.d.ts +77 -3
- package/dist/types/components/navigation/navbar/navbar.stories.d.ts +243 -6
- package/dist/types/components/navigation/sidebar/sidebar-item.d.ts +2 -2
- package/dist/types/components/navigation/sidebar/sidebar.stories.d.ts +90 -7
- package/dist/types/components/notification/notification.stories.d.ts +44 -0
- package/dist/types/components/number-indicator/number-indicator.stories.d.ts +19 -0
- package/dist/types/components/pagination/pagination.stories.d.ts +27 -0
- package/dist/types/components/progress-bar/progress-bar.stories.d.ts +25 -4
- package/dist/types/components/radio-button/radio-button.stories.d.ts +59 -8
- package/dist/types/components/search-bar/search-bar.d.ts +1 -1
- package/dist/types/components/search-bar/search-bar.stories.d.ts +60 -3
- package/dist/types/components/search-field/search-field.stories.d.ts +36 -6
- package/dist/types/components/select/multi-select/multiselect.d.ts +1 -1
- package/dist/types/components/select/multi-select/multiselect.stories.d.ts +125 -0
- package/dist/types/components/select/single-select/select.stories.d.ts +67 -24
- package/dist/types/components/slider/slider.stories.d.ts +110 -0
- package/dist/types/components/spinner/spinner.stories.d.ts +32 -0
- package/dist/types/components/status/status.stories.d.ts +23 -2
- package/dist/types/components/stepper/stepper.stories.d.ts +21 -4
- package/dist/types/components/switch/switch.stories.d.ts +50 -1
- package/dist/types/components/table-basic-version/table.stories.d.ts +19 -1
- package/dist/types/components/tabs/tabs.stories.d.ts +77 -7
- package/dist/types/components/tag/tag.stories.d.ts +20 -0
- package/dist/types/components/text-field/text-field.stories.d.ts +96 -11
- package/dist/types/components/tooltip/tooltip.stories.d.ts +41 -6
- package/dist/types/components.d.ts +10 -10
- package/package.json +1 -1
- package/dist/components/p-04b73e62.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-222c1af9.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-222c1af9.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-436babb8.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-436babb8.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-9481adc8.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-9481adc8.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-bc8a4226.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js.map +0 -1
@@ -2,10 +2,11 @@ import { icons } from "@infineon/infineon-icons";
|
|
2
2
|
export default {
|
3
3
|
title: 'Components/Navigation/Navbar',
|
4
4
|
args: {
|
5
|
+
profileLabel: "",
|
5
6
|
applicationName: 'Application name',
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
showLabelOfNavbarItem: true,
|
8
|
+
targetOfnavbarItem: '_self',
|
9
|
+
hrefOfNavbarItem: '',
|
9
10
|
searchBarIsOpen: false,
|
10
11
|
navbarPositionFixed: false,
|
11
12
|
showLogoAndAppname: true,
|
@@ -15,26 +16,216 @@ export default {
|
|
15
16
|
hideOnMobile: true,
|
16
17
|
profileImageUrl: "",
|
17
18
|
userName: "",
|
18
|
-
|
19
|
+
showNavbarProfileLabel: true,
|
20
|
+
href: "http://google.com",
|
21
|
+
target: "_self",
|
22
|
+
alt: "profile image",
|
19
23
|
},
|
20
24
|
argTypes: {
|
21
|
-
|
22
|
-
|
23
|
-
control: { type: '
|
25
|
+
profileLabel: {
|
26
|
+
name: 'Label',
|
27
|
+
control: { type: 'text' },
|
28
|
+
description: 'Label for the profile.',
|
29
|
+
table: {
|
30
|
+
category: 'story controls',
|
31
|
+
},
|
32
|
+
},
|
33
|
+
applicationName: {
|
34
|
+
control: { type: 'text' },
|
35
|
+
description: 'The name of the application.',
|
36
|
+
table: {
|
37
|
+
category: 'ifx-navbar props',
|
38
|
+
},
|
39
|
+
},
|
40
|
+
navbarPositionFixed: {
|
41
|
+
name: 'fixed',
|
42
|
+
control: { type: 'boolean' },
|
43
|
+
description: 'Fix the navbar to the top of the page.',
|
44
|
+
table: {
|
45
|
+
defaultValue: { summary: 'true' },
|
46
|
+
category: 'ifx-navbar props',
|
47
|
+
},
|
48
|
+
},
|
49
|
+
showLogoAndAppname: {
|
50
|
+
control: { type: 'boolean' },
|
51
|
+
description: 'Show the logo and application name.',
|
52
|
+
table: {
|
53
|
+
defaultValue: { summary: 'true' },
|
54
|
+
category: 'ifx-navbar props',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
logoHref: {
|
58
|
+
control: { type: 'text' },
|
59
|
+
description: 'The URL of the logo link.',
|
60
|
+
table: {
|
61
|
+
category: 'ifx-navbar props',
|
62
|
+
},
|
24
63
|
},
|
25
64
|
logoHrefTarget: {
|
26
|
-
description:
|
65
|
+
description: 'The target of the logo link.',
|
27
66
|
options: ['_self', '_blank', '_parent'],
|
28
67
|
control: { type: 'radio' },
|
68
|
+
table: {
|
69
|
+
defaultValue: { summary: '_self' },
|
70
|
+
category: 'ifx-navbar props',
|
71
|
+
type: {
|
72
|
+
summary: '_self | _blank | _parent',
|
73
|
+
},
|
74
|
+
},
|
75
|
+
},
|
76
|
+
showLabelOfNavbarItem: {
|
77
|
+
name: 'showLabel',
|
78
|
+
control: { type: 'boolean' },
|
79
|
+
description: 'Show the label of the navbar item.',
|
80
|
+
table: {
|
81
|
+
defaultValue: { summary: 'true' },
|
82
|
+
category: 'ifx-navbar-item props',
|
83
|
+
},
|
84
|
+
},
|
85
|
+
iconOfNavbarItem: {
|
86
|
+
name: 'icon',
|
87
|
+
options: Object.values(icons).map(i => i['name']),
|
88
|
+
control: { type: 'select' },
|
89
|
+
description: 'The icon to display in the navbar item.',
|
90
|
+
table: {
|
91
|
+
category: 'ifx-navbar-item props',
|
92
|
+
type: {
|
93
|
+
summary: 'string',
|
94
|
+
},
|
95
|
+
},
|
96
|
+
},
|
97
|
+
hrefOfNavbarItem: {
|
98
|
+
name: 'href',
|
99
|
+
control: { type: 'text' },
|
100
|
+
description: 'The URL of the navbar item link.',
|
101
|
+
table: {
|
102
|
+
category: 'ifx-navbar-item props',
|
103
|
+
},
|
104
|
+
},
|
105
|
+
targetOfnavbarItem: {
|
106
|
+
name: 'target',
|
107
|
+
control: { type: 'radio' },
|
108
|
+
options: ['_self'],
|
109
|
+
description: 'The target of the navbar item link.',
|
110
|
+
table: {
|
111
|
+
defaultValue: { summary: '_self' },
|
112
|
+
category: 'ifx-navbar-item props',
|
113
|
+
type: {
|
114
|
+
summary: '_self',
|
115
|
+
},
|
116
|
+
},
|
117
|
+
},
|
118
|
+
hideOnMobile: {
|
119
|
+
control: { type: 'boolean' },
|
120
|
+
description: 'Hide the navbar item on mobile.',
|
121
|
+
table: {
|
122
|
+
defaultValue: { summary: 'true' },
|
123
|
+
category: 'ifx-navbar-item props',
|
124
|
+
},
|
125
|
+
},
|
126
|
+
showNavbarProfileLabel: {
|
127
|
+
name: 'showLabel',
|
128
|
+
control: { type: 'boolean' },
|
129
|
+
description: 'Show label for the profile.',
|
130
|
+
table: {
|
131
|
+
defaultValue: { summary: 'true' },
|
132
|
+
category: 'ifx-navbar-profile props',
|
133
|
+
},
|
134
|
+
},
|
135
|
+
href: {
|
136
|
+
control: { type: 'text' },
|
137
|
+
description: 'The URL of the profile link.',
|
138
|
+
table: {
|
139
|
+
category: 'ifx-navbar-profile props',
|
140
|
+
},
|
141
|
+
},
|
142
|
+
profileImageUrl: {
|
143
|
+
name: 'imageUrl',
|
144
|
+
control: { type: 'text' },
|
145
|
+
description: 'The URL of the image.',
|
146
|
+
table: {
|
147
|
+
category: 'ifx-navbar-profile props',
|
148
|
+
},
|
149
|
+
},
|
150
|
+
target: {
|
151
|
+
control: { type: 'radio' },
|
152
|
+
options: ['_self', '_blank', '_parent'],
|
153
|
+
description: 'The target of the link.',
|
154
|
+
table: {
|
155
|
+
defaultValue: { summary: '_self' },
|
156
|
+
category: 'ifx-navbar-profile props',
|
157
|
+
type: {
|
158
|
+
summary: '_self | _blank | _parent',
|
159
|
+
},
|
160
|
+
},
|
161
|
+
},
|
162
|
+
alt: {
|
163
|
+
control: { type: 'text' },
|
164
|
+
description: 'The alternative text of the image.',
|
165
|
+
table: {
|
166
|
+
category: 'ifx-navbar-profile props',
|
167
|
+
},
|
168
|
+
},
|
169
|
+
userName: {
|
170
|
+
control: { type: 'text' },
|
171
|
+
description: 'The name of the user.',
|
172
|
+
table: {
|
173
|
+
category: 'ifx-navbar-profile props',
|
174
|
+
},
|
175
|
+
},
|
176
|
+
searchBarIsOpen: {
|
177
|
+
name: 'isOpen',
|
178
|
+
control: { type: 'boolean' },
|
179
|
+
description: 'Show the search bar.',
|
180
|
+
table: {
|
181
|
+
defaultValue: { summary: 'true' },
|
182
|
+
category: 'ifx-search-bar props',
|
183
|
+
},
|
29
184
|
},
|
30
185
|
searchBarPosition: {
|
186
|
+
description: 'The position of the search bar.',
|
31
187
|
options: ['left', 'right'],
|
32
188
|
control: { type: 'radio' },
|
189
|
+
table: {
|
190
|
+
defaultValue: { summary: 'left' },
|
191
|
+
category: 'ifx-search-bar props',
|
192
|
+
type: {
|
193
|
+
summary: 'left | right',
|
194
|
+
},
|
195
|
+
},
|
196
|
+
},
|
197
|
+
ifxNavbarMobileMenuIsOpen: {
|
198
|
+
action: 'ifxNavbarMobileMenuIsOpen',
|
199
|
+
description: 'Event emitted when the mobile menu is opened.',
|
200
|
+
table: {
|
201
|
+
category: 'custom events',
|
202
|
+
type: {
|
203
|
+
summary: 'Framework integration',
|
204
|
+
detail: `React: onifxNavbarMobileMenuIsOpen={handleOpen}
|
205
|
+
Vue: @ifxNavbarMobileMenuIsOpen="handleOpen"
|
206
|
+
Angular: (ifxNavbarMobileMenuIsOpen)="handleOpen()"
|
207
|
+
VanillaJs: .addEventListener("ifxNavbarMobileMenuIsOpen", (event) => {/*handle open*/});`
|
208
|
+
},
|
209
|
+
},
|
210
|
+
},
|
211
|
+
ifxNavItem: {
|
212
|
+
action: 'ifxNavItem',
|
213
|
+
description: 'Event emitted when a navbar item is clicked.',
|
214
|
+
table: {
|
215
|
+
category: 'custom events',
|
216
|
+
type: {
|
217
|
+
summary: 'Framework integration',
|
218
|
+
detail: `React: onifxNavItem={handleClick}
|
219
|
+
Vue: @ifxNavItem="handleClick"
|
220
|
+
Angular: (ifxNavItem)="handleClick()"
|
221
|
+
VanillaJs: .addEventListener("ifxNavItem", (event) => {/*handle click*/});`
|
222
|
+
},
|
223
|
+
},
|
33
224
|
},
|
34
225
|
},
|
35
226
|
};
|
36
|
-
const DefaultTemplate = args => `<ifx-navbar show-logo-and-appname="${args.showLogoAndAppname}" application-name="${args.applicationName}" fixed="${args.
|
37
|
-
<ifx-navbar-item icon="${args.
|
227
|
+
const DefaultTemplate = args => `<ifx-navbar show-logo-and-appname="${args.showLogoAndAppname}" application-name="${args.applicationName}" fixed="${args.navbarPositionFixed}" logo-href="${args.logoHref}" logo-href-target="${args.logoHrefTarget}">
|
228
|
+
<ifx-navbar-item icon="${args.iconOfNavbarItem}" slot="left-item" target="${args.targetOfnavbarItem}" href="${args.hrefOfNavbarItem}" hide-on-mobile="${args.hideOnMobile}">
|
38
229
|
Menu Item
|
39
230
|
<ifx-navbar-item icon="">
|
40
231
|
Layer 1 Nested Item 1
|
@@ -66,7 +257,7 @@ const DefaultTemplate = args => `<ifx-navbar show-logo-and-appname="${args.show
|
|
66
257
|
|
67
258
|
</ifx-navbar-item>
|
68
259
|
|
69
|
-
<ifx-navbar-item href="${args.
|
260
|
+
<ifx-navbar-item href="${args.hrefOfNavbarItem}" target="_self" slot="left-item" icon="" show-label="${args.showLabelOfNavbarItem}">
|
70
261
|
Menu Item
|
71
262
|
</ifx-navbar-item>
|
72
263
|
|
@@ -83,7 +274,7 @@ const DefaultTemplate = args => `<ifx-navbar show-logo-and-appname="${args.show
|
|
83
274
|
<ifx-navbar-item slot="right-item" hide-on-mobile="true" show-label='false' icon="image-16">
|
84
275
|
</ifx-navbar-item>
|
85
276
|
|
86
|
-
<ifx-navbar-profile user-name="${args.userName}" slot="right-item" image-url="${args.profileImageUrl}" show-label="
|
277
|
+
<ifx-navbar-profile user-name="${args.userName}" slot="right-item" image-url="${args.profileImageUrl}" show-label="${args.showNavbarProfileLabel}" href="" target="${args.target}" alt="${args.alt}">${args.profileLabel}</ifx-navbar-profile>
|
87
278
|
</ifx-navbar>`;
|
88
279
|
export const Default = DefaultTemplate.bind({});
|
89
280
|
//# sourceMappingURL=navbar.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"navbar.stories.js","sourceRoot":"","sources":["../../../../src/components/navigation/navbar/navbar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EA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AS;;;;;;;;;;qCAUnG,IAAI,CAAC,iBAAiB,cAAc,IAAI,CAAC,eAAe;;gGAEG,IAAI,CAAC,YAAY;;;;;mCAK9E,IAAI,CAAC,QAAQ,kCAAkC,IAAI,CAAC,eAAe,+CAA+C,IAAI,CAAC,YAAY;cACxJ,CAAC;AAEf,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Navigation/Navbar',\n args: {\n applicationName: 'Application name',\n hideLabel: true,\n navbarItemTarget: '_blank',\n navbarItemHref: '',\n searchBarIsOpen: false,\n navbarPositionFixed: false,\n showLogoAndAppname: true,\n logoHref: 'http://google.com',\n logoHrefTarget: '_self',\n searchBarPosition: 'left',\n hideOnMobile: true,\n profileImageUrl: \"\",\n userName: \"\",\n profileLabel: \"\"\n },\n argTypes: {\n icon: {\n options: Object.values(icons).map(i => i['name']),\n control: { type: 'select' },\n },\n logoHrefTarget: {\n description: \"If not '_self' or '_blank' or '_parent', then set to '_self' by default\",\n options: ['_self', '_blank', '_parent'],\n control: { type: 'radio' },\n },\n searchBarPosition: {\n options: ['left', 'right'],\n control: { type: 'radio' },\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-navbar show-logo-and-appname=\"${args.showLogoAndAppname}\" application-name=\"${args.applicationName}\" fixed=\"${args.fixed}\" logo-href=\"${args.logoHref}\" logo-href-target=\"${args.logoHrefTarget}\">\n <ifx-navbar-item icon=\"${args.icon}\" slot=\"left-item\" target=\"\" href=\"\" >\n Menu Item\n <ifx-navbar-item icon=\"\">\n Layer 1 Nested Item 1\n <ifx-navbar-item>\n Layer 2 Nested Item 2\n <ifx-navbar-item href=\"http://google.com\" target=\"_blank\">Link Layer 3 Nested Item 1</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 2</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 3</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 4</ifx-navbar-item>\n </ifx-navbar-item>\n <ifx-navbar-item >Layer 2 Nested Item 3</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Nested Item 4</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Nested Item 5</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-navbar-item>\n Layer 1 Nested Item 2\n <ifx-navbar-item>Layer 2 Item 1</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Item 2</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Item 3</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-navbar-item>Nested Item 3</ifx-navbar-item>\n\n <ifx-navbar-item>\n Layer 1 Nested Item 4\n <ifx-navbar-item>Nested Item 4</ifx-navbar-item>\n </ifx-navbar-item>\n\n </ifx-navbar-item>\n\n <ifx-navbar-item href=\"${args.navbarItemHref}\" target=\"${args.navbarItemTarget}\" slot=\"left-item\" icon=\"\" show-label=\"${args.hideLabel}\">\n Menu Item\n </ifx-navbar-item>\n\n <ifx-navbar-item slot=\"left-item\">\n More\n <ifx-navbar-item>Item1</ifx-navbar-item>\n <ifx-navbar-item>Item2</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-search-bar slot=\"search-bar-${args.searchBarPosition}\" is-open=\"${args.searchBarIsOpen}\"></ifx-search-bar>\n\n <ifx-navbar-item slot=\"right-item\" target=\"_blank\" href=\"http://google.com\" hide-on-mobile=\"${args.hideOnMobile}\" show-label=\"true\" icon=\"image-16\">\n </ifx-navbar-item>\n <ifx-navbar-item slot=\"right-item\" hide-on-mobile=\"true\" show-label='false' icon=\"image-16\">\n </ifx-navbar-item>\n\n <ifx-navbar-profile user-name=\"${args.userName}\" slot=\"right-item\" image-url=\"${args.profileImageUrl}\" show-label=\"true\" href=\"\" target=\"_blank\">${args.profileLabel}</ifx-navbar-profile>\n</ifx-navbar>`;\n\nexport const Default = DefaultTemplate.bind({});\n"]}
|
1
|
+
{"version":3,"file":"navbar.stories.js","sourceRoot":"","sources":["../../../../src/components/navigation/navbar/navbar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,eAAe;IACb,KAAK,EAAE,8BAA8B;IACrC,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,kBAAkB;QACnC,qBAAqB,EAAE,IAAI;QAC3B,kBAAkB,EAAE,OAAO;QAC3B,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,KAAK;QACtB,mBAAmB,EAAE,KAAK;QAC1B,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE,mBAAmB;QAC7B,cAAc,EAAE,OAAO;QACvB,iBAAiB,EAAE,MAAM;QACzB,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,sBAAsB,EAAE,IAAI;QAC5B,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,eAAe;KACrB;IACD,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;aAC3B;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,8BAA8B;YAC3C,KAAK,EAAE;gBACL,QAAQ,EAAE,kBAAkB;aAC7B;SACF;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5B,WAAW,EAAE,wCAAwC;YACrD,KAAK,EAAE;gBACL,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;gBACjC,QAAQ,EAAE,kBAAkB;aAC7B;SACF;QACD,k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ACL,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE;oBACJ,OAAO,EAAE,uBAAuB;oBAChC,MAAM,EAAE;;;mGAGiF;iBAC1F;aACF;SACF;QACD,UAAU,EAAE;YACV,MAAM,EAAE,YAAY;YACpB,WAAW,EAAE,8CAA8C;YAC3D,KAAK,EAAE;gBACL,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE;oBACJ,OAAO,EAAE,uBAAuB;oBAChC,MAAM,EAAE;;;qFAGmE;iBAAC;aAC/E;SACF;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,CAC7B,uCAAuC,IAAI,CAAC,kBAAkB,uBAAuB,IAAI,CAAC,eAAe,YAAY,IAAI,CAAC,mBAAmB,gBAAgB,IAAI,CAAC,QAAQ,uBAAuB,IAAI,CAAC,cAAc;2BAC3L,IAAI,CAAC,gBAAgB,8BAA8B,IAAI,CAAC,kBAAkB,WAAW,IAAI,CAAC,gBAAgB,qBAAqB,IAAI,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAgChJ,IAAI,CAAC,gBAAgB,yDAAyD,IAAI,CAAC,qBAAqB;;;;;;;;;;qCAU9F,IAAI,CAAC,iBAAiB,cAAc,IAAI,CAAC,eAAe;;gGAEG,IAAI,CAAC,YAAY;;;;;mCAK9E,IAAI,CAAC,QAAQ,kCAAkC,IAAI,CAAC,eAAe,iBAAiB,IAAI,CAAC,sBAAsB,qBAAqB,IAAI,CAAC,MAAM,UAAU,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,YAAY;cAC5M,CAAC;AAEf,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\nexport default {\n title: 'Components/Navigation/Navbar',\n args: {\n profileLabel: \"\",\n applicationName: 'Application name',\n showLabelOfNavbarItem: true,\n targetOfnavbarItem: '_self',\n hrefOfNavbarItem: '',\n searchBarIsOpen: false,\n navbarPositionFixed: false,\n showLogoAndAppname: true,\n logoHref: 'http://google.com',\n logoHrefTarget: '_self',\n searchBarPosition: 'left',\n hideOnMobile: true,\n profileImageUrl: \"\",\n userName: \"\",\n showNavbarProfileLabel: true,\n href: \"http://google.com\",\n target: \"_self\",\n alt: \"profile image\",\n },\n argTypes: {\n profileLabel: {\n name: 'Label',\n control: { type: 'text' },\n description: 'Label for the profile.',\n table: {\n category: 'story controls',\n },\n },\n applicationName: {\n control: { type: 'text' },\n description: 'The name of the application.',\n table: {\n category: 'ifx-navbar props',\n },\n },\n navbarPositionFixed: {\n name: 'fixed',\n control: { type: 'boolean' },\n description: 'Fix the navbar to the top of the page.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-navbar props',\n },\n },\n showLogoAndAppname: {\n control: { type: 'boolean' },\n description: 'Show the logo and application name.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-navbar props',\n },\n },\n logoHref: {\n control: { type: 'text' },\n description: 'The URL of the logo link.',\n table: {\n category: 'ifx-navbar props',\n },\n },\n logoHrefTarget: {\n description: 'The target of the logo link.',\n options: ['_self', '_blank', '_parent'],\n control: { type: 'radio' },\n table: {\n defaultValue: { summary: '_self' },\n category: 'ifx-navbar props',\n type: {\n summary: '_self | _blank | _parent',\n },\n },\n },\n showLabelOfNavbarItem: {\n name: 'showLabel',\n control: { type: 'boolean' },\n description: 'Show the label of the navbar item.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-navbar-item props',\n },\n },\n iconOfNavbarItem: {\n name: 'icon',\n options: Object.values(icons).map(i => i['name']),\n control: { type: 'select' },\n description: 'The icon to display in the navbar item.',\n table: {\n category: 'ifx-navbar-item props',\n type: {\n summary: 'string',\n },\n },\n },\n hrefOfNavbarItem: {\n name: 'href',\n control: { type: 'text' },\n description: 'The URL of the navbar item link.',\n table: {\n category: 'ifx-navbar-item props',\n },\n },\n\n targetOfnavbarItem: {\n name: 'target',\n control: { type: 'radio' },\n options: ['_self'],\n description: 'The target of the navbar item link.',\n table: {\n defaultValue: { summary: '_self' },\n category: 'ifx-navbar-item props',\n type: {\n summary: '_self',\n },\n },\n },\n hideOnMobile: {\n control: { type: 'boolean' },\n description: 'Hide the navbar item on mobile.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-navbar-item props',\n },\n },\n showNavbarProfileLabel: {\n name: 'showLabel',\n control: { type: 'boolean' },\n description: 'Show label for the profile.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-navbar-profile props',\n },\n },\n href: {\n control: { type: 'text' },\n description: 'The URL of the profile link.',\n table: {\n category: 'ifx-navbar-profile props',\n },\n },\n profileImageUrl: {\n name: 'imageUrl',\n control: { type: 'text' },\n description: 'The URL of the image.',\n table: {\n category: 'ifx-navbar-profile props',\n },\n },\n target: {\n control: { type: 'radio' },\n options: ['_self', '_blank', '_parent'],\n description: 'The target of the link.',\n table: {\n defaultValue: { summary: '_self' },\n category: 'ifx-navbar-profile props',\n type: {\n summary: '_self | _blank | _parent',\n },\n },\n },\n alt: {\n control: { type: 'text' },\n description: 'The alternative text of the image.',\n table: {\n category: 'ifx-navbar-profile props',\n },\n },\n userName: {\n control: { type: 'text' },\n description: 'The name of the user.',\n table: {\n category: 'ifx-navbar-profile props',\n },\n },\n searchBarIsOpen: {\n name: 'isOpen',\n control: { type: 'boolean' },\n description: 'Show the search bar.',\n table: {\n defaultValue: { summary: 'true' },\n category: 'ifx-search-bar props',\n },\n },\n searchBarPosition: {\n description: 'The position of the search bar.',\n options: ['left', 'right'],\n control: { type: 'radio' },\n table: {\n defaultValue: { summary: 'left' },\n category: 'ifx-search-bar props',\n type: {\n summary: 'left | right',\n },\n },\n },\n ifxNavbarMobileMenuIsOpen: {\n action: 'ifxNavbarMobileMenuIsOpen',\n description: 'Event emitted when the mobile menu is opened.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail: `React: onifxNavbarMobileMenuIsOpen={handleOpen} \n Vue: @ifxNavbarMobileMenuIsOpen=\"handleOpen\" \n Angular: (ifxNavbarMobileMenuIsOpen)=\"handleOpen()\" \n VanillaJs: .addEventListener(\"ifxNavbarMobileMenuIsOpen\", (event) => {/*handle open*/});`\n },\n },\n },\n ifxNavItem: {\n action: 'ifxNavItem',\n description: 'Event emitted when a navbar item is clicked.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail: `React: onifxNavItem={handleClick}\n Vue: @ifxNavItem=\"handleClick\" \n Angular: (ifxNavItem)=\"handleClick()\"\n VanillaJs: .addEventListener(\"ifxNavItem\", (event) => {/*handle click*/});`},\n },\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-navbar show-logo-and-appname=\"${args.showLogoAndAppname}\" application-name=\"${args.applicationName}\" fixed=\"${args.navbarPositionFixed}\" logo-href=\"${args.logoHref}\" logo-href-target=\"${args.logoHrefTarget}\">\n <ifx-navbar-item icon=\"${args.iconOfNavbarItem}\" slot=\"left-item\" target=\"${args.targetOfnavbarItem}\" href=\"${args.hrefOfNavbarItem}\" hide-on-mobile=\"${args.hideOnMobile}\">\n Menu Item\n <ifx-navbar-item icon=\"\">\n Layer 1 Nested Item 1\n <ifx-navbar-item>\n Layer 2 Nested Item 2\n <ifx-navbar-item href=\"http://google.com\" target=\"_blank\">Link Layer 3 Nested Item 1</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 2</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 3</ifx-navbar-item>\n <ifx-navbar-item>Layer 3 Nested Item 4</ifx-navbar-item>\n </ifx-navbar-item>\n <ifx-navbar-item >Layer 2 Nested Item 3</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Nested Item 4</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Nested Item 5</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-navbar-item>\n Layer 1 Nested Item 2\n <ifx-navbar-item>Layer 2 Item 1</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Item 2</ifx-navbar-item>\n <ifx-navbar-item>Layer 2 Item 3</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-navbar-item>Nested Item 3</ifx-navbar-item>\n\n <ifx-navbar-item>\n Layer 1 Nested Item 4\n <ifx-navbar-item>Nested Item 4</ifx-navbar-item>\n </ifx-navbar-item>\n\n </ifx-navbar-item>\n\n <ifx-navbar-item href=\"${args.hrefOfNavbarItem}\" target=\"_self\" slot=\"left-item\" icon=\"\" show-label=\"${args.showLabelOfNavbarItem}\">\n Menu Item\n </ifx-navbar-item>\n\n <ifx-navbar-item slot=\"left-item\">\n More\n <ifx-navbar-item>Item1</ifx-navbar-item>\n <ifx-navbar-item>Item2</ifx-navbar-item>\n </ifx-navbar-item>\n\n <ifx-search-bar slot=\"search-bar-${args.searchBarPosition}\" is-open=\"${args.searchBarIsOpen}\"></ifx-search-bar>\n\n <ifx-navbar-item slot=\"right-item\" target=\"_blank\" href=\"http://google.com\" hide-on-mobile=\"${args.hideOnMobile}\" show-label=\"true\" icon=\"image-16\">\n </ifx-navbar-item>\n <ifx-navbar-item slot=\"right-item\" hide-on-mobile=\"true\" show-label='false' icon=\"image-16\">\n </ifx-navbar-item>\n\n <ifx-navbar-profile user-name=\"${args.userName}\" slot=\"right-item\" image-url=\"${args.profileImageUrl}\" show-label=\"${args.showNavbarProfileLabel}\" href=\"\" target=\"${args.target}\" alt=\"${args.alt}\">${args.profileLabel}</ifx-navbar-profile>\n</ifx-navbar>`;\n\nexport const Default = DefaultTemplate.bind({});\n"]}
|
@@ -2,8 +2,8 @@ import { h } from "@stencil/core";
|
|
2
2
|
export class SidebarItem {
|
3
3
|
constructor() {
|
4
4
|
this.icon = "";
|
5
|
-
this.
|
6
|
-
this.
|
5
|
+
this.showIcon = true;
|
6
|
+
this.showIconWrapper = false;
|
7
7
|
this.href = "";
|
8
8
|
this.internalHref = "";
|
9
9
|
this.target = "_self";
|
@@ -36,10 +36,10 @@ export class SidebarItem {
|
|
36
36
|
}
|
37
37
|
handleConsoleError(event) {
|
38
38
|
if (event.detail) {
|
39
|
-
this.
|
39
|
+
this.showIcon = false;
|
40
40
|
}
|
41
41
|
else {
|
42
|
-
this.
|
42
|
+
this.showIcon = true;
|
43
43
|
}
|
44
44
|
}
|
45
45
|
handleEventEmission() {
|
@@ -243,11 +243,11 @@ export class SidebarItem {
|
|
243
243
|
}
|
244
244
|
render() {
|
245
245
|
var _a, _b;
|
246
|
-
return (h("div", { key: '
|
247
|
-
h("div", { key: '
|
248
|
-
h("div", { key: '
|
249
|
-
h("span", { key: '
|
250
|
-
h("span", { key: '
|
246
|
+
return (h("div", { key: '03c8e60e4e8ce63615cd5c4f0d54cbcc47d99998' }, h("a", { key: 'c0d56dff397166717925d49593e879f1beb8e2b2', tabIndex: 1, onKeyDown: (event) => this.handleKeyDown(event), href: this.internalHref, onClick: () => this.toggleSubmenu(), target: this.target, class: `sidebar__nav-item ${!this.isNested && this.isExpandable ? 'header__section' : ""} ${this.isSubMenuItem ? 'submenu__item' : ""}` }, this.icon &&
|
247
|
+
h("div", { key: 'ed1f4499796d54626da063fc49655985ffe8d407', class: `sidebar__nav-item-icon-wrapper ${!this.showIcon ? 'noIcon' : ""}` }, h("ifx-icon", { key: '44900dc9b7effc98c77730326b161484de3d6436', icon: this.icon })), h("div", { key: '5de25537fb558b01512a7dd002efa57a109a5fa7', class: "sidebar__nav-item-label" }, h("slot", { key: '053de1892d27e6ce01ab8e5f8eb16d7b695b4de3' })), (this.isExpandable || ((_a = this.numberIndicator) === null || _a === void 0 ? void 0 : _a.trim())) &&
|
248
|
+
h("div", { key: 'd5c4deb42f7ab7bc915cd428bedf2c81907544a8', class: "sidebar__nav-item-indicator" }, this.isExpandable &&
|
249
|
+
h("span", { key: 'bc0e3196d081f70d0341fbff92375741708343fb', class: 'item__arrow-wrapper' }, h("ifx-icon", { key: 'e02c07b3fad5dca7392a7161702c6ef7578ae8c1', icon: "chevron-down-12" })), ((_b = this.numberIndicator) === null || _b === void 0 ? void 0 : _b.trim()) && !this.isExpandable && !this.isNested &&
|
250
|
+
h("span", { key: 'feafb5a73b78bfb04c6951f3d209ed372591909b', class: 'item__number-indicator' }, h("ifx-number-indicator", { key: '80828a8d2f66ed0efa4e8eba00a42ffb49cb4dd6' }, this.numberIndicator)))), this.isExpandable && h("ul", { key: 'ca766f86f738918e2556d8069c34c2a08e31e1f9', class: 'expandable__submenu' })));
|
251
251
|
}
|
252
252
|
static get is() { return "ifx-sidebar-item"; }
|
253
253
|
static get encapsulation() { return "shadow"; }
|
@@ -428,8 +428,8 @@ export class SidebarItem {
|
|
428
428
|
}
|
429
429
|
static get states() {
|
430
430
|
return {
|
431
|
-
"
|
432
|
-
"
|
431
|
+
"showIcon": {},
|
432
|
+
"showIconWrapper": {},
|
433
433
|
"internalHref": {},
|
434
434
|
"isExpandable": {},
|
435
435
|
"isNested": {},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sidebar-item.js","sourceRoot":"","sources":["../../../../src/components/navigation/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAO/G,MAAM,OAAO,WAAW;;oBAEC,EAAE;uBACG,IAAI;8BACG,KAAK;oBACjB,EAAE;4BACO,EAAE;sBACT,OAAO;4BACC,KAAK;wBACT,IAAI;6BACC,KAAK;;sBAEb,KAAK;4BACC,KAAK;mCAEG,KAAK;qBAOrB,EAAE;;;IAK1B,kBAAkB,CAAC,QAAiB,EAAE,QAAiB;QACrD,wDAAwD;QACxD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;YACjC,OAAO;QACT,CAAC;QACD,IAAI,CAAC,mBAAmB,GAAG,QAAQ,CAAC;QACpC,IAAI,QAAQ,KAAK,Q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AC,IAAI,GAAa,CAClC;gBACR,4DAAK,KAAK,EAAC,yBAAyB;oBAClC,8DAAQ,CACJ;gBAEN,CAAC,IAAI,CAAC,YAAY,KAAI,MAAA,IAAI,CAAC,eAAe,0CAAE,IAAI,EAAE,CAAA,CAAC;oBACjD,4DAAK,KAAK,EAAC,6BAA6B;wBACrC,IAAI,CAAC,YAAY;4BAChB,6DAAM,KAAK,EAAC,qBAAqB;gCAC/B,iEAAU,IAAI,EAAC,iBAAiB,GAAG,CAC9B;wBAGR,CAAA,MAAA,IAAI,CAAC,eAAe,0CAAE,IAAI,EAAE,KAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ;4BACnE,6DAAM,KAAK,EAAC,wBAAwB;gCAClC,+EAAuB,IAAI,CAAC,eAAe,CAAwB,CAC9D,CAEL,CAEN;YACH,IAAI,CAAC,YAAY,IAAI,2DAAI,KAAK,EAAC,qBAAqB,GAAM,CAEvD,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, State, Listen, Watch, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-sidebar-item',\n styleUrl: 'sidebar-item.scss',\n shadow: true\n})\nexport class SidebarItem {\n @Element() el;\n @Prop() icon: string = \"\"\n @State() hasIcon: boolean = true;\n @State() hasIconWrapper: boolean = false;\n @Prop() href: string = \"\";\n @State() internalHref: string = \"\";\n @Prop() target: string = \"_self\";\n @State() isExpandable: boolean = false;\n @State() isNested: boolean = true;\n @State() isSubMenuItem: boolean = false;\n @Prop() numberIndicator: string;\n @Prop() active: boolean = false; // set to true manually or by clicking on a navigation item\n @Prop() isActionItem: boolean = false; // if an item is an action item, it can not become active\n\n @State() internalActiveState: boolean = false;\n\n @Event({ bubbles: true, composed: true }) ifxSidebarMenu: EventEmitter;\n @Event({ bubbles: true, composed: true }) ifxSidebarNavigationItem: EventEmitter;\n @Event({ bubbles: true, composed: true }) ifxSidebarActionItem: EventEmitter;\n\n\n @Prop() value: string = \"\"\n @Prop() handleItemClick: (item: HTMLElement) => void;\n\n\n @Watch('active')\n handleActiveChange(newValue: boolean, oldValue: boolean) {\n // If the item is an action item, ignore the active prop\n if (this.isActionItem) {\n this.internalActiveState = false;\n return;\n }\n this.internalActiveState = newValue;\n if (newValue !== oldValue) {\n let labelElement = this.getNavItem(this.el.shadowRoot)\n if (!this.isExpandable && !newValue) {\n this.handleClassList(labelElement, 'remove', 'active');\n }\n if (!this.isExpandable && newValue) {\n this.handleClassList(labelElement, 'add', 'active');\n }\n }\n }\n\n\n\n @Listen('consoleError')\n handleConsoleError(event: CustomEvent<boolean>) {\n if (event.detail) {\n this.hasIcon = false;\n } else {\n this.hasIcon = true;\n }\n }\n\n handleEventEmission() {\n // Get the active item section\n this.ifxSidebarMenu.emit(this.el)\n }\n\n handleClassList(el, type, className) {\n el.classList[type](className)\n if (type === 'contains') {\n return el.classList.contains(className)\n }\n }\n\n getExpandableMenu() {\n const expandableSubmenu = this.el.shadowRoot.querySelector('.expandable__submenu')\n return expandableSubmenu\n }\n\n getNavItem(el) {\n return el?.querySelector('.sidebar__nav-item')\n }\n\n\n\n getSidebarMenuItems(el = this.el) {\n const sidebarItems = el.querySelectorAll('ifx-sidebar-item');\n if (sidebarItems.length === 0) {\n return el.shadowRoot.querySelectorAll('ifx-sidebar-item');\n }\n return sidebarItems;\n }\n\n getSidebarMenuItem() {\n const sidebarItem = this.el.shadowRoot.querySelector('.sidebar__nav-item')\n return sidebarItem;\n }\n\n\n toggleSubmenu() {\n if (this.isExpandable) {\n const menuItem = this.getSidebarMenuItem();\n const expandableMenu = this.getExpandableMenu();\n this.handleClassList(expandableMenu, 'toggle', 'open');\n this.handleClassList(menuItem, 'toggle', 'open');\n // Emit an event with the current component\n this.handleEventEmission();\n } else {\n // If the sidebar item is not expandable, it's a leaf item without a submenu.\n // Emit an event to the parent `ifx-sidebar` component to notify it that a leaf item has been clicked.\n if (this.isActionItem) { //its an action item that eg opens an overlay etc and should not influence the active state of the item\n this.ifxSidebarActionItem.emit(this.el); // emit new event if isActionItem is true\n return;\n } else { //its a navigation item which becomes active after clicking it\n this.handleActiveChange(true, this.internalActiveState)\n this.ifxSidebarNavigationItem.emit(this.el);\n }\n // If the sidebar item is selectable (not expandable), then call the handler function with the current element.\n if (this.handleItemClick) {\n this.handleItemClick(this.el);\n }\n }\n // // Emit an event with the current component\n // this.handleEventEmission();\n }\n\n\n\n handleExpandableMenu(sidebarItems) {\n const sidebarExpandableMenu = this.getExpandableMenu();\n sidebarItems.forEach((el: HTMLElement) => {\n const li = document.createElement('li')\n li.appendChild(el)\n sidebarExpandableMenu.appendChild(li)\n })\n }\n\n parentElementIsSidebar() {\n const parentElement = this.el.parentElement;\n if (parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR') {\n return true;\n } else return false;\n }\n\n checkIfMenuItemIsNested() {\n const parentIsSidebar = this.parentElementIsSidebar()\n if (parentIsSidebar) {\n this.isNested = false;\n }\n }\n\n checkIfMenuItemIsSubMenu() {\n const parentElement = this.el.parentElement;\n const navItem = this.getNavItem(parentElement.shadowRoot);\n if(parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR-ITEM' && !this.handleClassList(navItem, 'contains', 'header__section')) {\n this.isSubMenuItem = true;\n }else {\n this.isSubMenuItem = false;\n }\n }\n\n isActive(iteratedComponent) {\n const activeAttributeValue = iteratedComponent.getAttribute('active');\n const isActive = activeAttributeValue === 'true';\n return isActive\n }\n\n getParentSection(el: HTMLElement) {\n let parentElement = el.parentElement;\n\n while (parentElement && parentElement.tagName.toUpperCase() !== 'IFX-SIDEBAR') {\n if (parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR-ITEM') {\n return parentElement;\n }\n parentElement = parentElement.parentElement;\n }\n\n return null;\n }\n\n\n\n handleBorderIndicatorDisplacement(menuItem) {\n // Recursive function to handle each item\n const handleItem = (item, menuItem) => {\n const isActive = this.isActive(item);\n if (isActive) {\n const isOpen = this.handleClassList(menuItem, 'contains', 'open');\n const activeMenuItemSection = this.getActiveItemSection();\n if (!isOpen) {\n this.handleClassList(activeMenuItemSection, 'add', 'active-section');\n } else {\n this.handleClassList(activeMenuItemSection, 'remove', 'active-section');\n }\n }\n\n // Process each child item\n const children = this.getSidebarMenuItems(item);\n children.forEach((child) => handleItem(child, menuItem));\n }\n\n // Start with the top-level items\n const topLevelItems = this.getSidebarMenuItems();\n topLevelItems.forEach((item) => handleItem(item, menuItem));\n }\n\n\n setHref() {\n if (this.href.toLowerCase().trim() === \"\") {\n this.internalHref = undefined;\n } else this.internalHref = this.href;\n }\n\n getActiveItemSection() {\n const parentIsSidebar = this.parentElementIsSidebar()\n if (parentIsSidebar) {\n const labelElement = this.getNavItem(this.el.shadowRoot)\n return labelElement;\n } else {\n const labelElement = this.getNavItem(this.el.shadowRoot)\n return labelElement;\n }\n }\n\n @Method()\n async setActiveClasses() {\n const activeMenuItem = this.getNavItem(this.el.shadowRoot)\n this.handleClassList(activeMenuItem, 'add', 'active')\n }\n\n @Method()\n async expandMenu(ac: boolean){\n const menuItem = this.getSidebarMenuItem();\n const expandableMenu = this.getExpandableMenu();\n this.handleClassList(expandableMenu, 'add', 'open');\n this.handleClassList(menuItem, 'add', 'open');\n if(ac){\n this.handleClassList(expandableMenu, 'remove', 'active-section')\n this.handleClassList(menuItem, 'remove', 'active-section')\n }\n }\n \n @Method()\n async isItemExpandable(){\n return this.isExpandable;\n }\n\n handleActiveState() {\n if (this.internalActiveState) {\n this.setActiveClasses()\n }\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n this.toggleSubmenu()\n }\n }\n\n componentDidLoad() {\n this.handleActiveState();\n if (this.isExpandable) {\n const sidebarItems = this.getSidebarMenuItems();\n this.handleExpandableMenu(sidebarItems)\n }\n }\n \n componentWillLoad() {\n this.internalActiveState = this.active;\n this.checkIfMenuItemIsNested();\n this.checkIfMenuItemIsSubMenu();\n this.setHref()\n const sidebarItems = this.getSidebarMenuItems();\n if (sidebarItems.length !== 0) {\n this.isExpandable = true;\n } else {\n this.isExpandable = false;\n }\n }\n\n componentWillUpdate() {\n // If the active prop has been set to true and the internalActiveState has not been set to true yet\n if (this.active && !this.internalActiveState) {\n // Set the internal active state to true\n this.internalActiveState = this.active;\n\n // Emit the event to notify the parent Sidebar\n this.ifxSidebarNavigationItem.emit(this.el);\n }\n }\n\n\n render() {\n return (\n <div>\n <a tabIndex={1} onKeyDown={(event) => this.handleKeyDown(event)} href={this.internalHref} onClick={() => this.toggleSubmenu()} target={this.target} class={`sidebar__nav-item ${!this.isNested && this.isExpandable ? 'header__section' : \"\"} ${this.isSubMenuItem ? 'submenu__item' : \"\"}`}>\n {this.icon &&\n <div class={`sidebar__nav-item-icon-wrapper ${!this.hasIcon ? 'noIcon' : \"\"}`}>\n <ifx-icon icon={this.icon}></ifx-icon>\n </div>}\n <div class=\"sidebar__nav-item-label\">\n <slot />\n </div>\n {\n (this.isExpandable || this.numberIndicator?.trim()) && \n <div class=\"sidebar__nav-item-indicator\">\n {this.isExpandable &&\n <span class='item__arrow-wrapper'>\n <ifx-icon icon=\"chevron-down-12\" />\n </span>\n }\n\n {this.numberIndicator?.trim() && !this.isExpandable && !this.isNested &&\n <span class='item__number-indicator'>\n <ifx-number-indicator>{this.numberIndicator}</ifx-number-indicator>\n </span>}\n\n </div>\n }\n </a>\n {this.isExpandable && <ul class='expandable__submenu'></ul>}\n\n </div>\n );\n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YAAY,IAAI,2DAAI,KAAK,EAAC,qBAAqB,GAAM,CAEvD,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, State, Listen, Watch, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-sidebar-item',\n styleUrl: 'sidebar-item.scss',\n shadow: true\n})\nexport class SidebarItem {\n @Element() el;\n @Prop() icon: string = \"\"\n @State() showIcon: boolean = true;\n @State() showIconWrapper: boolean = false;\n @Prop() href: string = \"\";\n @State() internalHref: string = \"\";\n @Prop() target: string = \"_self\";\n @State() isExpandable: boolean = false;\n @State() isNested: boolean = true;\n @State() isSubMenuItem: boolean = false;\n @Prop() numberIndicator: string;\n @Prop() active: boolean = false; // set to true manually or by clicking on a navigation item\n @Prop() isActionItem: boolean = false; // if an item is an action item, it can not become active\n\n @State() internalActiveState: boolean = false;\n\n @Event({ bubbles: true, composed: true }) ifxSidebarMenu: EventEmitter;\n @Event({ bubbles: true, composed: true }) ifxSidebarNavigationItem: EventEmitter;\n @Event({ bubbles: true, composed: true }) ifxSidebarActionItem: EventEmitter;\n\n\n @Prop() value: string = \"\"\n @Prop() handleItemClick: (item: HTMLElement) => void;\n\n\n @Watch('active')\n handleActiveChange(newValue: boolean, oldValue: boolean) {\n // If the item is an action item, ignore the active prop\n if (this.isActionItem) {\n this.internalActiveState = false;\n return;\n }\n this.internalActiveState = newValue;\n if (newValue !== oldValue) {\n let labelElement = this.getNavItem(this.el.shadowRoot)\n if (!this.isExpandable && !newValue) {\n this.handleClassList(labelElement, 'remove', 'active');\n }\n if (!this.isExpandable && newValue) {\n this.handleClassList(labelElement, 'add', 'active');\n }\n }\n }\n\n\n\n @Listen('consoleError')\n handleConsoleError(event: CustomEvent<boolean>) {\n if (event.detail) {\n this.showIcon = false;\n } else {\n this.showIcon = true;\n }\n }\n\n handleEventEmission() {\n // Get the active item section\n this.ifxSidebarMenu.emit(this.el)\n }\n\n handleClassList(el, type, className) {\n el.classList[type](className)\n if (type === 'contains') {\n return el.classList.contains(className)\n }\n }\n\n getExpandableMenu() {\n const expandableSubmenu = this.el.shadowRoot.querySelector('.expandable__submenu')\n return expandableSubmenu\n }\n\n getNavItem(el) {\n return el?.querySelector('.sidebar__nav-item')\n }\n\n\n\n getSidebarMenuItems(el = this.el) {\n const sidebarItems = el.querySelectorAll('ifx-sidebar-item');\n if (sidebarItems.length === 0) {\n return el.shadowRoot.querySelectorAll('ifx-sidebar-item');\n }\n return sidebarItems;\n }\n\n getSidebarMenuItem() {\n const sidebarItem = this.el.shadowRoot.querySelector('.sidebar__nav-item')\n return sidebarItem;\n }\n\n\n toggleSubmenu() {\n if (this.isExpandable) {\n const menuItem = this.getSidebarMenuItem();\n const expandableMenu = this.getExpandableMenu();\n this.handleClassList(expandableMenu, 'toggle', 'open');\n this.handleClassList(menuItem, 'toggle', 'open');\n // Emit an event with the current component\n this.handleEventEmission();\n } else {\n // If the sidebar item is not expandable, it's a leaf item without a submenu.\n // Emit an event to the parent `ifx-sidebar` component to notify it that a leaf item has been clicked.\n if (this.isActionItem) { //its an action item that eg opens an overlay etc and should not influence the active state of the item\n this.ifxSidebarActionItem.emit(this.el); // emit new event if isActionItem is true\n return;\n } else { //its a navigation item which becomes active after clicking it\n this.handleActiveChange(true, this.internalActiveState)\n this.ifxSidebarNavigationItem.emit(this.el);\n }\n // If the sidebar item is selectable (not expandable), then call the handler function with the current element.\n if (this.handleItemClick) {\n this.handleItemClick(this.el);\n }\n }\n // // Emit an event with the current component\n // this.handleEventEmission();\n }\n\n\n\n handleExpandableMenu(sidebarItems) {\n const sidebarExpandableMenu = this.getExpandableMenu();\n sidebarItems.forEach((el: HTMLElement) => {\n const li = document.createElement('li')\n li.appendChild(el)\n sidebarExpandableMenu.appendChild(li)\n })\n }\n\n parentElementIsSidebar() {\n const parentElement = this.el.parentElement;\n if (parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR') {\n return true;\n } else return false;\n }\n\n checkIfMenuItemIsNested() {\n const parentIsSidebar = this.parentElementIsSidebar()\n if (parentIsSidebar) {\n this.isNested = false;\n }\n }\n\n checkIfMenuItemIsSubMenu() {\n const parentElement = this.el.parentElement;\n const navItem = this.getNavItem(parentElement.shadowRoot);\n if(parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR-ITEM' && !this.handleClassList(navItem, 'contains', 'header__section')) {\n this.isSubMenuItem = true;\n }else {\n this.isSubMenuItem = false;\n }\n }\n\n isActive(iteratedComponent) {\n const activeAttributeValue = iteratedComponent.getAttribute('active');\n const isActive = activeAttributeValue === 'true';\n return isActive\n }\n\n getParentSection(el: HTMLElement) {\n let parentElement = el.parentElement;\n\n while (parentElement && parentElement.tagName.toUpperCase() !== 'IFX-SIDEBAR') {\n if (parentElement.tagName.toUpperCase() === 'IFX-SIDEBAR-ITEM') {\n return parentElement;\n }\n parentElement = parentElement.parentElement;\n }\n\n return null;\n }\n\n\n\n handleBorderIndicatorDisplacement(menuItem) {\n // Recursive function to handle each item\n const handleItem = (item, menuItem) => {\n const isActive = this.isActive(item);\n if (isActive) {\n const isOpen = this.handleClassList(menuItem, 'contains', 'open');\n const activeMenuItemSection = this.getActiveItemSection();\n if (!isOpen) {\n this.handleClassList(activeMenuItemSection, 'add', 'active-section');\n } else {\n this.handleClassList(activeMenuItemSection, 'remove', 'active-section');\n }\n }\n\n // Process each child item\n const children = this.getSidebarMenuItems(item);\n children.forEach((child) => handleItem(child, menuItem));\n }\n\n // Start with the top-level items\n const topLevelItems = this.getSidebarMenuItems();\n topLevelItems.forEach((item) => handleItem(item, menuItem));\n }\n\n\n setHref() {\n if (this.href.toLowerCase().trim() === \"\") {\n this.internalHref = undefined;\n } else this.internalHref = this.href;\n }\n\n getActiveItemSection() {\n const parentIsSidebar = this.parentElementIsSidebar()\n if (parentIsSidebar) {\n const labelElement = this.getNavItem(this.el.shadowRoot)\n return labelElement;\n } else {\n const labelElement = this.getNavItem(this.el.shadowRoot)\n return labelElement;\n }\n }\n\n @Method()\n async setActiveClasses() {\n const activeMenuItem = this.getNavItem(this.el.shadowRoot)\n this.handleClassList(activeMenuItem, 'add', 'active')\n }\n\n @Method()\n async expandMenu(ac: boolean){\n const menuItem = this.getSidebarMenuItem();\n const expandableMenu = this.getExpandableMenu();\n this.handleClassList(expandableMenu, 'add', 'open');\n this.handleClassList(menuItem, 'add', 'open');\n if(ac){\n this.handleClassList(expandableMenu, 'remove', 'active-section')\n this.handleClassList(menuItem, 'remove', 'active-section')\n }\n }\n \n @Method()\n async isItemExpandable(){\n return this.isExpandable;\n }\n\n handleActiveState() {\n if (this.internalActiveState) {\n this.setActiveClasses()\n }\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n this.toggleSubmenu()\n }\n }\n\n componentDidLoad() {\n this.handleActiveState();\n if (this.isExpandable) {\n const sidebarItems = this.getSidebarMenuItems();\n this.handleExpandableMenu(sidebarItems)\n }\n }\n \n componentWillLoad() {\n this.internalActiveState = this.active;\n this.checkIfMenuItemIsNested();\n this.checkIfMenuItemIsSubMenu();\n this.setHref()\n const sidebarItems = this.getSidebarMenuItems();\n if (sidebarItems.length !== 0) {\n this.isExpandable = true;\n } else {\n this.isExpandable = false;\n }\n }\n\n componentWillUpdate() {\n // If the active prop has been set to true and the internalActiveState has not been set to true yet\n if (this.active && !this.internalActiveState) {\n // Set the internal active state to true\n this.internalActiveState = this.active;\n\n // Emit the event to notify the parent Sidebar\n this.ifxSidebarNavigationItem.emit(this.el);\n }\n }\n\n\n render() {\n return (\n <div>\n <a tabIndex={1} onKeyDown={(event) => this.handleKeyDown(event)} href={this.internalHref} onClick={() => this.toggleSubmenu()} target={this.target} class={`sidebar__nav-item ${!this.isNested && this.isExpandable ? 'header__section' : \"\"} ${this.isSubMenuItem ? 'submenu__item' : \"\"}`}>\n {this.icon &&\n <div class={`sidebar__nav-item-icon-wrapper ${!this.showIcon ? 'noIcon' : \"\"}`}>\n <ifx-icon icon={this.icon}></ifx-icon>\n </div>}\n <div class=\"sidebar__nav-item-label\">\n <slot />\n </div>\n {\n (this.isExpandable || this.numberIndicator?.trim()) && \n <div class=\"sidebar__nav-item-indicator\">\n {this.isExpandable &&\n <span class='item__arrow-wrapper'>\n <ifx-icon icon=\"chevron-down-12\" />\n </span>\n }\n\n {this.numberIndicator?.trim() && !this.isExpandable && !this.isNested &&\n <span class='item__number-indicator'>\n <ifx-number-indicator>{this.numberIndicator}</ifx-number-indicator>\n </span>}\n\n </div>\n }\n </a>\n {this.isExpandable && <ul class='expandable__submenu'></ul>}\n\n </div>\n );\n }\n}\n"]}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { action } from "@storybook/addon-actions";
|
2
|
+
import { icons } from "@infineon/infineon-icons";
|
2
3
|
export default {
|
3
4
|
title: 'Components/Navigation/Sidebar',
|
4
5
|
// tags: ['autodocs'],
|
5
6
|
args: {
|
6
|
-
icon:
|
7
|
+
icon: 'image-16',
|
7
8
|
applicationName: 'Application Name',
|
8
9
|
showFooter: true,
|
9
10
|
showHeader: true,
|
@@ -14,26 +15,118 @@ export default {
|
|
14
15
|
copyrightText: `© 1999 - ${new Date().getFullYear()} Infineon Technologies AG`,
|
15
16
|
},
|
16
17
|
argTypes: {
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
applicationName: {
|
19
|
+
description: 'The name of the application to display at the top of the sidebar.',
|
20
|
+
table: {
|
21
|
+
category: 'ifx-sidebar props'
|
22
|
+
}
|
20
23
|
},
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
showHeader: {
|
25
|
+
description: 'Determines whether the header is displayed in the sidebar.',
|
26
|
+
table: {
|
27
|
+
category: 'ifx-sidebar props',
|
28
|
+
defaultValue: {
|
29
|
+
summary: true
|
30
|
+
}
|
31
|
+
}
|
24
32
|
},
|
25
|
-
|
26
|
-
|
27
|
-
|
33
|
+
showFooter: {
|
34
|
+
description: 'Determines whether the footer is displayed in the sidebar.',
|
35
|
+
table: {
|
36
|
+
category: 'ifx-sidebar props',
|
37
|
+
defaultValue: {
|
38
|
+
summary: true
|
39
|
+
}
|
40
|
+
}
|
41
|
+
},
|
42
|
+
initialCollapse: {
|
43
|
+
description: 'Determines if the sidebar should be collapsed by default when it first loads.',
|
44
|
+
table: {
|
45
|
+
category: 'ifx-sidebar props',
|
46
|
+
defaultValue: {
|
47
|
+
summary: true
|
48
|
+
}
|
49
|
+
}
|
28
50
|
},
|
29
51
|
imprint: {
|
52
|
+
description: 'The URL link for the "Imprint" section in the sidebar footer.',
|
30
53
|
if: { arg: 'showFooter', eq: true },
|
54
|
+
table: {
|
55
|
+
category: 'ifx-sidebar props'
|
56
|
+
}
|
31
57
|
},
|
32
58
|
termsOfUse: {
|
59
|
+
description: 'The URL link for the "Terms of Use" section in the sidebar footer.',
|
33
60
|
if: { arg: 'showFooter', eq: true },
|
61
|
+
table: {
|
62
|
+
category: 'ifx-sidebar props'
|
63
|
+
}
|
34
64
|
},
|
35
65
|
privacyPolicy: {
|
66
|
+
description: 'The URL link for the "Privacy Policy" section in the sidebar footer.',
|
36
67
|
if: { arg: 'showFooter', eq: true },
|
68
|
+
table: {
|
69
|
+
category: 'ifx-sidebar props'
|
70
|
+
}
|
71
|
+
},
|
72
|
+
copyrightText: {
|
73
|
+
description: 'The copyright text to display at the bottom of the sidebar.',
|
74
|
+
table: {
|
75
|
+
category: 'ifx-sidebar props'
|
76
|
+
}
|
77
|
+
},
|
78
|
+
icon: {
|
79
|
+
description: 'The icon to display for the sidebar items. Choose ***none*** to display no icon.',
|
80
|
+
options: ['none', ...Object.values(icons).map(i => i['name'])],
|
81
|
+
control: 'select',
|
82
|
+
table: {
|
83
|
+
category: 'ifx-sidebar-item props',
|
84
|
+
defaultValue: {
|
85
|
+
summary: 'image-16'
|
86
|
+
}
|
87
|
+
}
|
88
|
+
},
|
89
|
+
ifxSidebarNavigationItem: {
|
90
|
+
action: 'ifxSidebarNavigationItem',
|
91
|
+
description: 'Custom event emitted when a navigation item becomes active on selection',
|
92
|
+
table: {
|
93
|
+
category: 'custom events',
|
94
|
+
type: {
|
95
|
+
summary: 'Framework integration',
|
96
|
+
detail: `React: onIfxSidebarNavigationItem={handleChange}
|
97
|
+
Vue: @ifxSidebarNavigationItem="handleChange"
|
98
|
+
Angular: (ifxSidebarNavigationItem)="handleChange()"
|
99
|
+
VanillaJs: .addEventListener("ifxSidebarNavigationItem", (event) => {/*handle change*/});`
|
100
|
+
}
|
101
|
+
}
|
102
|
+
},
|
103
|
+
ifxSidebarActionItem: {
|
104
|
+
action: 'ifxSidebarActionItem',
|
105
|
+
description: 'Custom event emitted when an action item is selected',
|
106
|
+
table: {
|
107
|
+
category: 'custom events',
|
108
|
+
type: {
|
109
|
+
summary: 'Framework integration',
|
110
|
+
detail: `React: onIfxSidebarActionItem={handleAction}
|
111
|
+
Vue: @ifxSidebarActionItem="handleAction"
|
112
|
+
Angular: (ifxSidebarActionItem)="handleAction()"
|
113
|
+
VanillaJs: .addEventListener("ifxSidebarActionItem", (event) => {/*handle action*/});`
|
114
|
+
},
|
115
|
+
}
|
116
|
+
},
|
117
|
+
ifxSidebarMenu: {
|
118
|
+
action: 'ifxSidebarMenu',
|
119
|
+
description: 'Custom event emitted when a menu is expanded or closed',
|
120
|
+
table: {
|
121
|
+
category: 'custom events',
|
122
|
+
type: {
|
123
|
+
summary: 'Framework integration',
|
124
|
+
detail: `React: onIfxSidebarMenu={handleMenu}
|
125
|
+
Vue: @ifxSidebarMenu="handleMenu"
|
126
|
+
Angular: (ifxSidebarMenu)="handleMenu()"
|
127
|
+
VanillaJs: .addEventListener("ifxSidebarMenu", (event) => {/*handle menu*/});`
|
128
|
+
},
|
129
|
+
},
|
37
130
|
},
|
38
131
|
},
|
39
132
|
};
|
@@ -53,13 +146,13 @@ const DefaultTemplate = args => {
|
|
53
146
|
sidebarElement.setAttribute('copyright-text', args.copyrightText);
|
54
147
|
sidebarElement.innerHTML = `
|
55
148
|
<ifx-sidebar-title>Menu Items</ifx-sidebar-title>
|
56
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
57
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
58
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
59
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
149
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Menu Item</ifx-sidebar-item>
|
150
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Menu Item</ifx-sidebar-item>
|
151
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Menu Item</ifx-sidebar-item>
|
152
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Menu Item</ifx-sidebar-item>
|
60
153
|
<ifx-sidebar-item>
|
61
154
|
Section
|
62
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
155
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Menu Item</ifx-sidebar-item>
|
63
156
|
<ifx-sidebar-item icon='image-16'>
|
64
157
|
Menu Item
|
65
158
|
<ifx-sidebar-item>Sub menu item</ifx-sidebar-item>
|
@@ -70,8 +163,8 @@ const DefaultTemplate = args => {
|
|
70
163
|
<ifx-sidebar-item href='https://google.com' target='_blank'>Menu Item</ifx-sidebar-item>
|
71
164
|
</ifx-sidebar-item>
|
72
165
|
<ifx-sidebar-title>Items group</ifx-sidebar-title>
|
73
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
74
|
-
<ifx-sidebar-item href='https://google.com' target='_blank' icon='
|
166
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Item 1</ifx-sidebar-item>
|
167
|
+
<ifx-sidebar-item href='https://google.com' target='_blank' icon="${args.icon === 'none' ? '' : args.icon}">Item 2</ifx-sidebar-item>
|
75
168
|
`;
|
76
169
|
return sidebarElement;
|
77
170
|
};
|