@yesilyazilim/web.spa 1.0.54 → 1.0.55

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/index.js CHANGED
@@ -89,6 +89,7 @@ var $a3c2e7787b76c59b$export$4122921988e8a7c3;
89
89
  SystemEvents["PanelResizeEnd"] = "PanelResizeEnd";
90
90
  SystemEvents["UserLogin"] = "UserLogin";
91
91
  SystemEvents["UserLogout"] = "UserLogout";
92
+ SystemEvents["UserBeforeLogout"] = "UserBeforeLogout";
92
93
  SystemEvents["TokenRefresh"] = "TokenRefresh";
93
94
  })($a3c2e7787b76c59b$export$4122921988e8a7c3 || ($a3c2e7787b76c59b$export$4122921988e8a7c3 = {}));
94
95
  var $a3c2e7787b76c59b$export$183adaae804499ea;
@@ -955,15 +956,25 @@ let $2125c89b69faca07$export$69d4516a6fd8e701 = class AuthService {
955
956
  localStorage.setItem($2125c89b69faca07$var$LLI, JSON.stringify(lli));
956
957
  }
957
958
  logOut() {
958
- if (!this.isLogined) return;
959
- (0, $8f46b29572f8b95a$export$aa9349e63a87bac1).clearToken();
960
- this._user = null;
961
- localStorage.removeItem($2125c89b69faca07$var$LLI);
962
- (0, $00cd366309254471$export$e1c2d3f4dfe7964c).scopeActive = false;
963
- this.eventService.raise((0, $a3c2e7787b76c59b$export$4122921988e8a7c3).UserLogout, null);
964
- if (this._props.type == 'Cookie') {
965
- if (this._props.logoutUrl) location.assign(location.href + this._props.logoutUrl);
966
- }
959
+ return $2125c89b69faca07$var$__awaiter(this, void 0, void 0, function*() {
960
+ if (!this.isLogined) return Promise.resolve(false);
961
+ const results = yield this.eventService.raise((0, $a3c2e7787b76c59b$export$4122921988e8a7c3).UserBeforeLogout, null);
962
+ if (results && results.length > 0) {
963
+ if (!results.every((r)=>!!r)) return false;
964
+ }
965
+ if (this._whenLogOut) yield this._whenLogOut();
966
+ (0, $8f46b29572f8b95a$export$aa9349e63a87bac1).clearToken();
967
+ this._user = null;
968
+ localStorage.removeItem($2125c89b69faca07$var$LLI);
969
+ (0, $00cd366309254471$export$e1c2d3f4dfe7964c).scopeActive = false;
970
+ this.eventService.raise((0, $a3c2e7787b76c59b$export$4122921988e8a7c3).UserLogout, null);
971
+ if (this._props.type == 'Cookie') {
972
+ if (this._props.logoutUrl) location.assign(location.href + this._props.logoutUrl);
973
+ }
974
+ });
975
+ }
976
+ setLogoutHandler(logoutHandler) {
977
+ this._whenLogOut = logoutHandler;
967
978
  }
968
979
  _getLastValidLoginInfo() {
969
980
  try {
@@ -3140,7 +3151,13 @@ let $30a83760544554c4$export$2d8da92b919d0605 = class RibbonMenu extends (0, $05
3140
3151
  }
3141
3152
  _createRadioButton(item) {
3142
3153
  const ri = item;
3143
- const rb = new (0, $1401556c65a2dd20$export$a48395222641090)(ri.buttons, 'outline');
3154
+ const lks = ri.buttons.map((b)=>{
3155
+ return {
3156
+ key: b.key,
3157
+ title: b.text
3158
+ };
3159
+ });
3160
+ const rb = new (0, $1401556c65a2dd20$export$a48395222641090)(lks, 'outline');
3144
3161
  rb.bag = ri;
3145
3162
  const handler = (ev)=>{
3146
3163
  const cmdKey = ev.detail.key;