@koalarx/ui 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alert/esm2020/lib/dialog-alert.component.mjs +3 -3
- package/alert/esm2020/lib/koala.alert.module.mjs +4 -4
- package/alert/esm2020/lib/koala.alert.service.mjs +3 -3
- package/alert/fesm2015/koalarx-ui-alert.mjs +10 -10
- package/alert/fesm2020/koalarx-ui-alert.mjs +10 -10
- package/button/esm2020/lib/button.component.mjs +3 -3
- package/button/esm2020/lib/koala.button.module.mjs +4 -4
- package/button/fesm2015/koalarx-ui-button.mjs +7 -7
- package/button/fesm2020/koalarx-ui-button.mjs +7 -7
- package/common/esm2020/lib/services/csv/koala.csv.service.mjs +3 -3
- package/common/esm2020/lib/services/xlsx/koala.xlsx.service.mjs +58 -4
- package/common/fesm2015/koalarx-ui-common.mjs +63 -6
- package/common/fesm2015/koalarx-ui-common.mjs.map +1 -1
- package/common/fesm2020/koalarx-ui-common.mjs +60 -6
- package/common/fesm2020/koalarx-ui-common.mjs.map +1 -1
- package/common/lib/services/xlsx/koala.xlsx.service.d.ts +5 -0
- package/core/esm2020/lib/loader/loader-bar-page.component.mjs +3 -3
- package/core/esm2020/lib/ngx-koala.module.mjs +4 -4
- package/core/esm2020/lib/page/koala.page.module.mjs +4 -4
- package/core/esm2020/lib/page/notifications/notification.component.mjs +4 -4
- package/core/esm2020/lib/page/page.component.mjs +3 -3
- package/core/esm2020/lib/router/koala.parameter-hash-location-stategy.mjs +3 -3
- package/core/esm2020/lib/services/api-requester/koala.api-requester.service.mjs +3 -3
- package/core/esm2020/lib/services/loader/koala.loader.service.mjs +3 -3
- package/core/esm2020/lib/services/openid/koala.oauth2.service.mjs +3 -3
- package/core/esm2020/lib/services/request/koala.request.service.mjs +3 -3
- package/core/esm2020/lib/services/token/koala.token.service.mjs +3 -3
- package/core/fesm2015/koalarx-ui-core.mjs +36 -36
- package/core/fesm2015/koalarx-ui-core.mjs.map +1 -1
- package/core/fesm2020/koalarx-ui-core.mjs +36 -36
- package/core/fesm2020/koalarx-ui-core.mjs.map +1 -1
- package/dialog/esm2020/lib/dialog.component.mjs +3 -3
- package/dialog/esm2020/lib/koala.dialog.module.mjs +4 -4
- package/dialog/esm2020/lib/koala.dialog.service.mjs +3 -3
- package/dialog/fesm2015/koalarx-ui-dialog.mjs +10 -10
- package/dialog/fesm2020/koalarx-ui-dialog.mjs +10 -10
- package/dynamic-component/esm2020/lib/koala-dynamic-component.directive.mjs +3 -3
- package/dynamic-component/esm2020/lib/koala-dynamic-component.factory.mjs +3 -3
- package/dynamic-component/esm2020/lib/koala-dynamic-component.module.mjs +4 -4
- package/dynamic-component/fesm2015/koalarx-ui-dynamic-component.mjs +10 -10
- package/dynamic-component/fesm2020/koalarx-ui-dynamic-component.mjs +10 -10
- package/file-button/esm2020/lib/file-button.component.mjs +3 -3
- package/file-button/esm2020/lib/koala.btn-file.service.mjs +3 -3
- package/file-button/esm2020/lib/koala.file-button.module.mjs +4 -4
- package/file-button/fesm2015/koalarx-ui-file-button.mjs +10 -10
- package/file-button/fesm2020/koalarx-ui-file-button.mjs +10 -10
- package/folder-page/esm2020/lib/folder.component.mjs +3 -3
- package/folder-page/esm2020/lib/koala.folder-page.module.mjs +4 -4
- package/folder-page/fesm2015/koalarx-ui-folder-page.mjs +7 -7
- package/folder-page/fesm2015/koalarx-ui-folder-page.mjs.map +1 -1
- package/folder-page/fesm2020/koalarx-ui-folder-page.mjs +7 -7
- package/folder-page/fesm2020/koalarx-ui-folder-page.mjs.map +1 -1
- package/form/esm2020/lib/btn-submit/btn-submit.component.mjs +3 -3
- package/form/esm2020/lib/directives/koala-autofocus.directive.mjs +3 -3
- package/form/esm2020/lib/dynamic-form/dynamic-form.component.mjs +10 -11
- package/form/esm2020/lib/dynamic-form/koala.dynamic-form.service.mjs +3 -3
- package/form/esm2020/lib/koala.form.module.mjs +4 -4
- package/form/fesm2015/koalarx-ui-form.mjs +22 -23
- package/form/fesm2015/koalarx-ui-form.mjs.map +1 -1
- package/form/fesm2020/koalarx-ui-form.mjs +22 -23
- package/form/fesm2020/koalarx-ui-form.mjs.map +1 -1
- package/form/lib/dynamic-form/dynamic-form.component.d.ts +2 -2
- package/icon/esm2020/lib/icon.component.mjs +3 -3
- package/icon/esm2020/lib/koala.icon.module.mjs +4 -4
- package/icon/fesm2015/koalarx-ui-icon.mjs +7 -7
- package/icon/fesm2020/koalarx-ui-icon.mjs +7 -7
- package/icons-animated/esm2020/lib/icons/downloading/downloading-icon-animated.component.mjs +4 -4
- package/icons-animated/esm2020/lib/icons/loading/loading-icon-animated.component.mjs +4 -4
- package/icons-animated/esm2020/lib/icons-animated.component.mjs +3 -3
- package/icons-animated/esm2020/lib/icons-animated.service.mjs +3 -3
- package/icons-animated/esm2020/lib/koala-icons-animated.module.mjs +4 -4
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs +18 -18
- package/icons-animated/fesm2015/koalarx-ui-icons-animated.mjs.map +1 -1
- package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs +18 -18
- package/icons-animated/fesm2020/koalarx-ui-icons-animated.mjs.map +1 -1
- package/list/esm2020/lib/koala.list.module.mjs +4 -4
- package/list/esm2020/lib/koala.list.service.mjs +3 -3
- package/list/esm2020/lib/list.component.mjs +3 -3
- package/list/esm2020/lib/providers/pagination/pagination.provider.mjs +3 -3
- package/list/fesm2015/koalarx-ui-list.mjs +13 -13
- package/list/fesm2020/koalarx-ui-list.mjs +13 -13
- package/menu/esm2020/lib/koala.menu.module.mjs +4 -4
- package/menu/esm2020/lib/koala.menu.service.mjs +3 -3
- package/menu/esm2020/lib/menu.component.mjs +4 -4
- package/menu/fesm2015/koalarx-ui-menu.mjs +11 -11
- package/menu/fesm2015/koalarx-ui-menu.mjs.map +1 -1
- package/menu/fesm2020/koalarx-ui-menu.mjs +11 -11
- package/menu/fesm2020/koalarx-ui-menu.mjs.map +1 -1
- package/package.json +1 -1
- package/question/esm2020/lib/dialog-question.component.mjs +3 -3
- package/question/esm2020/lib/koala.question.module.mjs +4 -4
- package/question/esm2020/lib/koala.question.service.mjs +3 -3
- package/question/fesm2015/koalarx-ui-question.mjs +10 -10
- package/question/fesm2020/koalarx-ui-question.mjs +10 -10
- package/snackbar/esm2020/lib/koala.snackbar.component.mjs +3 -3
- package/snackbar/esm2020/lib/koala.snackbar.module.mjs +4 -4
- package/snackbar/esm2020/lib/koala.snackbar.service.mjs +3 -3
- package/snackbar/fesm2015/koalarx-ui-snackbar.mjs +10 -10
- package/snackbar/fesm2020/koalarx-ui-snackbar.mjs +10 -10
|
@@ -32,9 +32,9 @@ class KoalaCsvService {
|
|
|
32
32
|
document.body.removeChild(link);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
KoalaCsvService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
36
|
-
KoalaCsvService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
35
|
+
KoalaCsvService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, deps: [{ token: i1.Papa }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
+
KoalaCsvService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, providedIn: "any" });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, decorators: [{
|
|
38
38
|
type: Injectable,
|
|
39
39
|
args: [{ providedIn: "any" }]
|
|
40
40
|
}], ctorParameters: function () { return [{ type: i1.Papa }]; } });
|
|
@@ -101,10 +101,67 @@ class KoalaXlsxService {
|
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
+
convertJsonToXlsxWithTabs(tabs, config) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const header = [];
|
|
107
|
+
const workbook = new Excel.Workbook();
|
|
108
|
+
tabs.forEach(tab => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
const title = (_a = tab === null || tab === void 0 ? void 0 : tab.titleName) !== null && _a !== void 0 ? _a : config.title;
|
|
111
|
+
Object.keys(tab.json[0]).forEach(name => {
|
|
112
|
+
header.push((config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?
|
|
113
|
+
koala(name).string().normalize().getValue().toUpperCase() :
|
|
114
|
+
name));
|
|
115
|
+
});
|
|
116
|
+
const worksheet = workbook.addWorksheet((_b = tab === null || tab === void 0 ? void 0 : tab.sheetName) !== null && _b !== void 0 ? _b : config.sheetName);
|
|
117
|
+
if (config.title) {
|
|
118
|
+
const titleRow = worksheet.addRow([title]);
|
|
119
|
+
titleRow.alignment = { horizontal: 'center' };
|
|
120
|
+
if (config.titleFontColor) {
|
|
121
|
+
titleRow.font = { bold: true, color: { argb: config.titleFontColor.replace('#', '') } };
|
|
122
|
+
}
|
|
123
|
+
if (config.titleBackgroundColor) {
|
|
124
|
+
titleRow.fill = {
|
|
125
|
+
type: 'pattern',
|
|
126
|
+
pattern: 'solid',
|
|
127
|
+
fgColor: { argb: config.titleBackgroundColor.replace('#', '') },
|
|
128
|
+
bgColor: { argb: config.titleBackgroundColor.replace('#', '') }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(tab.json[0]).length).address}`);
|
|
132
|
+
}
|
|
133
|
+
const headerRow = worksheet.addRow(header);
|
|
134
|
+
headerRow.eachCell((cell, number) => {
|
|
135
|
+
if (config.headerBackgroundColor) {
|
|
136
|
+
cell.fill = {
|
|
137
|
+
type: 'pattern',
|
|
138
|
+
pattern: 'solid',
|
|
139
|
+
fgColor: { argb: config.headerBackgroundColor.replace('#', '') },
|
|
140
|
+
bgColor: { argb: config.headerBackgroundColor.replace('#', '') }
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (config.headerFontColor) {
|
|
144
|
+
cell.font = {
|
|
145
|
+
color: { argb: config.headerFontColor.replace('#', '') }
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
tab.json.forEach(item => {
|
|
150
|
+
const data = [];
|
|
151
|
+
Object.values(item).forEach(value => data.push(value));
|
|
152
|
+
worksheet.addRow(data);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
workbook.xlsx.writeBuffer().then((data) => {
|
|
156
|
+
const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
157
|
+
fs.saveAs(blob, config.filename + '.xlsx');
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
104
161
|
}
|
|
105
|
-
KoalaXlsxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
106
|
-
KoalaXlsxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
162
|
+
KoalaXlsxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
163
|
+
KoalaXlsxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, providedIn: "any" });
|
|
164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, decorators: [{
|
|
108
165
|
type: Injectable,
|
|
109
166
|
args: [{ providedIn: "any" }]
|
|
110
167
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-common.mjs","sources":["../../../projects/common/src/lib/services/csv/koala.csv.service.ts","../../../projects/common/src/lib/services/xlsx/koala.xlsx.service.ts","../../../projects/common/src/lib/mask-options.ts","../../../projects/common/src/koalarx-ui-common.ts"],"sourcesContent":["import { Papa } from 'ngx-papaparse';\nimport { Injectable } from '@angular/core';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaCsvService {\n\n constructor(private papa: Papa) {\n }\n\n public convertJsonToCsv(json: object[], filename: string = 'export') {\n this.downloadCsv(new Blob([\n this.papa.unparse(json, {\n header: true,\n delimiter: \";\",\n newline: \"\\r\\n\"\n })], {\n type: 'text/csv;charset=utf-8;'\n }), filename);\n }\n\n private downloadCsv(blob: Blob, filename: string = 'export') {\n let link = document.createElement('a');\n let url = URL.createObjectURL(blob);\n link.setAttribute(\"href\", url);\n link.setAttribute(\"download\", filename + '.csv');\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n}\n","import * as Excel from \"exceljs/dist/exceljs.min.js\";\nimport * as ExcelProper from \"exceljs\";\nimport * as fs from 'file-saver';\n\nimport { Injectable } from \"@angular/core\";\nimport { KoalaXlsxConfigInterface } from \"./koala.xlsx-config.interface\";\nimport { koala } from \"@koalarx/utils\";\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaXlsxService {\n\n public async convertJsonToXlsx(json: any[], config: KoalaXlsxConfigInterface) {\n const title = config.title;\n const header = [];\n\n Object.keys(json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n const worksheet = workbook.addWorksheet(config.sheetName);\n if (config.password) {\n await worksheet.protect(config.password, {\n selectLockedCells: false,\n selectUnlockedCells: false,\n scenarios: false\n });\n }\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n}\n","import { IConfig } from 'ngx-mask';\n\nexport const maskOptions: Partial<IConfig> | (() => Partial<IConfig>) = {\n\tvalidation: false\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAIa,eAAe,CAAA;AAE1B,IAAA,WAAA,CAAoB,IAAU,EAAA;AAAV,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAM;KAC7B;AAEM,IAAA,gBAAgB,CAAC,IAAc,EAAE,QAAA,GAAmB,QAAQ,EAAA;AACjE,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;AACxB,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AACtB,gBAAA,MAAM,EAAE,IAAI;AACZ,gBAAA,SAAS,EAAE,GAA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
+
{"version":3,"file":"koalarx-ui-common.mjs","sources":["../../../projects/common/src/lib/services/csv/koala.csv.service.ts","../../../projects/common/src/lib/services/xlsx/koala.xlsx.service.ts","../../../projects/common/src/lib/mask-options.ts","../../../projects/common/src/koalarx-ui-common.ts"],"sourcesContent":["import { Papa } from 'ngx-papaparse';\nimport { Injectable } from '@angular/core';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaCsvService {\n\n constructor(private papa: Papa) {\n }\n\n public convertJsonToCsv(json: object[], filename: string = 'export') {\n this.downloadCsv(new Blob([\n this.papa.unparse(json, {\n header: true,\n delimiter: \";\",\n newline: \"\\r\\n\"\n })], {\n type: 'text/csv;charset=utf-8;'\n }), filename);\n }\n\n private downloadCsv(blob: Blob, filename: string = 'export') {\n let link = document.createElement('a');\n let url = URL.createObjectURL(blob);\n link.setAttribute(\"href\", url);\n link.setAttribute(\"download\", filename + '.csv');\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n}\n","import * as Excel from \"exceljs/dist/exceljs.min.js\";\nimport * as ExcelProper from \"exceljs\";\nimport * as fs from 'file-saver';\n\nimport { Injectable } from \"@angular/core\";\nimport { KoalaXlsxConfigInterface } from \"./koala.xlsx-config.interface\";\nimport { koala } from \"@koalarx/utils\";\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaXlsxService {\n\n public async convertJsonToXlsx(json: any[], config: KoalaXlsxConfigInterface) {\n const title = config.title;\n const header = [];\n\n Object.keys(json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n const worksheet = workbook.addWorksheet(config.sheetName);\n if (config.password) {\n await worksheet.protect(config.password, {\n selectLockedCells: false,\n selectUnlockedCells: false,\n scenarios: false\n });\n }\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n\n public async convertJsonToXlsxWithTabs(tabs: {\n titleName?: string;\n sheetName?: string;\n json: any[]\n }[], config: KoalaXlsxConfigInterface) {\n const header = [];\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n\n tabs.forEach(tab => {\n const title = tab?.titleName ?? config.title;\n Object.keys(tab.json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const worksheet = workbook.addWorksheet(tab?.sheetName ?? config.sheetName);\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(tab.json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n tab.json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n}\n","import { IConfig } from 'ngx-mask';\n\nexport const maskOptions: Partial<IConfig> | (() => Partial<IConfig>) = {\n\tvalidation: false\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAIa,eAAe,CAAA;AAE1B,IAAA,WAAA,CAAoB,IAAU,EAAA;AAAV,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAM;KAC7B;AAEM,IAAA,gBAAgB,CAAC,IAAc,EAAE,QAAA,GAAmB,QAAQ,EAAA;AACjE,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;AACxB,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AACtB,gBAAA,MAAM,EAAE,IAAI;AACZ,gBAAA,SAAS,EAAE,GAAG;AACd,gBAAA,OAAO,EAAE,MAAM;aAChB,CAAC;SAAC,EAAE;AACL,YAAA,IAAI,EAA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KAAK,CAAC,CAAC,CAAC;AACvD,oBAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,iBAAC,CAAC,CAAC;AACL,aAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAI;AACxC,gBAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAC,IAAI,EAAE,mEAAmE,EAAC,CAAC,CAAC;gBAC3G,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;AAC7C,aAAC,CAAC,CAAC;SACJ,CAAA,CAAA;AAAA,KAAA;;6GAvIU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,KAAK,EAAA,CAAA,CAAA;2FACjB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,KAAK,EAAC,CAAA;;;ACNlB,MAAA,WAAW,GAAgD;AACvE,IAAA,UAAU,EAAE,KAAK;;;ACHlB;;AAEG;;;;"}
|
|
@@ -31,9 +31,9 @@ class KoalaCsvService {
|
|
|
31
31
|
document.body.removeChild(link);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
KoalaCsvService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
35
|
-
KoalaCsvService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
34
|
+
KoalaCsvService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, deps: [{ token: i1.Papa }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
KoalaCsvService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, providedIn: "any" });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaCsvService, decorators: [{
|
|
37
37
|
type: Injectable,
|
|
38
38
|
args: [{ providedIn: "any" }]
|
|
39
39
|
}], ctorParameters: function () { return [{ type: i1.Papa }]; } });
|
|
@@ -98,10 +98,64 @@ class KoalaXlsxService {
|
|
|
98
98
|
fs.saveAs(blob, config.filename + '.xlsx');
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
+
async convertJsonToXlsxWithTabs(tabs, config) {
|
|
102
|
+
const header = [];
|
|
103
|
+
const workbook = new Excel.Workbook();
|
|
104
|
+
tabs.forEach(tab => {
|
|
105
|
+
const title = tab?.titleName ?? config.title;
|
|
106
|
+
Object.keys(tab.json[0]).forEach(name => {
|
|
107
|
+
header.push((config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?
|
|
108
|
+
koala(name).string().normalize().getValue().toUpperCase() :
|
|
109
|
+
name));
|
|
110
|
+
});
|
|
111
|
+
const worksheet = workbook.addWorksheet(tab?.sheetName ?? config.sheetName);
|
|
112
|
+
if (config.title) {
|
|
113
|
+
const titleRow = worksheet.addRow([title]);
|
|
114
|
+
titleRow.alignment = { horizontal: 'center' };
|
|
115
|
+
if (config.titleFontColor) {
|
|
116
|
+
titleRow.font = { bold: true, color: { argb: config.titleFontColor.replace('#', '') } };
|
|
117
|
+
}
|
|
118
|
+
if (config.titleBackgroundColor) {
|
|
119
|
+
titleRow.fill = {
|
|
120
|
+
type: 'pattern',
|
|
121
|
+
pattern: 'solid',
|
|
122
|
+
fgColor: { argb: config.titleBackgroundColor.replace('#', '') },
|
|
123
|
+
bgColor: { argb: config.titleBackgroundColor.replace('#', '') }
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(tab.json[0]).length).address}`);
|
|
127
|
+
}
|
|
128
|
+
const headerRow = worksheet.addRow(header);
|
|
129
|
+
headerRow.eachCell((cell, number) => {
|
|
130
|
+
if (config.headerBackgroundColor) {
|
|
131
|
+
cell.fill = {
|
|
132
|
+
type: 'pattern',
|
|
133
|
+
pattern: 'solid',
|
|
134
|
+
fgColor: { argb: config.headerBackgroundColor.replace('#', '') },
|
|
135
|
+
bgColor: { argb: config.headerBackgroundColor.replace('#', '') }
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (config.headerFontColor) {
|
|
139
|
+
cell.font = {
|
|
140
|
+
color: { argb: config.headerFontColor.replace('#', '') }
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
tab.json.forEach(item => {
|
|
145
|
+
const data = [];
|
|
146
|
+
Object.values(item).forEach(value => data.push(value));
|
|
147
|
+
worksheet.addRow(data);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
workbook.xlsx.writeBuffer().then((data) => {
|
|
151
|
+
const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
152
|
+
fs.saveAs(blob, config.filename + '.xlsx');
|
|
153
|
+
});
|
|
154
|
+
}
|
|
101
155
|
}
|
|
102
|
-
KoalaXlsxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
103
|
-
KoalaXlsxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
156
|
+
KoalaXlsxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
157
|
+
KoalaXlsxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, providedIn: "any" });
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaXlsxService, decorators: [{
|
|
105
159
|
type: Injectable,
|
|
106
160
|
args: [{ providedIn: "any" }]
|
|
107
161
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-common.mjs","sources":["../../../projects/common/src/lib/services/csv/koala.csv.service.ts","../../../projects/common/src/lib/services/xlsx/koala.xlsx.service.ts","../../../projects/common/src/lib/mask-options.ts","../../../projects/common/src/koalarx-ui-common.ts"],"sourcesContent":["import { Papa } from 'ngx-papaparse';\nimport { Injectable } from '@angular/core';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaCsvService {\n\n constructor(private papa: Papa) {\n }\n\n public convertJsonToCsv(json: object[], filename: string = 'export') {\n this.downloadCsv(new Blob([\n this.papa.unparse(json, {\n header: true,\n delimiter: \";\",\n newline: \"\\r\\n\"\n })], {\n type: 'text/csv;charset=utf-8;'\n }), filename);\n }\n\n private downloadCsv(blob: Blob, filename: string = 'export') {\n let link = document.createElement('a');\n let url = URL.createObjectURL(blob);\n link.setAttribute(\"href\", url);\n link.setAttribute(\"download\", filename + '.csv');\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n}\n","import * as Excel from \"exceljs/dist/exceljs.min.js\";\nimport * as ExcelProper from \"exceljs\";\nimport * as fs from 'file-saver';\n\nimport { Injectable } from \"@angular/core\";\nimport { KoalaXlsxConfigInterface } from \"./koala.xlsx-config.interface\";\nimport { koala } from \"@koalarx/utils\";\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaXlsxService {\n\n public async convertJsonToXlsx(json: any[], config: KoalaXlsxConfigInterface) {\n const title = config.title;\n const header = [];\n\n Object.keys(json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n const worksheet = workbook.addWorksheet(config.sheetName);\n if (config.password) {\n await worksheet.protect(config.password, {\n selectLockedCells: false,\n selectUnlockedCells: false,\n scenarios: false\n });\n }\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n}\n","import { IConfig } from 'ngx-mask';\n\nexport const maskOptions: Partial<IConfig> | (() => Partial<IConfig>) = {\n\tv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A,CAAA,CAAA;AAAhB,gBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,KAAK,EAAA,CAAA,CAAA;2FACjB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,KAAK,EAAC,CAAA;;;ACNlB,MAAA,WAAW,GAAgD;AACvE,IAAA,UAAU,EAAE,KAAK;;;ACHlB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"koalarx-ui-common.mjs","sources":["../../../projects/common/src/lib/services/csv/koala.csv.service.ts","../../../projects/common/src/lib/services/xlsx/koala.xlsx.service.ts","../../../projects/common/src/lib/mask-options.ts","../../../projects/common/src/koalarx-ui-common.ts"],"sourcesContent":["import { Papa } from 'ngx-papaparse';\nimport { Injectable } from '@angular/core';\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaCsvService {\n\n constructor(private papa: Papa) {\n }\n\n public convertJsonToCsv(json: object[], filename: string = 'export') {\n this.downloadCsv(new Blob([\n this.papa.unparse(json, {\n header: true,\n delimiter: \";\",\n newline: \"\\r\\n\"\n })], {\n type: 'text/csv;charset=utf-8;'\n }), filename);\n }\n\n private downloadCsv(blob: Blob, filename: string = 'export') {\n let link = document.createElement('a');\n let url = URL.createObjectURL(blob);\n link.setAttribute(\"href\", url);\n link.setAttribute(\"download\", filename + '.csv');\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n}\n","import * as Excel from \"exceljs/dist/exceljs.min.js\";\nimport * as ExcelProper from \"exceljs\";\nimport * as fs from 'file-saver';\n\nimport { Injectable } from \"@angular/core\";\nimport { KoalaXlsxConfigInterface } from \"./koala.xlsx-config.interface\";\nimport { koala } from \"@koalarx/utils\";\n\n@Injectable({providedIn: \"any\"})\nexport class KoalaXlsxService {\n\n public async convertJsonToXlsx(json: any[], config: KoalaXlsxConfigInterface) {\n const title = config.title;\n const header = [];\n\n Object.keys(json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n const worksheet = workbook.addWorksheet(config.sheetName);\n if (config.password) {\n await worksheet.protect(config.password, {\n selectLockedCells: false,\n selectUnlockedCells: false,\n scenarios: false\n });\n }\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n\n public async convertJsonToXlsxWithTabs(tabs: {\n titleName?: string;\n sheetName?: string;\n json: any[]\n }[], config: KoalaXlsxConfigInterface) {\n const header = [];\n const workbook: ExcelProper.Workbook = new Excel.Workbook();\n\n tabs.forEach(tab => {\n const title = tab?.titleName ?? config.title;\n Object.keys(tab.json[0]).forEach(name => {\n header.push((\n config.normalizeHeader === true || config.normalizeHeader === null || config.normalizeHeader === undefined ?\n koala(name).string().normalize().getValue().toUpperCase() :\n name\n ));\n });\n\n const worksheet = workbook.addWorksheet(tab?.sheetName ?? config.sheetName);\n\n if (config.title) {\n const titleRow = worksheet.addRow([title]);\n titleRow.alignment = {horizontal: 'center'};\n if (config.titleFontColor) {\n titleRow.font = {bold: true, color: {argb: config.titleFontColor.replace('#', '')}};\n }\n if (config.titleBackgroundColor) {\n titleRow.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.titleBackgroundColor.replace('#', '')},\n bgColor: {argb: config.titleBackgroundColor.replace('#', '')}\n };\n }\n worksheet.mergeCells(`A1:${worksheet.getCell(1, Object.keys(tab.json[0]).length).address}`);\n }\n\n const headerRow = worksheet.addRow(header);\n headerRow.eachCell((cell, number) => {\n if (config.headerBackgroundColor) {\n cell.fill = {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {argb: config.headerBackgroundColor.replace('#', '')},\n bgColor: {argb: config.headerBackgroundColor.replace('#', '')}\n };\n }\n if (config.headerFontColor) {\n cell.font = {\n color: {argb: config.headerFontColor.replace('#', '')}\n };\n }\n });\n\n tab.json.forEach(item => {\n const data = [];\n Object.values(item).forEach(value => data.push(value));\n worksheet.addRow(data);\n });\n });\n\n workbook.xlsx.writeBuffer().then((data) => {\n const blob = new Blob([data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});\n fs.saveAs(blob, config.filename + '.xlsx');\n });\n }\n}\n","import { IConfig } from 'ngx-mask';\n\nexport const maskOptions: Partial<IConfig> | (() => Partial<IConfig>) = {\n\tvalidation: false\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAIa,eAAe,CAAA;AAE1B,IAAA,WAAA,CAA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M,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACvD,gBAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,aAAC,CAAC,CAAC;AACL,SAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAI;AACxC,YAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAC,IAAI,EAAE,mEAAmE,EAAC,CAAC,CAAC;YAC3G,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;AAC7C,SAAC,CAAC,CAAC;KACJ;;6GAvIU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,KAAK,EAAA,CAAA,CAAA;2FACjB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,KAAK,EAAC,CAAA;;;ACNlB,MAAA,WAAW,GAAgD;AACvE,IAAA,UAAU,EAAE,KAAK;;;ACHlB;;AAEG;;;;"}
|
|
@@ -2,6 +2,11 @@ import { KoalaXlsxConfigInterface } from "./koala.xlsx-config.interface";
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class KoalaXlsxService {
|
|
4
4
|
convertJsonToXlsx(json: any[], config: KoalaXlsxConfigInterface): Promise<void>;
|
|
5
|
+
convertJsonToXlsxWithTabs(tabs: {
|
|
6
|
+
titleName?: string;
|
|
7
|
+
sheetName?: string;
|
|
8
|
+
json: any[];
|
|
9
|
+
}[], config: KoalaXlsxConfigInterface): Promise<void>;
|
|
5
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<KoalaXlsxService, never>;
|
|
6
11
|
static ɵprov: i0.ɵɵInjectableDeclaration<KoalaXlsxService>;
|
|
7
12
|
}
|
|
@@ -9,9 +9,9 @@ export class LoaderBarPageComponent {
|
|
|
9
9
|
this.typeLoader = 'indeterminate';
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
LoaderBarPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
13
|
-
LoaderBarPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
12
|
+
LoaderBarPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: LoaderBarPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
LoaderBarPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: LoaderBarPageComponent, selector: "app-loader-page", inputs: { show: "show", progress: "progress", typeLoader: "typeLoader" }, ngImport: i0, template: "<div [ngClass]=\"{'bouncedInDown d-block': show}\" class=\"animated loader-bar-page\">\n <mat-progress-bar\n [bufferValue]=\"progress\"\n [mode]=\"typeLoader\"\n [value]=\"progress\"\n color=\"primary\">\n </mat-progress-bar>\n</div>\n", styles: [".loader-bar-page{position:absolute;display:none;top:0;left:0;width:100vw;height:100vh;z-index:100000}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: LoaderBarPageComponent, decorators: [{
|
|
15
15
|
type: Component,
|
|
16
16
|
args: [{ selector: 'app-loader-page', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"{'bouncedInDown d-block': show}\" class=\"animated loader-bar-page\">\n <mat-progress-bar\n [bufferValue]=\"progress\"\n [mode]=\"typeLoader\"\n [value]=\"progress\"\n color=\"primary\">\n </mat-progress-bar>\n</div>\n", styles: [".loader-bar-page{position:absolute;display:none;top:0;left:0;width:100vw;height:100vh;z-index:100000}\n"] }]
|
|
17
17
|
}], propDecorators: { show: [{
|
|
@@ -16,18 +16,18 @@ export class NgxKoalaModule {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
NgxKoalaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
20
|
-
NgxKoalaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
19
|
+
NgxKoalaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NgxKoalaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
20
|
+
NgxKoalaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: NgxKoalaModule, imports: [CommonModule,
|
|
21
21
|
HttpClientModule,
|
|
22
22
|
KoalaPageModule], exports: [HttpClientModule,
|
|
23
23
|
KoalaPageModule] });
|
|
24
|
-
NgxKoalaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
24
|
+
NgxKoalaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NgxKoalaModule, providers: [
|
|
25
25
|
KoalaOAuth2Service
|
|
26
26
|
], imports: [CommonModule,
|
|
27
27
|
HttpClientModule,
|
|
28
28
|
KoalaPageModule, HttpClientModule,
|
|
29
29
|
KoalaPageModule] });
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NgxKoalaModule, decorators: [{
|
|
31
31
|
type: NgModule,
|
|
32
32
|
args: [{
|
|
33
33
|
imports: [
|
|
@@ -17,8 +17,8 @@ import { RouterModule } from "@angular/router";
|
|
|
17
17
|
import * as i0 from "@angular/core";
|
|
18
18
|
export class KoalaPageModule {
|
|
19
19
|
}
|
|
20
|
-
KoalaPageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
21
|
-
KoalaPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
20
|
+
KoalaPageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
21
|
+
KoalaPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.8", ngImport: i0, type: KoalaPageModule, declarations: [PageComponent,
|
|
22
22
|
NotificationComponent,
|
|
23
23
|
LoaderBarPageComponent], imports: [CommonModule,
|
|
24
24
|
RouterModule,
|
|
@@ -33,7 +33,7 @@ KoalaPageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
33
33
|
MatListModule,
|
|
34
34
|
MatMenuModule], exports: [PageComponent,
|
|
35
35
|
RouterModule] });
|
|
36
|
-
KoalaPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
36
|
+
KoalaPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaPageModule, imports: [CommonModule,
|
|
37
37
|
RouterModule,
|
|
38
38
|
MatBadgeModule,
|
|
39
39
|
MatProgressSpinnerModule,
|
|
@@ -45,7 +45,7 @@ KoalaPageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
45
45
|
MatSidenavModule,
|
|
46
46
|
MatListModule,
|
|
47
47
|
MatMenuModule, RouterModule] });
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaPageModule, decorators: [{
|
|
49
49
|
type: NgModule,
|
|
50
50
|
args: [{
|
|
51
51
|
declarations: [
|
|
@@ -28,11 +28,11 @@ export class NotificationComponent {
|
|
|
28
28
|
this.delete.emit(notification);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
NotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
32
|
-
NotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
31
|
+
NotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
+
NotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: NotificationComponent, selector: "koala-notification-list", inputs: { notifications: "notifications" }, outputs: { deleteAll: "deleteAll", delete: "delete" }, usesOnChanges: true, ngImport: i0, template: "<div (click)=\"$event.stopPropagation()\" class=\"notifications-content\">\n <div class=\"title\">\n <mat-icon>info</mat-icon>\n <h2>Notifica\u00E7\u00F5es</h2>\n <span class=\"spacer\"></span>\n <button (click)=\"deleteAllNotifications()\" *ngIf=\"notifications.length > 0\" class=\"btn-delete-all\"\n mat-icon-button\n matTooltip=\"Excluir Todas\" matTooltipPosition=\"above\">\n <mat-icon>delete_sweep</mat-icon>\n </button>\n </div>\n <mat-action-list *ngIf=\"notifications.length > 0 else noNotifications\">\n <mat-list-item *ngFor=\"let notification of notifications\" [routerLink]=\"notification.redirectTo\" class=\"itemList\">\n <button (click)=\"deleteNotification(notification)\" class=\"delete-notification\" color=\"warn\" mat-icon-button\n matTooltip=\"Excluir\" matTooltipPosition=\"above\"\n mat-list-icon>\n <mat-icon>delete</mat-icon>\n </button>\n <mat-icon class=\"iconList\" mat-list-icon>announcement</mat-icon>\n <h4 class=\"titleList\" mat-line>{{notification.title}}</h4>\n <p [innerHTML]=\"notification.text\" class=\"textList\" mat-line></p>\n </mat-list-item>\n </mat-action-list>\n <ng-template #noNotifications>\n <div class=\"empty\">\n <mat-icon>mood</mat-icon>\n <p>Tudo certo por aqui!</p>\n </div>\n </ng-template>\n</div>\n", styles: [".title{color:#616161;padding:5px 20px 15px}.title h2{vertical-align:middle;display:inline-flex;padding:0 10px;margin:0;font-family:OpenSans,sans-serif;font-size:.8em}.title mat-icon{vertical-align:middle;display:inline-flex;width:22px;height:22px;font-size:22px;line-height:22px}.title .btn-delete-all{position:absolute;right:20px;top:5px}.iconList{color:#1976d2}.titleList{font-family:OpenSansLight,sans-serif;font-size:.7em!important;color:#616161}.textList{font-family:OpenSans,sans-serif;font-size:.9em!important;color:#212121;white-space:inherit!important}.itemList{height:-moz-fit-content!important;height:fit-content!important;padding:8px 0!important}.delete-notification{background:#b71c1c;border-radius:0!important;height:100%!important;margin-left:-75px;margin-right:10px;position:absolute;transition:.3s;width:50px!important}.delete-notification mat-icon{color:#fff;vertical-align:middle}mat-action-list{max-height:70vh;overflow-y:auto}mat-list-item:hover .delete-notification{margin-left:-15px}.empty{padding:50px;text-align:center;color:#616161}.empty mat-icon{width:40px;height:40px;font-size:40px;line-height:40px}.empty p{text-align:center;font-family:OpenSansLight,sans-serif;font-size:1em}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatLine, selector: "[mat-line], [matLine]" }, { kind: "directive", type: i6.MatListIconCssMatStyler, selector: "[mat-list-icon], [matListIcon]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
34
34
|
type: Component,
|
|
35
|
-
args: [{ selector: 'koala-notification-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"$event.stopPropagation()\" class=\"notifications-content\">\n <div class=\"title\">\n <mat-icon>info</mat-icon>\n <h2>Notifica\u00E7\u00F5es</h2>\n <span class=\"spacer\"></span>\n <button (click)=\"deleteAllNotifications()\" *ngIf=\"notifications.length > 0\" class=\"btn-delete-all\"\n mat-icon-button\n matTooltip=\"Excluir Todas\" matTooltipPosition=\"above\">\n <mat-icon>delete_sweep</mat-icon>\n </button>\n </div>\n <mat-action-list *ngIf=\"notifications.length > 0 else noNotifications\">\n <mat-list-item *ngFor=\"let notification of notifications\" [routerLink]=\"notification.redirectTo\" class=\"itemList\">\n <button (click)=\"deleteNotification(notification)\" class=\"delete-notification\" color=\"warn\" mat-icon-button\n matTooltip=\"Excluir\" matTooltipPosition=\"above\"\n mat-list-icon>\n <mat-icon>delete</mat-icon>\n </button>\n <mat-icon class=\"iconList\" mat-list-icon>announcement</mat-icon>\n <h4 class=\"titleList\" mat-line>{{notification.title}}</h4>\n <p [innerHTML]=\"notification.text\" class=\"textList\" mat-line></p>\n </mat-list-item>\n </mat-action-list>\n <ng-template #noNotifications>\n <div class=\"empty\">\n <mat-icon>mood</mat-icon>\n <p>Tudo certo por aqui!</p>\n </div>\n </ng-template>\n</div>\n", styles: [".title{color:#616161;padding:5px 20px 15px}.title h2{vertical-align:middle;display:inline-flex;padding:0 10px;margin:0;font-family:OpenSans,sans-serif;font-size:.8em}.title mat-icon{vertical-align:middle;display:inline-flex;width:22px;height:22px;font-size:22px;line-height:22px}.title .btn-delete-all{position:absolute;right:20px;top:5px}.iconList{color:#1976d2}.titleList{font-family:OpenSansLight,sans-serif;font-size:.7em!important;color:#616161}.textList{font-family:OpenSans,sans-serif;font-size:.9em!important;color:#212121;white-space:inherit!important}.itemList{height:-
|
|
35
|
+
args: [{ selector: 'koala-notification-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"$event.stopPropagation()\" class=\"notifications-content\">\n <div class=\"title\">\n <mat-icon>info</mat-icon>\n <h2>Notifica\u00E7\u00F5es</h2>\n <span class=\"spacer\"></span>\n <button (click)=\"deleteAllNotifications()\" *ngIf=\"notifications.length > 0\" class=\"btn-delete-all\"\n mat-icon-button\n matTooltip=\"Excluir Todas\" matTooltipPosition=\"above\">\n <mat-icon>delete_sweep</mat-icon>\n </button>\n </div>\n <mat-action-list *ngIf=\"notifications.length > 0 else noNotifications\">\n <mat-list-item *ngFor=\"let notification of notifications\" [routerLink]=\"notification.redirectTo\" class=\"itemList\">\n <button (click)=\"deleteNotification(notification)\" class=\"delete-notification\" color=\"warn\" mat-icon-button\n matTooltip=\"Excluir\" matTooltipPosition=\"above\"\n mat-list-icon>\n <mat-icon>delete</mat-icon>\n </button>\n <mat-icon class=\"iconList\" mat-list-icon>announcement</mat-icon>\n <h4 class=\"titleList\" mat-line>{{notification.title}}</h4>\n <p [innerHTML]=\"notification.text\" class=\"textList\" mat-line></p>\n </mat-list-item>\n </mat-action-list>\n <ng-template #noNotifications>\n <div class=\"empty\">\n <mat-icon>mood</mat-icon>\n <p>Tudo certo por aqui!</p>\n </div>\n </ng-template>\n</div>\n", styles: [".title{color:#616161;padding:5px 20px 15px}.title h2{vertical-align:middle;display:inline-flex;padding:0 10px;margin:0;font-family:OpenSans,sans-serif;font-size:.8em}.title mat-icon{vertical-align:middle;display:inline-flex;width:22px;height:22px;font-size:22px;line-height:22px}.title .btn-delete-all{position:absolute;right:20px;top:5px}.iconList{color:#1976d2}.titleList{font-family:OpenSansLight,sans-serif;font-size:.7em!important;color:#616161}.textList{font-family:OpenSans,sans-serif;font-size:.9em!important;color:#212121;white-space:inherit!important}.itemList{height:-moz-fit-content!important;height:fit-content!important;padding:8px 0!important}.delete-notification{background:#b71c1c;border-radius:0!important;height:100%!important;margin-left:-75px;margin-right:10px;position:absolute;transition:.3s;width:50px!important}.delete-notification mat-icon{color:#fff;vertical-align:middle}mat-action-list{max-height:70vh;overflow-y:auto}mat-list-item:hover .delete-notification{margin-left:-15px}.empty{padding:50px;text-align:center;color:#616161}.empty mat-icon{width:40px;height:40px;font-size:40px;line-height:40px}.empty p{text-align:center;font-family:OpenSansLight,sans-serif;font-size:1em}\n"] }]
|
|
36
36
|
}], ctorParameters: function () { return []; }, propDecorators: { notifications: [{
|
|
37
37
|
type: Input
|
|
38
38
|
}], deleteAll: [{
|
|
@@ -360,9 +360,9 @@ koala-menu ul li li.active a koala-icon * {fill: ${this.palletColors.menuOptions
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
PageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
364
|
-
PageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.
|
|
365
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
363
|
+
PageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: PageComponent, deps: [{ token: i1.KoalaTokenService }, { token: i2.Router }, { token: i3.KoalaLoaderService }, { token: i4.KoalaMenuService }, { token: i5.KoalaOAuth2Service }, { token: i6.DeviceDetectorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
364
|
+
PageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: PageComponent, selector: "koala-page", inputs: { showMenu: "showMenu", color: "color", logo: "logo", startMenuOpened: "startMenuOpened", showLoaderPage: "showLoaderPage", messageLoaderPage: "messageLoaderPage", defaultPage: "defaultPage", openPages: "openPages", notifications: "notifications", userMenuOptions: "userMenuOptions", palletColors: "palletColors", language: "language" }, outputs: { validatingScope: "validatingScope", logoutEmitter: "logoutEmitter", deleteAllNotifications: "deleteAllNotifications", deleteNotification: "deleteNotification" }, providers: [KoalaTokenService], viewQueries: [{ propertyName: "menu", first: true, predicate: ["drawer"], descendants: true, static: true }], ngImport: i0, template: "<div *ngIf=\"showLoaderPage | async\" class=\"koala-loader-pg\">\n <div class=\"loader-content\">\n <figure>\n <img [src]=\"logo\" alt=\"Logotipo\"/>\n <figcaption *ngIf=\"(messageLoaderPage | async) as messageLoader\" [innerHTML]=\"messageLoader\"></figcaption>\n </figure>\n <mat-spinner></mat-spinner>\n </div>\n</div>\n<app-loader-page *ngIf=\"(loaderSubject | async) as loader\" [progress]=\"loader.progress\" [show]=\"loader.show\"\n [typeLoader]=\"loader.typeLoader\"></app-loader-page>\n<mat-drawer-container autosize class=\"menu-container\">\n <mat-drawer #drawer class=\"menu-options\" [mode]=\"isMobile ? 'push' : 'side'\">\n <img [src]=\"logo\" alt=\"Logotipo\" id=\"logotipo\"/>\n <ng-content *ngIf=\"showMenu\" select=\"[menu-options]\"></ng-content>\n </mat-drawer>\n\n <mat-toolbar *ngIf=\"!!(logged$ | async) && (username$ | async)\" class=\"toolbar\">\n <img *ngIf=\"!showMenu\" [src]=\"logo\" alt=\"Logotipo Toolbar\" id=\"logotipo-toolbar\"/>\n <button (click)=\"toogleMenu()\" *ngIf=\"showMenu\" [color]=\"color\" class=\"btn-collapse-menu\" mat-icon-button>\n <mat-icon>menu</mat-icon>\n </button>\n <span class=\"spacer\"></span>\n\t <div class=\"menu-toolbar\">\n\t\t <ng-content select=\"[menu-toolbar]\"></ng-content>\n\t </div>\n <div *ngIf=\"(notifications | async) as notificationList\">\n <button *ngIf=\"notifications\" [color]=\"color\" [matMenuTriggerFor]=\"notificationsMenu\" class=\"btn-toolbar\"\n mat-icon-button>\n <mat-icon\n\t [matBadgeHidden]=\"notificationList.length === 0\"\n\t [matBadge]=\"notificationList.length.toString()\"\n\t matBadgeColor=\"warn\">notifications\n </mat-icon>\n </button>\n <mat-menu #notificationsMenu=\"matMenu\" class=\"menu-list\" yPosition=\"below\">\n <koala-notification-list\n (delete)=\"deleteNotification.emit($event)\"\n (deleteAll)=\"deleteAllNotifications.emit($event)\"\n [notifications]=\"notificationList\">\n </koala-notification-list>\n </mat-menu>\n </div>\n <button [color]=\"color\" [matMenuTriggerFor]=\"userOptions\" class=\"btn-toolbar\" mat-button>\n <span>{{username$ | async}}</span>\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span>\n </button>\n <mat-menu #userOptions=\"matMenu\" class=\"user-menu menu-list\" yPosition=\"below\">\n <div class=\"user-presentation\">\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span><br/>\n <span class=\"username\">{{username$ | async}}</span>\n </div>\n <button (click)=\"btn.action()\" *ngFor=\"let btn of userMenuOptions\" mat-menu-item>\n <mat-icon>{{btn.icon}}</mat-icon>\n <span>{{btn.name}}</span>\n </button>\n <button (click)=\"logout()\" mat-menu-item>\n <mat-icon>exit_to_app</mat-icon>\n <span>{{language === 'ptBr' ? 'Sair' : 'Logout'}}</span>\n </button>\n </mat-menu>\n </mat-toolbar>\n\n <ng-content class=\"page-content\" select=\"[page-content]\"></ng-content>\n\n</mat-drawer-container>\n\n<ng-content class=\"loading-info-content\" select=\"[loading-info-content]\"></ng-content>\n", styles: [".menu-container{height:100vh;width:100vw}.menu-options{border:none;padding:20px 0 0;width:250px}.page-content{align-items:center;display:flex;height:100%;justify-content:center}img#logotipo,img#logotipo-toolbar{display:block;height:auto;margin:0 auto 25px;position:relative;width:120px}.toolbar{box-shadow:none;padding:0 7px 0 13px}.toolbar img#logotipo-toolbar{margin:0;padding:0 10px}.menu-toolbar{margin:0 10px}.spacer{flex:1 1 auto}.btn-toolbar{display:inline-block;margin-right:10px;position:relative}.btn-toolbar span{padding:0 10px 0 0}.btn-toolbar span.icon-user,.user-presentation span.icon-user{border-radius:50%;display:inline-block;height:10px;line-height:10px;padding:5px;width:10px}.user-presentation{min-width:260px;padding:50px 10px;text-align:center}.user-presentation span.icon-user{font-size:30px;height:30px;line-height:30px;margin-bottom:10px;width:30px}.user-presentation span.username{font-family:OpenSansLight,sans-serif;word-break:break-all}@media (max-width: 900px){.btn-toolbar span:first-child{display:none}.btn-toolbar span.icon-user,.user-presentation span.icon-user{height:20px;line-height:20px;width:20px}}\n"], dependencies: [{ kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i11.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i12.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i13.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i13.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i14.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i14.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i14.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i15.NotificationComponent, selector: "koala-notification-list", inputs: ["notifications"], outputs: ["deleteAll", "delete"] }, { kind: "component", type: i16.LoaderBarPageComponent, selector: "app-loader-page", inputs: ["show", "progress", "typeLoader"] }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: PageComponent, decorators: [{
|
|
366
366
|
type: Component,
|
|
367
367
|
args: [{ selector: 'koala-page', providers: [KoalaTokenService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"showLoaderPage | async\" class=\"koala-loader-pg\">\n <div class=\"loader-content\">\n <figure>\n <img [src]=\"logo\" alt=\"Logotipo\"/>\n <figcaption *ngIf=\"(messageLoaderPage | async) as messageLoader\" [innerHTML]=\"messageLoader\"></figcaption>\n </figure>\n <mat-spinner></mat-spinner>\n </div>\n</div>\n<app-loader-page *ngIf=\"(loaderSubject | async) as loader\" [progress]=\"loader.progress\" [show]=\"loader.show\"\n [typeLoader]=\"loader.typeLoader\"></app-loader-page>\n<mat-drawer-container autosize class=\"menu-container\">\n <mat-drawer #drawer class=\"menu-options\" [mode]=\"isMobile ? 'push' : 'side'\">\n <img [src]=\"logo\" alt=\"Logotipo\" id=\"logotipo\"/>\n <ng-content *ngIf=\"showMenu\" select=\"[menu-options]\"></ng-content>\n </mat-drawer>\n\n <mat-toolbar *ngIf=\"!!(logged$ | async) && (username$ | async)\" class=\"toolbar\">\n <img *ngIf=\"!showMenu\" [src]=\"logo\" alt=\"Logotipo Toolbar\" id=\"logotipo-toolbar\"/>\n <button (click)=\"toogleMenu()\" *ngIf=\"showMenu\" [color]=\"color\" class=\"btn-collapse-menu\" mat-icon-button>\n <mat-icon>menu</mat-icon>\n </button>\n <span class=\"spacer\"></span>\n\t <div class=\"menu-toolbar\">\n\t\t <ng-content select=\"[menu-toolbar]\"></ng-content>\n\t </div>\n <div *ngIf=\"(notifications | async) as notificationList\">\n <button *ngIf=\"notifications\" [color]=\"color\" [matMenuTriggerFor]=\"notificationsMenu\" class=\"btn-toolbar\"\n mat-icon-button>\n <mat-icon\n\t [matBadgeHidden]=\"notificationList.length === 0\"\n\t [matBadge]=\"notificationList.length.toString()\"\n\t matBadgeColor=\"warn\">notifications\n </mat-icon>\n </button>\n <mat-menu #notificationsMenu=\"matMenu\" class=\"menu-list\" yPosition=\"below\">\n <koala-notification-list\n (delete)=\"deleteNotification.emit($event)\"\n (deleteAll)=\"deleteAllNotifications.emit($event)\"\n [notifications]=\"notificationList\">\n </koala-notification-list>\n </mat-menu>\n </div>\n <button [color]=\"color\" [matMenuTriggerFor]=\"userOptions\" class=\"btn-toolbar\" mat-button>\n <span>{{username$ | async}}</span>\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span>\n </button>\n <mat-menu #userOptions=\"matMenu\" class=\"user-menu menu-list\" yPosition=\"below\">\n <div class=\"user-presentation\">\n <span class=\"icon-user\">{{firstUserLetter$ | async}}</span><br/>\n <span class=\"username\">{{username$ | async}}</span>\n </div>\n <button (click)=\"btn.action()\" *ngFor=\"let btn of userMenuOptions\" mat-menu-item>\n <mat-icon>{{btn.icon}}</mat-icon>\n <span>{{btn.name}}</span>\n </button>\n <button (click)=\"logout()\" mat-menu-item>\n <mat-icon>exit_to_app</mat-icon>\n <span>{{language === 'ptBr' ? 'Sair' : 'Logout'}}</span>\n </button>\n </mat-menu>\n </mat-toolbar>\n\n <ng-content class=\"page-content\" select=\"[page-content]\"></ng-content>\n\n</mat-drawer-container>\n\n<ng-content class=\"loading-info-content\" select=\"[loading-info-content]\"></ng-content>\n", styles: [".menu-container{height:100vh;width:100vw}.menu-options{border:none;padding:20px 0 0;width:250px}.page-content{align-items:center;display:flex;height:100%;justify-content:center}img#logotipo,img#logotipo-toolbar{display:block;height:auto;margin:0 auto 25px;position:relative;width:120px}.toolbar{box-shadow:none;padding:0 7px 0 13px}.toolbar img#logotipo-toolbar{margin:0;padding:0 10px}.menu-toolbar{margin:0 10px}.spacer{flex:1 1 auto}.btn-toolbar{display:inline-block;margin-right:10px;position:relative}.btn-toolbar span{padding:0 10px 0 0}.btn-toolbar span.icon-user,.user-presentation span.icon-user{border-radius:50%;display:inline-block;height:10px;line-height:10px;padding:5px;width:10px}.user-presentation{min-width:260px;padding:50px 10px;text-align:center}.user-presentation span.icon-user{font-size:30px;height:30px;line-height:30px;margin-bottom:10px;width:30px}.user-presentation span.username{font-family:OpenSansLight,sans-serif;word-break:break-all}@media (max-width: 900px){.btn-toolbar span:first-child{display:none}.btn-toolbar span.icon-user,.user-presentation span.icon-user{height:20px;line-height:20px;width:20px}}\n"] }]
|
|
368
368
|
}], ctorParameters: function () { return [{ type: i1.KoalaTokenService }, { type: i2.Router }, { type: i3.KoalaLoaderService }, { type: i4.KoalaMenuService }, { type: i5.KoalaOAuth2Service }, { type: i6.DeviceDetectorService }]; }, propDecorators: { showMenu: [{
|
|
@@ -10,9 +10,9 @@ export class KoalaParameterHashLocationStrategy extends HashLocationStrategy {
|
|
|
10
10
|
super.prepareExternalUrl(internal);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
KoalaParameterHashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
14
|
-
KoalaParameterHashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
13
|
+
KoalaParameterHashLocationStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaParameterHashLocationStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
14
|
+
KoalaParameterHashLocationStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaParameterHashLocationStrategy });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaParameterHashLocationStrategy, decorators: [{
|
|
16
16
|
type: Injectable
|
|
17
17
|
}] });
|
|
18
18
|
//# sourceM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cnQgeyBIYXNoTG9jYXRpb25TdHJhdGVneSB9IGZyb20gXCJAYW5ndWxhci9jb21tb25cIjtcbmltcG9ydCB7IEtvYWxhRW52aXJvbm1lbnQgfSBmcm9tIFwiLi4vZW52aXJvbm1lbnRzL2tvYWxhRW52aXJvbm1lbnRcIjtcblxuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIEtvYWxhUGFyYW1ldGVySGFzaExvY2F0aW9uU3RyYXRlZ3kgZXh0ZW5kcyBIYXNoTG9jYXRpb25TdHJhdGVneSB7XG4gIHByZXBhcmVFeHRlcm5hbFVybChpbnRlcm5hbDogc3RyaW5nKTogc3RyaW5nIHtcbiAgICBjb25zdCBoYXNUb2tlbiA9ICEhbG9jYWxTdG9yYWdlLmdldEl0ZW0oS29hbGFFbnZpcm9ubWVudC5lbnZpcm9ubWVudD8uc3RvcmFnZVRva2VuTmFtZSk7XG4gICAgcmV0dXJuICFoYXNUb2tlbiA/XG4gICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbi5zZWFyY2ggKyBzdXBlci5wcmVwYXJlRXh0ZXJuYWxVcmwoaW50ZXJuYWwpIDpcbiAgICAgICAgICAgc3VwZXIucHJlcGFyZUV4dGVybmFsVXJsKGludGVybmFsKTtcbiAgfVxufVxuIl19
|
|
@@ -149,9 +149,9 @@ export class KoalaApiRequesterService {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
KoalaApiRequesterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
153
|
-
KoalaApiRequesterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
152
|
+
KoalaApiRequesterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaApiRequesterService, deps: [{ token: i1.HttpClient }, { token: i2.KoalaOAuth2Service }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
153
|
+
KoalaApiRequesterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaApiRequesterService, providedIn: "root" });
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaApiRequesterService, decorators: [{
|
|
155
155
|
type: Injectable,
|
|
156
156
|
args: [{ providedIn: "root" }]
|
|
157
157
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.KoalaOAuth2Service }]; } });
|
|
@@ -25,9 +25,9 @@ export class KoalaLoaderService {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
KoalaLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
29
|
-
KoalaLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
28
|
+
KoalaLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
+
KoalaLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaLoaderService, providedIn: "any" });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: KoalaLoaderService, decorators: [{
|
|
31
31
|
type: Injectable,
|
|
32
32
|
args: [{ providedIn: "any" }]
|
|
33
33
|
}] });
|