tailjng 0.0.12 → 0.0.13
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/cli/tailjng.js +105 -0
- package/fesm2022/tailjng.mjs +27 -4472
- package/fesm2022/tailjng.mjs.map +1 -1
- package/lib/services/icons.service.d.ts +9 -0
- package/lib/tailjng.component.d.ts +5 -0
- package/lib/tailjng.service.d.ts +6 -0
- package/package.json +8 -2
- package/public-api.d.ts +3 -30
- package/src/lib/components/label/label.component.css +0 -0
- package/src/lib/components/label/label.component.html +25 -0
- package/src/lib/components/label/label.component.ts +27 -0
- package/src/lib/components/tooltip/tooltip.directive.ts +341 -0
- package/src/lib/components/tooltip/tooltip.service.ts +192 -0
- package/lib/colors/colors.service.d.ts +0 -16
- package/lib/colors/theme/elements/theme.service.d.ts +0 -15
- package/lib/colors/theme/theme.component.d.ts +0 -87
- package/lib/components/alert-dialog/alert-dialog.component.d.ts +0 -24
- package/lib/components/alert-dialog/elements/alert-dialog.interface.d.ts +0 -41
- package/lib/components/alert-dialog/elements/alert-dialog.service.d.ts +0 -24
- package/lib/components/alert-toast/alert-toast.component.d.ts +0 -27
- package/lib/components/alert-toast/elements/alert-toast.interface.d.ts +0 -47
- package/lib/components/alert-toast/elements/alert-toast.service.d.ts +0 -26
- package/lib/components/button/button.component.d.ts +0 -35
- package/lib/components/checkbox/checkbox.component.d.ts +0 -21
- package/lib/components/crud/card-component/card.component.d.ts +0 -91
- package/lib/components/crud/filter-component/elements/filter.interface.d.ts +0 -62
- package/lib/components/crud/filter-component/filter.component.d.ts +0 -54
- package/lib/components/crud/form-component/components/content-form/content-form.component.d.ts +0 -8
- package/lib/components/crud/form-component/components/error-message/error-message.component.d.ts +0 -13
- package/lib/components/crud/form-component/form.component.d.ts +0 -29
- package/lib/components/crud/paginator-component/paginator.component.d.ts +0 -27
- package/lib/components/crud/table-component/elements/table.interface.d.ts +0 -65
- package/lib/components/crud/table-component/table.component.d.ts +0 -97
- package/lib/components/dialog/dialog.component.d.ts +0 -37
- package/lib/components/input/input.component.d.ts +0 -47
- package/lib/components/label/label.component.d.ts +0 -13
- package/lib/components/mode-toggle/mode-toggle.component.d.ts +0 -15
- package/lib/components/select/option/option.component.d.ts +0 -15
- package/lib/components/select/select.component.d.ts +0 -93
- package/lib/components/toggle-radio/toggle-radio.component.d.ts +0 -48
- package/lib/components/tooltip/tooltip.directive.d.ts +0 -20
- package/lib/components/tooltip/tooltip.service.d.ts +0 -16
- package/lib/http/api-url.d.ts +0 -2
- package/lib/http/converter.service.d.ts +0 -21
- package/lib/http/crud-generic.service.d.ts +0 -86
- package/lib/http/http-error.service.d.ts +0 -24
- package/lib/http/http-rest.service.d.ts +0 -9
- package/lib/http/interface/api-response.d.ts +0 -20
- package/lib/service/calendar.service.d.ts +0 -26
- package/lib/shared/dialog.shared.d.ts +0 -9
- package/lib/shared/form.shared.d.ts +0 -28
- package/tailjng-theme.css +0 -2810
package/cli/tailjng.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Color helpers
|
|
7
|
+
const COLORS = {
|
|
8
|
+
reset: "\x1b[0m",
|
|
9
|
+
bright: "\x1b[1m",
|
|
10
|
+
dim: "\x1b[2m",
|
|
11
|
+
underscore: "\x1b[4m",
|
|
12
|
+
red: "\x1b[31m",
|
|
13
|
+
green: "\x1b[32m",
|
|
14
|
+
yellow: "\x1b[33m",
|
|
15
|
+
blue: "\x1b[34m",
|
|
16
|
+
magenta: "\x1b[35m",
|
|
17
|
+
cyan: "\x1b[36m",
|
|
18
|
+
white: "\x1b[37m"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Determinar el root del paquete
|
|
22
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
23
|
+
|
|
24
|
+
// Path a los componentes dentro de la lib build
|
|
25
|
+
const componentsPath = path.join(packageRoot, 'src', 'lib', 'components');
|
|
26
|
+
|
|
27
|
+
const args = process.argv.slice(2);
|
|
28
|
+
const command = args[0];
|
|
29
|
+
|
|
30
|
+
if (command === 'add') {
|
|
31
|
+
const componentName = args[1];
|
|
32
|
+
checkTailwindInstalled();
|
|
33
|
+
addComponent(componentName);
|
|
34
|
+
} else {
|
|
35
|
+
console.log(`${COLORS.cyan}
|
|
36
|
+
Usage:
|
|
37
|
+
npx tailjng add <component>
|
|
38
|
+
${COLORS.reset}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function checkTailwindInstalled() {
|
|
42
|
+
try {
|
|
43
|
+
require.resolve('tailwindcss');
|
|
44
|
+
console.log(`${COLORS.green}[tailjng CLI] TailwindCSS is installed.${COLORS.reset}`);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.warn(`${COLORS.yellow}
|
|
47
|
+
[tailjng CLI] WARNING:
|
|
48
|
+
------------------------------------------------------------
|
|
49
|
+
TailwindCSS is not installed in your project.
|
|
50
|
+
|
|
51
|
+
Please install it to ensure styles work properly:
|
|
52
|
+
|
|
53
|
+
npm install tailwindcss
|
|
54
|
+
|
|
55
|
+
And generate the config:
|
|
56
|
+
|
|
57
|
+
npx tailwindcss init
|
|
58
|
+
------------------------------------------------------------
|
|
59
|
+
${COLORS.reset}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function addComponent(componentName) {
|
|
64
|
+
const sourcePath = path.join(componentsPath, componentName);
|
|
65
|
+
|
|
66
|
+
if (!fs.existsSync(sourcePath)) {
|
|
67
|
+
console.error(`${COLORS.red}[tailjng CLI] ERROR: Component "${componentName}" does not exist at path: ${sourcePath}${COLORS.reset}`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const projectRoot = process.cwd();
|
|
72
|
+
const targetPath = path.join(projectRoot, 'src', 'app', 'tailjng', componentName);
|
|
73
|
+
|
|
74
|
+
console.log(`${COLORS.blue}[tailjng CLI] Copying component "${componentName}" → ${path.relative(projectRoot, targetPath)}${COLORS.reset}`);
|
|
75
|
+
|
|
76
|
+
fs.mkdirSync(targetPath, { recursive: true });
|
|
77
|
+
|
|
78
|
+
const files = fs.readdirSync(sourcePath);
|
|
79
|
+
|
|
80
|
+
for (const file of files) {
|
|
81
|
+
const srcFile = path.join(sourcePath, file);
|
|
82
|
+
const destFile = path.join(targetPath, file);
|
|
83
|
+
|
|
84
|
+
let content = fs.readFileSync(srcFile, 'utf8');
|
|
85
|
+
|
|
86
|
+
// Analizar si necesita algún servicio de la librería
|
|
87
|
+
const serviceMatches = [...content.matchAll(/import\s+\{\s*(\w+)\s*\}\s+from\s+['"]\.\.\/\.\.\/services\/(.*?)['"]/g)];
|
|
88
|
+
|
|
89
|
+
for (const match of serviceMatches) {
|
|
90
|
+
const serviceName = match[1];
|
|
91
|
+
console.log(`${COLORS.yellow}[tailjng CLI] Updating import of service "${serviceName}" to tailjng.${COLORS.reset}`);
|
|
92
|
+
|
|
93
|
+
// ✅ Reescribir el import en el componente generado:
|
|
94
|
+
content = content.replace(
|
|
95
|
+
match[0],
|
|
96
|
+
`import { ${serviceName} } from 'tailjng'`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
fs.writeFileSync(destFile, content);
|
|
101
|
+
console.log(`${COLORS.green}[tailjng CLI] Copied file: ${file}${COLORS.reset}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
console.log(`${COLORS.greenBright || COLORS.green}\n[tailjng CLI] ✅ Component "${componentName}" copied successfully.${COLORS.reset}`);
|
|
105
|
+
}
|