@seniorsistemas/tmsx-angular-components 1.0.6 → 2.0.0
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/commons/field-type/field-type.d.ts +76 -0
- package/commons/field-type/index.d.ts +1 -0
- package/commons/index.d.ts +1 -0
- package/components/grid-editable-nested/grid-editable-nested.component.d.ts +11 -10
- package/components/grid-editable-nested/grid-editable-nested.module.d.ts +31 -0
- package/components/index.d.ts +1 -1
- package/components/painel-processamento/painel-processamento.component.d.ts +5 -2
- package/components/painel-processamento/painel-processamento.module.d.ts +13 -0
- package/components/painel-processamento/processamento.d.ts +1 -1
- package/esm2022/commons/field-type/field-type.mjs +76 -0
- package/esm2022/commons/field-type/index.mjs +2 -0
- package/esm2022/commons/index.mjs +2 -0
- package/esm2022/components/grid-editable-nested/grid-editable-nested.component.mjs +261 -0
- package/esm2022/components/grid-editable-nested/grid-editable-nested.module.mjs +133 -0
- package/esm2022/components/grid-editable-nested/grid.interface.mjs +9 -0
- package/esm2022/components/grid-editable-nested/index.mjs +3 -0
- package/esm2022/components/index.mjs +3 -0
- package/esm2022/components/painel-processamento/index.mjs +3 -0
- package/esm2022/components/painel-processamento/painel-processamento.component.mjs +226 -0
- package/esm2022/components/painel-processamento/painel-processamento.module.mjs +53 -0
- package/esm2022/components/painel-processamento/processamento.mjs +14 -0
- package/esm2022/locale/fallback.mjs +39 -0
- package/esm2022/public-api.mjs +6 -0
- package/esm2022/seniorsistemas-tmsx-angular-components.mjs +5 -0
- package/esm2022/tmsx-angular-components.module.mjs +24 -0
- package/esm2022/utils/index.mjs +2 -0
- package/esm2022/utils/services/utils.service.mjs +192 -0
- package/fesm2022/seniorsistemas-tmsx-angular-components.mjs +992 -0
- package/fesm2022/seniorsistemas-tmsx-angular-components.mjs.map +1 -0
- package/{seniorsistemas-tmsx-angular-components.d.ts → index.d.ts} +1 -0
- package/package.json +16 -59
- package/public-api.d.ts +4 -3
- package/tmsx-angular-components.module.d.ts +6 -2
- package/utils/services/utils.service.d.ts +7 -3
- package/bundles/seniorsistemas-tmsx-angular-components.umd.js +0 -1108
- package/bundles/seniorsistemas-tmsx-angular-components.umd.js.map +0 -1
- package/bundles/seniorsistemas-tmsx-angular-components.umd.min.js +0 -2
- package/bundles/seniorsistemas-tmsx-angular-components.umd.min.js.map +0 -1
- package/esm2015/components/grid-editable-nested/grid-editable-nested.component.js +0 -267
- package/esm2015/components/grid-editable-nested/grid-editable-nested.module.js +0 -64
- package/esm2015/components/grid-editable-nested/grid.interface.js +0 -9
- package/esm2015/components/grid-editable-nested/index.js +0 -3
- package/esm2015/components/index.js +0 -3
- package/esm2015/components/painel-processamento/index.js +0 -3
- package/esm2015/components/painel-processamento/painel-processamento.component.js +0 -235
- package/esm2015/components/painel-processamento/painel-processamento.module.js +0 -33
- package/esm2015/components/painel-processamento/processamento.js +0 -14
- package/esm2015/locale/fallback.js +0 -39
- package/esm2015/public-api.js +0 -5
- package/esm2015/seniorsistemas-tmsx-angular-components.js +0 -5
- package/esm2015/tmsx-angular-components.module.js +0 -22
- package/esm2015/utils/index.js +0 -2
- package/esm2015/utils/services/utils.service.js +0 -196
- package/esm5/components/grid-editable-nested/grid-editable-nested.component.js +0 -282
- package/esm5/components/grid-editable-nested/grid-editable-nested.module.js +0 -67
- package/esm5/components/grid-editable-nested/grid.interface.js +0 -9
- package/esm5/components/grid-editable-nested/index.js +0 -3
- package/esm5/components/index.js +0 -3
- package/esm5/components/painel-processamento/index.js +0 -3
- package/esm5/components/painel-processamento/painel-processamento.component.js +0 -263
- package/esm5/components/painel-processamento/painel-processamento.module.js +0 -36
- package/esm5/components/painel-processamento/processamento.js +0 -15
- package/esm5/locale/fallback.js +0 -39
- package/esm5/public-api.js +0 -5
- package/esm5/seniorsistemas-tmsx-angular-components.js +0 -5
- package/esm5/tmsx-angular-components.module.js +0 -26
- package/esm5/utils/index.js +0 -2
- package/esm5/utils/services/utils.service.js +0 -198
- package/fesm2015/seniorsistemas-tmsx-angular-components.js +0 -839
- package/fesm2015/seniorsistemas-tmsx-angular-components.js.map +0 -1
- package/fesm5/seniorsistemas-tmsx-angular-components.js +0 -895
- package/fesm5/seniorsistemas-tmsx-angular-components.js.map +0 -1
- package/seniorsistemas-tmsx-angular-components.metadata.json +0 -1
|
@@ -1,1108 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('p-limit'), require('@ngx-translate/core'), require('@angular/core'), require('@seniorsistemas/angular-components'), require('primeng/table'), require('@angular/common'), require('primeng/panel'), require('rxjs'), require('angular2-hotkeys'), require('primeng/toast'), require('@angular/forms'), require('primeng/inputtext'), require('primeng/confirmdialog'), require('primeng/calendar'), require('primeng/dropdown'), require('primeng/api'), require('primeng/tooltip'), require('primeng/autocomplete'), require('primeng/checkbox')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@seniorsistemas/tmsx-angular-components', ['exports', 'p-limit', '@ngx-translate/core', '@angular/core', '@seniorsistemas/angular-components', 'primeng/table', '@angular/common', 'primeng/panel', 'rxjs', 'angular2-hotkeys', 'primeng/toast', '@angular/forms', 'primeng/inputtext', 'primeng/confirmdialog', 'primeng/calendar', 'primeng/dropdown', 'primeng/api', 'primeng/tooltip', 'primeng/autocomplete', 'primeng/checkbox'], factory) :
|
|
4
|
-
(global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['tmsx-angular-components'] = {}), global.pLimit, global.core, global.ng.core, global.angularComponents, global.table, global.ng.common, global.panel, global.rxjs, global.angular2Hotkeys, global.toast, global.ng.forms, global.inputtext, global.confirmdialog, global.calendar, global.dropdown, global.api, global.tooltip, global.autocomplete, global.checkbox));
|
|
5
|
-
}(this, (function (exports, pLimit, core, core$1, angularComponents, table, common, panel, rxjs, angular2Hotkeys, toast, forms, inputtext, confirmdialog, calendar, dropdown, api, tooltip, autocomplete, checkbox) { 'use strict';
|
|
6
|
-
|
|
7
|
-
pLimit = pLimit && pLimit.hasOwnProperty('default') ? pLimit['default'] : pLimit;
|
|
8
|
-
|
|
9
|
-
/*! *****************************************************************************
|
|
10
|
-
Copyright (c) Microsoft Corporation.
|
|
11
|
-
|
|
12
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
-
purpose with or without fee is hereby granted.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
-
***************************************************************************** */
|
|
23
|
-
/* global Reflect, Promise */
|
|
24
|
-
|
|
25
|
-
var extendStatics = function(d, b) {
|
|
26
|
-
extendStatics = Object.setPrototypeOf ||
|
|
27
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
28
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
29
|
-
return extendStatics(d, b);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function __extends(d, b) {
|
|
33
|
-
extendStatics(d, b);
|
|
34
|
-
function __() { this.constructor = d; }
|
|
35
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var __assign = function() {
|
|
39
|
-
__assign = Object.assign || function __assign(t) {
|
|
40
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
41
|
-
s = arguments[i];
|
|
42
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
};
|
|
46
|
-
return __assign.apply(this, arguments);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
function __rest(s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function __decorate(decorators, target, key, desc) {
|
|
62
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
64
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
65
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function __param(paramIndex, decorator) {
|
|
69
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function __metadata(metadataKey, metadataValue) {
|
|
73
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
77
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
78
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
79
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
80
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
81
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
82
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function __generator(thisArg, body) {
|
|
87
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
88
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
89
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
90
|
-
function step(op) {
|
|
91
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
92
|
-
while (_) try {
|
|
93
|
-
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) return t;
|
|
94
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
95
|
-
switch (op[0]) {
|
|
96
|
-
case 0: case 1: t = op; break;
|
|
97
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
98
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
99
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
100
|
-
default:
|
|
101
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
102
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
103
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
104
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
105
|
-
if (t[2]) _.ops.pop();
|
|
106
|
-
_.trys.pop(); continue;
|
|
107
|
-
}
|
|
108
|
-
op = body.call(thisArg, _);
|
|
109
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
110
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function __createBinding(o, m, k, k2) {
|
|
115
|
-
if (k2 === undefined) k2 = k;
|
|
116
|
-
o[k2] = m[k];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function __exportStar(m, exports) {
|
|
120
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function __values(o) {
|
|
124
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
125
|
-
if (m) return m.call(o);
|
|
126
|
-
if (o && typeof o.length === "number") return {
|
|
127
|
-
next: function () {
|
|
128
|
-
if (o && i >= o.length) o = void 0;
|
|
129
|
-
return { value: o && o[i++], done: !o };
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function __read(o, n) {
|
|
136
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
137
|
-
if (!m) return o;
|
|
138
|
-
var i = m.call(o), r, ar = [], e;
|
|
139
|
-
try {
|
|
140
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
141
|
-
}
|
|
142
|
-
catch (error) { e = { error: error }; }
|
|
143
|
-
finally {
|
|
144
|
-
try {
|
|
145
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
146
|
-
}
|
|
147
|
-
finally { if (e) throw e.error; }
|
|
148
|
-
}
|
|
149
|
-
return ar;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function __spread() {
|
|
153
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
154
|
-
ar = ar.concat(__read(arguments[i]));
|
|
155
|
-
return ar;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function __spreadArrays() {
|
|
159
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
160
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
161
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
162
|
-
r[k] = a[j];
|
|
163
|
-
return r;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
function __await(v) {
|
|
167
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
171
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
172
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
173
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
174
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
175
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
176
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
177
|
-
function fulfill(value) { resume("next", value); }
|
|
178
|
-
function reject(value) { resume("throw", value); }
|
|
179
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function __asyncDelegator(o) {
|
|
183
|
-
var i, p;
|
|
184
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
185
|
-
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; }
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function __asyncValues(o) {
|
|
189
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
190
|
-
var m = o[Symbol.asyncIterator], i;
|
|
191
|
-
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);
|
|
192
|
-
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); }); }; }
|
|
193
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function __makeTemplateObject(cooked, raw) {
|
|
197
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
198
|
-
return cooked;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
function __importStar(mod) {
|
|
202
|
-
if (mod && mod.__esModule) return mod;
|
|
203
|
-
var result = {};
|
|
204
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
205
|
-
result.default = mod;
|
|
206
|
-
return result;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function __importDefault(mod) {
|
|
210
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
|
214
|
-
if (!privateMap.has(receiver)) {
|
|
215
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
216
|
-
}
|
|
217
|
-
return privateMap.get(receiver);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
221
|
-
if (!privateMap.has(receiver)) {
|
|
222
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
223
|
-
}
|
|
224
|
-
privateMap.set(receiver, value);
|
|
225
|
-
return value;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
var _a;
|
|
229
|
-
var EnumProcessamentoStatus;
|
|
230
|
-
(function (EnumProcessamentoStatus) {
|
|
231
|
-
EnumProcessamentoStatus["SUCCESS"] = "SUCCESS";
|
|
232
|
-
EnumProcessamentoStatus["FAILED"] = "FAILED";
|
|
233
|
-
EnumProcessamentoStatus["PENDING"] = "PENDING";
|
|
234
|
-
EnumProcessamentoStatus["PROCESSING"] = "PROCESSING";
|
|
235
|
-
})(EnumProcessamentoStatus || (EnumProcessamentoStatus = {}));
|
|
236
|
-
var EnumProcessamentoStatusTranslationMap = (_a = {},
|
|
237
|
-
_a[EnumProcessamentoStatus.SUCCESS] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_success',
|
|
238
|
-
_a[EnumProcessamentoStatus.FAILED] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_failed',
|
|
239
|
-
_a[EnumProcessamentoStatus.PENDING] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_pending',
|
|
240
|
-
_a[EnumProcessamentoStatus.PROCESSING] = 'tmsx_fnd.tmsx_angular_components.painel_processamento_status_processing',
|
|
241
|
-
_a);
|
|
242
|
-
|
|
243
|
-
var PainelProcessamentoComponent = /** @class */ (function () {
|
|
244
|
-
function PainelProcessamentoComponent(translate) {
|
|
245
|
-
this.translate = translate;
|
|
246
|
-
this.processado = new core$1.EventEmitter();
|
|
247
|
-
this.concluido = new core$1.EventEmitter();
|
|
248
|
-
this.totalRecords = 0;
|
|
249
|
-
this.successCount = 0;
|
|
250
|
-
this.failedCount = 0;
|
|
251
|
-
this.pendingCount = 0;
|
|
252
|
-
this.successProgress = '0%';
|
|
253
|
-
this.failedProgress = '0%';
|
|
254
|
-
this.pendingProgress = '100%';
|
|
255
|
-
this.processingProgress = '0%';
|
|
256
|
-
this.sortField = 'status';
|
|
257
|
-
this.sortOrder = 1;
|
|
258
|
-
}
|
|
259
|
-
PainelProcessamentoComponent_1 = PainelProcessamentoComponent;
|
|
260
|
-
PainelProcessamentoComponent.prototype.ngOnInit = function () {
|
|
261
|
-
this.initPanel();
|
|
262
|
-
};
|
|
263
|
-
PainelProcessamentoComponent.prototype.initPanel = function () {
|
|
264
|
-
this.gridColumns = this.getGridColumn();
|
|
265
|
-
this.initGrid();
|
|
266
|
-
this.initProgressBar();
|
|
267
|
-
};
|
|
268
|
-
PainelProcessamentoComponent.prototype.initProgressBar = function () {
|
|
269
|
-
this.successProgress = '0%';
|
|
270
|
-
this.failedProgress = '0%';
|
|
271
|
-
this.pendingProgress = '100%';
|
|
272
|
-
this.processingProgress = '0%';
|
|
273
|
-
this.totalRecords = this.params.registros.length;
|
|
274
|
-
this.pendingCount = this.totalRecords;
|
|
275
|
-
if (this.params.quantidadeChamadasSimultaneas > 1) {
|
|
276
|
-
this.processAllRecordsWithPLimit();
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
this.syncProcessRecord(0);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
PainelProcessamentoComponent.prototype.initGrid = function () {
|
|
283
|
-
this.gridData = [];
|
|
284
|
-
this.gridData = this.params.registros.map(function (registro) { return ({
|
|
285
|
-
registro: registro,
|
|
286
|
-
status: EnumProcessamentoStatus.PENDING,
|
|
287
|
-
label: registro.descricao
|
|
288
|
-
}); });
|
|
289
|
-
};
|
|
290
|
-
PainelProcessamentoComponent.prototype.getErrorMessage = function (error) {
|
|
291
|
-
var _a, _b;
|
|
292
|
-
try {
|
|
293
|
-
if (!error) {
|
|
294
|
-
return this.genericErrorMsg;
|
|
295
|
-
}
|
|
296
|
-
if ((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) {
|
|
297
|
-
return String(error.error.message);
|
|
298
|
-
}
|
|
299
|
-
if ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.message) {
|
|
300
|
-
return String(error.message.message);
|
|
301
|
-
}
|
|
302
|
-
return this.genericErrorMsg;
|
|
303
|
-
}
|
|
304
|
-
catch (_c) {
|
|
305
|
-
return this.genericErrorMsg;
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
Object.defineProperty(PainelProcessamentoComponent.prototype, "genericErrorMsg", {
|
|
309
|
-
get: function () {
|
|
310
|
-
return this.translate.instant(PainelProcessamentoComponent_1.GENERIC_ERR_KEY);
|
|
311
|
-
},
|
|
312
|
-
enumerable: true,
|
|
313
|
-
configurable: true
|
|
314
|
-
});
|
|
315
|
-
PainelProcessamentoComponent.prototype.updateRowSuccess = function (row, index) {
|
|
316
|
-
this.successCount++;
|
|
317
|
-
this.pendingCount--;
|
|
318
|
-
this.updateRowStatus(row, EnumProcessamentoStatus.SUCCESS);
|
|
319
|
-
this.processado.emit(row);
|
|
320
|
-
this.updateProgressBar();
|
|
321
|
-
};
|
|
322
|
-
PainelProcessamentoComponent.prototype.updateRowError = function (row, index, message) {
|
|
323
|
-
this.failedCount++;
|
|
324
|
-
this.pendingCount--;
|
|
325
|
-
this.updateRowStatus(row, EnumProcessamentoStatus.FAILED, message);
|
|
326
|
-
this.processado.emit(row);
|
|
327
|
-
this.updateProgressBar();
|
|
328
|
-
};
|
|
329
|
-
PainelProcessamentoComponent.prototype.syncProcessRecord = function (index) {
|
|
330
|
-
var _this = this;
|
|
331
|
-
if (this.pendingCount < 1) {
|
|
332
|
-
this.concluido.emit('ok');
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
this.updateRowStatus(this.gridData[index], EnumProcessamentoStatus.PROCESSING);
|
|
336
|
-
var record = this.params.registros[index];
|
|
337
|
-
var row = this.gridData.find(function (item) { return item.registro === record; });
|
|
338
|
-
if (record.apiEnvio) {
|
|
339
|
-
record.apiEnvio(record.objEnvio)
|
|
340
|
-
.subscribe(function () {
|
|
341
|
-
_this.updateRowSuccess(row, index);
|
|
342
|
-
_this.syncProcessRecord(index + 1);
|
|
343
|
-
}, function (error) {
|
|
344
|
-
_this.updateRowError(row, index, _this.getErrorMessage(error));
|
|
345
|
-
_this.syncProcessRecord(index + 1);
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
else {
|
|
349
|
-
this.failedCount = this.pendingCount;
|
|
350
|
-
this.pendingCount = 0;
|
|
351
|
-
this.updateRowStatus(row, EnumProcessamentoStatus.FAILED, this.translate.instant('tmsx_fnd.tmsx_angular_components.painel_processamento_api_error'));
|
|
352
|
-
this.updateProgressBar();
|
|
353
|
-
this.concluido.emit('erro');
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
PainelProcessamentoComponent.prototype.processAllRecordsWithPLimit = function () {
|
|
357
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
358
|
-
var pLimit$1, limit, promises, results;
|
|
359
|
-
var _this = this;
|
|
360
|
-
return __generator(this, function (_a) {
|
|
361
|
-
switch (_a.label) {
|
|
362
|
-
case 0:
|
|
363
|
-
pLimit$1 = pLimit;
|
|
364
|
-
limit = pLimit$1(this.params.quantidadeChamadasSimultaneas);
|
|
365
|
-
promises = this.params.registros.map(function (record, index) {
|
|
366
|
-
return limit(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
367
|
-
var row, result, error_1;
|
|
368
|
-
return __generator(this, function (_a) {
|
|
369
|
-
switch (_a.label) {
|
|
370
|
-
case 0:
|
|
371
|
-
row = this.gridData.find(function (item) { return item.registro === record; });
|
|
372
|
-
this.updateRowStatus(row, EnumProcessamentoStatus.PROCESSING);
|
|
373
|
-
_a.label = 1;
|
|
374
|
-
case 1:
|
|
375
|
-
_a.trys.push([1, 3, , 4]);
|
|
376
|
-
return [4 /*yield*/, record.apiEnvio(record.objEnvio).toPromise()];
|
|
377
|
-
case 2:
|
|
378
|
-
result = _a.sent();
|
|
379
|
-
this.updateRowSuccess(row, index);
|
|
380
|
-
return [2 /*return*/, { success: true, record: record, result: result }];
|
|
381
|
-
case 3:
|
|
382
|
-
error_1 = _a.sent();
|
|
383
|
-
this.updateRowError(row, index, this.getErrorMessage(error_1));
|
|
384
|
-
return [2 /*return*/, { success: false, record: record, error: error_1 }];
|
|
385
|
-
case 4: return [2 /*return*/];
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
}); });
|
|
389
|
-
});
|
|
390
|
-
return [4 /*yield*/, Promise.all(promises)];
|
|
391
|
-
case 1:
|
|
392
|
-
results = _a.sent();
|
|
393
|
-
this.concluido.emit(results);
|
|
394
|
-
return [2 /*return*/, results];
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
});
|
|
398
|
-
};
|
|
399
|
-
PainelProcessamentoComponent.prototype.updateProgressBar = function () {
|
|
400
|
-
var successWidth = (this.successCount / this.totalRecords) * 100;
|
|
401
|
-
var failedWidth = (this.failedCount / this.totalRecords) * 100;
|
|
402
|
-
var pendingWidth = (this.pendingCount / this.totalRecords) * 100;
|
|
403
|
-
var processedWidth = successWidth + failedWidth;
|
|
404
|
-
this.processingProgress = processedWidth.toFixed(0) + "%";
|
|
405
|
-
this.successProgress = successWidth.toFixed(0) + "%";
|
|
406
|
-
this.failedProgress = failedWidth.toFixed(0) + "%";
|
|
407
|
-
this.pendingProgress = pendingWidth.toFixed(0) + "%";
|
|
408
|
-
};
|
|
409
|
-
PainelProcessamentoComponent.prototype.updateRowStatus = function (row, status, message) {
|
|
410
|
-
row.status = status;
|
|
411
|
-
if (message) {
|
|
412
|
-
row.message = message;
|
|
413
|
-
}
|
|
414
|
-
this.sortGridData();
|
|
415
|
-
};
|
|
416
|
-
PainelProcessamentoComponent.prototype.sortGridData = function () {
|
|
417
|
-
var _this = this;
|
|
418
|
-
this.gridData.sort(function (a, b) {
|
|
419
|
-
var _a;
|
|
420
|
-
var statusOrder = (_a = {},
|
|
421
|
-
_a[EnumProcessamentoStatus.FAILED] = 1,
|
|
422
|
-
_a[EnumProcessamentoStatus.PROCESSING] = 2,
|
|
423
|
-
_a[EnumProcessamentoStatus.SUCCESS] = 3,
|
|
424
|
-
_a[EnumProcessamentoStatus.PENDING] = 4,
|
|
425
|
-
_a);
|
|
426
|
-
if (_this.sortField === 'status') {
|
|
427
|
-
return (statusOrder[a.status] - statusOrder[b.status]) * _this.sortOrder;
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
var valA = a[_this.sortField] || '';
|
|
431
|
-
var valB = b[_this.sortField] || '';
|
|
432
|
-
return valA.localeCompare(valB) * _this.sortOrder;
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
};
|
|
436
|
-
PainelProcessamentoComponent.prototype.getData = function (rowData, field) {
|
|
437
|
-
if (field === 'status') {
|
|
438
|
-
var text = this.translate.instant(EnumProcessamentoStatusTranslationMap[rowData.status]);
|
|
439
|
-
if (rowData.message) {
|
|
440
|
-
text += ": " + rowData.message;
|
|
441
|
-
}
|
|
442
|
-
return text;
|
|
443
|
-
}
|
|
444
|
-
return rowData[field];
|
|
445
|
-
};
|
|
446
|
-
PainelProcessamentoComponent.prototype.getClassStatus = function (rowData, field) {
|
|
447
|
-
if (field !== 'status') {
|
|
448
|
-
return '';
|
|
449
|
-
}
|
|
450
|
-
return "status " + rowData[field].toLowerCase();
|
|
451
|
-
};
|
|
452
|
-
PainelProcessamentoComponent.prototype.getGridColumn = function () {
|
|
453
|
-
return [
|
|
454
|
-
{
|
|
455
|
-
field: 'label',
|
|
456
|
-
header: this.translate.instant('tmsx_fnd.tmsx_angular_components.registro'),
|
|
457
|
-
style: { width: '50%' },
|
|
458
|
-
attributes: [],
|
|
459
|
-
type: angularComponents.EnumColumnFieldType.STRING
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
field: 'status',
|
|
463
|
-
header: this.translate.instant('tmsx_fnd.tmsx_angular_components.status'),
|
|
464
|
-
style: { width: '50%' },
|
|
465
|
-
attributes: [],
|
|
466
|
-
type: angularComponents.EnumColumnFieldType.STRING
|
|
467
|
-
},
|
|
468
|
-
];
|
|
469
|
-
};
|
|
470
|
-
var PainelProcessamentoComponent_1;
|
|
471
|
-
PainelProcessamentoComponent.GENERIC_ERR_KEY = 'tmsx_fnd.tmsx_angular_components.painel_processamento_generic_error';
|
|
472
|
-
PainelProcessamentoComponent.ctorParameters = function () { return [
|
|
473
|
-
{ type: core.TranslateService }
|
|
474
|
-
]; };
|
|
475
|
-
PainelProcessamentoComponent.ɵprov = core$1["ɵɵdefineInjectable"]({ factory: function PainelProcessamentoComponent_Factory() { return new PainelProcessamentoComponent(core$1["ɵɵinject"](core.TranslateService)); }, token: PainelProcessamentoComponent, providedIn: "root" });
|
|
476
|
-
__decorate([
|
|
477
|
-
core$1.Input()
|
|
478
|
-
], PainelProcessamentoComponent.prototype, "params", void 0);
|
|
479
|
-
__decorate([
|
|
480
|
-
core$1.Output()
|
|
481
|
-
], PainelProcessamentoComponent.prototype, "processado", void 0);
|
|
482
|
-
__decorate([
|
|
483
|
-
core$1.Output()
|
|
484
|
-
], PainelProcessamentoComponent.prototype, "concluido", void 0);
|
|
485
|
-
PainelProcessamentoComponent = PainelProcessamentoComponent_1 = __decorate([
|
|
486
|
-
core$1.Injectable({
|
|
487
|
-
providedIn: 'root'
|
|
488
|
-
}),
|
|
489
|
-
core$1.Component({
|
|
490
|
-
selector: 'tmsx-painel-processamento',
|
|
491
|
-
template: "<p-panel>\n <p-header>{{ this.params.titulo }} ({{processingProgress }})</p-header>\n\n <div class=\"progressbar\">\n <div class=\"success\"\n [ngClass]=\"successProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': successProgress }\"\n [sTooltip]=\"successProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n <div class=\"failed\"\n [ngClass]=\"failedProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': failedProgress }\"\n [sTooltip]=\"failedProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n <div class=\"pending\"\n [ngClass]=\"pendingProgress == '0%' ? '' : 'visible'\"\n [ngStyle]=\"{'width': pendingProgress }\"\n [sTooltip]=\"pendingProgress\"\n [escape]=\"false\"\n mobileBehavior=\"tap\"></div>\n </div>\n\n <p-table\n #myTable\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n [resizableColumns]=\"true\"\n sortMode=\"multiple\"\n [scrollable]=\"true\"\n [paginator]=\"true\"\n [rows]=\"10\"\n showInitialSortBadge=\"true\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [sortField]=\"sortField\"\n [sortOrder]=\"sortOrder\">\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [ngStyle]=\"col.style\">\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th scope=\"col\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.field\"\n [pSortableColumnDisabled]=\"col.disableColumnSort\"\n [ngStyle]=\"col.style\"\n pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{col.header}}</span>\n <p-sortIcon *ngIf=\"!col.disableColumnSort\" [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr>\n <td *ngFor=\"let col of columns\" [ngClass]=\"getClassStatus(rowData, col.field)\">\n {{ getData(rowData, col.field) }}\n </td>\n </tr>\n\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <s-table-paging\n [table]=\"myTable\"\n [totalRecords]=\"gridData.length\"\n [exportable]=\"false\"\n >\n </s-table-paging>\n </ng-template>\n </p-table>\n</p-panel>\n",
|
|
492
|
-
styles: [".progressbar{margin-bottom:30px;border-radius:20px;height:40px}.progressbar .visible:nth-child(1of.visible){border-top-left-radius:20px;border-bottom-left-radius:20px}.progressbar .visible:nth-last-child(1of.visible){border-top-right-radius:20px;border-bottom-right-radius:20px}.progressbar .failed,.progressbar .pending,.progressbar .success{display:inline-block;height:100%;width:0%}.progressbar .success{background-color:#4caf50}.progressbar .failed{background-color:#f44336}.progressbar .pending{background-color:#ccc}.status.success{color:#007504}.status.pending{color:#333}.status.failed{color:#8d0900}.status.processing{color:#b96f00}"]
|
|
493
|
-
})
|
|
494
|
-
], PainelProcessamentoComponent);
|
|
495
|
-
return PainelProcessamentoComponent;
|
|
496
|
-
}());
|
|
497
|
-
|
|
498
|
-
var PainelProcessamentoModule = /** @class */ (function () {
|
|
499
|
-
function PainelProcessamentoModule() {
|
|
500
|
-
}
|
|
501
|
-
PainelProcessamentoModule = __decorate([
|
|
502
|
-
core$1.NgModule({
|
|
503
|
-
imports: [
|
|
504
|
-
angularComponents.LocaleModule.forChild(),
|
|
505
|
-
core.TranslateModule.forChild(),
|
|
506
|
-
angularComponents.TooltipModule,
|
|
507
|
-
table.TableModule,
|
|
508
|
-
angularComponents.TableModule,
|
|
509
|
-
angularComponents.ButtonModule,
|
|
510
|
-
common.CommonModule,
|
|
511
|
-
panel.PanelModule,
|
|
512
|
-
],
|
|
513
|
-
declarations: [
|
|
514
|
-
PainelProcessamentoComponent
|
|
515
|
-
],
|
|
516
|
-
providers: [],
|
|
517
|
-
exports: [
|
|
518
|
-
PainelProcessamentoComponent
|
|
519
|
-
],
|
|
520
|
-
})
|
|
521
|
-
], PainelProcessamentoModule);
|
|
522
|
-
return PainelProcessamentoModule;
|
|
523
|
-
}());
|
|
524
|
-
|
|
525
|
-
var UtilsService = /** @class */ (function () {
|
|
526
|
-
function UtilsService(translate, dataPipe) {
|
|
527
|
-
this.translate = translate;
|
|
528
|
-
this.dataPipe = dataPipe;
|
|
529
|
-
}
|
|
530
|
-
UtilsService.prototype.getAuditCreatedBy = function (createdBy, createdDate) {
|
|
531
|
-
if (!createdBy || !createdDate) {
|
|
532
|
-
return '';
|
|
533
|
-
}
|
|
534
|
-
var date = '';
|
|
535
|
-
this.dataPipe.transform(createdDate).subscribe(function (item) { return date = item.split(' '); });
|
|
536
|
-
return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_created_by', { nome: createdBy, data: date[0], hora: date[1] });
|
|
537
|
-
};
|
|
538
|
-
UtilsService.prototype.getAuditModifiedBy = function (modifiedBy, modifiedDate) {
|
|
539
|
-
if (!modifiedBy || !modifiedDate) {
|
|
540
|
-
return '';
|
|
541
|
-
}
|
|
542
|
-
var date = '';
|
|
543
|
-
this.dataPipe.transform(modifiedDate).subscribe(function (item) { return date = item.split(' '); });
|
|
544
|
-
return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_modified_by', { nome: modifiedBy, data: date[0], hora: date[1] });
|
|
545
|
-
};
|
|
546
|
-
UtilsService.prototype.getAuditInactivatedBy = function (inactivatedBy, inactivatedDate) {
|
|
547
|
-
if (!inactivatedBy || !inactivatedDate) {
|
|
548
|
-
return '';
|
|
549
|
-
}
|
|
550
|
-
var date = '';
|
|
551
|
-
this.dataPipe.transform(inactivatedDate).subscribe(function (item) { return date = item.split(' '); });
|
|
552
|
-
return this.translate.instant('tmsx_fnd.tmsx_angular_components.audit_inactivated_by', { nome: inactivatedBy, data: date[0], hora: date[1] });
|
|
553
|
-
};
|
|
554
|
-
/* usage: [innerHTML]="getProp(rowData, 'nome')" */
|
|
555
|
-
UtilsService.prototype.getProp = function (obj, path, type) {
|
|
556
|
-
var value = path.split('.').reduce(function (result, prop) { return (result[prop] === undefined ? '' : result[prop]); }, obj);
|
|
557
|
-
if (value || value === 0) {
|
|
558
|
-
if (type) {
|
|
559
|
-
value = this.formatType(value, type);
|
|
560
|
-
}
|
|
561
|
-
return "<span>" + value + "</span>";
|
|
562
|
-
}
|
|
563
|
-
return "<span class=\"empty-grid\">" + this.translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_empty_field') + "</span>";
|
|
564
|
-
};
|
|
565
|
-
UtilsService.prototype.formatType = function (value, type) {
|
|
566
|
-
if (value) {
|
|
567
|
-
if (type === 'date') {
|
|
568
|
-
var date_1 = '';
|
|
569
|
-
this.dataPipe.transform(value).subscribe(function (item) { return date_1 = item.split(' '); });
|
|
570
|
-
return date_1[0];
|
|
571
|
-
}
|
|
572
|
-
if (type === 'datetime') {
|
|
573
|
-
var date_2 = '';
|
|
574
|
-
this.dataPipe.transform(value).subscribe(function (item) { return date_2 = item; });
|
|
575
|
-
return date_2;
|
|
576
|
-
}
|
|
577
|
-
if (type === 'decimal') {
|
|
578
|
-
if (typeof value === 'string') {
|
|
579
|
-
value = Number(value);
|
|
580
|
-
}
|
|
581
|
-
return value.toLocaleString('pt-BR', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
582
|
-
}
|
|
583
|
-
if (type === 'currency') {
|
|
584
|
-
return value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' });
|
|
585
|
-
}
|
|
586
|
-
if (type === 'cep') {
|
|
587
|
-
return value.replace(/^(\d{2})(\d{3})(\d{3})/, '$1.$2-$3');
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
return value;
|
|
591
|
-
};
|
|
592
|
-
/* usage: [ngClass]="emptyGridClass(value)" */
|
|
593
|
-
UtilsService.prototype.emptyGridClass = function (value) {
|
|
594
|
-
if (!value || value === this.translate.instant('tmsx_fnd.replicacao.list_grid_empty_field')) {
|
|
595
|
-
return 'empty-grid';
|
|
596
|
-
}
|
|
597
|
-
return '';
|
|
598
|
-
};
|
|
599
|
-
UtilsService.prototype.infoContent = function (entity) {
|
|
600
|
-
var text = '';
|
|
601
|
-
if (!entity) {
|
|
602
|
-
return this.translate.instant("tmsx_fnd.tmsx_angular_components.condicao_valor_lookup_condicional_no_audit");
|
|
603
|
-
}
|
|
604
|
-
text += this.getAuditCreatedBy(entity.createdBy, entity.createdDate);
|
|
605
|
-
if (text) {
|
|
606
|
-
text += '\n';
|
|
607
|
-
}
|
|
608
|
-
text += this.getAuditModifiedBy(entity.lastModifiedBy, entity.lastModifiedDate);
|
|
609
|
-
return text;
|
|
610
|
-
};
|
|
611
|
-
UtilsService.prototype.formatCurrency = function (value) {
|
|
612
|
-
return value.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' });
|
|
613
|
-
};
|
|
614
|
-
UtilsService.prototype.getAtivoTokenLabel = function (formField, value, translate) {
|
|
615
|
-
var _a = formField, name = _a.name, type = _a.type, label = _a.label;
|
|
616
|
-
if (type === angularComponents.FieldType.Radio) {
|
|
617
|
-
var labelValue = value
|
|
618
|
-
? translate.instant('tmsx_fnd.tmsx_angular_components.situacao_ativo_true')
|
|
619
|
-
: translate.instant('tmsx_fnd.tmsx_angular_components.situacao_ativo_false');
|
|
620
|
-
return { id: name, label: label + ": " + labelValue };
|
|
621
|
-
}
|
|
622
|
-
return this.createFilterTokens(formField, value, translate);
|
|
623
|
-
};
|
|
624
|
-
UtilsService.prototype.getUtilsProp = function (obj, path) {
|
|
625
|
-
return path.split('.').reduce(function (result, prop) { return (result[prop] === undefined ? '' : result[prop]); }, obj);
|
|
626
|
-
};
|
|
627
|
-
UtilsService.prototype.createFilterTokens = function (formField, value, translate) {
|
|
628
|
-
var _a = formField, name = _a.name, type = _a.type, label = _a.label, searchFields = _a.searchFields, options = _a.options;
|
|
629
|
-
var labelValue = this.getLabelValueByType(type, value, searchFields, options, translate);
|
|
630
|
-
return { id: name, label: label + ": " + labelValue };
|
|
631
|
-
};
|
|
632
|
-
UtilsService.prototype.getLabelValueByType = function (type, value, searchFields, options, translate) {
|
|
633
|
-
switch (type) {
|
|
634
|
-
case angularComponents.FieldType.Date:
|
|
635
|
-
return this.getDateLabel(value);
|
|
636
|
-
case angularComponents.FieldType.Time:
|
|
637
|
-
return this.getTimeFromDate(value);
|
|
638
|
-
case angularComponents.FieldType.LocalDateTime:
|
|
639
|
-
case angularComponents.FieldType.DateTime:
|
|
640
|
-
return this.getDateTimeFromDate(value);
|
|
641
|
-
case angularComponents.FieldType.Lookup:
|
|
642
|
-
return this.getLookupLabel(value, searchFields);
|
|
643
|
-
case angularComponents.FieldType.Enum:
|
|
644
|
-
return this.getEnumLabel(value, options);
|
|
645
|
-
case angularComponents.FieldType.Boolean:
|
|
646
|
-
return this.getBooleanLabel(value, translate);
|
|
647
|
-
default:
|
|
648
|
-
return value;
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
UtilsService.prototype.getDateLabel = function (value) {
|
|
652
|
-
var dateObj = value instanceof Date ? value : new Date(value);
|
|
653
|
-
return !isNaN(dateObj.getTime()) ? dateObj.toLocaleDateString('pt-BR') : value;
|
|
654
|
-
};
|
|
655
|
-
UtilsService.prototype.getLookupLabel = function (value, searchFields) {
|
|
656
|
-
var _this = this;
|
|
657
|
-
return searchFields.map(function (field) { return _this.getUtilsProp(value, field.name); }).join(' - ');
|
|
658
|
-
};
|
|
659
|
-
UtilsService.prototype.getEnumLabel = function (value, options) {
|
|
660
|
-
var option = options.find(function (opt) { return opt.value === value; });
|
|
661
|
-
return option ? option.label : value;
|
|
662
|
-
};
|
|
663
|
-
UtilsService.prototype.getBooleanLabel = function (value, translate) {
|
|
664
|
-
return value
|
|
665
|
-
? translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_boolean_true')
|
|
666
|
-
: translate.instant('tmsx_fnd.tmsx_angular_components.list_grid_boolean_false');
|
|
667
|
-
};
|
|
668
|
-
UtilsService.prototype.getTimeFromDate = function (value) {
|
|
669
|
-
var dateObj;
|
|
670
|
-
if (typeof value === 'string' && /^\d{2}:\d{2}(:\d{2})?$/.test(value)) {
|
|
671
|
-
var _a = __read(value.split(':'), 3), h = _a[0], m = _a[1], _b = _a[2], s = _b === void 0 ? '00' : _b;
|
|
672
|
-
dateObj = new Date();
|
|
673
|
-
dateObj.setHours(+h, +m, +s, 0);
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
dateObj = value instanceof Date ? value : new Date(value);
|
|
677
|
-
}
|
|
678
|
-
if (!isNaN(dateObj.getTime())) {
|
|
679
|
-
return dateObj.toLocaleTimeString('pt-BR', {
|
|
680
|
-
hour: '2-digit',
|
|
681
|
-
minute: '2-digit',
|
|
682
|
-
second: '2-digit',
|
|
683
|
-
hour12: false
|
|
684
|
-
}); // HH:mm:ss
|
|
685
|
-
}
|
|
686
|
-
return value;
|
|
687
|
-
};
|
|
688
|
-
UtilsService.prototype.getDateTimeFromDate = function (value) {
|
|
689
|
-
var dateObj = value instanceof Date ? value : new Date(value);
|
|
690
|
-
if (!isNaN(dateObj.getTime())) {
|
|
691
|
-
var datePart = dateObj.toLocaleDateString('pt-BR'); // DD/MM/AAAA
|
|
692
|
-
var timePart = dateObj.toLocaleTimeString('pt-BR', {
|
|
693
|
-
hour: '2-digit',
|
|
694
|
-
minute: '2-digit',
|
|
695
|
-
second: '2-digit',
|
|
696
|
-
hour12: false
|
|
697
|
-
}); // HH:mm:ss
|
|
698
|
-
return datePart + " " + timePart;
|
|
699
|
-
}
|
|
700
|
-
return value;
|
|
701
|
-
};
|
|
702
|
-
UtilsService.ctorParameters = function () { return [
|
|
703
|
-
{ type: core.TranslateService },
|
|
704
|
-
{ type: angularComponents.LocalizedDatePipe }
|
|
705
|
-
]; };
|
|
706
|
-
UtilsService.ɵprov = core$1["ɵɵdefineInjectable"]({ factory: function UtilsService_Factory() { return new UtilsService(core$1["ɵɵinject"](core.TranslateService), core$1["ɵɵinject"](angularComponents.LocalizedDatePipe)); }, token: UtilsService, providedIn: "root" });
|
|
707
|
-
UtilsService = __decorate([
|
|
708
|
-
core$1.Injectable({
|
|
709
|
-
providedIn: 'root'
|
|
710
|
-
})
|
|
711
|
-
], UtilsService);
|
|
712
|
-
return UtilsService;
|
|
713
|
-
}());
|
|
714
|
-
|
|
715
|
-
var GridEditableNestedComponent = /** @class */ (function () {
|
|
716
|
-
function GridEditableNestedComponent(changeDetectorRef, translate, utils, hotkeysService) {
|
|
717
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
718
|
-
this.translate = translate;
|
|
719
|
-
this.utils = utils;
|
|
720
|
-
this.hotkeysService = hotkeysService;
|
|
721
|
-
this.openDetails = new core$1.EventEmitter();
|
|
722
|
-
this.paging = new core$1.EventEmitter();
|
|
723
|
-
this.delete = new core$1.EventEmitter();
|
|
724
|
-
this.save = new core$1.EventEmitter();
|
|
725
|
-
this.add = new core$1.EventEmitter();
|
|
726
|
-
this.clonedData = {};
|
|
727
|
-
this.gridLoading = true;
|
|
728
|
-
this.editing = false;
|
|
729
|
-
this.lazy = true;
|
|
730
|
-
this.deleteEnabled = false;
|
|
731
|
-
this.editEnabled = false;
|
|
732
|
-
this.addEnabled = false;
|
|
733
|
-
this.detailsEnabled = false;
|
|
734
|
-
this.calendarTooltipText = '';
|
|
735
|
-
this.currentListParams = { page: 0, size: 5, sort: [] };
|
|
736
|
-
this.gridData = [];
|
|
737
|
-
this.gridColumns = [];
|
|
738
|
-
this.gridTotalRecords = 0;
|
|
739
|
-
this.selected = [];
|
|
740
|
-
this.nestedGridLoading = false;
|
|
741
|
-
this.frozenPosition = 'left';
|
|
742
|
-
this.frozenWidth = '200px';
|
|
743
|
-
this.frozenColumns = [];
|
|
744
|
-
this.ngUnsubscribe = new rxjs.Subject();
|
|
745
|
-
this.calendarTooltipText = this.translate.instant('tmsx_fnd.tmsx_angular_components.grid_editable_nested_calendar_required');
|
|
746
|
-
}
|
|
747
|
-
GridEditableNestedComponent.prototype.ngOnInit = function () {
|
|
748
|
-
this.setGridData();
|
|
749
|
-
this.setHotkeys();
|
|
750
|
-
};
|
|
751
|
-
GridEditableNestedComponent.prototype.ngOnChanges = function (changes) {
|
|
752
|
-
if (changes.config) {
|
|
753
|
-
this.setGridData();
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
GridEditableNestedComponent.prototype.formatData = function (column, value) {
|
|
757
|
-
return value;
|
|
758
|
-
};
|
|
759
|
-
GridEditableNestedComponent.prototype.setGridData = function () {
|
|
760
|
-
if (!this.config) {
|
|
761
|
-
return;
|
|
762
|
-
}
|
|
763
|
-
var _a = this.config, data = _a.data, size = _a.size, columns = _a.columns, frozenPosition = _a.frozenPosition, frozenColumns = _a.frozenColumns, editing = _a.editing, lazy = _a.lazy, deleteActionsEnabled = _a.deleteActionsEnabled, editEnabled = _a.editEnabled, addEnabled = _a.addEnabled, editActionsEnabled = _a.editActionsEnabled;
|
|
764
|
-
this.gridData = data !== null && data !== void 0 ? data : [];
|
|
765
|
-
this.gridTotalRecords = size !== null && size !== void 0 ? size : 0;
|
|
766
|
-
this.gridColumns = columns !== null && columns !== void 0 ? columns : [];
|
|
767
|
-
this.frozenPosition = frozenPosition !== null && frozenPosition !== void 0 ? frozenPosition : 'left';
|
|
768
|
-
this.frozenColumns = frozenColumns !== null && frozenColumns !== void 0 ? frozenColumns : [];
|
|
769
|
-
this.frozenWidth = this.calculateFrozenWidth(this.frozenColumns);
|
|
770
|
-
this.editing = !!editing;
|
|
771
|
-
this.lazy = !!lazy;
|
|
772
|
-
this.deleteEnabled = !!deleteActionsEnabled;
|
|
773
|
-
this.editEnabled = !!editEnabled;
|
|
774
|
-
this.addEnabled = !!addEnabled;
|
|
775
|
-
this.detailsEnabled = !!editActionsEnabled;
|
|
776
|
-
this.changeDetectorRef.detectChanges();
|
|
777
|
-
this.nestedGridLoading = false;
|
|
778
|
-
this.gridLoading = false;
|
|
779
|
-
};
|
|
780
|
-
GridEditableNestedComponent.prototype.calculateFrozenWidth = function (frozenColumns) {
|
|
781
|
-
var gutter = 120;
|
|
782
|
-
if (!(frozenColumns === null || frozenColumns === void 0 ? void 0 : frozenColumns.length)) {
|
|
783
|
-
return '120px';
|
|
784
|
-
}
|
|
785
|
-
var totalWidth = frozenColumns.reduce(function (sum, col) { return sum + gutter + (parseInt(col.width, 10) || 0); }, 0);
|
|
786
|
-
return totalWidth + "px";
|
|
787
|
-
};
|
|
788
|
-
GridEditableNestedComponent.prototype.getActions = function (data) {
|
|
789
|
-
var _this = this;
|
|
790
|
-
return [
|
|
791
|
-
{
|
|
792
|
-
id: 'edit',
|
|
793
|
-
label: this.translate.instant('tmsx_fnd.tmsx_angular_components.edit'),
|
|
794
|
-
disabled: !this.detailsEnabled,
|
|
795
|
-
command: function () {
|
|
796
|
-
_this.openRowDetails(data.id);
|
|
797
|
-
},
|
|
798
|
-
},
|
|
799
|
-
{ separator: true },
|
|
800
|
-
{
|
|
801
|
-
id: 'delete',
|
|
802
|
-
label: this.translate.instant('tmsx_fnd.tmsx_angular_components.delete'),
|
|
803
|
-
disabled: !this.deleteEnabled,
|
|
804
|
-
command: function () {
|
|
805
|
-
_this.onDelete(data.id);
|
|
806
|
-
},
|
|
807
|
-
},
|
|
808
|
-
];
|
|
809
|
-
};
|
|
810
|
-
GridEditableNestedComponent.prototype.updateGridData = function (event) {
|
|
811
|
-
var size = event.rows ? event.rows : 10;
|
|
812
|
-
var page = event.first ? event.first / size : 0;
|
|
813
|
-
this.gridLoading = true;
|
|
814
|
-
if (this.clonedData && Object.keys(this.clonedData).length) {
|
|
815
|
-
this.clonedData = {};
|
|
816
|
-
this.table.editingRowKeys = {};
|
|
817
|
-
}
|
|
818
|
-
this.paging.emit({ page: page, size: size });
|
|
819
|
-
};
|
|
820
|
-
GridEditableNestedComponent.prototype.updateNestedGridData = function (event, rowData) {
|
|
821
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
822
|
-
var size, page, sort;
|
|
823
|
-
return __generator(this, function (_a) {
|
|
824
|
-
switch (_a.label) {
|
|
825
|
-
case 0:
|
|
826
|
-
size = event.rows ? event.rows : 10;
|
|
827
|
-
page = event.first ? event.first / size : 0;
|
|
828
|
-
sort = event.multiSortMeta || [];
|
|
829
|
-
rowData.nestedGridLoading = true;
|
|
830
|
-
return [4 /*yield*/, this.nestedFunction({ page: page, size: size, sort: sort }, rowData)];
|
|
831
|
-
case 1:
|
|
832
|
-
_a.sent();
|
|
833
|
-
return [2 /*return*/];
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
});
|
|
837
|
-
};
|
|
838
|
-
GridEditableNestedComponent.prototype.onTab = function (event) {
|
|
839
|
-
if (event.key !== 'Tab') {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
event.preventDefault();
|
|
843
|
-
var focusables = Array.from(document.querySelectorAll('p-cellEditor input, p-cellEditor textarea, p-cellEditor [tabindex="0"]')).filter(function (el) { return el.offsetParent !== null; });
|
|
844
|
-
var currentIndex = focusables.indexOf(event.target);
|
|
845
|
-
var next;
|
|
846
|
-
if (event.shiftKey) {
|
|
847
|
-
next = focusables[currentIndex - 1] || focusables[focusables.length - 1];
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
next = focusables[currentIndex + 1] || focusables[0];
|
|
851
|
-
}
|
|
852
|
-
if (next) {
|
|
853
|
-
next.focus();
|
|
854
|
-
}
|
|
855
|
-
};
|
|
856
|
-
GridEditableNestedComponent.prototype.getRowIndex = function () {
|
|
857
|
-
var page = this.currentListParams.page || 0;
|
|
858
|
-
var size = this.currentListParams.size || 0;
|
|
859
|
-
return page * size;
|
|
860
|
-
};
|
|
861
|
-
GridEditableNestedComponent.prototype.getPageSize = function () {
|
|
862
|
-
var _a;
|
|
863
|
-
return (_a = this.currentListParams.size) !== null && _a !== void 0 ? _a : 0;
|
|
864
|
-
};
|
|
865
|
-
GridEditableNestedComponent.prototype.openRowDetails = function (id) {
|
|
866
|
-
this.openDetails.emit(id);
|
|
867
|
-
};
|
|
868
|
-
GridEditableNestedComponent.prototype.onDelete = function (id) {
|
|
869
|
-
this.delete.emit(id);
|
|
870
|
-
};
|
|
871
|
-
GridEditableNestedComponent.prototype.onAdd = function () {
|
|
872
|
-
this.add.emit();
|
|
873
|
-
};
|
|
874
|
-
GridEditableNestedComponent.prototype.ngOnDestroy = function () {
|
|
875
|
-
this.ngUnsubscribe.next();
|
|
876
|
-
this.ngUnsubscribe.complete();
|
|
877
|
-
};
|
|
878
|
-
GridEditableNestedComponent.prototype.onEditSave = function () {
|
|
879
|
-
this.saveAllRows();
|
|
880
|
-
};
|
|
881
|
-
GridEditableNestedComponent.prototype.onEditCancel = function () {
|
|
882
|
-
var _this = this;
|
|
883
|
-
this.gridData.forEach(function (data) {
|
|
884
|
-
if (_this.clonedData[data.id]) {
|
|
885
|
-
var index = _this.gridData.findIndex(function (row) { return row.id === data.id; });
|
|
886
|
-
_this.gridData[index] = _this.clonedData[data.id];
|
|
887
|
-
delete _this.clonedData[data.id];
|
|
888
|
-
}
|
|
889
|
-
_this.table.cancelRowEdit(data);
|
|
890
|
-
});
|
|
891
|
-
this.editing = false;
|
|
892
|
-
};
|
|
893
|
-
GridEditableNestedComponent.prototype.initAllRowsEdit = function () {
|
|
894
|
-
var _this = this;
|
|
895
|
-
this.gridData.forEach(function (data) {
|
|
896
|
-
_this.editing = true;
|
|
897
|
-
_this.table.initRowEdit(data);
|
|
898
|
-
_this.clonedData[data.id] = __assign({}, data);
|
|
899
|
-
});
|
|
900
|
-
};
|
|
901
|
-
GridEditableNestedComponent.prototype.saveAllRows = function () {
|
|
902
|
-
var _this = this;
|
|
903
|
-
this.gridData.forEach(function (data) {
|
|
904
|
-
if (_this.clonedData[data.id]) {
|
|
905
|
-
delete _this.clonedData[data.id];
|
|
906
|
-
}
|
|
907
|
-
_this.table.cancelRowEdit(data);
|
|
908
|
-
});
|
|
909
|
-
this.editing = false;
|
|
910
|
-
this.save.emit(this.gridData);
|
|
911
|
-
};
|
|
912
|
-
GridEditableNestedComponent.prototype.formatRowData = function (field) {
|
|
913
|
-
return field;
|
|
914
|
-
};
|
|
915
|
-
GridEditableNestedComponent.prototype.filterOptions = function (event) {
|
|
916
|
-
return event;
|
|
917
|
-
};
|
|
918
|
-
GridEditableNestedComponent.prototype.getSpanProp = function (obj, path, type) {
|
|
919
|
-
type = type === null || type === void 0 ? void 0 : type.toLowerCase();
|
|
920
|
-
var value = this.utils.getProp(obj, path, type);
|
|
921
|
-
if (value === '<span>0</span>' && type === 'decimal') {
|
|
922
|
-
return '<span>0,00</span>';
|
|
923
|
-
}
|
|
924
|
-
if (!obj.tiposDados) {
|
|
925
|
-
return value;
|
|
926
|
-
}
|
|
927
|
-
if ('MONETARIO' === obj.tiposDados[path]) {
|
|
928
|
-
return 'R$ ' + value;
|
|
929
|
-
}
|
|
930
|
-
if ('PERCENTUAL' === obj.tiposDados[path]) {
|
|
931
|
-
return value + ' %';
|
|
932
|
-
}
|
|
933
|
-
return value;
|
|
934
|
-
};
|
|
935
|
-
GridEditableNestedComponent.prototype.setHotkeys = function () {
|
|
936
|
-
var _this = this;
|
|
937
|
-
this.hotkeysService.add(new angular2Hotkeys.Hotkey('alt+shift+n', function () {
|
|
938
|
-
_this.onAdd();
|
|
939
|
-
return false;
|
|
940
|
-
}, ['INPUT', 'SELECT', 'TEXTAREA']));
|
|
941
|
-
};
|
|
942
|
-
GridEditableNestedComponent.ctorParameters = function () { return [
|
|
943
|
-
{ type: core$1.ChangeDetectorRef },
|
|
944
|
-
{ type: core.TranslateService },
|
|
945
|
-
{ type: UtilsService },
|
|
946
|
-
{ type: angular2Hotkeys.HotkeysService }
|
|
947
|
-
]; };
|
|
948
|
-
GridEditableNestedComponent.ɵprov = core$1["ɵɵdefineInjectable"]({ factory: function GridEditableNestedComponent_Factory() { return new GridEditableNestedComponent(core$1["ɵɵinject"](core$1.ChangeDetectorRef), core$1["ɵɵinject"](core.TranslateService), core$1["ɵɵinject"](UtilsService), core$1["ɵɵinject"](angular2Hotkeys.HotkeysService)); }, token: GridEditableNestedComponent, providedIn: "root" });
|
|
949
|
-
__decorate([
|
|
950
|
-
core$1.Input()
|
|
951
|
-
], GridEditableNestedComponent.prototype, "config", void 0);
|
|
952
|
-
__decorate([
|
|
953
|
-
core$1.Input()
|
|
954
|
-
], GridEditableNestedComponent.prototype, "nestedFunction", void 0);
|
|
955
|
-
__decorate([
|
|
956
|
-
core$1.Output()
|
|
957
|
-
], GridEditableNestedComponent.prototype, "openDetails", void 0);
|
|
958
|
-
__decorate([
|
|
959
|
-
core$1.Output()
|
|
960
|
-
], GridEditableNestedComponent.prototype, "paging", void 0);
|
|
961
|
-
__decorate([
|
|
962
|
-
core$1.Output()
|
|
963
|
-
], GridEditableNestedComponent.prototype, "delete", void 0);
|
|
964
|
-
__decorate([
|
|
965
|
-
core$1.Output()
|
|
966
|
-
], GridEditableNestedComponent.prototype, "save", void 0);
|
|
967
|
-
__decorate([
|
|
968
|
-
core$1.Output()
|
|
969
|
-
], GridEditableNestedComponent.prototype, "add", void 0);
|
|
970
|
-
__decorate([
|
|
971
|
-
core$1.ViewChild("table", { static: false })
|
|
972
|
-
], GridEditableNestedComponent.prototype, "table", void 0);
|
|
973
|
-
GridEditableNestedComponent = __decorate([
|
|
974
|
-
core$1.Injectable({
|
|
975
|
-
providedIn: 'root'
|
|
976
|
-
}),
|
|
977
|
-
core$1.Component({
|
|
978
|
-
selector: 'tmsx-grid-editable-nested',
|
|
979
|
-
template: "<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <s-button id=\"add-button\"\n data-cy=\"add-button\"\n priority=\"primary\" type=\"button\"\n [label]=\"'tmsx_fnd.tmsx_angular_components.add' | translate\"\n tooltip=\"{{'tmsx_fnd.tmsx_angular_components.add' | translate}} (Alt + Shift + N)\"\n [disabled]=\"!addEnabled\"\n (click)=\"onAdd()\">\n </s-button>\n <s-button\n *ngIf=\"!editing\"\n priority=\"primary\"\n iconClass=\"fa fa-edit\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar' | translate}}\"\n tooltip=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar' | translate}}\"\n [disabled]=\"!editEnabled\"\n (click)=\"initAllRowsEdit()\"\n ></s-button>\n <s-button\n *ngIf=\"editing\"\n priority=\"primary\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_salvar' | translate}}\"\n iconClass=\"fa fa-check\"\n [disabled]=\"false\"\n (click)=\"onEditSave()\"\n ></s-button>\n <s-button\n *ngIf=\"editing\"\n priority=\"default\"\n label=\"{{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_cancelar' | translate}}\"\n iconClass=\"fa fa-times\"\n [disabled]=\"false\"\n (click)=\"onEditCancel()\"\n ></s-button>\n <p-table\n selectionMode=\"single\"\n [(selection)]=\"selected\"\n [value]=\"gridData\"\n [columns]=\"gridColumns\"\n dataKey=\"id\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [paginator]=\"true\"\n [totalRecords]=\"gridTotalRecords\"\n [lazy]=\"lazy\"\n (onLazyLoad)=\"updateGridData($event)\"\n *sLoadingState=\"gridLoading\"\n sortMode=\"multiple\"\n [frozenWidth]=\"frozenWidth\"\n [scrollable]=\"true\"\n [sTableFrozenPosition]=\"frozenPosition\"\n [sTableFrozenValue]=\"gridData\"\n editMode=\"row\"\n #table\n >\n <ng-template pTemplate=\"frozencolgroup\" let-columns>\n <colgroup>\n <col class=\"col50\" />\n <col *ngFor=\"let col of frozenColumns\" class=\"col200\" />\n <col class=\"frozenButton\" />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"frozenheader\">\n <tr>\n <th pResizableColumn scope=\"col\"></th>\n <th pResizableColumn *ngFor=\"let col of frozenColumns\" scope=\"col\">{{ col.header }}</th>\n <th pResizableColumn scope=\"col\"></th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"frozenbody\" let-rowData let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"col50\" tabindex=\"0\" [sRowToggler]=\"rowData\">\n <i class=\"fa fa-{{ expanded ? 'minus' : 'plus' }} \"></i>\n </td>\n <td *ngFor=\"let col of frozenColumns\" class=\"colText\"\n tooltipPosition=\"top\" showDelay=\"500\"\n [innerHTML]=\"getSpanProp(rowData, col.field)\">\n </td>\n <td class=\"frozenButton\">\n <s-button\n id=\"edit-button\"\n data-cy=\"edit-button\"\n priority=\"default\"\n type=\"button\"\n size=\"small\"\n [auxiliary]=\"true\"\n [disabled]=\"false\"\n [model]=\"getActions(rowData)\">\n </s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" scope=\"col\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-expanded=\"expanded\" let-columns=\"columns\">\n <tr sNavigation tabindex=\"0\" [pEditableRow]=\"rowData\">\n <td\n *ngFor=\"let col of columns\"\n [ngClass]=\"editing? 'editPadding': ''\"\n pResizableColumn\n [pTooltip]=\"rowData[col.field]\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n tabindex=\"0\"\n class=\"col80 colText\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <div class=\"ui-fluid\">\n <ng-container [ngSwitch]=\"col.type\">\n <ng-container *ngSwitchCase=\"'Text'\">\n <span>{{ rowData[col.field] }}</span>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Date'\">\n <p-calendar\n [(ngModel)]=\"rowData[col.field]\"\n appendTo=\"body\"\n [showIcon]=\"true\"\n [required]=\"true\"\n pTooltip=\"{{ calendarTooltipText }}\"\n tooltipPosition=\"bottom\"\n [tooltipDisabled]=\"rowData[col.field]\"\n ></p-calendar>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Autocomplete'\">\n <p-autoComplete\n [(ngModel)]=\"rowData[col.field]\"\n [suggestions]=\"col.options\"\n appendTo=\"body\"\n (completeMethod)=\"filterOptions($event)\"\n [dropdown]=\"true\"\n [forceSelection]=\"true\"\n ></p-autoComplete>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'Decimal'\">\n <div class=\"ui-inputgroup\">\n <span class=\"ui-inputgroup-addon\"\n *ngIf=\"'MONETARIO' === rowData.tiposDados[col.field]\"\n >R$</span>\n <input sNumberInput [scale]=\"2\"\n alignTo=\"right\"\n thousandsSeparator=\".\"\n pInputText\n [(ngModel)]=\"rowData[col.field]\"\n (keydown)=\"onTab($event)\"\n />\n <span class=\"ui-inputgroup-addon\"\n *ngIf=\"'PERCENTUAL' === rowData.tiposDados[col.field]\"\n >%</span>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <input pInputText type=\"text\"\n [(ngModel)]=\"rowData[col.field]\"\n (keydown)=\"onTab($event)\"\n />\n </ng-container>\n </ng-container>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"output\">\n <div [innerHTML]=\"getSpanProp(rowData, col.field, col.type)\"></div>\n </ng-template>\n </p-cellEditor>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"rowexpansion\" let-rowData>\n <tr class=\"sds-expanded-row\">\n <td [attr.colspan]=\"gridColumns.length + 1\">\n <p-table\n [value]=\"rowData.nestedGridData\"\n [columns]=\"rowData.nestedGridColumns\"\n dataKey=\"id\"\n rows=\"5\"\n [first]=\"getRowIndex()\"\n [rows]=\"getPageSize()\"\n [rowsPerPageOptions]=\"[5, 10, 20, 50]\"\n [paginator]=\"true\"\n [totalRecords]=\"rowData.nestedGridTotalRecords\"\n [responsive]=\"true\"\n [lazy]=\"true\"\n (onLazyLoad)=\"updateNestedGridData($event, rowData)\"\n sortMode=\"multiple\"\n *sLoadingState=\"rowData.nestedGridLoading\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" scope=\"col\"\n [pSortableColumn]=\"col.field\">\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\n <tr [pSelectableRow]=\"rowData\">\n <td *ngFor=\"let col of columns\" class=\"colText\">\n {{ formatData(col, rowData[col.field]) }}\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ rowData.nestedGridTotalRecords }}\n {{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging' | translate}}\n </span>\n </ng-template>\n </p-table>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate=\"paginatorright\">\n <span>\n {{ gridTotalRecords }}\n {{'tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging' | translate}}\n </span>\n </ng-template>\n </p-table>\n </div>\n</div>\n",
|
|
980
|
-
styles: [":host ::ng-deep div.contents{margin-top:15px}input{max-width:100%}.col50{width:50px}.col80{width:80px}.col200{width:200px}.colText{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.frozenButton{width:70px;padding:5px}.editPadding{padding-top:8px;padding-bottom:9px}"]
|
|
981
|
-
})
|
|
982
|
-
], GridEditableNestedComponent);
|
|
983
|
-
return GridEditableNestedComponent;
|
|
984
|
-
}());
|
|
985
|
-
|
|
986
|
-
var GridEditableNestedModule = /** @class */ (function () {
|
|
987
|
-
function GridEditableNestedModule() {
|
|
988
|
-
}
|
|
989
|
-
GridEditableNestedModule = __decorate([
|
|
990
|
-
core$1.NgModule({
|
|
991
|
-
imports: [
|
|
992
|
-
common.CommonModule,
|
|
993
|
-
angularComponents.LocaleModule.forChild(),
|
|
994
|
-
core.TranslateModule.forChild(),
|
|
995
|
-
angularComponents.ButtonModule,
|
|
996
|
-
angularComponents.TableModule,
|
|
997
|
-
angularComponents.TooltipModule,
|
|
998
|
-
angularComponents.LoadingStateModule,
|
|
999
|
-
angularComponents.NumberInputModule,
|
|
1000
|
-
angularComponents.BreadcrumbModule,
|
|
1001
|
-
angularComponents.ControlErrorsModule,
|
|
1002
|
-
angularComponents.CustomFieldsModule,
|
|
1003
|
-
angularComponents.DynamicFormModule,
|
|
1004
|
-
angularComponents.EmptyStateModule,
|
|
1005
|
-
angularComponents.TokenListModule,
|
|
1006
|
-
// PrimeNG modules
|
|
1007
|
-
toast.ToastModule,
|
|
1008
|
-
table.TableModule,
|
|
1009
|
-
tooltip.TooltipModule,
|
|
1010
|
-
panel.PanelModule,
|
|
1011
|
-
inputtext.InputTextModule,
|
|
1012
|
-
confirmdialog.ConfirmDialogModule,
|
|
1013
|
-
calendar.CalendarModule,
|
|
1014
|
-
dropdown.DropdownModule,
|
|
1015
|
-
api.SharedModule,
|
|
1016
|
-
autocomplete.AutoCompleteModule,
|
|
1017
|
-
checkbox.CheckboxModule,
|
|
1018
|
-
// Angular modules
|
|
1019
|
-
forms.FormsModule,
|
|
1020
|
-
forms.ReactiveFormsModule
|
|
1021
|
-
],
|
|
1022
|
-
declarations: [
|
|
1023
|
-
GridEditableNestedComponent,
|
|
1024
|
-
],
|
|
1025
|
-
providers: [],
|
|
1026
|
-
exports: [
|
|
1027
|
-
GridEditableNestedComponent,
|
|
1028
|
-
],
|
|
1029
|
-
})
|
|
1030
|
-
], GridEditableNestedModule);
|
|
1031
|
-
return GridEditableNestedModule;
|
|
1032
|
-
}());
|
|
1033
|
-
|
|
1034
|
-
var HostProjectConfigsInjectionToken = new core$1.InjectionToken("hostProjectConfigs");
|
|
1035
|
-
var TmsxAngularComponentsModule = /** @class */ (function () {
|
|
1036
|
-
function TmsxAngularComponentsModule() {
|
|
1037
|
-
}
|
|
1038
|
-
TmsxAngularComponentsModule_1 = TmsxAngularComponentsModule;
|
|
1039
|
-
TmsxAngularComponentsModule.forRoot = function (config) {
|
|
1040
|
-
return {
|
|
1041
|
-
ngModule: TmsxAngularComponentsModule_1,
|
|
1042
|
-
providers: [
|
|
1043
|
-
{
|
|
1044
|
-
provide: HostProjectConfigsInjectionToken,
|
|
1045
|
-
useValue: config
|
|
1046
|
-
}
|
|
1047
|
-
]
|
|
1048
|
-
};
|
|
1049
|
-
};
|
|
1050
|
-
var TmsxAngularComponentsModule_1;
|
|
1051
|
-
TmsxAngularComponentsModule = TmsxAngularComponentsModule_1 = __decorate([
|
|
1052
|
-
core$1.NgModule({})
|
|
1053
|
-
], TmsxAngularComponentsModule);
|
|
1054
|
-
return TmsxAngularComponentsModule;
|
|
1055
|
-
}());
|
|
1056
|
-
|
|
1057
|
-
var fallback = {
|
|
1058
|
-
"tmsx_fnd.tmsx_angular_components.add": "Adicionar",
|
|
1059
|
-
"tmsx_fnd.tmsx_angular_components.audit_created_by": "Criado por {{nome}} em {{data}} às {{hora}}.",
|
|
1060
|
-
"tmsx_fnd.tmsx_angular_components.audit_modified_by": "Modificado por {{nome}} em {{data}} às {{hora}}.",
|
|
1061
|
-
"tmsx_fnd.tmsx_angular_components.audit_inactivated_by": "Inativado por {{nome}} em {{data}} às {{hora}}.",
|
|
1062
|
-
"tmsx_fnd.tmsx_angular_components.condicao_valor_lookup_condicional_no_audit": "Sem informações de auditoria",
|
|
1063
|
-
"tmsx_fnd.tmsx_angular_components.delete": "Excluir",
|
|
1064
|
-
"tmsx_fnd.tmsx_angular_components.edit": "Editar",
|
|
1065
|
-
"tmsx_fnd.tmsx_angular_components.error_forbidden_description": "Você não tem permissão para acessar este recurso.",
|
|
1066
|
-
"tmsx_fnd.tmsx_angular_components.error_forbidden_title": "Acesso Negado",
|
|
1067
|
-
"tmsx_fnd.tmsx_angular_components.error_not_found_description": "O recurso solicitado não foi encontrado.",
|
|
1068
|
-
"tmsx_fnd.tmsx_angular_components.error_not_found_title": "Não Encontrado",
|
|
1069
|
-
"tmsx_fnd.tmsx_angular_components.error_unauthorized_description": "Você não está autorizado a acessar este recurso.",
|
|
1070
|
-
"tmsx_fnd.tmsx_angular_components.error_unauthorized_title": "Não Autorizado",
|
|
1071
|
-
"tmsx_fnd.tmsx_angular_components.grid_aninhada": "Grid Aninhada",
|
|
1072
|
-
"tmsx_fnd.tmsx_angular_components.grid_editable_nested_calendar_required": "É necessário informar a data",
|
|
1073
|
-
"tmsx_fnd.tmsx_angular_components.grid_editable_nested_cancelar": "Cancelar",
|
|
1074
|
-
"tmsx_fnd.tmsx_angular_components.grid_editable_nested_editar": "Editar valores",
|
|
1075
|
-
"tmsx_fnd.tmsx_angular_components.grid_editable_nested_paging": "registros encontrados",
|
|
1076
|
-
"tmsx_fnd.tmsx_angular_components.grid_editable_nested_salvar": "Salvar alterações",
|
|
1077
|
-
"tmsx_fnd.tmsx_angular_components.list_grid_boolean_false": "Não",
|
|
1078
|
-
"tmsx_fnd.tmsx_angular_components.list_grid_boolean_true": "Sim",
|
|
1079
|
-
"tmsx_fnd.tmsx_angular_components.list_grid_empty_field": "Não informado",
|
|
1080
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento": "Painel de Processamento",
|
|
1081
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento_api_error": "API de envio não definida",
|
|
1082
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento_status_failed": "Ocorreu um erro",
|
|
1083
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento_status_pending": "Pendente",
|
|
1084
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento_status_processing": "Processando",
|
|
1085
|
-
"tmsx_fnd.tmsx_angular_components.painel_processamento_status_success": "Finalizado com sucesso",
|
|
1086
|
-
"tmsx_fnd.tmsx_angular_components.registro": "Registro",
|
|
1087
|
-
"tmsx_fnd.tmsx_angular_components.showcase_painel_processamento_title": "Demonstração do Painel de Processamento",
|
|
1088
|
-
"tmsx_fnd.tmsx_angular_components.showcase_table_title": "Demonstração da Tabela",
|
|
1089
|
-
"tmsx_fnd.tmsx_angular_components.showcase_title": "Showcase",
|
|
1090
|
-
"tmsx_fnd.tmsx_angular_components.situacao_ativo_false": "Inativo",
|
|
1091
|
-
"tmsx_fnd.tmsx_angular_components.situacao_ativo_true": "Ativo",
|
|
1092
|
-
"tmsx_fnd.tmsx_angular_components.status": "Situação",
|
|
1093
|
-
"tmsx_fnd.tmsx_angular_components.total_records": "{{ value }} registros encontrados"
|
|
1094
|
-
};
|
|
1095
|
-
|
|
1096
|
-
exports.GridEditableNestedComponent = GridEditableNestedComponent;
|
|
1097
|
-
exports.GridEditableNestedModule = GridEditableNestedModule;
|
|
1098
|
-
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
1099
|
-
exports.PainelProcessamentoComponent = PainelProcessamentoComponent;
|
|
1100
|
-
exports.PainelProcessamentoModule = PainelProcessamentoModule;
|
|
1101
|
-
exports.TmsxAngularComponentsModule = TmsxAngularComponentsModule;
|
|
1102
|
-
exports.UtilsService = UtilsService;
|
|
1103
|
-
exports.fallback = fallback;
|
|
1104
|
-
|
|
1105
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1106
|
-
|
|
1107
|
-
})));
|
|
1108
|
-
//# sourceMappingURL=seniorsistemas-tmsx-angular-components.umd.js.map
|