@roadtrip/components 3.29.0 → 3.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/index-12592729.js +16 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/road-badge_14.cjs.entry.js +2 -2
  4. package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
  5. package/dist/cjs/road-global-navigation-v2.cjs.entry.js +146 -0
  6. package/dist/cjs/road-global-navigation-v2.cjs.entry.js.map +1 -0
  7. package/dist/cjs/road-navbar-item-v2.cjs.entry.js +83 -0
  8. package/dist/cjs/road-navbar-item-v2.cjs.entry.js.map +1 -0
  9. package/dist/cjs/road-navbar-v2.cjs.entry.js +46 -0
  10. package/dist/cjs/road-navbar-v2.cjs.entry.js.map +1 -0
  11. package/dist/cjs/road-toolbar-v2.cjs.entry.js +21 -0
  12. package/dist/cjs/road-toolbar-v2.cjs.entry.js.map +1 -0
  13. package/dist/cjs/road-tooltip.cjs.entry.js +23 -3
  14. package/dist/cjs/road-tooltip.cjs.entry.js.map +1 -1
  15. package/dist/cjs/roadtrip.cjs.js +1 -1
  16. package/dist/collection/collection-manifest.json +4 -0
  17. package/dist/collection/components/drawer/drawer.css +1 -0
  18. package/dist/collection/components/global-navigation-v2/global-navigation-v2.css +14 -0
  19. package/dist/collection/components/global-navigation-v2/global-navigation-v2.js +231 -0
  20. package/dist/collection/components/global-navigation-v2/global-navigation-v2.js.map +1 -0
  21. package/dist/collection/components/global-navigation-v2/global-navigation-v2.stories.js +446 -0
  22. package/dist/collection/components/icon/icon.css +1 -1
  23. package/dist/collection/components/navbar-item-v2/navbar-item-v2.css +221 -0
  24. package/dist/collection/components/navbar-item-v2/navbar-item-v2.js +268 -0
  25. package/dist/collection/components/navbar-item-v2/navbar-item-v2.js.map +1 -0
  26. package/dist/collection/components/navbar-v2/navbar-v2.css +113 -0
  27. package/dist/collection/components/navbar-v2/navbar-v2.js +143 -0
  28. package/dist/collection/components/navbar-v2/navbar-v2.js.map +1 -0
  29. package/dist/collection/components/navbar-v2/navbar-v2.stories.js +381 -0
  30. package/dist/collection/components/toolbar-v2/toolbar-v2.css +216 -0
  31. package/dist/collection/components/toolbar-v2/toolbar-v2.js +27 -0
  32. package/dist/collection/components/toolbar-v2/toolbar-v2.js.map +1 -0
  33. package/dist/collection/components/toolbar-v2/toolbar-v2.stories.js +90 -0
  34. package/dist/collection/components/tooltip/tooltip.css +2 -0
  35. package/dist/collection/components/tooltip/tooltip.js +22 -2
  36. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  37. package/dist/esm/index-52302079.js +16 -0
  38. package/dist/esm/loader.js +1 -1
  39. package/dist/esm/road-badge_14.entry.js +2 -2
  40. package/dist/esm/road-badge_14.entry.js.map +1 -1
  41. package/dist/esm/road-global-navigation-v2.entry.js +142 -0
  42. package/dist/esm/road-global-navigation-v2.entry.js.map +1 -0
  43. package/dist/esm/road-navbar-item-v2.entry.js +79 -0
  44. package/dist/esm/road-navbar-item-v2.entry.js.map +1 -0
  45. package/dist/esm/road-navbar-v2.entry.js +42 -0
  46. package/dist/esm/road-navbar-v2.entry.js.map +1 -0
  47. package/dist/esm/road-toolbar-v2.entry.js +17 -0
  48. package/dist/esm/road-toolbar-v2.entry.js.map +1 -0
  49. package/dist/esm/road-tooltip.entry.js +23 -3
  50. package/dist/esm/road-tooltip.entry.js.map +1 -1
  51. package/dist/esm/roadtrip.js +1 -1
  52. package/dist/html.html-data.json +99 -0
  53. package/dist/roadtrip/p-36895fa7.entry.js +2 -0
  54. package/dist/roadtrip/p-36895fa7.entry.js.map +1 -0
  55. package/dist/roadtrip/p-586a101a.entry.js +2 -0
  56. package/dist/roadtrip/p-586a101a.entry.js.map +1 -0
  57. package/dist/roadtrip/p-5bf1b477.entry.js +2 -0
  58. package/dist/roadtrip/p-5bf1b477.entry.js.map +1 -0
  59. package/dist/roadtrip/p-5cdf4e2f.entry.js +2 -0
  60. package/dist/roadtrip/p-5cdf4e2f.entry.js.map +1 -0
  61. package/dist/roadtrip/p-a498e8eb.entry.js +2 -0
  62. package/dist/roadtrip/p-a498e8eb.entry.js.map +1 -0
  63. package/dist/roadtrip/p-e2e3aa1a.entry.js +2 -0
  64. package/dist/roadtrip/p-e2e3aa1a.entry.js.map +1 -0
  65. package/dist/roadtrip/roadtrip.css +1 -1
  66. package/dist/roadtrip/roadtrip.esm.js +1 -1
  67. package/dist/roadtrip/roadtrip.esm.js.map +1 -1
  68. package/dist/types/components/global-navigation-v2/global-navigation-v2.d.ts +32 -0
  69. package/dist/types/components/navbar-item-v2/navbar-item-v2.d.ts +61 -0
  70. package/dist/types/components/navbar-v2/navbar-v2.d.ts +23 -0
  71. package/dist/types/components/toolbar-v2/toolbar-v2.d.ts +11 -0
  72. package/dist/types/components/tooltip/tooltip.d.ts +6 -0
  73. package/dist/types/components-react.d.ts +81 -0
  74. package/dist/types/components.d.ts +180 -0
  75. package/hydrate/index.js +352 -6
  76. package/package.json +1 -1
  77. package/dist/roadtrip/p-1115f970.entry.js +0 -2
  78. package/dist/roadtrip/p-1115f970.entry.js.map +0 -1
  79. package/dist/roadtrip/p-a77727f2.entry.js +0 -2
  80. package/dist/roadtrip/p-a77727f2.entry.js.map +0 -1
@@ -0,0 +1,268 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * @slot - Content of the item, it should be road-icon and road-label elements.
4
+ *
5
+ * @part native - The native HTML anchor element that wraps all child elements.
6
+ */
7
+ export class NavbarItem {
8
+ constructor() {
9
+ this.onKeyUp = (ev) => {
10
+ if (ev.key === 'Enter' || ev.key === ' ') {
11
+ this.selectTab(ev);
12
+ }
13
+ };
14
+ this.onClick = (ev) => {
15
+ this.selectTab(ev);
16
+ };
17
+ this.disabled = false;
18
+ this.download = undefined;
19
+ this.href = undefined;
20
+ this.rel = undefined;
21
+ this.selected = false;
22
+ this.tab = undefined;
23
+ this.target = undefined;
24
+ }
25
+ onNavbarChanged(ev) {
26
+ this.selected = this.tab === ev.detail.tab;
27
+ }
28
+ /**
29
+ * Watch for changes to `selected` and move focus to this element if `selected` is true.
30
+ */
31
+ handleSelectedChange(newValue) {
32
+ if (newValue) {
33
+ this.el.focus();
34
+ }
35
+ }
36
+ selectTab(ev) {
37
+ if (this.tab !== undefined) {
38
+ if (!this.disabled) {
39
+ this.roadnavbaritemclick.emit({
40
+ tab: this.tab,
41
+ href: this.href,
42
+ selected: this.selected,
43
+ });
44
+ this.roadNavbarItemClick.emit({
45
+ tab: this.tab,
46
+ href: this.href,
47
+ selected: this.selected,
48
+ });
49
+ }
50
+ if (this.href === undefined) {
51
+ ev.preventDefault();
52
+ }
53
+ }
54
+ }
55
+ render() {
56
+ const { href, rel, target, selected, tab, disabled } = this;
57
+ const attrs = {
58
+ download: this.download,
59
+ href,
60
+ rel,
61
+ target,
62
+ };
63
+ return (h(Host, { onClick: this.onClick, onKeyup: this.onKeyUp, role: "menuitem", tabindex: "0", "aria-selected": selected ? 'true' : null, id: tab !== undefined ? `navbar-item-${tab}` : null, disabled: disabled, class: {
64
+ 'navbar-item': true,
65
+ 'tab-selected': selected,
66
+ 'tab-disabled': disabled,
67
+ } }, h("a", Object.assign({}, attrs, { tabIndex: -1, class: "button-native", part: "native" }), h("span", { class: "button-inner" }, h("slot", null)))));
68
+ }
69
+ static get is() { return "road-navbar-item-v2"; }
70
+ static get encapsulation() { return "shadow"; }
71
+ static get originalStyleUrls() {
72
+ return {
73
+ "$": ["navbar-item-v2.css"]
74
+ };
75
+ }
76
+ static get styleUrls() {
77
+ return {
78
+ "$": ["navbar-item-v2.css"]
79
+ };
80
+ }
81
+ static get properties() {
82
+ return {
83
+ "disabled": {
84
+ "type": "boolean",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "boolean",
88
+ "resolved": "boolean",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": "If `true`, the user cannot interact with the tab button."
96
+ },
97
+ "attribute": "disabled",
98
+ "reflect": false,
99
+ "defaultValue": "false"
100
+ },
101
+ "download": {
102
+ "type": "string",
103
+ "mutable": false,
104
+ "complexType": {
105
+ "original": "string | undefined",
106
+ "resolved": "string | undefined",
107
+ "references": {}
108
+ },
109
+ "required": false,
110
+ "optional": false,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": "This attribute instructs browsers to download a URL instead of navigating to\nit, so the user will be prompted to save it as a local file. If the attribute\nhas a value, it is used as the pre-filled file name in the Save prompt\n(the user can still change the file name if they want)."
114
+ },
115
+ "attribute": "download",
116
+ "reflect": false
117
+ },
118
+ "href": {
119
+ "type": "string",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "string | undefined",
123
+ "resolved": "string | undefined",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": "Contains a URL or a URL fragment that the hyperlink points to.\nIf this property is set, an anchor tag will be rendered."
131
+ },
132
+ "attribute": "href",
133
+ "reflect": false
134
+ },
135
+ "rel": {
136
+ "type": "string",
137
+ "mutable": false,
138
+ "complexType": {
139
+ "original": "string | undefined",
140
+ "resolved": "string | undefined",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "Specifies the relationship of the target object to the link object.\nThe value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types)."
148
+ },
149
+ "attribute": "rel",
150
+ "reflect": false
151
+ },
152
+ "selected": {
153
+ "type": "boolean",
154
+ "mutable": true,
155
+ "complexType": {
156
+ "original": "boolean",
157
+ "resolved": "boolean",
158
+ "references": {}
159
+ },
160
+ "required": false,
161
+ "optional": false,
162
+ "docs": {
163
+ "tags": [],
164
+ "text": "The selected tab component"
165
+ },
166
+ "attribute": "selected",
167
+ "reflect": false,
168
+ "defaultValue": "false"
169
+ },
170
+ "tab": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "string",
175
+ "resolved": "string | undefined",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": true,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": "A tab id must be provided for each `road-tab`. It's used internally to reference\nthe selected tab."
183
+ },
184
+ "attribute": "tab",
185
+ "reflect": false
186
+ },
187
+ "target": {
188
+ "type": "string",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "string | undefined",
192
+ "resolved": "string | undefined",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": false,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Specifies where to display the linked URL.\nOnly applies when an `href` is provided.\nSpecial keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`."
200
+ },
201
+ "attribute": "target",
202
+ "reflect": false
203
+ }
204
+ };
205
+ }
206
+ static get events() {
207
+ return [{
208
+ "method": "roadnavbaritemclick",
209
+ "name": "roadnavbaritemclick",
210
+ "bubbles": true,
211
+ "cancelable": true,
212
+ "composed": true,
213
+ "docs": {
214
+ "tags": [{
215
+ "name": "internal",
216
+ "text": undefined
217
+ }],
218
+ "text": "Emitted when the tab bar is clicked"
219
+ },
220
+ "complexType": {
221
+ "original": "any",
222
+ "resolved": "any",
223
+ "references": {}
224
+ }
225
+ }, {
226
+ "method": "roadNavbarItemClick",
227
+ "name": "roadNavbarItemClick",
228
+ "bubbles": true,
229
+ "cancelable": true,
230
+ "composed": true,
231
+ "docs": {
232
+ "tags": [{
233
+ "name": "internal",
234
+ "text": undefined
235
+ }],
236
+ "text": ""
237
+ },
238
+ "complexType": {
239
+ "original": "any",
240
+ "resolved": "any",
241
+ "references": {}
242
+ }
243
+ }];
244
+ }
245
+ static get elementRef() { return "el"; }
246
+ static get watchers() {
247
+ return [{
248
+ "propName": "selected",
249
+ "methodName": "handleSelectedChange"
250
+ }];
251
+ }
252
+ static get listeners() {
253
+ return [{
254
+ "name": "roadNavbarChanged",
255
+ "method": "onNavbarChanged",
256
+ "target": "window",
257
+ "capture": false,
258
+ "passive": false
259
+ }, {
260
+ "name": "roadnavbarchanged",
261
+ "method": "onNavbarChanged",
262
+ "target": "window",
263
+ "capture": false,
264
+ "passive": false
265
+ }];
266
+ }
267
+ }
268
+ //# sourceMappingURL=navbar-item-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbar-item-v2.js","sourceRoot":"","sources":["../../../src/components/navbar-item-v2/navbar-item-v2.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, Host, h, Element, Prop, Event, EventEmitter, Listen, Watch } from '@stencil/core';\n\n/**\n * @slot - Content of the item, it should be road-icon and road-label elements.\n *\n * @part native - The native HTML anchor element that wraps all child elements.\n */\n\n@Component({\n tag: 'road-navbar-item-v2',\n styleUrl: 'navbar-item-v2.css',\n shadow: true,\n})\nexport class NavbarItem {\n\n @Element() el!: HTMLRoadNavbarItemElement;\n\n /**\n * If `true`, the user cannot interact with the tab button.\n */\n @Prop() disabled = false;\n\n /**\n * This attribute instructs browsers to download a URL instead of navigating to\n * it, so the user will be prompted to save it as a local file. If the attribute\n * has a value, it is used as the pre-filled file name in the Save prompt\n * (the user can still change the file name if they want).\n */\n @Prop() download: string | undefined;\n\n /**\n * Contains a URL or a URL fragment that the hyperlink points to.\n * If this property is set, an anchor tag will be rendered.\n */\n @Prop() href: string | undefined;\n\n /**\n * Specifies the relationship of the target object to the link object.\n * The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types).\n */\n @Prop() rel: string | undefined;\n\n /**\n * The selected tab component\n */\n @Prop({ mutable: true }) selected = false;\n\n /**\n * A tab id must be provided for each `road-tab`. It's used internally to reference\n * the selected tab.\n */\n @Prop() tab?: string;\n\n /**\n * Specifies where to display the linked URL.\n * Only applies when an `href` is provided.\n * Special keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`.\n */\n @Prop() target: string | undefined;\n\n /**\n * Emitted when the tab bar is clicked\n * @internal\n */\n @Event() roadnavbaritemclick!: EventEmitter;\n /** @internal */\n @Event() roadNavbarItemClick!: EventEmitter;\n\n @Listen('roadNavbarChanged', { target: 'window' })\n @Listen('roadnavbarchanged', { target: 'window' })\n onNavbarChanged(ev: CustomEvent) {\n this.selected = this.tab === ev.detail.tab;\n }\n\n /**\n * Watch for changes to `selected` and move focus to this element if `selected` is true.\n */\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n if (newValue) {\n this.el.focus();\n }\n }\n\n private selectTab(ev: Event | KeyboardEvent) {\n if (this.tab !== undefined) {\n if (!this.disabled) {\n this.roadnavbaritemclick.emit({\n tab: this.tab,\n href: this.href,\n selected: this.selected,\n });\n this.roadNavbarItemClick.emit({\n tab: this.tab,\n href: this.href,\n selected: this.selected,\n });\n }\n if(this.href === undefined) {\n ev.preventDefault();\n }\n }\n }\n\n private onKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter' || ev.key === ' ') {\n this.selectTab(ev);\n }\n };\n\n private onClick = (ev: Event) => {\n this.selectTab(ev);\n };\n\n render() {\n const { href, rel, target, selected, tab, disabled } = this;\n const attrs = {\n download: this.download,\n href,\n rel,\n target,\n };\n\n return (\n <Host\n onClick={this.onClick}\n onKeyup={this.onKeyUp}\n role=\"menuitem\"\n tabindex=\"0\"\n aria-selected={selected ? 'true' : null}\n id={tab !== undefined ? `navbar-item-${tab}` : null}\n disabled={disabled}\n class={{\n 'navbar-item': true,\n 'tab-selected': selected,\n 'tab-disabled': disabled,\n }}\n >\n <a {...attrs} tabIndex={-1} class=\"button-native\" part=\"native\">\n <span class=\"button-inner\">\n <slot/>\n </span>\n </a>\n </Host>\n );\n }\n\n}\n"]}
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Navbar
3
+ *
4
+ */
5
+
6
+ /**
7
+ * @prop --z-index: The z-index of the Navbar.
8
+ */
9
+
10
+ :host {
11
+ --z-index: 3;
12
+
13
+ position: fixed;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: var(--z-index);
17
+ box-sizing: border-box;
18
+ display: flex;
19
+ align-items: center;
20
+ width: 100%;
21
+ height: 5.125rem;
22
+ padding-left: 0;
23
+ margin: 0;
24
+ text-align: center;
25
+ -webkit-user-select: none;
26
+ user-select: none;
27
+ background-color: var(--road-surface);
28
+ border-top: 1px solid var(--road-outline-weak);
29
+ }
30
+
31
+ @media (max-width: 576px) {
32
+
33
+ :host {
34
+ overflow-x: auto;
35
+ }
36
+ }
37
+
38
+ @media (min-width: 1200px) {
39
+
40
+ :host {
41
+ flex-direction: column;
42
+ align-items: flex-start;
43
+ width: 260px;
44
+ height: 100%;
45
+ padding: var(--road-spacing-05);
46
+ text-align: left;
47
+ border-top: 0;
48
+ border-right: 1px solid var(--road-outline-weak);
49
+ justify-content: space-between;
50
+ height: 100%;
51
+ }
52
+ }
53
+
54
+
55
+ /**
56
+ * Button save drawer.
57
+ */
58
+
59
+ ::slotted(.drawer-button-save) {
60
+ position: absolute;
61
+ bottom: 0;
62
+ width: 100%;
63
+ }
64
+
65
+ .button-native {
66
+ position: relative;
67
+ display: flex;
68
+ flex-flow: row nowrap;
69
+ flex-shrink: 0;
70
+ align-items: center;
71
+ justify-content: center;
72
+ width: 100%;
73
+ height: 100%;
74
+ padding: var(--padding-end) var(--padding-end) var(--padding-start) 0;
75
+ margin: 0;
76
+ font-family: inherit;
77
+ font-size: inherit;
78
+ font-style: inherit;
79
+ font-weight: inherit;
80
+ color: inherit;
81
+ text-align: inherit;
82
+ text-decoration: none;
83
+ text-indent: inherit;
84
+ text-overflow: inherit;
85
+ text-transform: inherit;
86
+ letter-spacing: inherit;
87
+ white-space: inherit;
88
+ cursor: pointer;
89
+ background: transparent;
90
+ border: none;
91
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
92
+ }
93
+
94
+
95
+ /**
96
+ * Compact
97
+ */
98
+
99
+ @media (min-width: 1200px) {
100
+
101
+ :host(.compact){
102
+ max-width: 5.5rem;
103
+ }
104
+
105
+ .compact ::slotted(.compact-container){
106
+ max-width: 3.5rem;
107
+ }
108
+
109
+ .compact ::slotted(.compact-container) .compact-logo{
110
+ justify-content: center;
111
+ }
112
+
113
+ }
@@ -0,0 +1,143 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import "./../../utils/polyfill";
3
+ /**
4
+ * @slot - Content of the navbar, it should be road-navbar-item elements. Max 5 items on Mobile
5
+ */
6
+ export class NavbarV2 {
7
+ constructor() {
8
+ this.compact = false;
9
+ this.selectedTab = undefined;
10
+ }
11
+ selectedTabChanged() {
12
+ if (this.selectedTab !== undefined) {
13
+ this.roadnavbarchanged.emit({
14
+ tab: this.selectedTab,
15
+ });
16
+ this.roadNavbarChanged.emit({
17
+ tab: this.selectedTab,
18
+ });
19
+ }
20
+ }
21
+ onNavbarChanged(ev) {
22
+ this.selectedTab = ev.detail.tab;
23
+ }
24
+ componentWillLoad() {
25
+ this.selectedTabChanged();
26
+ }
27
+ render() {
28
+ const compactClass = this.compact ? 'compact' : '';
29
+ return (h(Host, { role: "menubar", class: `${compactClass}` }, h("slot", null)));
30
+ }
31
+ static get is() { return "road-navbar-v2"; }
32
+ static get encapsulation() { return "shadow"; }
33
+ static get originalStyleUrls() {
34
+ return {
35
+ "$": ["navbar-v2.css"]
36
+ };
37
+ }
38
+ static get styleUrls() {
39
+ return {
40
+ "$": ["navbar-v2.css"]
41
+ };
42
+ }
43
+ static get properties() {
44
+ return {
45
+ "compact": {
46
+ "type": "boolean",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "boolean",
50
+ "resolved": "boolean",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": false,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": "Set to `true` for a compact navbar."
58
+ },
59
+ "attribute": "compact",
60
+ "reflect": true,
61
+ "defaultValue": "false"
62
+ },
63
+ "selectedTab": {
64
+ "type": "string",
65
+ "mutable": false,
66
+ "complexType": {
67
+ "original": "string",
68
+ "resolved": "string | undefined",
69
+ "references": {}
70
+ },
71
+ "required": false,
72
+ "optional": true,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": "The selected tab component"
76
+ },
77
+ "attribute": "selected-tab",
78
+ "reflect": false
79
+ }
80
+ };
81
+ }
82
+ static get events() {
83
+ return [{
84
+ "method": "roadnavbarchanged",
85
+ "name": "roadnavbarchanged",
86
+ "bubbles": true,
87
+ "cancelable": true,
88
+ "composed": true,
89
+ "docs": {
90
+ "tags": [{
91
+ "name": "internal",
92
+ "text": undefined
93
+ }],
94
+ "text": ""
95
+ },
96
+ "complexType": {
97
+ "original": "any",
98
+ "resolved": "any",
99
+ "references": {}
100
+ }
101
+ }, {
102
+ "method": "roadNavbarChanged",
103
+ "name": "roadNavbarChanged",
104
+ "bubbles": true,
105
+ "cancelable": true,
106
+ "composed": true,
107
+ "docs": {
108
+ "tags": [{
109
+ "name": "internal",
110
+ "text": undefined
111
+ }],
112
+ "text": ""
113
+ },
114
+ "complexType": {
115
+ "original": "any",
116
+ "resolved": "any",
117
+ "references": {}
118
+ }
119
+ }];
120
+ }
121
+ static get watchers() {
122
+ return [{
123
+ "propName": "selectedTab",
124
+ "methodName": "selectedTabChanged"
125
+ }];
126
+ }
127
+ static get listeners() {
128
+ return [{
129
+ "name": "roadNavbarItemClick",
130
+ "method": "onNavbarChanged",
131
+ "target": undefined,
132
+ "capture": false,
133
+ "passive": false
134
+ }, {
135
+ "name": "roadnavbaritemclick",
136
+ "method": "onNavbarChanged",
137
+ "target": undefined,
138
+ "capture": false,
139
+ "passive": false
140
+ }];
141
+ }
142
+ }
143
+ //# sourceMappingURL=navbar-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbar-v2.js","sourceRoot":"","sources":["../../../src/components/navbar-v2/navbar-v2.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,wBAAwB,CAAC;AAEhC;;GAEG;AAOH,MAAM,OAAO,QAAQ;;mBAKyB,KAAK;;;EAOjD,kBAAkB;IAChB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;MAClC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;QAC1B,GAAG,EAAE,IAAI,CAAC,WAAW;OACtB,CAAC,CAAC;MACH,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;QAC1B,GAAG,EAAE,IAAI,CAAC,WAAW;OACtB,CAAC,CAAC;KACJ;EACH,CAAC;EASD,eAAe,CAAC,EAAe;IAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;EACnC,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,kBAAkB,EAAE,CAAC;EAC5B,CAAC;EAED,MAAM;IAEJ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnD,OAAO,CACL,EAAC,IAAI,IACH,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,GAAG,YAAY,EAAE;MAExB,eAAO,CACF,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport './../../utils/polyfill';\n\n/**\n * @slot - Content of the navbar, it should be road-navbar-item elements. Max 5 items on Mobile\n */\n\n@Component({\n tag: 'road-navbar-v2',\n styleUrl: 'navbar-v2.css',\n shadow: true,\n})\nexport class NavbarV2 {\n\n /**\n * Set to `true` for a compact navbar.\n */\n @Prop({ reflect: true }) compact: boolean = false;\n\n /**\n * The selected tab component\n */\n @Prop() selectedTab?: string;\n @Watch('selectedTab')\n selectedTabChanged() {\n if (this.selectedTab !== undefined) {\n this.roadnavbarchanged.emit({\n tab: this.selectedTab,\n });\n this.roadNavbarChanged.emit({\n tab: this.selectedTab,\n });\n }\n }\n\n /** @internal */\n @Event() roadnavbarchanged!: EventEmitter;\n /** @internal */\n @Event() roadNavbarChanged!: EventEmitter;\n\n @Listen('roadNavbarItemClick')\n @Listen('roadnavbaritemclick')\n onNavbarChanged(ev: CustomEvent) {\n this.selectedTab = ev.detail.tab;\n }\n\n componentWillLoad() {\n this.selectedTabChanged();\n }\n\n render() {\n\n const compactClass = this.compact ? 'compact' : '';\n\n return (\n <Host\n role=\"menubar\"\n class={`${compactClass}`}\n >\n <slot/>\n </Host>\n );\n }\n\n}\n"]}