tailjng 0.0.36 → 0.0.38

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.
Files changed (27) hide show
  1. package/cli/component-manager.js +79 -55
  2. package/cli/dependency-manager.js +43 -26
  3. package/cli/settings/components-list.js +10 -6
  4. package/cli/settings/header-generator.js +1 -1
  5. package/fesm2022/tailjng.mjs +2 -1
  6. package/fesm2022/tailjng.mjs.map +1 -1
  7. package/lib/services/http/error-handler-http.service.d.ts +1 -1
  8. package/lib/services/static/icons.service.d.ts +1 -0
  9. package/package.json +2 -2
  10. package/src/lib/components/badge/badge.component.html +6 -6
  11. package/src/lib/components/badge/badge.component.ts +11 -16
  12. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.html +34 -33
  13. package/src/lib/components/dialog/dialog.component.html +32 -27
  14. package/src/lib/components/dialog/dialog.component.ts +3 -3
  15. package/src/lib/components/form/form-sidebar/sidebar-form.component.ts +4 -5
  16. package/src/lib/components/input/input-textarea/textarea-input.component.html +1 -1
  17. package/src/lib/components/select/select-multi-table/multi-table-select.component.html +61 -94
  18. package/src/lib/components/select/select-multi-table/multi-table-select.component.ts +112 -314
  19. package/src/lib/components/table/table-complete/complete-table.component.html +8 -7
  20. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +1 -1
  21. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +3 -3
  22. package/src/lib/components/{image/image-viewer/viewer-image.component.html → viewer/viewer-image/image-viewer.component.html} +51 -40
  23. package/src/lib/components/{image/image-viewer/viewer-image.component.ts → viewer/viewer-image/image-viewer.component.ts} +84 -8
  24. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.html +28 -0
  25. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.scss +0 -0
  26. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.ts +31 -0
  27. /package/src/lib/components/{image/image-viewer/viewer-image.component.css → viewer/viewer-image/image-viewer.component.css} +0 -0
@@ -1,71 +1,95 @@
1
1
  // component-manager.js
2
2
 
3
- const fs = require("fs")
4
- const path = require("path")
5
- const { copyComponentFiles } = require("./file-operations")
6
- const { installDependencies } = require("./dependency-manager")
7
- const { COLORS } = require("./settings/colors")
3
+ const { copyComponentFiles } = require("./file-operations");
4
+ const { installDependencies } = require("./dependency-manager");
5
+ const { COLORS } = require("./settings/colors");
8
6
 
7
+ // Registro global para evitar re-instalaciones duplicadas
8
+ const installedComponentsGlobal = new Set();
9
+
10
+ /**
11
+ * Instala un componente individual y sus dependencias.
12
+ */
9
13
  async function addComponent(componentName, componentList) {
10
- const componentData = componentList[componentName]
11
- if (!componentData) {
12
- console.error(
13
- `${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}ERROR: Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.red}not found in the component list.${COLORS.reset}`,
14
- )
15
- process.exit(1)
16
- }
14
+ const componentData = componentList[componentName];
15
+ if (!componentData) {
16
+ console.error(
17
+ `${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}ERROR: Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.red}not found in the component list.${COLORS.reset}`
18
+ );
19
+ process.exit(1);
20
+ }
17
21
 
18
- console.log(`${COLORS.blue}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.blue}Adding component: ${COLORS.bright}"${componentName}"${COLORS.reset}`)
22
+ console.log(
23
+ `${COLORS.blue}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.blue}Adding component: ${COLORS.bright}"${componentName}"${COLORS.reset}`
24
+ );
19
25
 
20
- // Create a Set to track already processed components
21
- const installedComponents = new Set()
26
+ // Instalar dependencias primero
27
+ await installDependencies(componentData.dependencies, componentList, installedComponentsGlobal);
22
28
 
23
- // Install dependencies first to ensure they are available before the main component
24
- await installDependencies(componentData.dependencies, componentList, installedComponents)
29
+ // Si el componente principal ya fue procesado (como dependencia), saltarlo
30
+ if (installedComponentsGlobal.has(componentName)) {
31
+ console.log(
32
+ `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Main component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.dim}was already processed as a dependency.${COLORS.reset}`
33
+ );
34
+ return;
35
+ }
25
36
 
26
- // Check if the main component was already processed as a dependency
27
- if (!installedComponents.has(componentName)) {
28
- // Copy the main component files to the project
29
- const wasInstalled = await copyComponentFiles(componentName, componentData.path, false)
37
+ // Copiar los archivos del componente principal
38
+ const wasInstalled = await copyComponentFiles(componentName, componentData.path, false);
30
39
 
31
- if (wasInstalled) {
32
- console.log(
33
- `${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.greenBright}installed successfully.${COLORS.reset}`,
34
- )
35
- } else {
36
- console.log(
37
- `${COLORS.yellow}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.yellow}Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.yellow}installation was cancelled by user.${COLORS.reset}`,
38
- )
39
- }
40
- } else {
41
- console.log(
42
- `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Main component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.dim}was already processed as a dependency.${COLORS.reset}`,
43
- )
44
- }
45
- }
40
+ installedComponentsGlobal.add(componentName); // lo marcamos como instalado
46
41
 
42
+ if (wasInstalled) {
43
+ console.log(
44
+ `${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.greenBright}installed successfully.${COLORS.reset}`
45
+ );
46
+ } else {
47
+ console.log(
48
+ `${COLORS.yellow}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.yellow}Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.yellow}installation was cancelled by user.${COLORS.reset}`
49
+ );
50
+ }
51
+ }
47
52
 
53
+ /**
54
+ * Instala todos los componentes disponibles en la lista.
55
+ */
48
56
  async function installAllComponents(componentList) {
49
- console.log(`${COLORS.blue}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.blue}Installing all components...${COLORS.reset}`)
50
-
51
- const installedComponents = new Set()
52
-
53
- for (const componentName of Object.keys(componentList)) {
54
- if (!installedComponents.has(componentName)) {
55
- await installDependencies(componentList[componentName].dependencies, componentList, installedComponents)
56
-
57
- if (!installedComponents.has(componentName)) {
58
- const wasInstalled = await copyComponentFiles(componentName, componentList[componentName].path, false)
59
- if (wasInstalled) {
60
- console.log(`${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.greenBright}installed successfully.${COLORS.reset}`)
61
- } else {
62
- console.log(`${COLORS.yellow}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.yellow}Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.yellow}installation was skipped by user.${COLORS.reset}`)
63
- }
64
- }
65
- }
57
+ console.log(
58
+ `${COLORS.blue}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.blue}Installing all components...${COLORS.reset}`
59
+ );
60
+
61
+ for (const componentName of Object.keys(componentList)) {
62
+ const componentData = componentList[componentName];
63
+
64
+ // Evita duplicados
65
+ if (installedComponentsGlobal.has(componentName)) {
66
+ console.log(
67
+ `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Skipping already installed: ${COLORS.bright}"${componentName}"${COLORS.reset}`
68
+ );
69
+ continue;
70
+ }
71
+
72
+ // Instalar dependencias
73
+ await installDependencies(componentData.dependencies, componentList, installedComponentsGlobal);
74
+
75
+ // Instalar el componente principal
76
+ const wasInstalled = await copyComponentFiles(componentName, componentData.path, false);
77
+ installedComponentsGlobal.add(componentName);
78
+
79
+ if (wasInstalled) {
80
+ console.log(
81
+ `${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.greenBright}installed successfully.${COLORS.reset}`
82
+ );
83
+ } else {
84
+ console.log(
85
+ `${COLORS.yellow}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.yellow}Component ${COLORS.bright}"${componentName}"${COLORS.reset} ${COLORS.yellow}installation was skipped by user.${COLORS.reset}`
86
+ );
66
87
  }
88
+ }
67
89
 
68
- console.log(`${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ All components processed.${COLORS.reset}`)
90
+ console.log(
91
+ `${COLORS.greenBright}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.greenBright}✔ All components processed.${COLORS.reset}`
92
+ );
69
93
  }
70
94
 
71
- module.exports = { addComponent, installAllComponents }
95
+ module.exports = { addComponent, installAllComponents };
@@ -1,54 +1,71 @@
1
1
  // dependency-manager.js
2
+ const { copyComponentFiles } = require("./file-operations");
3
+ const { COLORS } = require("./settings/colors");
2
4
 
3
- const { copyComponentFiles } = require("./file-operations")
4
- const { COLORS } = require("./settings/colors")
5
-
5
+ /**
6
+ * Instala recursivamente dependencias de componentes,
7
+ * evitando re-instalar o re-actualizar los mismos componentes.
8
+ */
6
9
  async function installDependencies(dependencies = [], componentList, installedComponents = new Set()) {
7
- if (dependencies.length === 0) {
8
- console.log(`${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}No dependencies to install.${COLORS.reset}`)
9
- return
10
+ if (!dependencies || dependencies.length === 0) {
11
+ console.log(
12
+ `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}No dependencies to install.${COLORS.reset}`
13
+ );
14
+ return;
10
15
  }
11
16
 
12
17
  for (const dep of dependencies) {
13
- // Avoid infinite loops by checking if the component was already processed
18
+ // Evita duplicados y bucles
14
19
  if (installedComponents.has(dep)) {
15
- console.log(`${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Component ${COLORS.bright}"${dep}"${COLORS.reset} ${COLORS.dim}already processed, skipping.${COLORS.reset}`)
16
- continue
20
+ console.log(
21
+ `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Component ${COLORS.bright}"${dep}"${COLORS.reset} ${COLORS.dim}already processed, skipping.${COLORS.reset}`
22
+ );
23
+ continue;
17
24
  }
18
25
 
19
- const depComponentData = componentList[dep]
26
+ const depComponentData = componentList[dep];
20
27
  if (!depComponentData) {
21
28
  console.error(
22
- `${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}ERROR: Dependency component ${COLORS.bright}"${dep}" ${COLORS.red}not found in the component list.${COLORS.reset}`,
23
- )
24
- process.exit(1)
29
+ `${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}ERROR: Dependency component ${COLORS.bright}"${dep}"${COLORS.red} not found in the component list.${COLORS.reset}`
30
+ );
31
+ process.exit(1);
25
32
  }
26
33
 
27
- console.log(`${COLORS.magenta}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.magenta}Installing dependency component: ${COLORS.bright}"${dep}"${COLORS.reset}`)
34
+ // Marca como instalado antes de procesarlo (previene loops circulares)
35
+ installedComponents.add(dep);
28
36
 
29
- // Mark as processed before installing to avoid infinite loops
30
- installedComponents.add(dep)
37
+ console.log(
38
+ `${COLORS.magenta}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.magenta}Installing dependency: ${COLORS.bright}"${dep}"${COLORS.reset}`
39
+ );
31
40
 
32
- // Install recursively the dependencies of this dependency
41
+ // Instalar dependencias internas del dependency
33
42
  if (depComponentData.dependencies && depComponentData.dependencies.length > 0) {
34
- await installDependencies(depComponentData.dependencies, componentList, installedComponents)
43
+ await installDependencies(depComponentData.dependencies, componentList, installedComponents);
35
44
  }
36
45
 
37
- // Copy the dependent component files
46
+ // Copiar los archivos del componente
38
47
  try {
39
- const wasInstalled = await copyComponentFiles(dep, depComponentData.path, true)
48
+ const wasInstalled = await copyComponentFiles(dep, depComponentData.path, true);
40
49
 
41
50
  if (wasInstalled) {
42
- console.log(`${COLORS.green}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.green}Successfully installed dependency: ${COLORS.bright}"${dep}"${COLORS.reset}`)
51
+ console.log(
52
+ `${COLORS.green}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.green}Successfully installed dependency: ${COLORS.bright}"${dep}"${COLORS.reset}`
53
+ );
43
54
  } else {
44
- console.log(`${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Dependency ${COLORS.bright}"${dep}"${COLORS.reset} ${COLORS.dim}was skipped by user choice.${COLORS.reset}`)
55
+ console.log(
56
+ `${COLORS.dim}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.dim}Dependency ${COLORS.bright}"${dep}"${COLORS.reset} ${COLORS.dim}was skipped by user choice.${COLORS.reset}`
57
+ );
45
58
  }
46
59
  } catch (err) {
47
- console.error(`${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}Failed to install dependency component: ${COLORS.bright}"${dep}"${COLORS.reset}`)
48
- console.error(`${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}Error details:${COLORS.reset}`, err)
49
- process.exit(1)
60
+ console.error(
61
+ `${COLORS.red}${COLORS.bright}[tailjng CLI]${COLORS.reset} ${COLORS.red}Failed to install dependency: ${COLORS.bright}"${dep}"${COLORS.reset}`
62
+ );
63
+ console.error(`${COLORS.red}Error details:${COLORS.reset}`, err);
64
+ process.exit(1);
50
65
  }
51
66
  }
67
+
68
+ return installedComponents;
52
69
  }
53
70
 
54
- module.exports = { installDependencies }
71
+ module.exports = { installDependencies };
@@ -50,10 +50,14 @@ function getComponentList() {
50
50
  path: "src/lib/components/progress-bar",
51
51
  dependencies: [],
52
52
  },
53
- 'image-viewer': {
54
- path: "src/lib/components/image/image-viewer",
53
+ 'viewer-image': {
54
+ path: "src/lib/components/viewer/viewer-image",
55
55
  dependencies: ["button"],
56
56
  },
57
+ 'viewer-pdf': {
58
+ path: "src/lib/components/viewer/viewer-pdf",
59
+ dependencies: [],
60
+ },
57
61
  'dialog': {
58
62
  path: "src/lib/components/dialog",
59
63
  dependencies: [],
@@ -114,10 +118,10 @@ function getComponentList() {
114
118
  path: "src/lib/components/menu/menu-options-table",
115
119
  dependencies: ["button"],
116
120
  },
117
-
118
-
119
-
120
-
121
+
122
+
123
+
124
+
121
125
  'table-crud-complete': {
122
126
  path: "src/lib/components/table/table-crud-complete",
123
127
  dependencies: ["button", "paginator-complete", "filter-complete", "checkbox-input", "menu-options-table", "dialog", "image-viewer", "select-dropdown", "input"],
@@ -27,7 +27,7 @@ Authors:
27
27
  License:
28
28
  This project is licensed under the BSD 3-Clause - see the LICENSE file for more details.
29
29
 
30
- Version: 0.0.36
30
+ Version: 0.0.38
31
31
  Creation Date: 2025-01-04
32
32
  ===============================================`
33
33
 
@@ -6,7 +6,7 @@ import { es } from 'date-fns/locale';
6
6
  import { map, isObservable, firstValueFrom, forkJoin } from 'rxjs';
7
7
  import * as i1$1 from '@angular/common/http';
8
8
  import { HttpParams } from '@angular/common/http';
9
- import { Clock, Calendar, EllipsisVertical, Trash, Edit, Pencil, PencilLine, ListRestart, FileUp, MonitorUp, FileSpreadsheet, Cpu, Trash2, Eraser, ArrowDownWideNarrow, Filter, ArrowBigRight, ChevronsRight, ChevronRight, ChevronLeft, ChevronsLeft, Loader2, Moon, Sun, Save, Copy, Search, SquareDashedMousePointer, ChevronsUpDown, ChevronDown, ChevronUp, Eye, Upload, ImageOff, Images, Image, Minimize2, Scan, RefreshCcw, RotateCcw, RotateCw, ZoomOut, ZoomIn, Check, X, CircleHelp, TriangleAlert, CircleX, CircleCheck, Info } from 'lucide-angular';
9
+ import { Clock, Calendar, EllipsisVertical, Trash, Edit, Pencil, PencilLine, ListRestart, FileUp, Download, MonitorUp, FileSpreadsheet, Cpu, Trash2, Eraser, ArrowDownWideNarrow, Filter, ArrowBigRight, ChevronsRight, ChevronRight, ChevronLeft, ChevronsLeft, Loader2, Moon, Sun, Save, Copy, Search, SquareDashedMousePointer, ChevronsUpDown, ChevronDown, ChevronUp, Eye, Upload, ImageOff, Images, Image, Minimize2, Scan, RefreshCcw, RotateCcw, RotateCw, ZoomOut, ZoomIn, Check, X, CircleHelp, TriangleAlert, CircleX, CircleCheck, Info } from 'lucide-angular';
10
10
  import * as FileSaver from 'file-saver';
11
11
  import * as ExcelJS from 'exceljs';
12
12
  import * as XLSX from 'xlsx';
@@ -1070,6 +1070,7 @@ class JIconsService {
1070
1070
  default: Cpu,
1071
1071
  fileSpreadsheet: FileSpreadsheet,
1072
1072
  monitorUp: MonitorUp,
1073
+ download: Download,
1073
1074
  fileUp: FileUp,
1074
1075
  listRestart: ListRestart,
1075
1076
  editRowLine: PencilLine,