@salla.sa/twilight-components 2.11.15 → 2.11.16

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.
@@ -22665,7 +22665,6 @@ const SallaMap = class {
22665
22665
  });
22666
22666
  this.apiKey = 'AIzaSyBPhPJ4KG13ywvmeAovLRnbi7WzlsdcWKs';
22667
22667
  }
22668
- ;
22669
22668
  formatAddress(address) {
22670
22669
  return address.length > 25 ? address.substring(0, 25) + '...' : address;
22671
22670
  }
@@ -26806,16 +26805,21 @@ const SallaUserMenu = class {
26806
26805
  ? index.h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[item[0]])
26807
26806
  : ""));
26808
26807
  }
26808
+ componentShouldUpdate() {
26809
+ if (!this.opened) {
26810
+ window.removeEventListener('click', this.onClickOutside);
26811
+ }
26812
+ }
26809
26813
  render() {
26810
26814
  //todo:: reduce class names, they are too long
26811
26815
  return (index.h(index.Host, null, this.inline ?
26812
26816
  index.h("ul", { class: "s-user-menu-inline" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i)))
26813
26817
  : index.h("div", { class: { 's-user-menu-wrapper': true, 's-user-menu-relative-dropdown': this.relativeDropdown } }, this.getTheHeader(), index.h("div", { class: { 's-user-menu-toggler': true, 'opened': this.opened } }, index.h("div", { class: "s-user-menu-dropdown", onClick: (e) => e.stopPropagation() }, this.showHeader ? index.h("div", { class: "s-user-menu-dropdown-header" }, index.h("img", { src: this.avatar, alt: `${this.first_name} ${this.last_name}` }), index.h("div", { class: "s-user-menu-dropdown-header-content" }, index.h("span", null, this.hello), index.h("p", null, this.first_name, " ", this.last_name)), index.h("button", { class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => this.opened = false })) : '', index.h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
26814
26818
  }
26815
- componentShouldUpdate() {
26816
- if (!this.opened) {
26817
- window.removeEventListener('click', this.onClickOutside);
26818
- }
26819
+ componentDidLoad() {
26820
+ var _a;
26821
+ //make sure to load the avatar if it's lazy, we use it in Y
26822
+ (_a = document.lazyLoadInstance) === null || _a === void 0 ? void 0 : _a.update(this.host.querySelectorAll('.lazy'));
26819
26823
  }
26820
26824
  get host() { return index.getElement(this); }
26821
26825
  };
@@ -56,7 +56,6 @@ export class SallaMap {
56
56
  });
57
57
  this.apiKey = 'AIzaSyBPhPJ4KG13ywvmeAovLRnbi7WzlsdcWKs';
58
58
  }
59
- ;
60
59
  formatAddress(address) {
61
60
  return address.length > 25 ? address.substring(0, 25) + '...' : address;
62
61
  }
@@ -144,6 +144,11 @@ export class SallaUserMenu {
144
144
  ? h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[item[0]])
145
145
  : ""));
146
146
  }
147
+ componentShouldUpdate() {
148
+ if (!this.opened) {
149
+ window.removeEventListener('click', this.onClickOutside);
150
+ }
151
+ }
147
152
  render() {
148
153
  //todo:: reduce class names, they are too long
149
154
  return (h(Host, null, this.inline ?
@@ -163,10 +168,10 @@ export class SallaUserMenu {
163
168
  h("button", { class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => this.opened = false })) : '',
164
169
  h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
165
170
  }
166
- componentShouldUpdate() {
167
- if (!this.opened) {
168
- window.removeEventListener('click', this.onClickOutside);
169
- }
171
+ componentDidLoad() {
172
+ var _a;
173
+ //make sure to load the avatar if it's lazy, we use it in Y
174
+ (_a = document.lazyLoadInstance) === null || _a === void 0 ? void 0 : _a.update(this.host.querySelectorAll('.lazy'));
170
175
  }
171
176
  static get is() { return "salla-user-menu"; }
172
177
  static get originalStyleUrls() { return {
@@ -492,7 +492,6 @@ const SallaMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
492
492
  });
493
493
  this.apiKey = 'AIzaSyBPhPJ4KG13ywvmeAovLRnbi7WzlsdcWKs';
494
494
  }
495
- ;
496
495
  formatAddress(address) {
497
496
  return address.length > 25 ? address.substring(0, 25) + '...' : address;
498
497
  }
@@ -159,16 +159,21 @@ const SallaUserMenu$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
159
159
  ? h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[item[0]])
160
160
  : ""));
161
161
  }
162
+ componentShouldUpdate() {
163
+ if (!this.opened) {
164
+ window.removeEventListener('click', this.onClickOutside);
165
+ }
166
+ }
162
167
  render() {
163
168
  //todo:: reduce class names, they are too long
164
169
  return (h(Host, null, this.inline ?
165
170
  h("ul", { class: "s-user-menu-inline" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i)))
166
171
  : h("div", { class: { 's-user-menu-wrapper': true, 's-user-menu-relative-dropdown': this.relativeDropdown } }, this.getTheHeader(), h("div", { class: { 's-user-menu-toggler': true, 'opened': this.opened } }, h("div", { class: "s-user-menu-dropdown", onClick: (e) => e.stopPropagation() }, this.showHeader ? h("div", { class: "s-user-menu-dropdown-header" }, h("img", { src: this.avatar, alt: `${this.first_name} ${this.last_name}` }), h("div", { class: "s-user-menu-dropdown-header-content" }, h("span", null, this.hello), h("p", null, this.first_name, " ", this.last_name)), h("button", { class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => this.opened = false })) : '', h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
167
172
  }
168
- componentShouldUpdate() {
169
- if (!this.opened) {
170
- window.removeEventListener('click', this.onClickOutside);
171
- }
173
+ componentDidLoad() {
174
+ var _a;
175
+ //make sure to load the avatar if it's lazy, we use it in Y
176
+ (_a = document.lazyLoadInstance) === null || _a === void 0 ? void 0 : _a.update(this.host.querySelectorAll('.lazy'));
172
177
  }
173
178
  get host() { return this; }
174
179
  static get style() { return sallaUserMenuCss; }
@@ -22661,7 +22661,6 @@ const SallaMap = class {
22661
22661
  });
22662
22662
  this.apiKey = 'AIzaSyBPhPJ4KG13ywvmeAovLRnbi7WzlsdcWKs';
22663
22663
  }
22664
- ;
22665
22664
  formatAddress(address) {
22666
22665
  return address.length > 25 ? address.substring(0, 25) + '...' : address;
22667
22666
  }
@@ -26802,16 +26801,21 @@ const SallaUserMenu = class {
26802
26801
  ? h("span", { class: "s-user-menu-dropdown-item-badge" }, this.badges[item[0]])
26803
26802
  : ""));
26804
26803
  }
26804
+ componentShouldUpdate() {
26805
+ if (!this.opened) {
26806
+ window.removeEventListener('click', this.onClickOutside);
26807
+ }
26808
+ }
26805
26809
  render() {
26806
26810
  //todo:: reduce class names, they are too long
26807
26811
  return (h(Host, null, this.inline ?
26808
26812
  h("ul", { class: "s-user-menu-inline" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i)))
26809
26813
  : h("div", { class: { 's-user-menu-wrapper': true, 's-user-menu-relative-dropdown': this.relativeDropdown } }, this.getTheHeader(), h("div", { class: { 's-user-menu-toggler': true, 'opened': this.opened } }, h("div", { class: "s-user-menu-dropdown", onClick: (e) => e.stopPropagation() }, this.showHeader ? h("div", { class: "s-user-menu-dropdown-header" }, h("img", { src: this.avatar, alt: `${this.first_name} ${this.last_name}` }), h("div", { class: "s-user-menu-dropdown-header-content" }, h("span", null, this.hello), h("p", null, this.first_name, " ", this.last_name)), h("button", { class: "s-user-menu-dropdown-header-close", innerHTML: Cancel, onClick: () => this.opened = false })) : '', h("ul", { class: "s-user-menu-dropdown-list" }, Object.entries(this.items).map((item, i) => this.getMenuItem(item, i))))))));
26810
26814
  }
26811
- componentShouldUpdate() {
26812
- if (!this.opened) {
26813
- window.removeEventListener('click', this.onClickOutside);
26814
- }
26815
+ componentDidLoad() {
26816
+ var _a;
26817
+ //make sure to load the avatar if it's lazy, we use it in Y
26818
+ (_a = document.lazyLoadInstance) === null || _a === void 0 ? void 0 : _a.update(this.host.querySelectorAll('.lazy'));
26815
26819
  }
26816
26820
  get host() { return getElement(this); }
26817
26821
  };