@salla.sa/twilight-components 2.13.31 → 2.13.32
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/salla-add-product-button_47.cjs.entry.js +20 -8
- package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -0
- package/dist/cjs/salla-metadata.cjs.entry.js.map +1 -1
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -0
- package/dist/collection/components/salla-metadata/salla-metadata.js.map +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +20 -8
- package/dist/collection/components/salla-user-menu/salla-user-menu.js.map +1 -1
- package/dist/components/salla-metadata.js +3 -0
- package/dist/components/salla-metadata.js.map +1 -1
- package/dist/components/salla-user-menu.js +20 -8
- package/dist/components/salla-user-menu.js.map +1 -1
- package/dist/esm/salla-add-product-button_47.entry.js +20 -8
- package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm/salla-metadata.entry.js +3 -0
- package/dist/esm/salla-metadata.entry.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js.map +1 -1
- package/dist/twilight/p-64707107.system.js +1 -1
- package/dist/twilight/{p-6b84f8e3.system.entry.js → p-ac4405da.system.entry.js} +2 -2
- package/dist/twilight/p-ac4405da.system.entry.js.map +1 -0
- package/dist/twilight/p-b7b268e9.entry.js +5 -0
- package/dist/twilight/p-b7b268e9.entry.js.map +1 -0
- package/dist/twilight/{p-52a426c5.entry.js → p-d3986c26.entry.js} +2 -2
- package/dist/twilight/p-d3986c26.entry.js.map +1 -0
- package/dist/twilight/p-fa78ea46.system.entry.js +5 -0
- package/dist/twilight/p-fa78ea46.system.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +3 -1
- package/package.json +5 -5
- package/dist/twilight/p-52a426c5.entry.js.map +0 -1
- package/dist/twilight/p-6b84f8e3.system.entry.js.map +0 -1
- package/dist/twilight/p-9d26358c.system.entry.js +0 -5
- package/dist/twilight/p-9d26358c.system.entry.js.map +0 -1
- package/dist/twilight/p-fc29f3c5.entry.js +0 -5
- package/dist/twilight/p-fc29f3c5.entry.js.map +0 -1
|
@@ -28839,7 +28839,6 @@ const sallaUserMenuCss = "";
|
|
|
28839
28839
|
const SallaUserMenu = class {
|
|
28840
28840
|
constructor(hostRef) {
|
|
28841
28841
|
index.registerInstance(this, hostRef);
|
|
28842
|
-
var _a;
|
|
28843
28842
|
this.items = {
|
|
28844
28843
|
notifications: BellRing,
|
|
28845
28844
|
orders: OrderIcon,
|
|
@@ -28893,7 +28892,6 @@ const SallaUserMenu = class {
|
|
|
28893
28892
|
}
|
|
28894
28893
|
//we need it to be the last item
|
|
28895
28894
|
this.items.logout = LogoutIcon;
|
|
28896
|
-
this.triggerSlot = ((_a = this.host.querySelector('[slot="trigger"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
|
|
28897
28895
|
salla.onReady(() => {
|
|
28898
28896
|
if (salla.config.isGuest()) {
|
|
28899
28897
|
return;
|
|
@@ -28924,6 +28922,17 @@ const SallaUserMenu = class {
|
|
|
28924
28922
|
}
|
|
28925
28923
|
});
|
|
28926
28924
|
}
|
|
28925
|
+
componentWillLoad() {
|
|
28926
|
+
return (new Promise((resolve) => salla.onReady(resolve))).then(() => {
|
|
28927
|
+
let trigger = this.host.querySelector('[slot="trigger"]');
|
|
28928
|
+
this.triggerSlot = '<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
|
|
28929
|
+
if (!trigger) {
|
|
28930
|
+
return;
|
|
28931
|
+
}
|
|
28932
|
+
this.triggerSlot = trigger.innerHTML;
|
|
28933
|
+
trigger.innerHTML = this.replaceParams(trigger.innerHTML);
|
|
28934
|
+
});
|
|
28935
|
+
}
|
|
28927
28936
|
fetchFreshProfile() {
|
|
28928
28937
|
//don't request fetchFreshProfile unless token is injected into the api
|
|
28929
28938
|
if (!salla.api.token) {
|
|
@@ -28959,17 +28968,20 @@ const SallaUserMenu = class {
|
|
|
28959
28968
|
event.preventDefault();
|
|
28960
28969
|
salla.auth.logout('sall-user-menu');
|
|
28961
28970
|
}
|
|
28971
|
+
replaceParams(body) {
|
|
28972
|
+
return body
|
|
28973
|
+
.replace(/\{hello\}/g, this.hello)
|
|
28974
|
+
.replace(/\{first_name\}/g, this.first_name)
|
|
28975
|
+
.replace(/\{last_name\}/g, this.last_name)
|
|
28976
|
+
.replace(/\{avatar\}/g, this.avatar)
|
|
28977
|
+
.replace(/\{icon\}/g, ArrowDown);
|
|
28978
|
+
}
|
|
28962
28979
|
getTheHeader() {
|
|
28963
28980
|
return index.h("div", { class: {
|
|
28964
28981
|
's-user-menu-trigger-slot': true,
|
|
28965
28982
|
's-user-menu-red-dot': this.hasBadges,
|
|
28966
28983
|
's-user-menu-trigger-avatar-only': this.avatarOnly
|
|
28967
|
-
}, id: 'trigger-slot', onClick: (e) => this.open(e), innerHTML: this.triggerSlot
|
|
28968
|
-
.replace(/\{hello\}/g, this.hello)
|
|
28969
|
-
.replace(/\{first_name\}/g, this.first_name)
|
|
28970
|
-
.replace(/\{last_name\}/g, this.last_name)
|
|
28971
|
-
.replace(/\{avatar\}/g, this.avatar)
|
|
28972
|
-
.replace(/\{icon\}/g, ArrowDown) });
|
|
28984
|
+
}, id: 'trigger-slot', onClick: (e) => this.open(e), innerHTML: this.replaceParams(this.triggerSlot) });
|
|
28973
28985
|
}
|
|
28974
28986
|
getMenuItem(item, i) {
|
|
28975
28987
|
//todo:: enhancement support slot here
|