@senior-agronegocio/angular-components 0.0.82 → 0.0.84
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/bundles/senior-agronegocio-angular-components.umd.js +109 -3
- package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
- package/common/agro-logics.class.d.ts +18 -0
- package/common/index.d.ts +1 -0
- package/components/event-control-board/common/event-operation.d.ts +2 -1
- package/esm2015/common/agro-logics.class.js +46 -0
- package/esm2015/common/index.js +2 -1
- package/esm2015/components/event-control-board/common/event-control-constants.js +7 -1
- package/esm2015/components/event-control-board/common/event-operation.js +2 -1
- package/esm2015/services/i18n/en-US.js +3 -2
- package/esm2015/services/i18n/es-CO.js +3 -2
- package/esm2015/services/i18n/pt-BR.js +3 -2
- package/esm5/common/agro-logics.class.js +97 -0
- package/esm5/common/index.js +2 -1
- package/esm5/components/event-control-board/common/event-control-constants.js +7 -1
- package/esm5/components/event-control-board/common/event-operation.js +2 -1
- package/esm5/services/i18n/en-US.js +3 -2
- package/esm5/services/i18n/es-CO.js +3 -2
- package/esm5/services/i18n/pt-BR.js +3 -2
- package/fesm2015/senior-agronegocio-angular-components.js +60 -4
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +109 -4
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-agronegocio-angular-components.metadata.json +1 -1
- package/services/i18n/en-US.d.ts +1 -0
- package/services/i18n/es-CO.d.ts +1 -0
- package/services/i18n/pt-BR.d.ts +1 -0
|
@@ -3001,6 +3001,101 @@
|
|
|
3001
3001
|
return AgroArrayUtils;
|
|
3002
3002
|
}());
|
|
3003
3003
|
|
|
3004
|
+
var AgroLogics = /** @class */ (function () {
|
|
3005
|
+
function AgroLogics() {
|
|
3006
|
+
}
|
|
3007
|
+
/**
|
|
3008
|
+
* Agrupa o conjunto de dados pelos campos de entidade fornecidos e calcula
|
|
3009
|
+
* a distribuição de probabilidade (frequência e porcentagem).
|
|
3010
|
+
*
|
|
3011
|
+
* @param data - Array de objetos a serem analisados
|
|
3012
|
+
* @param keys - Chaves ou caminhos aninhados para agrupar (ex: ["entity1", "entity2"])
|
|
3013
|
+
* @returns Array de estatísticas agrupadas ordenadas por samplingSuccess (decrescente)
|
|
3014
|
+
*/
|
|
3015
|
+
AgroLogics.entityDistributionStats = function (data, keys) {
|
|
3016
|
+
var e_1, _a;
|
|
3017
|
+
var total = data.length;
|
|
3018
|
+
var map = new Map();
|
|
3019
|
+
var _loop_1 = function (item) {
|
|
3020
|
+
var e_2, _a, e_3, _b;
|
|
3021
|
+
var uniqueKey = JSON.stringify(keys.map(function (c) {
|
|
3022
|
+
var e_4, _a;
|
|
3023
|
+
var parts = c.split(".");
|
|
3024
|
+
var value = item;
|
|
3025
|
+
try {
|
|
3026
|
+
for (var parts_2 = (e_4 = void 0, __values(parts)), parts_2_1 = parts_2.next(); !parts_2_1.done; parts_2_1 = parts_2.next()) {
|
|
3027
|
+
var p = parts_2_1.value;
|
|
3028
|
+
value = value === null || value === void 0 ? void 0 : value[p];
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
3032
|
+
finally {
|
|
3033
|
+
try {
|
|
3034
|
+
if (parts_2_1 && !parts_2_1.done && (_a = parts_2.return)) _a.call(parts_2);
|
|
3035
|
+
}
|
|
3036
|
+
finally { if (e_4) throw e_4.error; }
|
|
3037
|
+
}
|
|
3038
|
+
return value;
|
|
3039
|
+
}));
|
|
3040
|
+
if (!map.has(uniqueKey)) {
|
|
3041
|
+
var groupedData = {};
|
|
3042
|
+
try {
|
|
3043
|
+
for (var keys_1 = (e_2 = void 0, __values(keys)), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
3044
|
+
var c = keys_1_1.value;
|
|
3045
|
+
var parts = c.split(".");
|
|
3046
|
+
var value = item;
|
|
3047
|
+
try {
|
|
3048
|
+
for (var parts_1 = (e_3 = void 0, __values(parts)), parts_1_1 = parts_1.next(); !parts_1_1.done; parts_1_1 = parts_1.next()) {
|
|
3049
|
+
var p = parts_1_1.value;
|
|
3050
|
+
value = value === null || value === void 0 ? void 0 : value[p];
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3054
|
+
finally {
|
|
3055
|
+
try {
|
|
3056
|
+
if (parts_1_1 && !parts_1_1.done && (_b = parts_1.return)) _b.call(parts_1);
|
|
3057
|
+
}
|
|
3058
|
+
finally { if (e_3) throw e_3.error; }
|
|
3059
|
+
}
|
|
3060
|
+
// add the full entity (not only its ID)
|
|
3061
|
+
groupedData[c.toString().split(".")[0]] = value;
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
3065
|
+
finally {
|
|
3066
|
+
try {
|
|
3067
|
+
if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
|
|
3068
|
+
}
|
|
3069
|
+
finally { if (e_2) throw e_2.error; }
|
|
3070
|
+
}
|
|
3071
|
+
map.set(uniqueKey, { data: groupedData, count: 0 });
|
|
3072
|
+
}
|
|
3073
|
+
map.get(uniqueKey).count++;
|
|
3074
|
+
};
|
|
3075
|
+
try {
|
|
3076
|
+
for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
|
|
3077
|
+
var item = data_1_1.value;
|
|
3078
|
+
_loop_1(item);
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3082
|
+
finally {
|
|
3083
|
+
try {
|
|
3084
|
+
if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);
|
|
3085
|
+
}
|
|
3086
|
+
finally { if (e_1) throw e_1.error; }
|
|
3087
|
+
}
|
|
3088
|
+
var result = Array.from(map.values()).map(function (entry) { return ({
|
|
3089
|
+
data: entry.data,
|
|
3090
|
+
samplingQuantity: entry.count,
|
|
3091
|
+
samplingSuccess: Math.round((entry.count / total) * 100),
|
|
3092
|
+
}); });
|
|
3093
|
+
result.sort(function (a, b) { return b.samplingSuccess - a.samplingSuccess; });
|
|
3094
|
+
return result;
|
|
3095
|
+
};
|
|
3096
|
+
return AgroLogics;
|
|
3097
|
+
}());
|
|
3098
|
+
|
|
3004
3099
|
var AsyncLock = /** @class */ (function () {
|
|
3005
3100
|
function AsyncLock() {
|
|
3006
3101
|
this.queue = [];
|
|
@@ -3795,7 +3890,8 @@
|
|
|
3795
3890
|
"agro.angular_components.TRANSFER_CREATE_FINANCIAL_TITLE": "Criação de título financeiro",
|
|
3796
3891
|
"agro.angular_components.TRANSFER_CANCEL_FINANCIAL_TITLE": "Cancelamento de título financeiro",
|
|
3797
3892
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emissão NF de serviço",
|
|
3798
|
-
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelamento de NF de serviço"
|
|
3893
|
+
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelamento de NF de serviço",
|
|
3894
|
+
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reabertura da NF",
|
|
3799
3895
|
};
|
|
3800
3896
|
|
|
3801
3897
|
var enUS = {
|
|
@@ -4041,7 +4137,8 @@
|
|
|
4041
4137
|
"agro.angular_components.TRANSFER_CREATE_FINANCIAL_TITLE": "Financial title creation",
|
|
4042
4138
|
"agro.angular_components.TRANSFER_CANCEL_FINANCIAL_TITLE": "Financial title cancellation",
|
|
4043
4139
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Service invoice issuance",
|
|
4044
|
-
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Service invoice cancellation"
|
|
4140
|
+
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Service invoice cancellation",
|
|
4141
|
+
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reopen invoice fixation",
|
|
4045
4142
|
};
|
|
4046
4143
|
|
|
4047
4144
|
var esCO = {
|
|
@@ -4287,7 +4384,8 @@
|
|
|
4287
4384
|
"agro.angular_components.TRANSFER_CREATE_FINANCIAL_TITLE": "Creación de título financiero",
|
|
4288
4385
|
"agro.angular_components.TRANSFER_CANCEL_FINANCIAL_TITLE": "Cancelación de título financiero",
|
|
4289
4386
|
"agro.angular_components.TRANSFER_CREATE_SERVICE_INVOICE": "Emisión de NF de servicio",
|
|
4290
|
-
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelación de NF de servicio"
|
|
4387
|
+
"agro.angular_components.TRANSFER_CANCEL_SERVICE_INVOICE": "Cancelación de NF de servicio",
|
|
4388
|
+
"agro.angular_components.REOPEN_INVOICE_FIXATION": "Reapertura de factura",
|
|
4291
4389
|
};
|
|
4292
4390
|
|
|
4293
4391
|
var LibTranslationService = /** @class */ (function () {
|
|
@@ -4507,6 +4605,7 @@
|
|
|
4507
4605
|
EventOperation["TRANSFER_CANCEL_FINANCIAL_TITLE"] = "TRANSFER_CANCEL_FINANCIAL_TITLE";
|
|
4508
4606
|
EventOperation["TRANSFER_CREATE_SERVICE_INVOICE"] = "TRANSFER_CREATE_SERVICE_INVOICE";
|
|
4509
4607
|
EventOperation["TRANSFER_CANCEL_SERVICE_INVOICE"] = "TRANSFER_CANCEL_SERVICE_INVOICE";
|
|
4608
|
+
EventOperation["REOPEN_INVOICE_FIXATION"] = "REOPEN_INVOICE_FIXATION";
|
|
4510
4609
|
})(EventOperation || (EventOperation = {}));
|
|
4511
4610
|
|
|
4512
4611
|
var InputFields;
|
|
@@ -4618,12 +4717,18 @@
|
|
|
4618
4717
|
label: "agro.angular_components." + EventOperation.TRANSFER_CANCEL_SERVICE_INVOICE,
|
|
4619
4718
|
value: EventOperation.TRANSFER_CANCEL_SERVICE_INVOICE,
|
|
4620
4719
|
},
|
|
4720
|
+
{
|
|
4721
|
+
label: "agro.angular_components." + EventOperation.REOPEN_INVOICE_FIXATION,
|
|
4722
|
+
value: EventOperation.REOPEN_INVOICE_FIXATION,
|
|
4723
|
+
subLabelField: InputFields.INVOICE_NUMBER,
|
|
4724
|
+
},
|
|
4621
4725
|
];
|
|
4622
4726
|
var inputFieldsPath = [
|
|
4623
4727
|
{ path: null, field: InputFields.INVOICE_TYPE, operation: EventOperation.ORIGINATION_CREATE_INVOICE },
|
|
4624
4728
|
{ path: "invoiceCreateRecordIn.0", field: InputFields.INVOICE_TYPE, operation: EventOperation.CREATE_INVOICE_FIXATION },
|
|
4625
4729
|
{ path: "invoiceCancelRecordIn.0", field: InputFields.INVOICE_TYPE, operation: EventOperation.CANCEL_INVOICE_FIXATION },
|
|
4626
4730
|
{ path: "invoiceCreateRecordIn.0", field: InputFields.INVOICE_NUMBER, operation: EventOperation.CLOSE_INVOICE_FIXATION },
|
|
4731
|
+
{ path: "invoiceCreateRecordIn.0", field: InputFields.INVOICE_NUMBER, operation: EventOperation.REOPEN_INVOICE_FIXATION },
|
|
4627
4732
|
];
|
|
4628
4733
|
|
|
4629
4734
|
var EventOrigin;
|
|
@@ -6538,6 +6643,7 @@
|
|
|
6538
6643
|
exports.AgroCookieUtils = AgroCookieUtils;
|
|
6539
6644
|
exports.AgroDateUtils = AgroDateUtils;
|
|
6540
6645
|
exports.AgroFormValidator = AgroFormValidator;
|
|
6646
|
+
exports.AgroLogics = AgroLogics;
|
|
6541
6647
|
exports.AgroNameUtils = AgroNameUtils;
|
|
6542
6648
|
exports.AgroNumberUtils = AgroNumberUtils;
|
|
6543
6649
|
exports.AgroObjectUtils = AgroObjectUtils;
|