@webtypen/webframez-core 0.3.31 → 0.3.33
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.
|
@@ -199,6 +199,19 @@ class DataBuilder {
|
|
|
199
199
|
newData.forms = {};
|
|
200
200
|
if (typeof type.forms === "function") {
|
|
201
201
|
newData.forms = yield type.forms(req);
|
|
202
|
+
if (newData === null || newData === void 0 ? void 0 : newData.forms) {
|
|
203
|
+
for (let form in newData.forms) {
|
|
204
|
+
if (typeof newData.forms[form].pageActions === "function") {
|
|
205
|
+
newData.forms[form].pageActions = yield newData.forms[form].pageActions(req);
|
|
206
|
+
}
|
|
207
|
+
if (typeof newData.forms[form].fields === "function") {
|
|
208
|
+
newData.forms[form].fields = yield newData.forms[form].fields(req);
|
|
209
|
+
}
|
|
210
|
+
if (typeof newData.forms[form].backLink === "function") {
|
|
211
|
+
newData.forms[form].backLink = yield newData.forms[form].backLink(req);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
202
215
|
}
|
|
203
216
|
for (let form in type.forms) {
|
|
204
217
|
if (!type.forms[form] || !type.forms[form].fields) {
|
|
@@ -220,15 +233,6 @@ class DataBuilder {
|
|
|
220
233
|
else if (type.forms[form].fields) {
|
|
221
234
|
newData.forms[form].fields = JSON.parse(JSON.stringify(type.forms[form].fields));
|
|
222
235
|
}
|
|
223
|
-
if (typeof newData.forms[form].pageActions === "function") {
|
|
224
|
-
newData.forms[form].pageActions = yield newData.forms[form].pageActions(req);
|
|
225
|
-
}
|
|
226
|
-
if (typeof newData.forms[form].fields === "function") {
|
|
227
|
-
newData.forms[form].fields = yield newData.forms[form].fields(req);
|
|
228
|
-
}
|
|
229
|
-
if (typeof newData.forms[form].backLink === "function") {
|
|
230
|
-
newData.forms[form].backLink = yield newData.forms[form].backLink(req);
|
|
231
|
-
}
|
|
232
236
|
if (!newData.forms[form].fields || newData.forms[form].fields.length < 1) {
|
|
233
237
|
continue;
|
|
234
238
|
}
|
|
@@ -273,7 +273,7 @@ class Datatable {
|
|
|
273
273
|
stats[0] &&
|
|
274
274
|
stats[0]["sum_" + req.body.sums[key].mapping] !== undefined &&
|
|
275
275
|
stats[0]["sum_" + req.body.sums[key].mapping] !== null
|
|
276
|
-
? NumericFunctions_1.NumericFunctions.numberFormat(stats[0]["sum_" + req.body.sums[key].mapping]) +
|
|
276
|
+
? NumericFunctions_1.NumericFunctions.numberFormat(req.body.sums[key].divideBy > 0 ? stats[0]["sum_" + req.body.sums[key].mapping] / req.body.sums[key].divideBy : stats[0]["sum_" + req.body.sums[key].mapping]) +
|
|
277
277
|
(req.body.sums[key].suffix ? req.body.sums[key].suffix : "")
|
|
278
278
|
: undefined });
|
|
279
279
|
}
|
package/dist/info.js
CHANGED
package/package.json
CHANGED
|
@@ -255,6 +255,20 @@ export class DataBuilder {
|
|
|
255
255
|
newData.forms = {};
|
|
256
256
|
if (typeof type.forms === "function") {
|
|
257
257
|
newData.forms = await type.forms(req);
|
|
258
|
+
|
|
259
|
+
if (newData?.forms) {
|
|
260
|
+
for (let form in newData.forms) {
|
|
261
|
+
if (typeof newData.forms[form].pageActions === "function") {
|
|
262
|
+
newData.forms[form].pageActions = await newData.forms[form].pageActions(req);
|
|
263
|
+
}
|
|
264
|
+
if (typeof newData.forms[form].fields === "function") {
|
|
265
|
+
newData.forms[form].fields = await newData.forms[form].fields(req);
|
|
266
|
+
}
|
|
267
|
+
if (typeof newData.forms[form].backLink === "function") {
|
|
268
|
+
newData.forms[form].backLink = await newData.forms[form].backLink(req);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
258
272
|
}
|
|
259
273
|
|
|
260
274
|
for (let form in type.forms) {
|
|
@@ -279,16 +293,6 @@ export class DataBuilder {
|
|
|
279
293
|
newData.forms[form].fields = JSON.parse(JSON.stringify(type.forms[form].fields));
|
|
280
294
|
}
|
|
281
295
|
|
|
282
|
-
if (typeof newData.forms[form].pageActions === "function") {
|
|
283
|
-
newData.forms[form].pageActions = await newData.forms[form].pageActions(req);
|
|
284
|
-
}
|
|
285
|
-
if (typeof newData.forms[form].fields === "function") {
|
|
286
|
-
newData.forms[form].fields = await newData.forms[form].fields(req);
|
|
287
|
-
}
|
|
288
|
-
if (typeof newData.forms[form].backLink === "function") {
|
|
289
|
-
newData.forms[form].backLink = await newData.forms[form].backLink(req);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
296
|
if (!newData.forms[form].fields || newData.forms[form].fields.length < 1) {
|
|
293
297
|
continue;
|
|
294
298
|
}
|
|
@@ -290,7 +290,7 @@ export class Datatable {
|
|
|
290
290
|
stats[0] &&
|
|
291
291
|
stats[0]["sum_" + req.body.sums[key].mapping] !== undefined &&
|
|
292
292
|
stats[0]["sum_" + req.body.sums[key].mapping] !== null
|
|
293
|
-
? NumericFunctions.numberFormat(stats[0]["sum_" + req.body.sums[key].mapping]) +
|
|
293
|
+
? NumericFunctions.numberFormat(req.body.sums[key].divideBy > 0 ? stats[0]["sum_" + req.body.sums[key].mapping] / req.body.sums[key].divideBy : stats[0]["sum_" + req.body.sums[key].mapping]) +
|
|
294
294
|
(req.body.sums[key].suffix ? req.body.sums[key].suffix : "")
|
|
295
295
|
: undefined,
|
|
296
296
|
};
|
package/src/info.ts
CHANGED