@seniorsistemas/angular-components 14.13.1 → 14.13.4
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/seniorsistemas-angular-components.umd.js +42 -47
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/dynamic-form/components/lookup/lookup.component.d.ts +0 -2
- package/esm2015/components/dynamic-form/components/lookup/lookup.component.js +1 -43
- package/esm2015/components/table/table-paging/table-paging.component.js +35 -6
- package/esm2015/components/utils/export-utils.js +9 -2
- package/esm5/components/dynamic-form/components/lookup/lookup.component.js +1 -43
- package/esm5/components/table/table-paging/table-paging.component.js +36 -6
- package/esm5/components/utils/export-utils.js +9 -2
- package/fesm2015/seniorsistemas-angular-components.js +41 -47
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +42 -47
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -2137,17 +2137,6 @@
|
|
|
2137
2137
|
this.searchFields = this.searchFields.map(function (value) { return new FormField(__assign(__assign({}, value), { size: { sm: 12, md: 12, lg: 12, xl: 12 } })); });
|
|
2138
2138
|
this.searchGridFields = (this.searchGridFields || this.searchFields).map(function (gridField) {
|
|
2139
2139
|
gridField["width"] = _this.getColWidth(gridField.label);
|
|
2140
|
-
var calendarOptions = gridField.calendarLocaleOptions;
|
|
2141
|
-
if (calendarOptions === null || calendarOptions === void 0 ? void 0 : calendarOptions.dateFormat) {
|
|
2142
|
-
switch (gridField.type) {
|
|
2143
|
-
case exports.FieldType.Date:
|
|
2144
|
-
calendarOptions.dateFormat = _this._convertToMomentDateFormat(calendarOptions.dateFormat);
|
|
2145
|
-
break;
|
|
2146
|
-
case exports.FieldType.Time:
|
|
2147
|
-
calendarOptions.dateFormat = _this._convertToMomentHourFormat(calendarOptions.hourFormat, calendarOptions.dateFormat);
|
|
2148
|
-
break;
|
|
2149
|
-
}
|
|
2150
|
-
}
|
|
2151
2140
|
return gridField;
|
|
2152
2141
|
});
|
|
2153
2142
|
var formGroup = this.searchFields.reduce(function (result, field) {
|
|
@@ -2173,36 +2162,6 @@
|
|
|
2173
2162
|
_this.onChange(newValue);
|
|
2174
2163
|
});
|
|
2175
2164
|
};
|
|
2176
|
-
LookupComponent.prototype._convertToMomentHourFormat = function (hourFormat, format) {
|
|
2177
|
-
if (format === "dd/mm/yy") { // valor padrão para o format.
|
|
2178
|
-
return "LTS";
|
|
2179
|
-
}
|
|
2180
|
-
if (hourFormat === "12") {
|
|
2181
|
-
return format
|
|
2182
|
-
.replace(/\bH\b/, "h") // hour (12 hour time) (no leading zero)
|
|
2183
|
-
.replace(/\bHH\b/, "hh"); // hour (12 hour time)
|
|
2184
|
-
}
|
|
2185
|
-
if (hourFormat === "24") {
|
|
2186
|
-
return format
|
|
2187
|
-
.replace(/\bh\b/, "H") // hour (24 hour time) (no leading zero)
|
|
2188
|
-
.replace(/\bhh\b/, "HH"); // hour (24 hour time)
|
|
2189
|
-
}
|
|
2190
|
-
return format;
|
|
2191
|
-
};
|
|
2192
|
-
LookupComponent.prototype._convertToMomentDateFormat = function (format) {
|
|
2193
|
-
// A ordem dos replaces é importante.
|
|
2194
|
-
return format
|
|
2195
|
-
.replace(/\bd\b/, "D") // day of month (no leading zero)
|
|
2196
|
-
.replace(/\bdd\b/, "DD") // day of month
|
|
2197
|
-
.replace(/\bo\b/, "DDD") // day of the year (no leading zero)
|
|
2198
|
-
.replace(/\boo\b/, "DDDD") // day of the year
|
|
2199
|
-
.replace(/\bM\b/, "MMM") // month name short
|
|
2200
|
-
.replace(/\bMM\b/, "MMMM") // month name long
|
|
2201
|
-
.replace(/\bm\b/, "M") // month of year (no leading)
|
|
2202
|
-
.replace(/\bmm\b/, "MM") // month of year
|
|
2203
|
-
.replace(/\by\b/, "YY") // year (two digits)
|
|
2204
|
-
.replace(/\byy\b/, "YYYY"); // year (four digits)
|
|
2205
|
-
};
|
|
2206
2165
|
LookupComponent.prototype.ngAfterViewInit = function () {
|
|
2207
2166
|
this.autocomplete.onOverlayAnimationDone = function (event) { };
|
|
2208
2167
|
};
|
|
@@ -2794,7 +2753,14 @@
|
|
|
2794
2753
|
data.forEach(function (record) {
|
|
2795
2754
|
csv += "\n";
|
|
2796
2755
|
columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
|
|
2797
|
-
var cellData
|
|
2756
|
+
var cellData;
|
|
2757
|
+
if (Array.isArray(column.field)) {
|
|
2758
|
+
var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
|
|
2759
|
+
cellData = fieldValues.flat().join(column.separator);
|
|
2760
|
+
}
|
|
2761
|
+
else {
|
|
2762
|
+
cellData = _this.resolveFieldData(record, column.field);
|
|
2763
|
+
}
|
|
2798
2764
|
if (cellData != null)
|
|
2799
2765
|
cellData = String(cellData).replace(/"/g, "\"\"");
|
|
2800
2766
|
else
|
|
@@ -4403,21 +4369,50 @@
|
|
|
4403
4369
|
};
|
|
4404
4370
|
TablePagingComponent.prototype.getColumnsToExport = function () {
|
|
4405
4371
|
return __spread(this.table.columns).map(function (column) {
|
|
4406
|
-
|
|
4407
|
-
|
|
4372
|
+
var _a;
|
|
4373
|
+
var exportColumn = {
|
|
4374
|
+
header: column.header,
|
|
4375
|
+
exportable: true,
|
|
4376
|
+
field: column.field,
|
|
4377
|
+
separator: (_a = column.separator) !== null && _a !== void 0 ? _a : " - "
|
|
4378
|
+
};
|
|
4379
|
+
if (column.exportable === false) {
|
|
4380
|
+
exportColumn.exportable = false;
|
|
4408
4381
|
}
|
|
4409
|
-
|
|
4382
|
+
if (column.attributes && column.attributes.length) {
|
|
4383
|
+
if (column.attributes.length === 1) {
|
|
4384
|
+
exportColumn.field = column.attributes[0];
|
|
4385
|
+
}
|
|
4386
|
+
else {
|
|
4387
|
+
exportColumn.field = column.attributes;
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
return exportColumn;
|
|
4410
4391
|
});
|
|
4411
4392
|
};
|
|
4412
4393
|
TablePagingComponent.prototype.getRowsToExport = function () {
|
|
4413
|
-
|
|
4394
|
+
var _this = this;
|
|
4395
|
+
var enumColumns = this.table.columns.filter(function (p) { return p.enumPrefix; });
|
|
4396
|
+
if (!enumColumns.length)
|
|
4397
|
+
return this.table.value;
|
|
4398
|
+
return __spread(this.table.value).map(function (row) {
|
|
4399
|
+
for (var i = 0; i <= enumColumns.length - 1; i++) {
|
|
4400
|
+
var column = enumColumns[i];
|
|
4401
|
+
var fieldName = column.field;
|
|
4402
|
+
var columnData = row[fieldName];
|
|
4403
|
+
row[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
|
|
4404
|
+
}
|
|
4405
|
+
return row;
|
|
4406
|
+
});
|
|
4414
4407
|
};
|
|
4415
4408
|
TablePagingComponent.prototype.getSelectedRowsToExport = function () {
|
|
4416
4409
|
return this.table.selection;
|
|
4417
4410
|
};
|
|
4418
4411
|
TablePagingComponent.prototype.getExportFileName = function () {
|
|
4419
4412
|
var _a;
|
|
4420
|
-
|
|
4413
|
+
var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
|
|
4414
|
+
var currentDate = moment_(new Date()).format("DD-MM-YYYY[_]HH:mm");
|
|
4415
|
+
return fileName + "_" + currentDate;
|
|
4421
4416
|
};
|
|
4422
4417
|
TablePagingComponent.prototype.exportCurrentPage = function () {
|
|
4423
4418
|
this.validateComponent();
|