@zeedhi/zd-user-info-common 3.0.0 → 3.0.2
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/types/index.d.ts +0 -3
- package/dist/user-info-common.es.js +72 -477
- package/package.json +2 -2
- package/dist/types/tek-user-info/TekUserInfoController.d.ts +0 -22
- package/dist/types/tek-user-info/interfaces.d.ts +0 -27
- package/dist/types/tek-user-info/tek-user-info-list.d.ts +0 -32
- package/dist/types/tek-user-info/tek-user-info.d.ts +0 -37
package/dist/types/index.d.ts
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
throw TypeError(
|
|
1
|
+
var Z = Object.create;
|
|
2
|
+
var P = Object.defineProperty;
|
|
3
|
+
var T = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var U = (e, i) => (i = Symbol[e]) ? i : Symbol.for("Symbol." + e), C = (e) => {
|
|
5
|
+
throw TypeError(e);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
return
|
|
15
|
-
}, set [
|
|
16
|
-
return
|
|
17
|
-
} },
|
|
18
|
-
|
|
19
|
-
for (var
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
var
|
|
24
|
-
import { ComponentRender as
|
|
25
|
-
import { Singleton as
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
class
|
|
29
|
-
constructor(
|
|
30
|
-
|
|
31
|
-
this.component =
|
|
7
|
+
var R = (e, i, t) => i in e ? P(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t;
|
|
8
|
+
var L = (e, i) => P(e, "name", { value: i, configurable: !0 });
|
|
9
|
+
var N = (e) => [, , , Z((e == null ? void 0 : e[U("metadata")]) ?? null)], F = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], I = (e) => e !== void 0 && typeof e != "function" ? C("Function expected") : e, X = (e, i, t, n, h) => ({ kind: F[e], name: i, metadata: n, addInitializer: (a) => t._ ? C("Already initialized") : h.push(I(a || null)) }), Y = (e, i) => R(i, U("metadata"), e[3]), W = (e, i, t, n) => {
|
|
10
|
+
for (var h = 0, a = e[i >> 1], g = a && a.length; h < g; h++) i & 1 ? a[h].call(t) : n = a[h].call(t, n);
|
|
11
|
+
return n;
|
|
12
|
+
}, A = (e, i, t, n, h, a) => {
|
|
13
|
+
var g, r, x, u, f, o = i & 7, O = !!(i & 8), c = !!(i & 16), v = o > 3 ? e.length + 1 : o ? O ? 1 : 2 : 0, H = F[o + 5], E = o > 3 && (e[v - 1] = []), G = e[v] || (e[v] = []), m = o && (!c && !O && (h = h.prototype), o < 5 && (o > 3 || !c) && T(o < 4 ? h : { get [t]() {
|
|
14
|
+
return V(this, a);
|
|
15
|
+
}, set [t](l) {
|
|
16
|
+
return b(this, a, l);
|
|
17
|
+
} }, t));
|
|
18
|
+
o ? c && o < 4 && L(a, (o > 2 ? "set " : o > 1 ? "get " : "") + t) : L(h, t);
|
|
19
|
+
for (var S = n.length - 1; S >= 0; S--)
|
|
20
|
+
u = X(o, t, x = {}, e[3], G), o && (u.static = O, u.private = c, f = u.access = { has: c ? (l) => w(h, l) : (l) => t in l }, o ^ 3 && (f.get = c ? (l) => (o ^ 1 ? V : z)(l, h, o ^ 4 ? a : m.get) : (l) => l[t]), o > 2 && (f.set = c ? (l, _) => b(l, h, _, o ^ 4 ? a : m.set) : (l, _) => l[t] = _)), r = (0, n[S])(o ? o < 4 ? c ? a : m[H] : o > 4 ? void 0 : { get: m.get, set: m.set } : h, u), x._ = 1, o ^ 4 || r === void 0 ? I(r) && (o > 4 ? E.unshift(r) : o ? c ? a = r : m[H] = r : h = r) : typeof r != "object" || r === null ? C("Object expected") : (I(g = r.get) && (m.get = g), I(g = r.set) && (m.set = g), I(g = r.init) && E.unshift(g));
|
|
21
|
+
return o || Y(e, h), m && P(h, t, m), c ? o ^ 4 ? a : m : h;
|
|
22
|
+
}, s = (e, i, t) => R(e, typeof i != "symbol" ? i + "" : i, t), k = (e, i, t) => i.has(e) || C("Cannot " + t), w = (e, i) => Object(i) !== i ? C('Cannot use the "in" operator on this value') : e.has(i), V = (e, i, t) => (k(e, i, "read from private field"), t ? t.call(e) : i.get(e));
|
|
23
|
+
var b = (e, i, t, n) => (k(e, i, "write to private field"), n ? n.call(e, t) : i.set(e, t), t), z = (e, i, t) => (k(e, i, "access private method"), t);
|
|
24
|
+
import { ComponentRender as B } from "@zeedhi/common";
|
|
25
|
+
import { Singleton as M, Messages as j, Loader as q } from "@zeedhi/core";
|
|
26
|
+
var $, p;
|
|
27
|
+
$ = [M];
|
|
28
|
+
class d {
|
|
29
|
+
constructor(i) {
|
|
30
|
+
s(this, "component");
|
|
31
|
+
this.component = i;
|
|
32
32
|
}
|
|
33
33
|
get showChangeProfile() {
|
|
34
|
-
const { changeProfile:
|
|
35
|
-
return
|
|
34
|
+
const { changeProfile: i } = this.component.visibleItems;
|
|
35
|
+
return i || i === void 0;
|
|
36
36
|
}
|
|
37
37
|
get showLogout() {
|
|
38
|
-
const { logout:
|
|
39
|
-
return
|
|
38
|
+
const { logout: i } = this.component.visibleItems;
|
|
39
|
+
return i || i === void 0;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
class
|
|
44
|
-
constructor(
|
|
45
|
-
super(
|
|
42
|
+
p = N(null), d = A(p, 0, "UserInfoController", $, d), W(p, 1, d);
|
|
43
|
+
class K extends B {
|
|
44
|
+
constructor(t) {
|
|
45
|
+
super(t);
|
|
46
46
|
/**
|
|
47
47
|
* Dropdown activator
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
s(this, "activator");
|
|
50
50
|
/**
|
|
51
51
|
* Props to be passed to the ZdAvatar component
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
s(this, "avatarProps", {});
|
|
54
54
|
/**
|
|
55
55
|
* Components to be rendered on the bottom slot
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
s(this, "bottomSlot", []);
|
|
58
58
|
/**
|
|
59
59
|
* Components to be rendered on the center slot
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
s(this, "centerSlot", []);
|
|
62
62
|
/**
|
|
63
63
|
* Components to be rendered on the top slot
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
s(this, "topSlot", []);
|
|
66
66
|
/**
|
|
67
67
|
* User name
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
s(this, "user", "");
|
|
70
70
|
/**
|
|
71
71
|
* User image
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
s(this, "userImage", "");
|
|
74
74
|
/**
|
|
75
75
|
* Designates if menu should close on outside-activator click.
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
s(this, "closeOnClick", !0);
|
|
78
78
|
/**
|
|
79
79
|
* Designates if menu should close when its content is clicked.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
s(this, "closeOnContentClick", !0);
|
|
82
82
|
/**
|
|
83
83
|
* Applies position fixed to the dropdown.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
s(this, "fixed", !1);
|
|
86
86
|
/**
|
|
87
87
|
* Components to be rendered on the menu header
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
s(this, "headerSlot", []);
|
|
90
90
|
/**
|
|
91
91
|
* Props to be passed to the ZdImage component (rendered inside the avatar)
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
s(this, "imageProps", {});
|
|
94
94
|
/**
|
|
95
95
|
* Offset the menu on the x-axis.
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
s(this, "offsetX", !1);
|
|
98
98
|
/**
|
|
99
99
|
* Offset the menu on the x-axis.
|
|
100
100
|
*/
|
|
101
|
-
|
|
101
|
+
s(this, "offsetY", !0);
|
|
102
102
|
/**
|
|
103
103
|
* Designates whether menu should open on activator click.
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
s(this, "openOnClick", !0);
|
|
106
106
|
/**
|
|
107
107
|
* Designates whether menu should open on activator hover.
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
s(this, "openOnHover", !1);
|
|
110
110
|
/**
|
|
111
111
|
* Controls whether the component is visible or hidden.
|
|
112
112
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
s(this, "value", !1);
|
|
114
|
+
s(this, "visibleItems", {
|
|
115
115
|
userName: !0,
|
|
116
116
|
changeProfile: !0,
|
|
117
117
|
logout: !0
|
|
@@ -119,25 +119,25 @@ class oe extends Q {
|
|
|
119
119
|
/**
|
|
120
120
|
* Sets the height for the dropdown.
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
s(this, "height", "auto");
|
|
123
123
|
/**
|
|
124
124
|
* Sets the maximum height for the dropdown.
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
s(this, "maxHeight");
|
|
127
127
|
/**
|
|
128
128
|
* Sets the maximum width for the dropdown.
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
s(this, "maxWidth");
|
|
131
131
|
/**
|
|
132
132
|
* Sets the minimum height for the dropdown.
|
|
133
133
|
*/
|
|
134
|
-
|
|
134
|
+
s(this, "minHeight");
|
|
135
135
|
/**
|
|
136
136
|
* Sets the minimum width for the dropdown.
|
|
137
137
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.user = this.getInitValue("user",
|
|
138
|
+
s(this, "minWidth");
|
|
139
|
+
s(this, "propCenterSlot");
|
|
140
|
+
this.user = this.getInitValue("user", t.user, this.user), this.userImage = this.getInitValue("userImage", t.userImage, this.userImage), this.closeOnClick = this.getInitValue("closeOnClick", t.closeOnClick, this.closeOnClick), this.closeOnContentClick = this.getInitValue("closeOnContentClick", t.closeOnContentClick, this.closeOnContentClick), this.fixed = this.getInitValue("fixed", t.fixed, this.fixed), this.offsetX = this.getInitValue("offsetX", t.offsetX, this.offsetX), this.offsetY = this.getInitValue("offsetY", t.offsetY, this.offsetY), this.openOnClick = this.getInitValue("openOnClick", t.openOnClick, this.openOnClick), this.openOnHover = this.getInitValue("openOnHover", t.openOnHover, this.openOnHover), this.value = this.getInitValue("value", t.value, this.value), this.visibleItems = this.getInitValue("visibleItems", t.visibleItems, this.visibleItems), this.height = this.getInitValue("height", t.height, this.height), this.maxHeight = this.getInitValue("maxHeight", t.maxHeight, this.maxHeight), this.minHeight = this.getInitValue("minHeight", t.minHeight, this.minHeight), this.maxWidth = this.getInitValue("maxWidth", t.maxWidth, this.maxWidth), this.minWidth = this.getInitValue("minWidth", t.minWidth, this.minWidth), this.avatarProps = t.avatarProps || this.avatarProps, this.imageProps = t.imageProps || this.imageProps, this.activator = t.activator || this.getActivator(), this.bottomSlot = t.bottomSlot || this.bottomSlot, this.propCenterSlot = t.centerSlot, this.topSlot = t.topSlot || this.topSlot, this.headerSlot = t.headerSlot || this.headerSlot, this.createAccessors();
|
|
141
141
|
}
|
|
142
142
|
getActivator() {
|
|
143
143
|
return {
|
|
@@ -177,7 +177,7 @@ class oe extends Q {
|
|
|
177
177
|
cssClass: "zd-px-2",
|
|
178
178
|
isVisible: `{{UserInfoController_${this.componentId}.showChangeProfile}}`,
|
|
179
179
|
events: {
|
|
180
|
-
click: ({ event:
|
|
180
|
+
click: ({ event: t, element: n }) => this.onProfileChange(t, n)
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -188,24 +188,24 @@ class oe extends Q {
|
|
|
188
188
|
cssClass: "zd-px-2",
|
|
189
189
|
isVisible: `{{UserInfoController_${this.componentId}.showLogout}}`,
|
|
190
190
|
events: {
|
|
191
|
-
click: ({ event:
|
|
191
|
+
click: ({ event: t, element: n }) => this.onLogoutClick(t, n)
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
]
|
|
195
195
|
}
|
|
196
196
|
];
|
|
197
197
|
}
|
|
198
|
-
onLogoutClick(
|
|
199
|
-
this.callEvent("onLogoutClick", { event:
|
|
198
|
+
onLogoutClick(t, n) {
|
|
199
|
+
this.callEvent("onLogoutClick", { event: t, element: n, component: this });
|
|
200
200
|
}
|
|
201
|
-
onProfileChange(
|
|
202
|
-
this.callEvent("onProfileChange", { event:
|
|
201
|
+
onProfileChange(t, n) {
|
|
202
|
+
this.callEvent("onProfileChange", { event: t, element: n, component: this });
|
|
203
203
|
}
|
|
204
204
|
onCreated() {
|
|
205
|
-
super.onCreated(),
|
|
205
|
+
super.onCreated(), q.addController(`UserInfoController_${this.componentId}`, d, [this]), this.centerSlot = this.propCenterSlot ? this.propCenterSlot : this.getCenterSlot();
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
j.add({
|
|
209
209
|
"pt-BR": {
|
|
210
210
|
translation: {
|
|
211
211
|
USERINFO_CHANGE_PROFILE: "Alterar perfil",
|
|
@@ -225,411 +225,6 @@ D.add({
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
|
-
var B, $;
|
|
229
|
-
B = [w];
|
|
230
|
-
class _ {
|
|
231
|
-
constructor(t) {
|
|
232
|
-
n(this, "component");
|
|
233
|
-
this.component = t;
|
|
234
|
-
}
|
|
235
|
-
get versionInfo() {
|
|
236
|
-
return this.component.versionInfo;
|
|
237
|
-
}
|
|
238
|
-
get name() {
|
|
239
|
-
var t;
|
|
240
|
-
return ((t = this.versionInfo) == null ? void 0 : t.name) || "";
|
|
241
|
-
}
|
|
242
|
-
set name(t) {
|
|
243
|
-
this.versionInfo && (this.versionInfo.name = t);
|
|
244
|
-
}
|
|
245
|
-
get version() {
|
|
246
|
-
var t;
|
|
247
|
-
return ((t = this.versionInfo) == null ? void 0 : t.version) || "";
|
|
248
|
-
}
|
|
249
|
-
set version(t) {
|
|
250
|
-
this.versionInfo && (this.versionInfo.version = t);
|
|
251
|
-
}
|
|
252
|
-
get hasDefaultEmail() {
|
|
253
|
-
return !!this.component.defaultEmail;
|
|
254
|
-
}
|
|
255
|
-
get hasAboutImage() {
|
|
256
|
-
return !!this.component.aboutImage;
|
|
257
|
-
}
|
|
258
|
-
mergeText(t, e) {
|
|
259
|
-
return `<li>${t} - <b>${e}</b></li>`;
|
|
260
|
-
}
|
|
261
|
-
get mainVersion() {
|
|
262
|
-
var t;
|
|
263
|
-
return !((t = this.versionInfo) != null && t.name) || !this.versionInfo.version ? "" : `${this.versionInfo.name} - <b>${this.versionInfo.version}</b>`;
|
|
264
|
-
}
|
|
265
|
-
getItems(t) {
|
|
266
|
-
return this.versionInfo ? `<ul>${this.versionInfo[t].map((i) => this.mergeText(i.name, i.version)).join("")}</ul>` : [];
|
|
267
|
-
}
|
|
268
|
-
get frontendItems() {
|
|
269
|
-
return this.getItems("frontend");
|
|
270
|
-
}
|
|
271
|
-
get backendItems() {
|
|
272
|
-
return this.getItems("backend");
|
|
273
|
-
}
|
|
274
|
-
get modulesItems() {
|
|
275
|
-
return this.getItems("modules");
|
|
276
|
-
}
|
|
277
|
-
get showReportError() {
|
|
278
|
-
const { reportError: t } = this.component.visibleItems;
|
|
279
|
-
return t || t === void 0;
|
|
280
|
-
}
|
|
281
|
-
get showVersionInfo() {
|
|
282
|
-
const { versionInfo: t } = this.component.visibleItems;
|
|
283
|
-
return t || t === void 0;
|
|
284
|
-
}
|
|
285
|
-
get showAbout() {
|
|
286
|
-
const { about: t } = this.component.visibleItems;
|
|
287
|
-
return t || t === void 0;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
$ = C(null), _ = b($, 0, "TekUserInfoController", B, _), T($, 1, _);
|
|
291
|
-
class ne extends oe {
|
|
292
|
-
constructor(e) {
|
|
293
|
-
super(e);
|
|
294
|
-
n(this, "aboutModal");
|
|
295
|
-
n(this, "reportModal");
|
|
296
|
-
/**
|
|
297
|
-
* Data about the application version
|
|
298
|
-
*/
|
|
299
|
-
n(this, "versionInfo", null);
|
|
300
|
-
/**
|
|
301
|
-
* Default email address to be defined in the Report Bug form
|
|
302
|
-
*/
|
|
303
|
-
n(this, "defaultEmail", "");
|
|
304
|
-
/**
|
|
305
|
-
* Url from which the version info will be retrieved
|
|
306
|
-
*/
|
|
307
|
-
n(this, "versionUrl", "");
|
|
308
|
-
/**
|
|
309
|
-
* Path to the image to be shown on about modal
|
|
310
|
-
*/
|
|
311
|
-
n(this, "aboutImage", "");
|
|
312
|
-
n(this, "propBottomSlot");
|
|
313
|
-
this.versionInfo = this.getInitValue("versionInfo", e.versionInfo, this.versionInfo), this.defaultEmail = this.getInitValue("defaultEmail", e.defaultEmail, this.defaultEmail), this.versionUrl = this.getInitValue("versionUrl", e.versionUrl, this.versionUrl), this.aboutImage = this.getInitValue("aboutImage", e.aboutImage, this.aboutImage), this.createAccessors(), this.propBottomSlot = e.bottomSlot;
|
|
314
|
-
}
|
|
315
|
-
getBottomSlot() {
|
|
316
|
-
return [
|
|
317
|
-
{
|
|
318
|
-
name: `${this.name}_bottom_list`,
|
|
319
|
-
component: "TekUserInfoList",
|
|
320
|
-
parentName: this.name
|
|
321
|
-
}
|
|
322
|
-
];
|
|
323
|
-
}
|
|
324
|
-
onAboutClick() {
|
|
325
|
-
this.aboutModal || (this.aboutModal = Z.create({
|
|
326
|
-
name: `${this.name}_about_modal`,
|
|
327
|
-
cssClass: "about-modal",
|
|
328
|
-
grid: { cols: 8, sm: 4, lg: 5 },
|
|
329
|
-
children: [
|
|
330
|
-
{
|
|
331
|
-
name: `${this.name}_about_header`,
|
|
332
|
-
component: "ZdHeader",
|
|
333
|
-
color: "transparent",
|
|
334
|
-
padless: !0,
|
|
335
|
-
elevation: 0,
|
|
336
|
-
rightSlot: [
|
|
337
|
-
{
|
|
338
|
-
name: `${this.name}_about_close_button`,
|
|
339
|
-
component: "ZdModalCloseButton",
|
|
340
|
-
small: !0,
|
|
341
|
-
modalName: `${this.name}_about_modal`
|
|
342
|
-
}
|
|
343
|
-
]
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
name: `${this.name}_about_row`,
|
|
347
|
-
component: "ZdTag",
|
|
348
|
-
tag: "div",
|
|
349
|
-
cssClass: "zd-justify-center zd-px-6",
|
|
350
|
-
isVisible: `{{TekUserInfoController_${this.componentId}.hasAboutImage}}`,
|
|
351
|
-
children: [
|
|
352
|
-
{
|
|
353
|
-
name: `${this.name}_about_image`,
|
|
354
|
-
component: "ZdImage",
|
|
355
|
-
width: "100%",
|
|
356
|
-
src: this.aboutImage
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
name: `${this.name}_version_tabs`,
|
|
362
|
-
cssClass: "zd-pt-3 zd-tekUserInfo-tab",
|
|
363
|
-
component: "ZdTabs",
|
|
364
|
-
tabs: [
|
|
365
|
-
{
|
|
366
|
-
name: `${this.name}_version_frontend_tab`,
|
|
367
|
-
tabTitle: "Frontend",
|
|
368
|
-
children: this.getVersionTree("frontend")
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
name: `${this.name}_version_backend_tab`,
|
|
372
|
-
tabTitle: "Backend",
|
|
373
|
-
children: this.getVersionTree("backend")
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
name: `${this.name}_version_modules_tab`,
|
|
377
|
-
tabTitle: "Modules",
|
|
378
|
-
children: this.getVersionTree("modules")
|
|
379
|
-
}
|
|
380
|
-
]
|
|
381
|
-
}
|
|
382
|
-
]
|
|
383
|
-
})), this.aboutModal.show();
|
|
384
|
-
}
|
|
385
|
-
getVersionTree(e) {
|
|
386
|
-
if (!this.versionInfo) return [];
|
|
387
|
-
const i = {
|
|
388
|
-
name: `${this.name}_version_${e}_main`,
|
|
389
|
-
component: "ZdText",
|
|
390
|
-
text: `{{TekUserInfoController_${this.componentId}.mainVersion}}`
|
|
391
|
-
}, a = {
|
|
392
|
-
name: `${this.name}_version_${e}`,
|
|
393
|
-
component: "ZdText",
|
|
394
|
-
cssClass: "zd-pl-4",
|
|
395
|
-
text: `{{TekUserInfoController_${this.componentId}.${e}Items}}`
|
|
396
|
-
};
|
|
397
|
-
return [i, a];
|
|
398
|
-
}
|
|
399
|
-
onReportClick() {
|
|
400
|
-
this.reportModal || (this.reportModal = Z.create({
|
|
401
|
-
name: `${this.name}_report_modal`,
|
|
402
|
-
children: [
|
|
403
|
-
{
|
|
404
|
-
name: `${this.name}_report_header`,
|
|
405
|
-
component: "ZdHeader",
|
|
406
|
-
color: "transparent",
|
|
407
|
-
padless: !0,
|
|
408
|
-
elevation: 0,
|
|
409
|
-
leftSlot: [
|
|
410
|
-
{
|
|
411
|
-
name: `${this.name}_report_title`,
|
|
412
|
-
component: "ZdText",
|
|
413
|
-
text: "TEKUSERINFO_REPORT_ERROR",
|
|
414
|
-
cssClass: "zd-theme-font-title"
|
|
415
|
-
}
|
|
416
|
-
],
|
|
417
|
-
rightSlot: [
|
|
418
|
-
{
|
|
419
|
-
name: `${this.name}_report_close_button`,
|
|
420
|
-
component: "ZdModalCloseButton",
|
|
421
|
-
small: !0,
|
|
422
|
-
modalName: `${this.name}_report_modal`
|
|
423
|
-
}
|
|
424
|
-
]
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
name: `${this.name}_report_form`,
|
|
428
|
-
component: "ZdForm",
|
|
429
|
-
cssClass: "zd-pt-4",
|
|
430
|
-
children: [
|
|
431
|
-
{
|
|
432
|
-
name: "report_email",
|
|
433
|
-
component: "ZdTextInput",
|
|
434
|
-
label: "E-mail",
|
|
435
|
-
grid: {
|
|
436
|
-
cols: "12"
|
|
437
|
-
},
|
|
438
|
-
value: this.defaultEmail,
|
|
439
|
-
readonly: `{{TekUserInfoController_${this.componentId}.hasDefaultEmail}}`,
|
|
440
|
-
validations: {
|
|
441
|
-
required: {},
|
|
442
|
-
email: {}
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
name: "report_cc",
|
|
447
|
-
component: "ZdTextInput",
|
|
448
|
-
label: "CC",
|
|
449
|
-
placeholder: "TEKUSERINFO_EMAIL_PLACEHOLDER",
|
|
450
|
-
grid: {
|
|
451
|
-
cols: "12"
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
name: "report_type",
|
|
456
|
-
component: "ZdSelect",
|
|
457
|
-
label: "TEKUSERINFO_TYPE",
|
|
458
|
-
dataValue: "value",
|
|
459
|
-
dataText: "text",
|
|
460
|
-
datasource: {
|
|
461
|
-
uniqueKey: "value",
|
|
462
|
-
translate: !0,
|
|
463
|
-
data: [
|
|
464
|
-
{ value: "0", text: "TEKUSERINFO_ERROR" },
|
|
465
|
-
{ value: "1", text: "TEKUSERINFO_IMPROVEMENT" }
|
|
466
|
-
]
|
|
467
|
-
},
|
|
468
|
-
grid: {
|
|
469
|
-
cols: "12"
|
|
470
|
-
},
|
|
471
|
-
validations: {
|
|
472
|
-
required: {}
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
name: "report_description",
|
|
477
|
-
component: "ZdTextarea",
|
|
478
|
-
label: "TEKUSERINFO_DESCRIPTION",
|
|
479
|
-
grid: {
|
|
480
|
-
cols: "12"
|
|
481
|
-
},
|
|
482
|
-
validations: {
|
|
483
|
-
required: {}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
]
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
name: `${this.name}_report_footer`,
|
|
490
|
-
component: "ZdFooter",
|
|
491
|
-
color: "transparent",
|
|
492
|
-
padless: !0,
|
|
493
|
-
rightSlot: [
|
|
494
|
-
{
|
|
495
|
-
name: `${this.name}_report_cancel`,
|
|
496
|
-
component: "ZdButton",
|
|
497
|
-
label: "TEKUSERINFO_CANCEL",
|
|
498
|
-
outline: !0,
|
|
499
|
-
events: {
|
|
500
|
-
click: () => {
|
|
501
|
-
var e;
|
|
502
|
-
(e = this.reportModal) == null || e.hide();
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
name: `${this.name}_report_send`,
|
|
508
|
-
component: "ZdButton",
|
|
509
|
-
label: "TEKUSERINFO_SEND",
|
|
510
|
-
events: {
|
|
511
|
-
click: (e) => this.onSendReport(e)
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
]
|
|
515
|
-
}
|
|
516
|
-
]
|
|
517
|
-
})), this.reportModal.show();
|
|
518
|
-
}
|
|
519
|
-
async onSendReport({ event: e, element: i }) {
|
|
520
|
-
if (!this.reportModal) return;
|
|
521
|
-
const a = W.getInstance(`${this.name}_report_form`);
|
|
522
|
-
(await a.validate()).valid && (this.callEvent("onSendReport", {
|
|
523
|
-
event: e,
|
|
524
|
-
element: i,
|
|
525
|
-
component: this,
|
|
526
|
-
form: a
|
|
527
|
-
}), this.reportModal.hide());
|
|
528
|
-
}
|
|
529
|
-
onCreated() {
|
|
530
|
-
super.onCreated(), z.addController(`TekUserInfoController_${this.componentId}`, _, [this]), this.bottomSlot = this.propBottomSlot ? this.propBottomSlot : this.getBottomSlot();
|
|
531
|
-
}
|
|
532
|
-
async onMounted(e) {
|
|
533
|
-
if (super.onMounted(e), this.versionUrl) {
|
|
534
|
-
const i = await te.get(this.versionUrl);
|
|
535
|
-
this.versionInfo = i.data.versionInfo;
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
D.add({
|
|
540
|
-
"pt-BR": {
|
|
541
|
-
translation: {
|
|
542
|
-
TEKUSERINFO_ABOUT: "Sobre",
|
|
543
|
-
TEKUSERINFO_REPORT_ERROR: "Reportar Erro",
|
|
544
|
-
TEKUSERINFO_EMAIL_PLACEHOLDER: 'Separe e-mails usando ";"',
|
|
545
|
-
TEKUSERINFO_TYPE: "Tipo",
|
|
546
|
-
TEKUSERINFO_ERROR: "Erro",
|
|
547
|
-
TEKUSERINFO_IMPROVEMENT: "Melhoria",
|
|
548
|
-
TEKUSERINFO_DESCRIPTION: "Descrição",
|
|
549
|
-
TEKUSERINFO_CANCEL: "Cancelar",
|
|
550
|
-
TEKUSERINFO_SEND: "Enviar"
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
"en-US": {
|
|
554
|
-
translation: {
|
|
555
|
-
TEKUSERINFO_ABOUT: "About",
|
|
556
|
-
TEKUSERINFO_REPORT_ERROR: "Report Bug",
|
|
557
|
-
TEKUSERINFO_EMAIL_PLACEHOLDER: 'Separate e-mails using ";"',
|
|
558
|
-
TEKUSERINFO_TYPE: "Type",
|
|
559
|
-
TEKUSERINFO_ERROR: "Bug",
|
|
560
|
-
TEKUSERINFO_IMPROVEMENT: "Improvement",
|
|
561
|
-
TEKUSERINFO_DESCRIPTION: "Description",
|
|
562
|
-
TEKUSERINFO_CANCEL: "Cancel",
|
|
563
|
-
TEKUSERINFO_SEND: "Send"
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
"es-CL": {
|
|
567
|
-
translation: {
|
|
568
|
-
TEKUSERINFO_ABOUT: "Sobre",
|
|
569
|
-
TEKUSERINFO_REPORT_ERROR: "Reportar Error",
|
|
570
|
-
TEKUSERINFO_EMAIL_PLACEHOLDER: 'Separar e-mails usando ";"',
|
|
571
|
-
TEKUSERINFO_TYPE: "Tipo",
|
|
572
|
-
TEKUSERINFO_ERROR: "Error",
|
|
573
|
-
TEKUSERINFO_IMPROVEMENT: "Mejora",
|
|
574
|
-
TEKUSERINFO_DESCRIPTION: "Descripción",
|
|
575
|
-
TEKUSERINFO_CANCEL: "Cancelar",
|
|
576
|
-
TEKUSERINFO_SEND: "Enviar"
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
class re extends ee {
|
|
581
|
-
constructor(e) {
|
|
582
|
-
super(e);
|
|
583
|
-
/**
|
|
584
|
-
* Name of the user info component
|
|
585
|
-
*/
|
|
586
|
-
n(this, "parentName", "");
|
|
587
|
-
n(this, "dense", !0);
|
|
588
|
-
this.parentName = e.parentName || "";
|
|
589
|
-
}
|
|
590
|
-
onCreated() {
|
|
591
|
-
super.onCreated(), this.items = this.getItems();
|
|
592
|
-
}
|
|
593
|
-
getItems() {
|
|
594
|
-
const e = this.parentName ? W.getInstance(this.parentName) : this.parent;
|
|
595
|
-
if (!(e instanceof ne))
|
|
596
|
-
throw Error(`Could not find the TekUserInfo component associated with ${this.name} TekUserInfoList`);
|
|
597
|
-
return [
|
|
598
|
-
{
|
|
599
|
-
name: `${e.name}_version`,
|
|
600
|
-
component: "ZdListItem",
|
|
601
|
-
title: `{{TekUserInfoController_${e.componentId}.name}}`,
|
|
602
|
-
subtitle: `{{TekUserInfoController_${e.componentId}.version}}`,
|
|
603
|
-
isVisible: `{{TekUserInfoController_${e.componentId}.showVersionInfo}}`,
|
|
604
|
-
cssClass: "zd-px-2"
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
name: `${e.name}_about`,
|
|
608
|
-
component: "ZdListItem",
|
|
609
|
-
title: "TEKUSERINFO_ABOUT",
|
|
610
|
-
prependIcon: "infoOutline",
|
|
611
|
-
cssClass: "zd-px-2",
|
|
612
|
-
isVisible: `{{TekUserInfoController_${e.componentId}.showAbout}}`,
|
|
613
|
-
events: {
|
|
614
|
-
click: () => e.onAboutClick()
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
name: `${e.name}_report`,
|
|
619
|
-
component: "ZdListItem",
|
|
620
|
-
title: "TEKUSERINFO_REPORT_ERROR",
|
|
621
|
-
prependIcon: "mdi-ladybug",
|
|
622
|
-
cssClass: "zd-px-2",
|
|
623
|
-
isVisible: `{{TekUserInfoController_${e.componentId}.showReportError}}`,
|
|
624
|
-
events: {
|
|
625
|
-
click: () => e.onReportClick()
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
];
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
228
|
export {
|
|
632
|
-
|
|
633
|
-
re as TekUserInfoList,
|
|
634
|
-
oe as UserInfo
|
|
229
|
+
K as UserInfo
|
|
635
230
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/zd-user-info-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"vite-plugin-dts": "^4.3.0",
|
|
38
38
|
"vitest": "^2.1.8"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "79af6a510c1e8daa71328cdf07711cc6e2be18e4"
|
|
41
41
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TekUserInfo } from './tek-user-info';
|
|
2
|
-
declare class TekUserInfoController {
|
|
3
|
-
component: TekUserInfo;
|
|
4
|
-
get versionInfo(): import('./interfaces').IVersionInfo | null;
|
|
5
|
-
constructor(component: TekUserInfo);
|
|
6
|
-
get name(): string;
|
|
7
|
-
set name(value: string);
|
|
8
|
-
get version(): string;
|
|
9
|
-
set version(value: string);
|
|
10
|
-
get hasDefaultEmail(): boolean;
|
|
11
|
-
get hasAboutImage(): boolean;
|
|
12
|
-
mergeText(name: string, version: string): string;
|
|
13
|
-
get mainVersion(): string;
|
|
14
|
-
protected getItems(tab: 'frontend' | 'backend' | 'modules'): string | never[];
|
|
15
|
-
get frontendItems(): string | never[];
|
|
16
|
-
get backendItems(): string | never[];
|
|
17
|
-
get modulesItems(): string | never[];
|
|
18
|
-
get showReportError(): boolean;
|
|
19
|
-
get showVersionInfo(): boolean;
|
|
20
|
-
get showAbout(): boolean;
|
|
21
|
-
}
|
|
22
|
-
export { TekUserInfoController };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IList } from '@zeedhi/common';
|
|
2
|
-
import { IUserInfo } from '../interfaces';
|
|
3
|
-
export interface IVersionInfo {
|
|
4
|
-
name: string;
|
|
5
|
-
version: string;
|
|
6
|
-
frontend: {
|
|
7
|
-
name: string;
|
|
8
|
-
version: string;
|
|
9
|
-
}[];
|
|
10
|
-
backend: {
|
|
11
|
-
name: string;
|
|
12
|
-
version: string;
|
|
13
|
-
}[];
|
|
14
|
-
modules: {
|
|
15
|
-
name: string;
|
|
16
|
-
version: string;
|
|
17
|
-
}[];
|
|
18
|
-
}
|
|
19
|
-
export interface ITekUserInfo extends IUserInfo {
|
|
20
|
-
aboutImage?: string;
|
|
21
|
-
defaultEmail?: string;
|
|
22
|
-
versionInfo?: IVersionInfo | null;
|
|
23
|
-
versionUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ITekUserInfoList extends IList {
|
|
26
|
-
parentName?: string;
|
|
27
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { List } from '@zeedhi/common';
|
|
2
|
-
import { ITekUserInfo, ITekUserInfoList } from './interfaces';
|
|
3
|
-
export declare class TekUserInfoList extends List implements ITekUserInfoList {
|
|
4
|
-
/**
|
|
5
|
-
* Name of the user info component
|
|
6
|
-
*/
|
|
7
|
-
parentName: string;
|
|
8
|
-
dense: boolean;
|
|
9
|
-
constructor(props: ITekUserInfo);
|
|
10
|
-
onCreated(): void;
|
|
11
|
-
protected getItems(): ({
|
|
12
|
-
name: string;
|
|
13
|
-
component: string;
|
|
14
|
-
title: string;
|
|
15
|
-
subtitle: string;
|
|
16
|
-
isVisible: string;
|
|
17
|
-
cssClass: string;
|
|
18
|
-
prependIcon?: undefined;
|
|
19
|
-
events?: undefined;
|
|
20
|
-
} | {
|
|
21
|
-
name: string;
|
|
22
|
-
component: string;
|
|
23
|
-
title: string;
|
|
24
|
-
prependIcon: string;
|
|
25
|
-
cssClass: string;
|
|
26
|
-
isVisible: string;
|
|
27
|
-
events: {
|
|
28
|
-
click: () => void;
|
|
29
|
-
};
|
|
30
|
-
subtitle?: undefined;
|
|
31
|
-
})[];
|
|
32
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Button, IComponentRender, Modal } from '@zeedhi/common';
|
|
2
|
-
import { IEventParam } from '@zeedhi/core';
|
|
3
|
-
import { UserInfo } from '../user-info';
|
|
4
|
-
import { ITekUserInfo, IVersionInfo } from './interfaces';
|
|
5
|
-
export declare class TekUserInfo extends UserInfo implements ITekUserInfo {
|
|
6
|
-
aboutModal?: Modal;
|
|
7
|
-
reportModal?: Modal;
|
|
8
|
-
/**
|
|
9
|
-
* Data about the application version
|
|
10
|
-
*/
|
|
11
|
-
versionInfo: IVersionInfo | null;
|
|
12
|
-
/**
|
|
13
|
-
* Default email address to be defined in the Report Bug form
|
|
14
|
-
*/
|
|
15
|
-
defaultEmail: string;
|
|
16
|
-
/**
|
|
17
|
-
* Url from which the version info will be retrieved
|
|
18
|
-
*/
|
|
19
|
-
versionUrl: string;
|
|
20
|
-
/**
|
|
21
|
-
* Path to the image to be shown on about modal
|
|
22
|
-
*/
|
|
23
|
-
aboutImage: string;
|
|
24
|
-
protected propBottomSlot?: IComponentRender[];
|
|
25
|
-
constructor(props: ITekUserInfo);
|
|
26
|
-
protected getBottomSlot(): IComponentRender[];
|
|
27
|
-
onAboutClick(): void;
|
|
28
|
-
protected getVersionTree(tab: 'frontend' | 'backend' | 'modules'): {
|
|
29
|
-
name: string;
|
|
30
|
-
component: string;
|
|
31
|
-
text: string;
|
|
32
|
-
}[];
|
|
33
|
-
onReportClick(): void;
|
|
34
|
-
onSendReport({ event, element }: IEventParam<Button>): Promise<void>;
|
|
35
|
-
onCreated(): void;
|
|
36
|
-
onMounted(element: any): Promise<void>;
|
|
37
|
-
}
|