@wawjs/ngx-prime 22.0.2 → 22.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,238 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, InjectionToken, inject, Renderer2, input, computed, ElementRef, effect, Directive } from '@angular/core';
3
+ import { BaseComponent, PARENT_INSTANCE } from '@wawjs/ngx-prime/basecomponent';
4
+ import * as i1 from '@wawjs/ngx-prime/bind';
5
+ import { Bind } from '@wawjs/ngx-prime/bind';
6
+ import { style } from '@wawjs/css-prime-styles/link';
7
+ import { BaseStyle } from '@wawjs/ngx-prime/base';
8
+
9
+ const classes = {
10
+ root: ({ instance }) => [
11
+ 'p-link p-component',
12
+ {
13
+ 'p-disabled': instance.disabled()
14
+ }
15
+ ],
16
+ icon: ({ instance }) => [
17
+ 'p-link-icon',
18
+ {
19
+ 'p-link-icon-right': instance.iconPos() === 'right'
20
+ }
21
+ ]
22
+ };
23
+ class LinkStyle extends BaseStyle {
24
+ name = 'link';
25
+ style = style;
26
+ classes = classes;
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: LinkStyle, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
28
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: LinkStyle });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: LinkStyle, decorators: [{
31
+ type: Injectable
32
+ }] });
33
+ /**
34
+ *
35
+ * Link renders a semantic, styled anchor for display-only navigation.
36
+ *
37
+ * [Live Demo](https://ngx-prime.org/link)
38
+ *
39
+ * @module linkstyle
40
+ *
41
+ */
42
+ var LinkClasses;
43
+ (function (LinkClasses) {
44
+ /**
45
+ * Class name of the root element
46
+ */
47
+ LinkClasses["root"] = "p-link";
48
+ /**
49
+ * Class name of the icon element
50
+ */
51
+ LinkClasses["icon"] = "p-link-icon";
52
+ })(LinkClasses || (LinkClasses = {}));
53
+
54
+ const LINK_INSTANCE = new InjectionToken('LINK_INSTANCE');
55
+ /**
56
+ * Link renders a semantic, styled anchor for display-only navigation. It
57
+ * derives `mailto:`, `tel:`, `sms:`, WhatsApp, or `https:` targets from
58
+ * `value` based on `type`, or use `href` directly for a custom target.
59
+ *
60
+ * [Live Demo](https://ngx-prime.org/link)
61
+ *
62
+ * @group Components
63
+ */
64
+ class Link extends BaseComponent {
65
+ componentName = 'Link';
66
+ $pcLink = inject(LINK_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
67
+ bindDirectiveInstance = inject(Bind, { self: true });
68
+ _componentStyle = inject(LinkStyle);
69
+ _renderer = inject(Renderer2);
70
+ /**
71
+ * Style class of the component.
72
+ * @group Props
73
+ */
74
+ styleClass = input(/* @ts-ignore */
75
+ ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
76
+ /**
77
+ * Text or address the href is derived from when `href` is not set.
78
+ * @group Props
79
+ */
80
+ value = input('', /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
82
+ /**
83
+ * Determines how `value` is turned into an href.
84
+ * @group Props
85
+ */
86
+ type = input('url', /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
88
+ /**
89
+ * Explicit href, takes precedence over the value derived from `value`/`type`.
90
+ * @group Props
91
+ */
92
+ href = input(null, /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
94
+ /**
95
+ * Native anchor target.
96
+ * @group Props
97
+ */
98
+ target = input('_self', /* @ts-ignore */
99
+ ...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
100
+ /**
101
+ * Explicit rel, defaults to `noopener noreferrer` for `_blank` targets.
102
+ * @group Props
103
+ */
104
+ rel = input(null, /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "rel" }] : /* istanbul ignore next */ []));
106
+ /**
107
+ * Icon shown next to the anchor content, e.g. `pi pi-envelope`.
108
+ * @group Props
109
+ */
110
+ icon = input(/* @ts-ignore */
111
+ ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
112
+ /**
113
+ * Position of the icon relative to the anchor content.
114
+ * @group Props
115
+ */
116
+ iconPos = input('left', /* @ts-ignore */
117
+ ...(ngDevMode ? [{ debugName: "iconPos" }] : /* istanbul ignore next */ []));
118
+ /**
119
+ * When true, the link is not navigable and click events are suppressed.
120
+ * @group Props
121
+ */
122
+ disabled = input(false, /* @ts-ignore */
123
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
124
+ linkHref = computed(() => {
125
+ const explicitHref = this.href()?.trim();
126
+ if (explicitHref) {
127
+ return explicitHref;
128
+ }
129
+ const value = this.value().trim();
130
+ if (!value) {
131
+ return null;
132
+ }
133
+ switch (this.type()) {
134
+ case 'email':
135
+ return `mailto:${value}`;
136
+ case 'tel':
137
+ return `tel:${value.replace(/[^+\d]/g, '')}`;
138
+ case 'sms':
139
+ return `sms:${value.replace(/[^+\d]/g, '')}`;
140
+ case 'whatsapp':
141
+ return `https://wa.me/${value.replace(/\D/g, '')}`;
142
+ case 'url':
143
+ return /^[a-z][a-z\d+.-]*:/i.test(value) ? value : `https://${value}`;
144
+ case 'custom':
145
+ return null;
146
+ default:
147
+ return null;
148
+ }
149
+ }, /* @ts-ignore */
150
+ ...(ngDevMode ? [{ debugName: "linkHref" }] : /* istanbul ignore next */ []));
151
+ linkRel = computed(() => {
152
+ const rel = this.rel()?.trim();
153
+ if (rel) {
154
+ return rel;
155
+ }
156
+ return this.target() === '_blank' ? 'noopener noreferrer' : null;
157
+ }, /* @ts-ignore */
158
+ ...(ngDevMode ? [{ debugName: "linkRel" }] : /* istanbul ignore next */ []));
159
+ isClickable = computed(() => !!this.linkHref() && !this.disabled(), /* @ts-ignore */
160
+ ...(ngDevMode ? [{ debugName: "isClickable" }] : /* istanbul ignore next */ []));
161
+ get hostHref() {
162
+ return this.isClickable() ? this.linkHref() : null;
163
+ }
164
+ get hostRel() {
165
+ return this.linkRel();
166
+ }
167
+ get hostAriaDisabled() {
168
+ return this.disabled() || !this.linkHref() ? 'true' : null;
169
+ }
170
+ get dataP() {
171
+ return this.cn({
172
+ disabled: this.disabled()
173
+ });
174
+ }
175
+ _elementRef = inject(ElementRef);
176
+ _iconEl;
177
+ constructor() {
178
+ super();
179
+ this._iconEl = this._renderer.createElement('span');
180
+ this._renderer.setAttribute(this._iconEl, 'aria-hidden', 'true');
181
+ effect(() => this._syncIcon());
182
+ }
183
+ onAfterViewChecked() {
184
+ this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
185
+ }
186
+ onClick(event) {
187
+ if (!this.isClickable()) {
188
+ event.preventDefault();
189
+ return;
190
+ }
191
+ }
192
+ _syncIcon() {
193
+ const iconClass = this.icon();
194
+ const host = this._elementRef.nativeElement;
195
+ this._iconEl.className = this.cn(this.cx('icon'), iconClass) ?? '';
196
+ if (!iconClass) {
197
+ if (this._iconEl.parentElement) {
198
+ this._renderer.removeChild(host, this._iconEl);
199
+ }
200
+ return;
201
+ }
202
+ if (!this._iconEl.parentElement) {
203
+ if (this.iconPos() === 'right') {
204
+ this._renderer.appendChild(host, this._iconEl);
205
+ }
206
+ else {
207
+ this._renderer.insertBefore(host, this._iconEl, host.firstChild);
208
+ }
209
+ }
210
+ }
211
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: Link, deps: [], target: i0.ɵɵFactoryTarget.Directive });
212
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.2", type: Link, isStandalone: true, selector: "a[pLink]", inputs: { styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, rel: { classPropertyName: "rel", publicName: "rel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "class": "cn(cx('root'), styleClass())", "attr.href": "hostHref", "attr.target": "target()", "attr.rel": "hostRel", "attr.aria-disabled": "hostAriaDisabled", "attr.data-p": "dataP" } }, providers: [LinkStyle, { provide: LINK_INSTANCE, useExisting: Link }, { provide: PARENT_INSTANCE, useExisting: Link }], usesInheritance: true, hostDirectives: [{ directive: i1.Bind }], ngImport: i0 });
213
+ }
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: Link, decorators: [{
215
+ type: Directive,
216
+ args: [{
217
+ selector: 'a[pLink]',
218
+ standalone: true,
219
+ host: {
220
+ '[class]': "cn(cx('root'), styleClass())",
221
+ '[attr.href]': 'hostHref',
222
+ '[attr.target]': 'target()',
223
+ '[attr.rel]': 'hostRel',
224
+ '[attr.aria-disabled]': 'hostAriaDisabled',
225
+ '[attr.data-p]': 'dataP',
226
+ '(click)': 'onClick($event)'
227
+ },
228
+ providers: [LinkStyle, { provide: LINK_INSTANCE, useExisting: Link }, { provide: PARENT_INSTANCE, useExisting: Link }],
229
+ hostDirectives: [Bind]
230
+ }]
231
+ }], ctorParameters: () => [], propDecorators: { styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], rel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
232
+
233
+ /**
234
+ * Generated bundle index. Do not edit.
235
+ */
236
+
237
+ export { Link, LinkClasses, LinkStyle };
238
+ //# sourceMappingURL=wawjs-ngx-prime-link.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wawjs-ngx-prime-link.mjs","sources":["../../src/link/style/linkstyle.ts","../../src/link/link.ts","../../src/link/wawjs-ngx-prime-link.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { style } from '@wawjs/css-prime-styles/link';\nimport { BaseStyle } from '@wawjs/ngx-prime/base';\n\nconst classes = {\n root: ({ instance }) => [\n 'p-link p-component',\n {\n 'p-disabled': instance.disabled()\n }\n ],\n icon: ({ instance }) => [\n 'p-link-icon',\n {\n 'p-link-icon-right': instance.iconPos() === 'right'\n }\n ]\n};\n\n@Injectable()\nexport class LinkStyle extends BaseStyle {\n name = 'link';\n\n style = style;\n\n classes = classes;\n}\n\n/**\n *\n * Link renders a semantic, styled anchor for display-only navigation.\n *\n * [Live Demo](https://ngx-prime.org/link)\n *\n * @module linkstyle\n *\n */\nexport enum LinkClasses {\n /**\n * Class name of the root element\n */\n root = 'p-link',\n /**\n * Class name of the icon element\n */\n icon = 'p-link-icon'\n}\n","import { Directive, ElementRef, InjectionToken, Renderer2, computed, effect, inject, input } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from '@wawjs/ngx-prime/basecomponent';\nimport { Bind } from '@wawjs/ngx-prime/bind';\nimport type { LinkIconPosition, LinkPassThrough } from '@wawjs/ngx-prime/types/link';\nimport { LinkStyle } from './style/linkstyle';\n\nconst LINK_INSTANCE = new InjectionToken<Link>('LINK_INSTANCE');\n\nexport type LinkType = 'email' | 'tel' | 'sms' | 'whatsapp' | 'url' | 'custom';\n\n/**\n * Link renders a semantic, styled anchor for display-only navigation. It\n * derives `mailto:`, `tel:`, `sms:`, WhatsApp, or `https:` targets from\n * `value` based on `type`, or use `href` directly for a custom target.\n *\n * [Live Demo](https://ngx-prime.org/link)\n *\n * @group Components\n */\n@Directive({\n selector: 'a[pLink]',\n standalone: true,\n host: {\n '[class]': \"cn(cx('root'), styleClass())\",\n '[attr.href]': 'hostHref',\n '[attr.target]': 'target()',\n '[attr.rel]': 'hostRel',\n '[attr.aria-disabled]': 'hostAriaDisabled',\n '[attr.data-p]': 'dataP',\n '(click)': 'onClick($event)'\n },\n providers: [LinkStyle, { provide: LINK_INSTANCE, useExisting: Link }, { provide: PARENT_INSTANCE, useExisting: Link }],\n hostDirectives: [Bind]\n})\nexport class Link extends BaseComponent<LinkPassThrough> {\n componentName = 'Link';\n\n $pcLink: Link | undefined = inject(LINK_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;\n\n bindDirectiveInstance = inject(Bind, { self: true });\n\n _componentStyle = inject(LinkStyle);\n\n private readonly _renderer = inject(Renderer2);\n\n /**\n * Style class of the component.\n * @group Props\n */\n styleClass = input<string>();\n /**\n * Text or address the href is derived from when `href` is not set.\n * @group Props\n */\n value = input<string>('');\n /**\n * Determines how `value` is turned into an href.\n * @group Props\n */\n type = input<LinkType>('url');\n /**\n * Explicit href, takes precedence over the value derived from `value`/`type`.\n * @group Props\n */\n href = input<string | null>(null);\n /**\n * Native anchor target.\n * @group Props\n */\n target = input<string>('_self');\n /**\n * Explicit rel, defaults to `noopener noreferrer` for `_blank` targets.\n * @group Props\n */\n rel = input<string | null>(null);\n /**\n * Icon shown next to the anchor content, e.g. `pi pi-envelope`.\n * @group Props\n */\n icon = input<string>();\n /**\n * Position of the icon relative to the anchor content.\n * @group Props\n */\n iconPos = input<LinkIconPosition>('left');\n /**\n * When true, the link is not navigable and click events are suppressed.\n * @group Props\n */\n disabled = input<boolean>(false);\n\n linkHref = computed(() => {\n const explicitHref = this.href()?.trim();\n\n if (explicitHref) {\n return explicitHref;\n }\n\n const value = this.value().trim();\n\n if (!value) {\n return null;\n }\n\n switch (this.type()) {\n case 'email':\n return `mailto:${value}`;\n case 'tel':\n return `tel:${value.replace(/[^+\\d]/g, '')}`;\n case 'sms':\n return `sms:${value.replace(/[^+\\d]/g, '')}`;\n case 'whatsapp':\n return `https://wa.me/${value.replace(/\\D/g, '')}`;\n case 'url':\n return /^[a-z][a-z\\d+.-]*:/i.test(value) ? value : `https://${value}`;\n case 'custom':\n return null;\n default:\n return null;\n }\n });\n\n linkRel = computed(() => {\n const rel = this.rel()?.trim();\n\n if (rel) {\n return rel;\n }\n\n return this.target() === '_blank' ? 'noopener noreferrer' : null;\n });\n\n isClickable = computed(() => !!this.linkHref() && !this.disabled());\n\n get hostHref(): string | null {\n return this.isClickable() ? this.linkHref() : null;\n }\n\n get hostRel(): string | null {\n return this.linkRel();\n }\n\n get hostAriaDisabled(): 'true' | null {\n return this.disabled() || !this.linkHref() ? 'true' : null;\n }\n\n get dataP() {\n return this.cn({\n disabled: this.disabled()\n });\n }\n\n private readonly _elementRef = inject<ElementRef<HTMLAnchorElement>>(ElementRef);\n private readonly _iconEl: HTMLElement;\n\n constructor() {\n super();\n\n this._iconEl = this._renderer.createElement('span');\n this._renderer.setAttribute(this._iconEl, 'aria-hidden', 'true');\n\n effect(() => this._syncIcon());\n }\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));\n }\n\n onClick(event: MouseEvent): void {\n if (!this.isClickable()) {\n event.preventDefault();\n return;\n }\n }\n\n private _syncIcon(): void {\n const iconClass = this.icon();\n const host = this._elementRef.nativeElement;\n\n this._iconEl.className = this.cn(this.cx('icon'), iconClass) ?? '';\n\n if (!iconClass) {\n if (this._iconEl.parentElement) {\n this._renderer.removeChild(host, this._iconEl);\n }\n return;\n }\n\n if (!this._iconEl.parentElement) {\n if (this.iconPos() === 'right') {\n this._renderer.appendChild(host, this._iconEl);\n } else {\n this._renderer.insertBefore(host, this._iconEl, host.firstChild);\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAIA,MAAM,OAAO,GAAG;AACZ,IAAA,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK;QACpB,oBAAoB;AACpB,QAAA;AACI,YAAA,YAAY,EAAE,QAAQ,CAAC,QAAQ;AAClC;AACJ,KAAA;AACD,IAAA,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK;QACpB,aAAa;AACb,QAAA;AACI,YAAA,mBAAmB,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK;AAC/C;AACJ;CACJ;AAGK,MAAO,SAAU,SAAQ,SAAS,CAAA;IACpC,IAAI,GAAG,MAAM;IAEb,KAAK,GAAG,KAAK;IAEb,OAAO,GAAG,OAAO;uGALR,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAT,SAAS,EAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;;AASD;;;;;;;;AAQG;IACS;AAAZ,CAAA,UAAY,WAAW,EAAA;AACnB;;AAEG;AACH,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,QAAe;AACf;;AAEG;AACH,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,aAAoB;AACxB,CAAC,EATW,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;;AC/BvB,MAAM,aAAa,GAAG,IAAI,cAAc,CAAO,eAAe,CAAC;AAI/D;;;;;;;;A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AA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAG7G,IAAI,EAAA,UAAA,EAAA,CAAA;kBAfhB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,SAAS,EAAE,8BAA8B;AACzC,wBAAA,aAAa,EAAE,UAAU;AACzB,wBAAA,eAAe,EAAE,UAAU;AAC3B,wBAAA,YAAY,EAAE,SAAS;AACvB,wBAAA,sBAAsB,EAAE,kBAAkB;AAC1C,wBAAA,eAAe,EAAE,OAAO;AACxB,wBAAA,SAAS,EAAE;AACd,qBAAA;oBACD,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAA,IAAM,EAAE,CAAC;oBACtH,cAAc,EAAE,CAAC,IAAI;AACxB,iBAAA;;;ACjCD;;AAEG;;;;"}
@@ -1353,14 +1353,16 @@ class MegaMenu extends BaseComponent {
1353
1353
  return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index;
1354
1354
  }
1355
1355
  bindResizeListener() {
1356
- if (!this.resizeListener) {
1357
- this.resizeListener = (event) => {
1358
- if (!isTouchDevice()) {
1359
- this.hide(event, true);
1360
- }
1361
- this.mobileActive = false;
1362
- };
1363
- window.addEventListener('resize', this.resizeListener);
1356
+ if (isPlatformBrowser(this.platformId)) {
1357
+ if (!this.resizeListener) {
1358
+ this.resizeListener = (event) => {
1359
+ if (!isTouchDevice()) {
1360
+ this.hide(event, true);
1361
+ }
1362
+ this.mobileActive = false;
1363
+ };
1364
+ window.addEventListener('resize', this.resizeListener);
1365
+ }
1364
1366
  }
1365
1367
  }
1366
1368
  bindOutsideClickListener() {
@@ -1382,7 +1384,7 @@ class MegaMenu extends BaseComponent {
1382
1384
  }
1383
1385
  }
1384
1386
  unbindResizeListener() {
1385
- if (this.resizeListener) {
1387
+ if (isPlatformBrowser(this.platformId) && this.resizeListener) {
1386
1388
  window.removeEventListener('resize', this.resizeListener);
1387
1389
  this.resizeListener = null;
1388
1390
  }