tailjng 0.0.55 → 0.0.56

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.
@@ -1,5 +1,8 @@
1
- type KeyPath<T> = T extends object ? {
2
- [K in keyof T]: K extends string | number ? `${K}` | `${K}.${KeyPath<T[K]>}` : never;
1
+ type Prev = [never, 0, 1, 2, 3, 4, 5];
2
+ type KeyPath<T, D extends number = 3> = [
3
+ D
4
+ ] extends [never] ? never : T extends object ? {
5
+ [K in keyof T]: K extends string | number ? NonNullable<T[K]> extends object ? `${K}` | `${K}.${KeyPath<NonNullable<T[K]>, Prev[D]>}` : `${K}` : never;
3
6
  }[keyof T] : never;
4
7
  type ExtraColumnKeys = 'total' | 'expand' | 'extra';
5
8
  type ExtendedKeyPath<T> = KeyPath<T> | ExtraColumnKeys;
@@ -42,12 +42,14 @@ export interface ExportFileExcel {
42
42
  type FilterButtonWithChangeIcon = CommonFilterButtonProps & {
43
43
  isChangeIcon: boolean | (() => boolean);
44
44
  iconChange: any;
45
+ isLoading?: boolean | (() => boolean);
45
46
  nameSheet?: string;
46
47
  styles?: ExcelStyleConfig;
47
48
  };
48
49
  type FilterButtonWithoutChangeIcon = CommonFilterButtonProps & {
49
50
  isChangeIcon?: undefined;
50
51
  iconChange?: any;
52
+ isLoading?: boolean | (() => boolean);
51
53
  nameSheet?: string;
52
54
  styles?: ExcelStyleConfig;
53
55
  };
@@ -64,6 +66,7 @@ export interface DropdownFilterSelect {
64
66
  onSelected?: (value: any) => void;
65
67
  optionLabel?: string | string[];
66
68
  optionValue?: string;
69
+ labelSeparator?: string;
67
70
  placeholder?: string;
68
71
  showClear?: boolean;
69
72
  options: any[];
@@ -81,6 +84,7 @@ export interface SearchableFilterSelect {
81
84
  isSearch?: boolean;
82
85
  optionLabel: string | string[];
83
86
  optionValue: string;
87
+ labelSeparator?: string;
84
88
  placeholder?: string;
85
89
  showClear?: boolean;
86
90
  loadOnInit?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailjng",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0",
@@ -0,0 +1,104 @@
1
+ <div class="w-full mb-3">
2
+ @if (isSearch) {
3
+ <JFilter
4
+ [params]="params"
5
+ [columns]="columns"
6
+ [endpoint]="endpoint"
7
+ [mainEndpoint]="mainEndpoint"
8
+ [data]="data"
9
+ [(searchQuery)]="searchQuery"
10
+ (search)="onSearch()"
11
+ [searchPlaceholder]="searchPlaceholder"
12
+ [(itemsPerPage)]="itemsPerPage"
13
+ [itemsPerPageOptions]="itemsPerPageOptions"
14
+ (onItemsPerPageChangeEvent)="onItemsPerPageChange()"
15
+ [isLoadingSearch]="isLoading('search')"
16
+ [isLoadingPerPage]="isLoading('itemsPerPage')"
17
+ [isLoadingAditionalButtons]="loadingStates.aditionalButtons"
18
+ (clearFilters)="onClearFilters($event)"
19
+ [filtersButton]="filtersButton"
20
+ [filtersSelect]="filtersSelect"
21
+
22
+ [isShowColumns]="false"
23
+
24
+ [checked]="checked"
25
+ [titleChecked]="titleChecked"
26
+ [isChecked]="isChecked"
27
+ [isLoadingChecked]="isLoading('checked')"
28
+ (checkActiveInactive)="checkActiveInactive($event)"
29
+ />
30
+ }
31
+
32
+ @if (isPaginator) {
33
+ <div class="my-4">
34
+ <JCompletePaginator
35
+ [currentPage]="currentPage"
36
+ [itemsPerPageOptions]="itemsPerPageOptions"
37
+ [itemsPerPage]="itemsPerPage"
38
+ [totalItems]="totalItems"
39
+ [pages]="pages"
40
+ (pageChange)="handlePageChange($event)"
41
+ [isLoading]="isLoading('pagination')"
42
+ />
43
+ </div>
44
+ }
45
+
46
+ @if (isLoading('initialLoad') && displayData.length === 0) {
47
+ <div class="j-crud-card w-full flex justify-center items-center h-100 bg-white dark:bg-foreground rounded-[20px] border border-border dark:border-dark-border">
48
+ <div class="flex flex-col gap-3 items-center justify-center py-4">
49
+ <lucide-icon [name]="iconsService.icons.loading" size="30" class="text-primary animate-spin"></lucide-icon>
50
+ <p>Cargando datos...</p>
51
+ </div>
52
+ </div>
53
+ } @else if (displayData.length > 0) {
54
+
55
+ @if (itemTemplate) {
56
+ <div class="j-crud-card grid grid-cols-4 items-start max-[1300px]:grid-cols-3 max-[1150px]:grid-cols-2 max-[800px]:grid-cols-1 gap-4 my-4">
57
+ @for (item of displayData; track trackById($index, item)) {
58
+ <div class="flex flex-col gap-3 rounded-xl border border-border dark:border-dark-border bg-white dark:bg-foreground shadow-sm hover:shadow-lg hover:border-primary/50 hover:dark:border-primary transition-all duration-300">
59
+ <ng-container
60
+ *ngTemplateOutlet="itemTemplate; context: {
61
+ $implicit: item,
62
+ getValue: getValue.bind(this),
63
+ columns: columns,
64
+ item: item,
65
+ template: getTemplate,
66
+ toggleExpanded: toggleExpanded.bind(this),
67
+ isExpanded: isExpanded.bind(this),
68
+ expandData: getExpandData.bind(this),
69
+ expandTemplate: expandTemplate,
70
+ isLoadingExpand: isLoadingExpand.bind(this),
71
+ }"
72
+ />
73
+ </div>
74
+ }
75
+ </div>
76
+
77
+
78
+ } @else {
79
+ <div class="j-crud-card w-full flex justify-center items-center h-100 bg-white dark:bg-foreground rounded-[20px]">
80
+ <p>No se ha definido ninguna plantilla personalizada (<code>itemTemplate</code>).</p>
81
+ </div>
82
+ }
83
+
84
+ } @else if (!isLoading('pagination')) {
85
+ <div class="j-crud-card w-full flex flex-col gap-3 justify-center items-center h-100 bg-white dark:bg-foreground rounded-[20px] border border-border dark:border-dark-border hover:border-primary/50 hover:dark:border-primary">
86
+ <lucide-icon [name]="iconsService.icons.info" size="35" class="text-primary"></lucide-icon>
87
+ <p class="text-black dark:text-white">No hay datos disponibles</p>
88
+ </div>
89
+ }
90
+
91
+ @if (isPaginator) {
92
+ <div class="my-4">
93
+ <JCompletePaginator
94
+ [currentPage]="currentPage"
95
+ [itemsPerPageOptions]="itemsPerPageOptions"
96
+ [itemsPerPage]="itemsPerPage"
97
+ [totalItems]="totalItems"
98
+ [pages]="pages"
99
+ (pageChange)="handlePageChange($event)"
100
+ [isLoading]="isLoading('pagination')"
101
+ />
102
+ </div>
103
+ }
104
+ </div>
@@ -0,0 +1,35 @@
1
+ /*
2
+ ===============================================
3
+ Component and Function Library - tailjNg
4
+ ===============================================
5
+ Description:
6
+ This library is designed to provide a set of reusable components and optimized functions
7
+ to facilitate the development of user interfaces and data management in web applications.
8
+ It includes tools to improve the developer experience and user interaction.
9
+
10
+ Purpose:
11
+ - Create modular and customizable components.
12
+ - Improve front-end development efficiency through reusable tools.
13
+ - Provide scalable solutions that are easy to integrate with existing applications.
14
+
15
+ Usage:
16
+ To access full functionality, simply import the necessary modules and use the
17
+ components according to your use case. Be sure to review the official documentation for detailed examples
18
+ on implementation and customization.
19
+
20
+ Authors:
21
+ Armando Josue Velasquez Delgado - Lead Developer
22
+
23
+ License:
24
+ This project is licensed under the BSD 3-Clause - see the LICENSE file for more details.
25
+
26
+ Version: 0.0.25
27
+ Creation Date: 2025-01-04
28
+ ===============================================
29
+ */
30
+
31
+ .j-crud-card {
32
+ @media (max-width: 470px) {
33
+ width: 485px !important;
34
+ }
35
+ }