tailjng 0.0.62 → 0.1.1
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/README.md +187 -32
- package/cli/component-manager.js +71 -20
- package/cli/execute/init-app.js +284 -0
- package/cli/file-operations.js +45 -29
- package/cli/index.js +66 -15
- package/cli/settings/components-list.js +4 -151
- package/cli/settings/header-generator.js +9 -10
- package/cli/settings/lib-utils.js +89 -0
- package/cli/settings/overwrite-policy.js +18 -0
- package/cli/settings/path-utils.js +14 -29
- package/cli/settings/project-utils.js +290 -0
- package/cli/settings/prompt-utils.js +66 -5
- package/cli/templates/app.generator.js +382 -0
- package/fesm2022/tailjng.mjs +232 -66
- package/fesm2022/tailjng.mjs.map +1 -1
- package/lib/services/static/colors.service.d.ts +17 -0
- package/lib/services/transformer/transform.service.d.ts +3 -3
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/registry/components.json +164 -0
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.css +17 -0
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.html +83 -51
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.ts +85 -53
- package/src/lib/components/alert/alert-toast/toast-alert.component.css +38 -4
- package/src/lib/components/alert/alert-toast/toast-alert.component.html +72 -40
- package/src/lib/components/alert/alert-toast/toast-alert.component.ts +84 -19
- package/src/lib/components/badge/badge.component.ts +1 -2
- package/src/lib/components/button/button.component.css +14 -0
- package/src/lib/components/button/button.component.html +17 -17
- package/src/lib/components/button/button.component.ts +139 -48
- package/src/lib/components/card/card-crud-complete/complete-crud-card.component.ts +5 -1
- package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.html +1 -1
- package/src/lib/components/filter/filter-complete/complete-filter.component.html +1 -1
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.html +8 -5
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.scss +12 -0
- package/src/lib/components/select/select-dropdown/dropdown-select.component.css +4 -0
- package/src/lib/components/select/select-dropdown/dropdown-select.component.html +1 -1
- package/src/lib/components/select/select-dropdown/dropdown-select.component.ts +3 -3
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.css +4 -0
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.html +1 -1
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.ts +30 -20
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +504 -170
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.scss +92 -0
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +139 -5
- package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.builder.ts +116 -0
- package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.helper.ts +43 -0
- package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.types.ts +39 -0
- package/src/lib/components/table/table-crud-complete/index.ts +3 -0
- package/src/lib/components/toggle-radio/toggle-radio.component.css +4 -0
- package/src/lib/components/toggle-radio/toggle-radio.component.html +4 -4
- package/src/lib/components/toggle-radio/toggle-radio.component.ts +15 -6
- package/src/lib/components/tooltip/tooltip.service.ts +0 -30
- package/tailjng-0.1.1.tgz +0 -0
- package/src/lib/components/color/colors.service.ts +0 -187
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
function buildDefaultThemeBlock() {
|
|
2
|
+
return `@theme {
|
|
3
|
+
--color-background: #F0F1F4;
|
|
4
|
+
--color-foreground: #18191A;
|
|
5
|
+
--color-card: #E1E4E9;
|
|
6
|
+
--color-card-foreground: #242528;
|
|
7
|
+
--color-popover: #F0F1F4;
|
|
8
|
+
--color-popover-foreground: #011231;
|
|
9
|
+
--color-primary: #405883;
|
|
10
|
+
--color-primary-foreground: #FFFFFF;
|
|
11
|
+
--color-secondary: #A5AEBF;
|
|
12
|
+
--color-secondary-foreground: #000000;
|
|
13
|
+
--color-muted: #D2DFDF;
|
|
14
|
+
--color-muted-foreground: #60646B;
|
|
15
|
+
--color-accent: #C3D4D4;
|
|
16
|
+
--color-accent-foreground: #242528;
|
|
17
|
+
--color-destructive: #BF3F3F;
|
|
18
|
+
--color-destructive-foreground: #E4E5E6;
|
|
19
|
+
--color-border: #6C7D9D;
|
|
20
|
+
--color-input: #667799;
|
|
21
|
+
--color-ring: #405883;
|
|
22
|
+
--color-radius: 0.5rem;
|
|
23
|
+
|
|
24
|
+
--color-dark-background: #15181D;
|
|
25
|
+
--color-dark-foreground: #E4E5E6;
|
|
26
|
+
--color-dark-card: #15181D;
|
|
27
|
+
--color-dark-card-foreground: #E4E5E6;
|
|
28
|
+
--color-dark-popover: #0A0C0E;
|
|
29
|
+
--color-dark-popover-foreground: #E4E5E6;
|
|
30
|
+
--color-dark-primary: #2d3f5e;
|
|
31
|
+
--color-dark-primary-foreground: #FFFFFF;
|
|
32
|
+
--color-dark-secondary: #2A303B;
|
|
33
|
+
--color-dark-secondary-foreground: #FFFFFF;
|
|
34
|
+
--color-dark-muted: #344A4A;
|
|
35
|
+
--color-dark-muted-foreground: #93979E;
|
|
36
|
+
--color-dark-accent: #344A4A;
|
|
37
|
+
--color-dark-accent-foreground: #E4E5E6;
|
|
38
|
+
--color-dark-destructive: #BF3F3F;
|
|
39
|
+
--color-dark-destructive-foreground: #E4E5E6;
|
|
40
|
+
--color-dark-border: #667799;
|
|
41
|
+
--color-dark-input: #667799;
|
|
42
|
+
--color-dark-ring: #405883;
|
|
43
|
+
--color-dark-radius: 0.5rem;
|
|
44
|
+
}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function buildStylesCss() {
|
|
48
|
+
return `@import "tailwindcss";
|
|
49
|
+
|
|
50
|
+
html,
|
|
51
|
+
body {
|
|
52
|
+
font-family: 'Arial', sans-serif;
|
|
53
|
+
width: 100%;
|
|
54
|
+
min-height: 100%;
|
|
55
|
+
padding: 0;
|
|
56
|
+
margin: 0;
|
|
57
|
+
overflow-x: hidden;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
app-root {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
min-height: 100vh;
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
68
|
+
|
|
69
|
+
${buildDefaultThemeBlock()}
|
|
70
|
+
|
|
71
|
+
.dark {
|
|
72
|
+
--tw-bg-opacity: 1;
|
|
73
|
+
color: var(--white);
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function buildStylesScss() {
|
|
79
|
+
return `@use "tailwindcss";
|
|
80
|
+
|
|
81
|
+
@use "./scss/scroll";
|
|
82
|
+
@use "./scss/input";
|
|
83
|
+
|
|
84
|
+
html,
|
|
85
|
+
body {
|
|
86
|
+
font-family: 'Arial', sans-serif;
|
|
87
|
+
width: 100%;
|
|
88
|
+
min-height: 100%;
|
|
89
|
+
padding: 0;
|
|
90
|
+
margin: 0;
|
|
91
|
+
overflow-x: hidden;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
app-root {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
min-height: 100vh;
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
102
|
+
|
|
103
|
+
${buildDefaultThemeBlock()}
|
|
104
|
+
|
|
105
|
+
.dark {
|
|
106
|
+
--tw-bg-opacity: 1;
|
|
107
|
+
color: var(--white);
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function buildScrollScss() {
|
|
113
|
+
return `.scroll-element {
|
|
114
|
+
padding-right: 5px;
|
|
115
|
+
|
|
116
|
+
&::-webkit-scrollbar {
|
|
117
|
+
width: 5px;
|
|
118
|
+
height: 5px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&::-webkit-scrollbar-track {
|
|
122
|
+
border-radius: 10px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&::-webkit-scrollbar-thumb {
|
|
126
|
+
border-radius: 10px;
|
|
127
|
+
background: var(--color-primary);
|
|
128
|
+
transition: 0.5s;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
132
|
+
background: var(--color-dark-primary);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&::-webkit-scrollbar-button {
|
|
136
|
+
width: 0;
|
|
137
|
+
height: 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.scroll-screen {
|
|
142
|
+
&::-webkit-scrollbar {
|
|
143
|
+
width: 10px;
|
|
144
|
+
height: 10px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&::-webkit-scrollbar-thumb {
|
|
148
|
+
background: var(--color-dark-primary);
|
|
149
|
+
border: 3px solid var(--color-primary);
|
|
150
|
+
transition: 0.5s;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
154
|
+
background: var(--color-primary);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&::-webkit-scrollbar-button {
|
|
158
|
+
width: 0;
|
|
159
|
+
height: 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.dark .scroll-screen {
|
|
164
|
+
&::-webkit-scrollbar-thumb {
|
|
165
|
+
background: var(--color-dark-primary);
|
|
166
|
+
border: 3px solid var(--color-primary);
|
|
167
|
+
transition: 0.5s;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
171
|
+
background: var(--color-primary);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function buildInputScss() {
|
|
178
|
+
return `.input {
|
|
179
|
+
&:-webkit-autofill {
|
|
180
|
+
-webkit-text-fill-color: black !important;
|
|
181
|
+
-webkit-box-shadow: 0 0 0 1000px color-mix(in srgb, var(--color-primary) 15%, white) inset !important;
|
|
182
|
+
caret-color: var(--color-primary) !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&:-webkit-autofill:hover,
|
|
186
|
+
&:-webkit-autofill:focus,
|
|
187
|
+
&:-webkit-autofill:active {
|
|
188
|
+
-webkit-text-fill-color: black !important;
|
|
189
|
+
-webkit-box-shadow: 0 0 0 1000px color-mix(in srgb, var(--color-primary) 15%, white) inset !important;
|
|
190
|
+
caret-color: var(--color-primary) !important;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dark .input {
|
|
195
|
+
&:-webkit-autofill {
|
|
196
|
+
-webkit-text-fill-color: white !important;
|
|
197
|
+
-webkit-box-shadow: 0 0 0 1000px color-mix(in srgb, var(--color-dark-background) 85%, black) inset !important;
|
|
198
|
+
caret-color: var(--color-dark-primary) !important;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&:-webkit-autofill:hover,
|
|
202
|
+
&:-webkit-autofill:focus,
|
|
203
|
+
&:-webkit-autofill:active {
|
|
204
|
+
-webkit-text-fill-color: white !important;
|
|
205
|
+
-webkit-box-shadow: 0 0 0 1000px color-mix(in srgb, var(--color-dark-background) 85%, black) inset !important;
|
|
206
|
+
caret-color: var(--color-dark-primary) !important;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.input[type="date"]::-webkit-calendar-picker-indicator,
|
|
211
|
+
.input[type="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
212
|
+
filter: none !important;
|
|
213
|
+
opacity: 1 !important;
|
|
214
|
+
color: black !important;
|
|
215
|
+
background-color: transparent !important;
|
|
216
|
+
-webkit-filter: brightness(0) invert(0) !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.dark .input[type="date"]::-webkit-calendar-picker-indicator,
|
|
220
|
+
.dark .input[type="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
221
|
+
filter: none !important;
|
|
222
|
+
opacity: 1 !important;
|
|
223
|
+
color: white !important;
|
|
224
|
+
background-color: transparent !important;
|
|
225
|
+
-webkit-filter: brightness(0) invert(1) !important;
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function buildEnvironmentTs(urlBase, socketUrl) {
|
|
231
|
+
return `export const environment = {
|
|
232
|
+
production: false,
|
|
233
|
+
urlBase: '${urlBase}',
|
|
234
|
+
socketUrl: '${socketUrl}',
|
|
235
|
+
};
|
|
236
|
+
`;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function buildTailjngProviders() {
|
|
240
|
+
return `import { CurrencyPipe } from '@angular/common';
|
|
241
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
242
|
+
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
243
|
+
import { TAILJNG_CONFIG } from 'tailjng';
|
|
244
|
+
import { environment } from '../../environment';
|
|
245
|
+
|
|
246
|
+
export const tailjngProviders = [
|
|
247
|
+
provideHttpClient(),
|
|
248
|
+
provideAnimations(),
|
|
249
|
+
CurrencyPipe,
|
|
250
|
+
{
|
|
251
|
+
provide: TAILJNG_CONFIG,
|
|
252
|
+
useValue: {
|
|
253
|
+
urlBase: environment.urlBase,
|
|
254
|
+
socketUrl: environment.socketUrl,
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
];
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function buildAppConfigTs() {
|
|
262
|
+
return `import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
|
263
|
+
import { provideRouter } from '@angular/router';
|
|
264
|
+
import { routes } from './app.routes';
|
|
265
|
+
import { tailjngProviders } from './config/tailjng.providers';
|
|
266
|
+
|
|
267
|
+
export const appConfig: ApplicationConfig = {
|
|
268
|
+
providers: [
|
|
269
|
+
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
270
|
+
provideRouter(routes),
|
|
271
|
+
...tailjngProviders,
|
|
272
|
+
],
|
|
273
|
+
};
|
|
274
|
+
`;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function buildPostcssRc() {
|
|
278
|
+
return JSON.stringify(
|
|
279
|
+
{
|
|
280
|
+
plugins: {
|
|
281
|
+
'@tailwindcss/postcss': {},
|
|
282
|
+
autoprefixer: {},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
null,
|
|
286
|
+
2,
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function buildPathsJson(componentsPath) {
|
|
291
|
+
return JSON.stringify(
|
|
292
|
+
{
|
|
293
|
+
components: componentsPath,
|
|
294
|
+
stylesStrategy: 'angular-json-tailjng-styles',
|
|
295
|
+
},
|
|
296
|
+
null,
|
|
297
|
+
2,
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function buildPathsReadme() {
|
|
302
|
+
return `# Tailjng — configuración del proyecto
|
|
303
|
+
|
|
304
|
+
Este archivo define rutas usadas por el CLI de tailjng en este proyecto.
|
|
305
|
+
|
|
306
|
+
- \`components\`: carpeta donde se copian los componentes UI (\`npx tailjng add\`)
|
|
307
|
+
- Los servicios e interfaces se importan desde el paquete npm: \`import { ... } from 'tailjng'\`
|
|
308
|
+
|
|
309
|
+
Generado por \`npx tailjng init:app\`.
|
|
310
|
+
`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function buildInitFiles(options) {
|
|
314
|
+
const {
|
|
315
|
+
styleLanguage,
|
|
316
|
+
primaryStylePath,
|
|
317
|
+
urlBase,
|
|
318
|
+
socketUrl,
|
|
319
|
+
componentsPath,
|
|
320
|
+
overwrite,
|
|
321
|
+
} = options;
|
|
322
|
+
|
|
323
|
+
const files = [
|
|
324
|
+
{
|
|
325
|
+
relativePath: '.postcssrc.json',
|
|
326
|
+
content: buildPostcssRc(),
|
|
327
|
+
appRootRelative: true,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
relativePath: 'src/environment.ts',
|
|
331
|
+
content: buildEnvironmentTs(urlBase, socketUrl),
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
relativePath: 'src/app/config/tailjng.providers.ts',
|
|
335
|
+
content: buildTailjngProviders(),
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
relativePath: '.tailjng/paths.json',
|
|
339
|
+
content: buildPathsJson(componentsPath),
|
|
340
|
+
appRootRelative: true,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
relativePath: '.tailjng/README.md',
|
|
344
|
+
content: buildPathsReadme(),
|
|
345
|
+
appRootRelative: true,
|
|
346
|
+
},
|
|
347
|
+
];
|
|
348
|
+
|
|
349
|
+
if (styleLanguage === 'scss') {
|
|
350
|
+
files.push({
|
|
351
|
+
relativePath: primaryStylePath,
|
|
352
|
+
content: buildStylesScss(),
|
|
353
|
+
});
|
|
354
|
+
files.push({
|
|
355
|
+
relativePath: 'src/scss/_scroll.scss',
|
|
356
|
+
content: buildScrollScss(),
|
|
357
|
+
});
|
|
358
|
+
files.push({
|
|
359
|
+
relativePath: 'src/scss/_input.scss',
|
|
360
|
+
content: buildInputScss(),
|
|
361
|
+
});
|
|
362
|
+
} else {
|
|
363
|
+
files.push({
|
|
364
|
+
relativePath: primaryStylePath,
|
|
365
|
+
content: buildStylesCss(),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (!options.hasAppConfig) {
|
|
370
|
+
files.push({
|
|
371
|
+
relativePath: 'src/app/app.config.ts',
|
|
372
|
+
content: buildAppConfigTs(),
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return files.map((file) => ({ ...file, overwrite }));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
module.exports = {
|
|
380
|
+
buildInitFiles,
|
|
381
|
+
buildAppConfigTs,
|
|
382
|
+
};
|