tailjng 0.0.62 → 0.1.0

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 (54) hide show
  1. package/README.md +186 -32
  2. package/cli/component-manager.js +71 -20
  3. package/cli/execute/init-app.js +251 -0
  4. package/cli/file-operations.js +45 -29
  5. package/cli/index.js +66 -15
  6. package/cli/settings/components-list.js +4 -151
  7. package/cli/settings/header-generator.js +9 -10
  8. package/cli/settings/lib-utils.js +89 -0
  9. package/cli/settings/overwrite-policy.js +18 -0
  10. package/cli/settings/path-utils.js +14 -29
  11. package/cli/settings/project-utils.js +220 -0
  12. package/cli/settings/prompt-utils.js +66 -5
  13. package/cli/templates/app.generator.js +382 -0
  14. package/fesm2022/tailjng.mjs +232 -66
  15. package/fesm2022/tailjng.mjs.map +1 -1
  16. package/lib/services/static/colors.service.d.ts +17 -0
  17. package/lib/services/transformer/transform.service.d.ts +3 -3
  18. package/package.json +1 -1
  19. package/public-api.d.ts +2 -0
  20. package/registry/components.json +164 -0
  21. package/src/lib/components/alert/alert-dialog/dialog-alert.component.css +17 -0
  22. package/src/lib/components/alert/alert-dialog/dialog-alert.component.html +83 -51
  23. package/src/lib/components/alert/alert-dialog/dialog-alert.component.ts +85 -53
  24. package/src/lib/components/alert/alert-toast/toast-alert.component.css +38 -4
  25. package/src/lib/components/alert/alert-toast/toast-alert.component.html +72 -40
  26. package/src/lib/components/alert/alert-toast/toast-alert.component.ts +84 -19
  27. package/src/lib/components/badge/badge.component.ts +1 -2
  28. package/src/lib/components/button/button.component.css +14 -0
  29. package/src/lib/components/button/button.component.html +17 -17
  30. package/src/lib/components/button/button.component.ts +139 -48
  31. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.ts +5 -1
  32. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.html +1 -1
  33. package/src/lib/components/filter/filter-complete/complete-filter.component.html +1 -1
  34. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.html +8 -5
  35. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.scss +12 -0
  36. package/src/lib/components/select/select-dropdown/dropdown-select.component.css +4 -0
  37. package/src/lib/components/select/select-dropdown/dropdown-select.component.html +1 -1
  38. package/src/lib/components/select/select-dropdown/dropdown-select.component.ts +3 -3
  39. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.css +4 -0
  40. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.html +1 -1
  41. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.ts +30 -20
  42. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +504 -170
  43. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.scss +92 -0
  44. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +139 -5
  45. package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.builder.ts +116 -0
  46. package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.helper.ts +43 -0
  47. package/src/lib/components/table/table-crud-complete/expand-grid/table-expand-grid.types.ts +39 -0
  48. package/src/lib/components/table/table-crud-complete/index.ts +3 -0
  49. package/src/lib/components/toggle-radio/toggle-radio.component.css +4 -0
  50. package/src/lib/components/toggle-radio/toggle-radio.component.html +4 -4
  51. package/src/lib/components/toggle-radio/toggle-radio.component.ts +15 -6
  52. package/src/lib/components/tooltip/tooltip.service.ts +0 -30
  53. package/tailjng-0.1.0.tgz +0 -0
  54. package/src/lib/components/color/colors.service.ts +0 -187
@@ -7,6 +7,7 @@
7
7
  coachPosition="bottom-left"
8
8
  coachTrigger="click"
9
9
  [coachMaxWidth]="'170px'"
10
+ [coachWidth]="'170px'"
10
11
  [coachSpotlight]="false"
11
12
  [icon]="iconsService.icons.ellipsisVertical"
12
13
  [iconSize]="20"
@@ -15,28 +16,30 @@
15
16
  />
16
17
 
17
18
  <ng-template #customTemplateActions>
18
- <div class="flex flex-col gap-2">
19
+ <div class="menu-options-list flex flex-col gap-2 w-full min-w-full">
19
20
  @if (optionsTable.length > 0) {
20
21
  @for (option of optionsTable; track $index) {
21
22
  @if (getIsVisible(option, group)) {
22
23
  <div
23
- class="w-full hover:bg-primary/10 dark:hover:bg-dark-primary/10 text-[10px]"
24
+ class="menu-option-item w-full hover:bg-primary/10 dark:hover:bg-dark-primary/10 text-[10px]"
24
25
  >
25
26
  <JButton
26
27
  onKeyPress
28
+ size="sm"
27
29
  [icon]="getIcon(option.icon, group)"
28
- [iconSize]="20"
30
+ [iconSize]="16"
29
31
  (clicked)="handleClick(option, group)"
30
32
  [tooltip]="getTooltip(option.tooltip ?? '', group)"
31
33
  [tooltipPosition]="option.tooltipPosition ?? 'top'"
32
34
  [disabled]="getDisabled(option, group)"
33
35
  [isLoading]="false"
34
36
  [classes]="
35
- 'w-full text-left justify-start ' + (option.classes ?? '')
37
+ 'w-full min-w-full text-left justify-start h-[30px] ' +
38
+ (option.classes ?? '')
36
39
  "
37
40
  [ngClasses]="mergeNgClasses(option.ngClass, group)"
38
41
  >
39
- {{ getTooltip(option.text ?? "", group) }}
42
+ {{ getTooltip(option.text ?? '', group) }}
40
43
  </JButton>
41
44
  </div>
42
45
  }
@@ -0,0 +1,12 @@
1
+ .menu-options-list,
2
+ .menu-option-item {
3
+ width: 100%;
4
+ min-width: 100%;
5
+ }
6
+
7
+ :host ::ng-deep .menu-option-item j-button,
8
+ :host ::ng-deep .menu-option-item jbutton {
9
+ display: flex;
10
+ width: 100%;
11
+ min-width: 0;
12
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ width: 100%;
4
+ }
@@ -1,4 +1,4 @@
1
- <div class="relative w-full h-full">
1
+ <div class="relative w-full">
2
2
  <div #selectButton class="w-auto">
3
3
  <button
4
4
  type="button"
@@ -1,5 +1,5 @@
1
1
 
2
- import { Component, Input, Output, EventEmitter, ElementRef, ViewChild, OnDestroy, ChangeDetectorRef, AfterViewInit, OnInit, SimpleChanges, OnChanges, } from "@angular/core"
2
+ import { Component, Input, Output, EventEmitter, ElementRef, ViewChild, OnDestroy, ChangeDetectorRef, AfterViewInit, OnInit, SimpleChanges, OnChanges, Optional, } from "@angular/core"
3
3
  import { FormsModule, ControlValueAccessor, ReactiveFormsModule, NG_VALUE_ACCESSOR } from "@angular/forms"
4
4
  import { CommonModule } from "@angular/common"
5
5
  import { LucideAngularModule } from "lucide-angular"
@@ -123,7 +123,7 @@ export class JDropdownSelectComponent implements ControlValueAccessor, AfterView
123
123
  public readonly iconsService: JIconsService,
124
124
  private readonly cdr: ChangeDetectorRef,
125
125
  private readonly elementRef: ElementRef,
126
- private readonly genericService: JGenericCrudService,
126
+ @Optional() private readonly genericService: JGenericCrudService | null,
127
127
  ) { }
128
128
 
129
129
  ngOnInit() {
@@ -270,7 +270,7 @@ export class JDropdownSelectComponent implements ControlValueAccessor, AfterView
270
270
  * @returns
271
271
  */
272
272
  loadData() {
273
- if (!this.endpoint) return
273
+ if (!this.endpoint || !this.genericService) return
274
274
 
275
275
  this.isLoading = true
276
276
  const params: any = {}
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ width: 100%;
4
+ }
@@ -1,4 +1,4 @@
1
- <div class="relative w-full h-full">
1
+ <div class="relative w-full">
2
2
  <div class="w-auto" #selectButton>
3
3
  <button
4
4
  type="button"
@@ -1,4 +1,4 @@
1
- import { Component, Input, Output, EventEmitter, ElementRef, ViewChild, OnDestroy, ChangeDetectorRef, AfterViewInit, OnInit, SimpleChanges, OnChanges, } from "@angular/core"
1
+ import { Component, Input, Output, EventEmitter, ElementRef, ViewChild, OnDestroy, ChangeDetectorRef, AfterViewInit, OnInit, SimpleChanges, OnChanges, Optional, } from "@angular/core"
2
2
  import { FormsModule, type ControlValueAccessor, ReactiveFormsModule, NG_VALUE_ACCESSOR } from "@angular/forms"
3
3
  import { CommonModule } from "@angular/common"
4
4
  import { LucideAngularModule } from "lucide-angular"
@@ -124,7 +124,7 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
124
124
  public readonly iconsService: JIconsService,
125
125
  private readonly cdr: ChangeDetectorRef,
126
126
  private readonly elementRef: ElementRef,
127
- private readonly genericService: JGenericCrudService,
127
+ @Optional() private readonly genericService: JGenericCrudService | null,
128
128
  ) { }
129
129
 
130
130
  ngOnInit() {
@@ -187,9 +187,10 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
187
187
  const text = Array.isArray(this.optionLabel)
188
188
  ? this.optionLabel.map((k) => this.getNestedValue(option, k)).join(this.labelSeparator)
189
189
  : this.getNestedValue(option, this.optionLabel);
190
- return { value: option[this.optionValue], text, original: option };
190
+ return { value: this.normalizeOptionValue(option[this.optionValue]), text, original: option };
191
191
  });
192
- } else {
192
+ } else if (!(this.type === 'searchable' && this.endpoint)) {
193
+ // No vaciar opciones ya cargadas desde API (modo remoto)
193
194
  this.processedOptions = [];
194
195
  }
195
196
 
@@ -204,7 +205,7 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
204
205
  // Carga desde API
205
206
  // ============================
206
207
  loadData() {
207
- if (!this._finalEndpoint) return;
208
+ if (!this._finalEndpoint || !this.genericService) return;
208
209
 
209
210
  this.isLoading = true;
210
211
 
@@ -226,16 +227,16 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
226
227
  this.genericService.findAll<any>({ endpoint: this._finalEndpoint, params }).subscribe({
227
228
  next: (resp) => {
228
229
  const data = resp?.data?.[this.mainEndpoint] ?? resp?.data ?? [];
229
- // mapea a processedOptions
230
- this.processedOptions = Array.isArray(data)
231
- ? data.map((option: any) => ({
232
- value: option?.[this.optionValue],
233
- text: Array.isArray(this.optionLabel)
234
- ? this.optionLabel.map((k) => this.getNestedValue(option, k)).filter(Boolean).join(this.labelSeparator)
235
- : this.getNestedValue(option, this.optionLabel),
236
- original: option,
237
- }))
238
- : [];
230
+ const list = Array.isArray(data) ? data : [];
231
+ // Mantener @Input options sincronizado (igual que JDropdownSelect) para processOptions()
232
+ this.options = list;
233
+ this.processedOptions = list.map((option: any) => ({
234
+ value: this.normalizeOptionValue(option?.[this.optionValue]),
235
+ text: Array.isArray(this.optionLabel)
236
+ ? this.optionLabel.map((k) => this.getNestedValue(option, k)).filter(Boolean).join(this.labelSeparator)
237
+ : this.getNestedValue(option, this.optionLabel),
238
+ original: option,
239
+ }));
239
240
 
240
241
  this.filteredProcessedOptions = [...this.processedOptions];
241
242
  this.fullData.emit(data);
@@ -367,7 +368,7 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
367
368
  this.onTouched();
368
369
  this.updateDropdownPosition();
369
370
 
370
- if (this.type === 'searchable' && (this.loadOpen || (!this.loadOnInit && this.processedOptions.length === 0))) {
371
+ if (this.type === 'searchable' && (this.loadOpen || this.processedOptions.length === 0)) {
371
372
  this.loadData();
372
373
  }
373
374
  }
@@ -588,10 +589,19 @@ export class JMultiDropdownSelectComponent implements ControlValueAccessor, Afte
588
589
  * Write the value to the component
589
590
  * @param value
590
591
  */
591
- writeValue(value: any[]): void {
592
- this.selectedValues = Array.isArray(value) ? value : []
593
- this.updateDisplayLabel()
594
- this.cdr.markForCheck()
592
+ writeValue(value: any[] | null): void {
593
+ this.selectedValues = Array.isArray(value)
594
+ ? value.map((item) => this.normalizeOptionValue(item))
595
+ : [];
596
+ this.updateDisplayLabel();
597
+ this.cdr.markForCheck();
598
+ }
599
+
600
+ private normalizeOptionValue(value: unknown): unknown {
601
+ if (typeof value === 'string' && value.trim() !== '' && !Number.isNaN(Number(value))) {
602
+ return Number(value);
603
+ }
604
+ return value;
595
605
  }
596
606
 
597
607