@sambath999/localize-token 12.4.19 → 13.0.1

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 (25) hide show
  1. package/components/localize-token-login-dialog.component.d.ts +3 -0
  2. package/esm2020/components/localize-token-login-dialog.component.mjs +446 -0
  3. package/esm2020/models/localize-token.module.mjs +41 -0
  4. package/esm2020/services/localize-token-configure.service.mjs +27 -0
  5. package/esm2020/services/localize-token-dialog.service.mjs +61 -0
  6. package/fesm2015/{sambath999-localize-token.js → sambath999-localize-token.mjs} +133 -62
  7. package/fesm2015/sambath999-localize-token.mjs.map +1 -0
  8. package/fesm2020/sambath999-localize-token.mjs +574 -0
  9. package/fesm2020/sambath999-localize-token.mjs.map +1 -0
  10. package/models/localize-token.module.d.ts +10 -0
  11. package/package.json +26 -14
  12. package/sambath999-localize-token.d.ts +1 -0
  13. package/services/localize-token-configure.service.d.ts +3 -0
  14. package/services/localize-token-dialog.service.d.ts +3 -0
  15. package/bundles/sambath999-localize-token.umd.js +0 -590
  16. package/bundles/sambath999-localize-token.umd.js.map +0 -1
  17. package/esm2015/components/localize-token-login-dialog.component.js +0 -392
  18. package/esm2015/models/localize-token.module.js +0 -26
  19. package/esm2015/services/localize-token-configure.service.js +0 -32
  20. package/esm2015/services/localize-token-dialog.service.js +0 -64
  21. package/fesm2015/sambath999-localize-token.js.map +0 -1
  22. package/sambath999-localize-token.metadata.json +0 -1
  23. /package/{esm2015/models/localize-token-models.js → esm2020/models/localize-token-models.mjs} +0 -0
  24. /package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  25. /package/{esm2015/sambath999-localize-token.js → esm2020/sambath999-localize-token.mjs} +0 -0
@@ -1,590 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('primeng/api'), require('primeng/dynamicdialog'), require('@angular/platform-browser'), require('@sambath999/localize-api'), require('@angular/common'), require('primeng/toast'), require('primeng/inputtext'), require('primeng/button'), require('@angular/forms')) :
3
- typeof define === 'function' && define.amd ? define('@sambath999/localize-token', ['exports', '@angular/core', 'primeng/api', 'primeng/dynamicdialog', '@angular/platform-browser', '@sambath999/localize-api', '@angular/common', 'primeng/toast', 'primeng/inputtext', 'primeng/button', '@angular/forms'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sambath999 = global.sambath999 || {}, global.sambath999["localize-token"] = {}), global.ng.core, global.api, global.dynamicdialog, global.ng.platformBrowser, global.i1, global.ng.common, global.toast, global.inputtext, global.button, global.ng.forms));
5
- })(this, (function (exports, i0, api, dynamicdialog, platformBrowser, i1, common, toast, inputtext, button, forms) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
-
28
- /*! *****************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
- /* global Reflect, Promise */
43
- var extendStatics = function (d, b) {
44
- extendStatics = Object.setPrototypeOf ||
45
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
46
- function (d, b) { for (var p in b)
47
- if (Object.prototype.hasOwnProperty.call(b, p))
48
- d[p] = b[p]; };
49
- return extendStatics(d, b);
50
- };
51
- function __extends(d, b) {
52
- if (typeof b !== "function" && b !== null)
53
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
54
- extendStatics(d, b);
55
- function __() { this.constructor = d; }
56
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57
- }
58
- var __assign = function () {
59
- __assign = Object.assign || function __assign(t) {
60
- for (var s, i = 1, n = arguments.length; i < n; i++) {
61
- s = arguments[i];
62
- for (var p in s)
63
- if (Object.prototype.hasOwnProperty.call(s, p))
64
- t[p] = s[p];
65
- }
66
- return t;
67
- };
68
- return __assign.apply(this, arguments);
69
- };
70
- function __rest(s, e) {
71
- var t = {};
72
- for (var p in s)
73
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
74
- t[p] = s[p];
75
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
76
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
77
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
78
- t[p[i]] = s[p[i]];
79
- }
80
- return t;
81
- }
82
- function __decorate(decorators, target, key, desc) {
83
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
84
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
85
- r = Reflect.decorate(decorators, target, key, desc);
86
- else
87
- for (var i = decorators.length - 1; i >= 0; i--)
88
- if (d = decorators[i])
89
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
90
- return c > 3 && r && Object.defineProperty(target, key, r), r;
91
- }
92
- function __param(paramIndex, decorator) {
93
- return function (target, key) { decorator(target, key, paramIndex); };
94
- }
95
- function __metadata(metadataKey, metadataValue) {
96
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
97
- return Reflect.metadata(metadataKey, metadataValue);
98
- }
99
- function __awaiter(thisArg, _arguments, P, generator) {
100
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
101
- return new (P || (P = Promise))(function (resolve, reject) {
102
- function fulfilled(value) { try {
103
- step(generator.next(value));
104
- }
105
- catch (e) {
106
- reject(e);
107
- } }
108
- function rejected(value) { try {
109
- step(generator["throw"](value));
110
- }
111
- catch (e) {
112
- reject(e);
113
- } }
114
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
115
- step((generator = generator.apply(thisArg, _arguments || [])).next());
116
- });
117
- }
118
- function __generator(thisArg, body) {
119
- var _ = { label: 0, sent: function () { if (t[0] & 1)
120
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
121
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
122
- function verb(n) { return function (v) { return step([n, v]); }; }
123
- function step(op) {
124
- if (f)
125
- throw new TypeError("Generator is already executing.");
126
- while (_)
127
- try {
128
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
129
- return t;
130
- if (y = 0, t)
131
- op = [op[0] & 2, t.value];
132
- switch (op[0]) {
133
- case 0:
134
- case 1:
135
- t = op;
136
- break;
137
- case 4:
138
- _.label++;
139
- return { value: op[1], done: false };
140
- case 5:
141
- _.label++;
142
- y = op[1];
143
- op = [0];
144
- continue;
145
- case 7:
146
- op = _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- default:
150
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
151
- _ = 0;
152
- continue;
153
- }
154
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
155
- _.label = op[1];
156
- break;
157
- }
158
- if (op[0] === 6 && _.label < t[1]) {
159
- _.label = t[1];
160
- t = op;
161
- break;
162
- }
163
- if (t && _.label < t[2]) {
164
- _.label = t[2];
165
- _.ops.push(op);
166
- break;
167
- }
168
- if (t[2])
169
- _.ops.pop();
170
- _.trys.pop();
171
- continue;
172
- }
173
- op = body.call(thisArg, _);
174
- }
175
- catch (e) {
176
- op = [6, e];
177
- y = 0;
178
- }
179
- finally {
180
- f = t = 0;
181
- }
182
- if (op[0] & 5)
183
- throw op[1];
184
- return { value: op[0] ? op[1] : void 0, done: true };
185
- }
186
- }
187
- var __createBinding = Object.create ? (function (o, m, k, k2) {
188
- if (k2 === undefined)
189
- k2 = k;
190
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
191
- }) : (function (o, m, k, k2) {
192
- if (k2 === undefined)
193
- k2 = k;
194
- o[k2] = m[k];
195
- });
196
- function __exportStar(m, o) {
197
- for (var p in m)
198
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
199
- __createBinding(o, m, p);
200
- }
201
- function __values(o) {
202
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
203
- if (m)
204
- return m.call(o);
205
- if (o && typeof o.length === "number")
206
- return {
207
- next: function () {
208
- if (o && i >= o.length)
209
- o = void 0;
210
- return { value: o && o[i++], done: !o };
211
- }
212
- };
213
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
214
- }
215
- function __read(o, n) {
216
- var m = typeof Symbol === "function" && o[Symbol.iterator];
217
- if (!m)
218
- return o;
219
- var i = m.call(o), r, ar = [], e;
220
- try {
221
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
222
- ar.push(r.value);
223
- }
224
- catch (error) {
225
- e = { error: error };
226
- }
227
- finally {
228
- try {
229
- if (r && !r.done && (m = i["return"]))
230
- m.call(i);
231
- }
232
- finally {
233
- if (e)
234
- throw e.error;
235
- }
236
- }
237
- return ar;
238
- }
239
- /** @deprecated */
240
- function __spread() {
241
- for (var ar = [], i = 0; i < arguments.length; i++)
242
- ar = ar.concat(__read(arguments[i]));
243
- return ar;
244
- }
245
- /** @deprecated */
246
- function __spreadArrays() {
247
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
248
- s += arguments[i].length;
249
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
250
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
251
- r[k] = a[j];
252
- return r;
253
- }
254
- function __spreadArray(to, from, pack) {
255
- if (pack || arguments.length === 2)
256
- for (var i = 0, l = from.length, ar; i < l; i++) {
257
- if (ar || !(i in from)) {
258
- if (!ar)
259
- ar = Array.prototype.slice.call(from, 0, i);
260
- ar[i] = from[i];
261
- }
262
- }
263
- return to.concat(ar || from);
264
- }
265
- function __await(v) {
266
- return this instanceof __await ? (this.v = v, this) : new __await(v);
267
- }
268
- function __asyncGenerator(thisArg, _arguments, generator) {
269
- if (!Symbol.asyncIterator)
270
- throw new TypeError("Symbol.asyncIterator is not defined.");
271
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
272
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
273
- function verb(n) { if (g[n])
274
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
275
- function resume(n, v) { try {
276
- step(g[n](v));
277
- }
278
- catch (e) {
279
- settle(q[0][3], e);
280
- } }
281
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
282
- function fulfill(value) { resume("next", value); }
283
- function reject(value) { resume("throw", value); }
284
- function settle(f, v) { if (f(v), q.shift(), q.length)
285
- resume(q[0][0], q[0][1]); }
286
- }
287
- function __asyncDelegator(o) {
288
- var i, p;
289
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
290
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
291
- }
292
- function __asyncValues(o) {
293
- if (!Symbol.asyncIterator)
294
- throw new TypeError("Symbol.asyncIterator is not defined.");
295
- var m = o[Symbol.asyncIterator], i;
296
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
297
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
298
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
299
- }
300
- function __makeTemplateObject(cooked, raw) {
301
- if (Object.defineProperty) {
302
- Object.defineProperty(cooked, "raw", { value: raw });
303
- }
304
- else {
305
- cooked.raw = raw;
306
- }
307
- return cooked;
308
- }
309
- ;
310
- var __setModuleDefault = Object.create ? (function (o, v) {
311
- Object.defineProperty(o, "default", { enumerable: true, value: v });
312
- }) : function (o, v) {
313
- o["default"] = v;
314
- };
315
- function __importStar(mod) {
316
- if (mod && mod.__esModule)
317
- return mod;
318
- var result = {};
319
- if (mod != null)
320
- for (var k in mod)
321
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
322
- __createBinding(result, mod, k);
323
- __setModuleDefault(result, mod);
324
- return result;
325
- }
326
- function __importDefault(mod) {
327
- return (mod && mod.__esModule) ? mod : { default: mod };
328
- }
329
- function __classPrivateFieldGet(receiver, state, kind, f) {
330
- if (kind === "a" && !f)
331
- throw new TypeError("Private accessor was defined without a getter");
332
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
333
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
334
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
335
- }
336
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
337
- if (kind === "m")
338
- throw new TypeError("Private method is not writable");
339
- if (kind === "a" && !f)
340
- throw new TypeError("Private accessor was defined without a setter");
341
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
342
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
343
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
344
- }
345
-
346
- var LocalizeTokenLoginDialogComponent = /** @class */ (function () {
347
- function LocalizeTokenLoginDialogComponent(messageService, cdt, dlgRef, dlgConfig, sanitizer, injector) {
348
- this.messageService = messageService;
349
- this.cdt = cdt;
350
- this.dlgRef = dlgRef;
351
- this.dlgConfig = dlgConfig;
352
- this.sanitizer = sanitizer;
353
- this.injector = injector;
354
- this.messageKey = "$localize-api-token-login-dlg";
355
- this.config = this.dlgConfig.data.loginConfig;
356
- this.loginService = this.injector.get(i1.LocalizeApiLoginService);
357
- this.properties = this.config.properties;
358
- this.decodeToken = this.loginService.decodedToken;
359
- this.logout = this.config.logoutFunc;
360
- this.configure();
361
- }
362
- Object.defineProperty(LocalizeTokenLoginDialogComponent.prototype, "loading", {
363
- get: function () { return this.loginService.isLoading; },
364
- enumerable: false,
365
- configurable: true
366
- });
367
- Object.defineProperty(LocalizeTokenLoginDialogComponent.prototype, "success", {
368
- get: function () { return this.loginService.isSuccess; },
369
- enumerable: false,
370
- configurable: true
371
- });
372
- Object.defineProperty(LocalizeTokenLoginDialogComponent.prototype, "sanitizedTitle", {
373
- get: function () { var _a; return this.sanitizer.bypassSecurityTrustHtml((_a = this.properties.title) !== null && _a !== void 0 ? _a : ''); },
374
- enumerable: false,
375
- configurable: true
376
- });
377
- LocalizeTokenLoginDialogComponent.prototype.configure = function () {
378
- var _this = this;
379
- var _a, _b, _c;
380
- this.dlgConfig.closable = false;
381
- this.dlgConfig.dismissableMask = false;
382
- this.dlgConfig.modal = true;
383
- this.loginService.configure({
384
- loginUrl: this.config.loginUrl,
385
- refreshTokenTtl: this.config.expire,
386
- onSuccess: this.onSuccess.bind(this),
387
- onFailure: this.showError.bind(this),
388
- onError: this.showError.bind(this),
389
- loginFunction: (_a = this.config.loginFunction) === null || _a === void 0 ? void 0 : _a.bind(this),
390
- passwordResolver: function () { return _this.password; },
391
- passwordValidator: (_c = (_b = this.properties) === null || _b === void 0 ? void 0 : _b.passwordValidator) === null || _c === void 0 ? void 0 : _c.bind(this),
392
- });
393
- };
394
- LocalizeTokenLoginDialogComponent.prototype.ngOnInit = function () {
395
- var _this = this;
396
- if (!this.decodeToken) {
397
- this.showError("Invalid Token. Please login again.");
398
- setTimeout(function () { var _a; return (_a = _this.logout) === null || _a === void 0 ? void 0 : _a.call(_this); }, 2000);
399
- }
400
- };
401
- LocalizeTokenLoginDialogComponent.prototype.ngAfterViewInit = function () {
402
- this.cdt.detectChanges();
403
- };
404
- LocalizeTokenLoginDialogComponent.prototype.onSuccess = function () {
405
- return __awaiter(this, void 0, void 0, function () {
406
- return __generator(this, function (_d) {
407
- switch (_d.label) {
408
- case 0: return [4 /*yield*/, i1.waitFor(2000)];
409
- case 1:
410
- _d.sent();
411
- this.dlgRef.close(true);
412
- return [2 /*return*/];
413
- }
414
- });
415
- });
416
- };
417
- LocalizeTokenLoginDialogComponent.prototype.clickLogin = function () {
418
- return __awaiter(this, void 0, void 0, function () {
419
- return __generator(this, function (_d) {
420
- switch (_d.label) {
421
- case 0: return [4 /*yield*/, this.loginService.clickLogin()];
422
- case 1:
423
- _d.sent();
424
- return [2 /*return*/];
425
- }
426
- });
427
- });
428
- };
429
- LocalizeTokenLoginDialogComponent.prototype.clickLogout = function () {
430
- var _a;
431
- (_a = this.logout) === null || _a === void 0 ? void 0 : _a.call(this);
432
- };
433
- LocalizeTokenLoginDialogComponent.prototype.showError = function (summary) {
434
- this.messageService.add({ key: this.messageKey, severity: "error", summary: summary });
435
- };
436
- LocalizeTokenLoginDialogComponent.prototype.ngOnDestroy = function () {
437
- this.loginService.unConfigure();
438
- };
439
- return LocalizeTokenLoginDialogComponent;
440
- }());
441
- LocalizeTokenLoginDialogComponent.decorators = [
442
- { type: i0.Component, args: [{
443
- template: "<p-toast [key]=\"messageKey\" position=\"top-center\"></p-toast>\n <div id=\"login-dlg-wrap\">\n <div id=\"login-dlg-header\">\n <div id=\"login-logo\" class=\"p-mb-2\" style=\"background: url('{{properties.logoImage}}') no-repeat\"></div>\n <h3 *ngIf=\"!success\" [innerHTML]=\"sanitizedTitle\"></h3>\n <h3 *ngIf=\"success\" style=\"color:green !important;\">{{properties.loginSuccessMessage}}</h3>\n </div>\n <div id=\"login-dlg-content\">\n <ng-container *ngIf=\"!success\">\n <div *ngIf=\"loading\" class=\"loader-wrap\">\n <div class=\"login-dlg-loader\"></div>\n </div>\n <div class=\"login-dlg-elm\">\n <div class=\"p-inputgroup\">\n <span class=\"p-inputgroup-addon\">\n <i class=\"material-icons-round\">person</i>\n </span>\n <input disabled pInputText type=\"text\" placeholder=\"{{properties.username?.placeHolder}}\" [value]=\"decodeToken?.email\" />\n </div>\n </div>\n \n <div class=\"login-dlg-elm\">\n <div class=\"p-inputgroup\">\n <span class=\"p-inputgroup-addon\">\n <i class=\"material-icons-round\">lock</i>\n </span>\n <input [disabled]=\"loading\" (keydown.enter)=\"clickLogin()\" pInputText type=\"password\" \n placeholder=\"{{properties.password?.placeHolder}}\" [(ngModel)]=\"password\"\n autofocus />\n </div>\n </div>\n <div class=\"login-dlg-elm\">\n <button style=\"width: 100%;\" pButton type=\"button\" label=\"{{properties.loginButton?.placeHolder}}\" (click)=\"clickLogin()\"\n [disabled]=\"!password || loading\"></button>\n </div>\n \n <div class=\"login-dlg-elm login-dlg-suggest\" style=\"display:flex;align-items: center;user-select: none;\">\n <span>{{properties.logoutButton?.message}}</span>\n <button class=\"p-button-text\" pButton type=\"button\" label=\"{{properties.logoutButton?.placeHolder}}\" \n (click)=\"clickLogout()\"></button>\n </div>\n </ng-container>\n \n <ng-container *ngIf=\"success\">\n <div style=\"margin-top:35px;\"></div>\n <div class=\"check-animation-wrap\">\n <div class=\"check-main-container\">\n <div class=\"check-container\">\n <div class=\"check-background\">\n <svg viewBox=\"0 0 65 51\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M7 25L27.3077 44L58.5 7\" stroke=\"white\" stroke-width=\"13\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path>\n </svg>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>",
444
- selector: "app-localize-logindlg",
445
- providers: [api.MessageService],
446
- encapsulation: i0.ViewEncapsulation.None,
447
- styles: ["\n #login-dlg-wrap {\n width: 100%;\n max-width: 400px;\n margin: 0 auto;\n padding: 30px;\n height: 100%;\n }\n \n .login-dlg-elm {\n margin-top: 1rem;\n }\n\n .login-dlg-elm.login-dlg-suggest {\n display: flex ;\n align-items: center;\n user-select: none;\n border-bottom: solid 1px #ddd;\n border-radius: 5px;\n padding: 5px 10px;\n background: #f9f9f9;\n box-shadow: 1px 5px 10px -12px #000;\n }\n \n #login-dlg-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n }\n \n #login-dlg-header h3 {\n font-weight: bold;\n font-size: 0.9rem;\n color: orange;\n text-align: center;\n }\n \n #login-logo {\n height: 55px;\n width: 55px;\n /* background: url(\"/assets/images/logo-300px.png\") no-repeat; */\n background-size: contain !important;\n }\n \n #login-dlg-content .p-inputgroup {\n height: 45px;\n }\n \n #login-dlg-content .p-inputgroup .p-inputgroup-addon {\n height: 45px;\n border-radius: 15px 0 0 15px;\n width: 50px;\n }\n #login-dlg-content *{\n font-size: .9rem;\n /* font-family: 'Lexend', 'Roboto', sans-serif, 'material-icons-round'; */\n }\n \n #login-dlg-content .p-inputgroup .p-inputgroup-addon * {\n font-size: 1rem;\n }\n \n #login-dlg-content .p-inputgroup input {\n height: 45px;\n border-radius: 0 15px 15px 0;\n }\n \n #login-dlg-content button {\n height: 45px;\n border-radius: 15px;\n }\n \n /*check animation block*/\n \n .check-animation-wrap {\n top: 0;\n left: 0;\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: calc(100% - 200px);\n min-height: 400px;\n }\n \n .check-main-container {\n width: 100%;\n height: 100vh;\n display: flex;\n flex-flow: column;\n justify-content: center;\n align-items: center;\n }\n \n .check-container {\n width: 6.25rem;\n height: 7.5rem;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: space-between;\n }\n \n .check-container .check-background {\n width: 100%;\n height: calc(100% - 1.25rem);\n background: linear-gradient(to bottom right, #5de593, #41d67c);\n box-shadow: 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset;\n transform: scale(0.84);\n border-radius: 50%;\n animation: animateContainer 0.75s ease-out forwards 0.75s;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n }\n \n .check-container .check-background svg {\n width: 65%;\n transform: translateY(0.25rem);\n stroke-dasharray: 80;\n stroke-dashoffset: 80;\n animation: animateCheck 0.35s forwards 1.25s ease-out;\n min-width: auto !important;\n }\n \n .check-container .check-shadow {\n bottom: calc(-15% - 5px);\n left: 0;\n border-radius: 50%;\n background: radial-gradient(closest-side, rgba(73, 218, 131, 1), transparent);\n animation: animateShadow 0.75s ease-out forwards 0.75s;\n }\n \n @keyframes animateContainer {\n 0% {\n opacity: 0;\n transform: scale(0);\n box-shadow: 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset;\n }\n \n 25% {\n opacity: 1;\n transform: scale(0.9);\n box-shadow: 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset;\n }\n \n 43.75% {\n transform: scale(1.15);\n box-shadow: 0px 0px 0px 43.334px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 65px rgba(255, 255, 255, 0.25) inset;\n }\n \n 62.5% {\n transform: scale(1);\n box-shadow: 0px 0px 0px 0px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 21.667px rgba(255, 255, 255, 0.25) inset;\n }\n \n 81.25% {\n box-shadow: 0px 0px 0px 0px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.25) inset;\n }\n \n 100% {\n opacity: 1;\n box-shadow: 0px 0px 0px 0px rgba(255, 255, 255, 0.25) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.25) inset;\n }\n }\n \n @keyframes animateCheck {\n from {\n stroke-dashoffset: 80;\n }\n \n to {\n stroke-dashoffset: 0;\n }\n }\n \n @keyframes animateShadow {\n 0% {\n opacity: 0;\n width: 100%;\n height: 15%;\n }\n \n 25% {\n opacity: 0.25;\n }\n \n 43.75% {\n width: 40%;\n height: 7%;\n opacity: 0.35;\n }\n \n 100% {\n width: 85%;\n height: 15%;\n opacity: 0.25;\n }\n }\n #login-dlg-wrap .loader-wrap {\n display: flex;\n justify-content: center;\n align-items: center;\n height:100%;\n width:100%;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 100;\n background: #ffffff42;\n backdrop-filter: blur(1px);\n }\n\n #login-dlg-wrap .login-dlg-loader {\n border: 15px solid #e7e7e7;\n border-top: 15px solid #52dba1;\n border-radius: 50%;\n width: 100px;\n height: 100px;\n animation: spinloader 2s linear infinite;\n }\n\n #login-dlg-wrap .loader-wrap::before {\n content: \"\";\n position: absolute;\n width: 70px;\n height: 70px;\n transform: translate(-50%, -50%);\n z-index: 1;\n border: 15px solid #e7e7e700;\n border-top: 15px solid #52dba1c9;\n border-radius: 50%;\n animation: spinloader .75s linear infinite;\n }\n\n @keyframes spinloader {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "]
448
- },] }
449
- ];
450
- LocalizeTokenLoginDialogComponent.ctorParameters = function () { return [
451
- { type: api.MessageService },
452
- { type: i0.ChangeDetectorRef },
453
- { type: dynamicdialog.DynamicDialogRef },
454
- { type: dynamicdialog.DynamicDialogConfig },
455
- { type: platformBrowser.DomSanitizer },
456
- { type: i0.Injector }
457
- ]; };
458
-
459
- var LocalizeTokenDialogService = /** @class */ (function () {
460
- function LocalizeTokenDialogService(injector) {
461
- this.injector = injector;
462
- }
463
- LocalizeTokenDialogService.prototype.openLoginDialog = function (loginConfig, config) {
464
- return __awaiter(this, void 0, void 0, function () {
465
- var dialogService, dialog;
466
- return __generator(this, function (_b) {
467
- switch (_b.label) {
468
- case 0:
469
- config = this.intercepDialogConfig(config);
470
- this.initConfig(loginConfig);
471
- config.data = Object.assign(Object.assign({}, (config.data || {})), { loginConfig: loginConfig });
472
- dialogService = this.injector.get(dynamicdialog.DialogService);
473
- dialog = dialogService.open(LocalizeTokenLoginDialogComponent, config);
474
- return [4 /*yield*/, new Promise(function (resolve) { return dialog.onClose.subscribe(function (res) {
475
- if (res) {
476
- resolve();
477
- }
478
- }); })];
479
- case 1:
480
- _b.sent();
481
- return [2 /*return*/];
482
- }
483
- });
484
- });
485
- };
486
- LocalizeTokenDialogService.prototype.intercepDialogConfig = function (config) {
487
- config !== null && config !== void 0 ? config : (config = {
488
- header: 'Login',
489
- style: { 'max-width': '400px', width: '100%', 'height': '650px' },
490
- modal: true,
491
- closable: false,
492
- showHeader: false,
493
- });
494
- config = Object.assign(Object.assign({}, config), {
495
- contentStyle: { 'height': '100%', 'border-radius': '20px' }
496
- });
497
- config.style = Object.assign(Object.assign({}, config.style), { 'border-radius': '20px' });
498
- return config;
499
- };
500
- LocalizeTokenDialogService.prototype.initConfig = function (loginConfig) {
501
- var _a;
502
- loginConfig !== null && loginConfig !== void 0 ? loginConfig : (loginConfig = {});
503
- (_a = loginConfig.properties) !== null && _a !== void 0 ? _a : (loginConfig.properties = {
504
- title: 'Your session is expired!<br/> Please login again to continue.',
505
- loginSuccessMessage: 'You have successfully logged in.',
506
- logoImage: '/assets/images/logo-300px.png',
507
- username: { placeHolder: 'Username' },
508
- password: { placeHolder: 'Password' },
509
- loginButton: { placeHolder: 'Login' },
510
- logoutButton: {
511
- message: 'No, I want to login with another user.',
512
- placeHolder: 'Logout'
513
- }
514
- });
515
- };
516
- return LocalizeTokenDialogService;
517
- }());
518
- LocalizeTokenDialogService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalizeTokenDialogService_Factory() { return new LocalizeTokenDialogService(i0__namespace.ɵɵinject(i0__namespace.INJECTOR)); }, token: LocalizeTokenDialogService, providedIn: "root" });
519
- LocalizeTokenDialogService.decorators = [
520
- { type: i0.Injectable, args: [{
521
- providedIn: 'root'
522
- },] }
523
- ];
524
- LocalizeTokenDialogService.ctorParameters = function () { return [
525
- { type: i0.Injector }
526
- ]; };
527
-
528
- var LocalizeTokenModule = /** @class */ (function () {
529
- function LocalizeTokenModule() {
530
- }
531
- return LocalizeTokenModule;
532
- }());
533
- LocalizeTokenModule.decorators = [
534
- { type: i0.NgModule, args: [{
535
- declarations: [LocalizeTokenLoginDialogComponent],
536
- exports: [LocalizeTokenLoginDialogComponent],
537
- imports: [
538
- common.CommonModule,
539
- toast.ToastModule,
540
- inputtext.InputTextModule,
541
- forms.FormsModule,
542
- button.ButtonModule,
543
- ],
544
- providers: [LocalizeTokenDialogService],
545
- schemas: [i0.CUSTOM_ELEMENTS_SCHEMA],
546
- },] }
547
- ];
548
-
549
- var LocalizeTokenConfigureService = /** @class */ (function () {
550
- function LocalizeTokenConfigureService(tokenService, apiService, loginDialogService) {
551
- this.api = apiService;
552
- this.token = tokenService;
553
- this.loginDialog = loginDialogService;
554
- }
555
- LocalizeTokenConfigureService.prototype.initialize = function (tokenConfig, apiConfig) {
556
- // Initialize the LocalizeApiTokenService with the provided token configuration
557
- this.token.init(tokenConfig);
558
- // Initialize the LocalizeApiService with the provided API configuration
559
- this.api.init(apiConfig);
560
- console.log('LocalizeTokenConfigureService initialized with token and API configurations.');
561
- };
562
- return LocalizeTokenConfigureService;
563
- }());
564
- LocalizeTokenConfigureService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalizeTokenConfigureService_Factory() { return new LocalizeTokenConfigureService(i0__namespace.ɵɵinject(i1__namespace.LocalizeApiTokenService), i0__namespace.ɵɵinject(i1__namespace.LocalizeApiService), i0__namespace.ɵɵinject(LocalizeTokenDialogService)); }, token: LocalizeTokenConfigureService, providedIn: "root" });
565
- LocalizeTokenConfigureService.decorators = [
566
- { type: i0.Injectable, args: [{
567
- providedIn: 'root'
568
- },] }
569
- ];
570
- LocalizeTokenConfigureService.ctorParameters = function () { return [
571
- { type: i1.LocalizeApiTokenService },
572
- { type: i1.LocalizeApiService },
573
- { type: LocalizeTokenDialogService }
574
- ]; };
575
-
576
- //#region login dialog
577
-
578
- /**
579
- * Generated bundle index. Do not edit.
580
- */
581
-
582
- exports.LocalizeTokenConfigureService = LocalizeTokenConfigureService;
583
- exports.LocalizeTokenDialogService = LocalizeTokenDialogService;
584
- exports.LocalizeTokenLoginDialogComponent = LocalizeTokenLoginDialogComponent;
585
- exports.LocalizeTokenModule = LocalizeTokenModule;
586
-
587
- Object.defineProperty(exports, '__esModule', { value: true });
588
-
589
- }));
590
- //# sourceMappingURL=sambath999-localize-token.umd.js.map