tailjng 0.1.6 → 0.1.7

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 (176) hide show
  1. package/README.md +12 -4
  2. package/cli/execute/init-app.js +5 -2
  3. package/cli/execute/sync-app.js +14 -2
  4. package/cli/settings/colors-config-utils.js +43 -8
  5. package/cli/settings/icons-config-utils.js +62 -0
  6. package/cli/settings/path-utils.js +32 -2
  7. package/cli/settings/project-utils.js +7 -1
  8. package/cli/templates/app.generator.js +2 -2
  9. package/fesm2022/tailjng.mjs +247 -80
  10. package/fesm2022/tailjng.mjs.map +1 -1
  11. package/lib/services/static/theme.service.d.ts +39 -1
  12. package/lib/utils/theme/theme-variables.util.d.ts +31 -0
  13. package/package.json +1 -1
  14. package/public-api.d.ts +2 -1
  15. package/registry/components.json +41 -18
  16. package/src/colors.safelist.css +2 -2
  17. package/src/lib/components/.config/README.md +11 -0
  18. package/src/lib/components/.config/colors/README.md +38 -0
  19. package/src/lib/components/{colors-config → .config/colors}/colors.config.ts +5 -5
  20. package/src/lib/components/{colors-config → .config/colors}/colors.safelist.css +2 -2
  21. package/src/lib/components/.config/icons/README.md +26 -0
  22. package/src/lib/components/.config/icons/icons.lucide.ts +134 -0
  23. package/src/lib/components/.config/input/README.md +24 -0
  24. package/src/lib/components/.config/input/input.classes.ts +119 -0
  25. package/src/lib/components/alert/alert-dialog/dialog-alert.component.css +244 -2
  26. package/src/lib/components/alert/alert-dialog/dialog-alert.component.html +25 -38
  27. package/src/lib/components/alert/alert-dialog/dialog-alert.component.ts +66 -56
  28. package/src/lib/components/alert/alert-dialog/dialog-alert.types.ts +19 -0
  29. package/src/lib/components/alert/alert-toast/toast-alert.component.css +630 -12
  30. package/src/lib/components/alert/alert-toast/toast-alert.component.html +103 -102
  31. package/src/lib/components/alert/alert-toast/toast-alert.component.ts +485 -128
  32. package/src/lib/components/alert/alert-toast/toast-alert.types.ts +25 -0
  33. package/src/lib/components/badge/badge.component.html +34 -21
  34. package/src/lib/components/badge/badge.component.ts +140 -31
  35. package/src/lib/components/button/button.component.html +16 -10
  36. package/src/lib/components/button/button.component.ts +162 -22
  37. package/src/lib/components/card/card-complete/complete-card.component.html +2 -2
  38. package/src/lib/components/card/card-complete/complete-card.component.ts +26 -16
  39. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.html +2 -2
  40. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.ts +26 -16
  41. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.css +97 -0
  42. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.html +54 -46
  43. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.ts +135 -64
  44. package/src/lib/components/checkbox/checkbox-input/input-checkbox.types.ts +3 -0
  45. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.css +112 -0
  46. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.html +28 -25
  47. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.ts +67 -15
  48. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.types.ts +1 -0
  49. package/src/lib/components/coach-mark/coach-mark.component.html +4 -22
  50. package/src/lib/components/coach-mark/coach-mark.component.scss +1 -1
  51. package/src/lib/components/coach-mark/coach-mark.component.ts +51 -18
  52. package/src/lib/components/coach-mark/coach-mark.directive.ts +133 -78
  53. package/src/lib/components/coach-mark/coach-mark.types.ts +12 -0
  54. package/src/lib/components/dialog/dialog.component.css +103 -1
  55. package/src/lib/components/dialog/dialog.component.html +46 -66
  56. package/src/lib/components/dialog/dialog.component.ts +136 -110
  57. package/src/lib/components/dialog/dialog.types.ts +19 -0
  58. package/src/lib/components/filter/filter-complete/complete-filter.component.html +16 -19
  59. package/src/lib/components/filter/filter-complete/complete-filter.component.scss +35 -0
  60. package/src/lib/components/filter/filter-complete/complete-filter.component.ts +58 -34
  61. package/src/lib/components/filter/filter-complete/complete-filter.types.ts +7 -0
  62. package/src/lib/components/filter/filter-complete/complete-filter.util.ts +16 -0
  63. package/src/lib/components/form/form-container/container-form.component.css +4 -0
  64. package/src/lib/components/form/form-container/container-form.component.html +2 -2
  65. package/src/lib/components/form/form-container/container-form.component.ts +72 -16
  66. package/src/lib/components/form/form-container/container-form.types.ts +42 -0
  67. package/src/lib/components/form/form-container/form-col-span.directive.ts +25 -0
  68. package/src/lib/components/form/form-sidebar/sidebar-form.component.css +276 -0
  69. package/src/lib/components/form/form-sidebar/sidebar-form.component.html +117 -125
  70. package/src/lib/components/form/form-sidebar/sidebar-form.component.ts +109 -34
  71. package/src/lib/components/form/form-sidebar/sidebar-form.types.ts +3 -0
  72. package/src/lib/components/{toggle-radio/toggle-radio.component.css → form/form-validation/validation-form.component.css} +0 -1
  73. package/src/lib/components/form/form-validation/validation-form.component.html +10 -6
  74. package/src/lib/components/form/form-validation/validation-form.component.ts +99 -12
  75. package/src/lib/components/form/form-validation/validation-form.types.ts +33 -0
  76. package/src/lib/components/icon/icon.component.html +8 -5
  77. package/src/lib/components/icon/icon.component.ts +111 -9
  78. package/src/lib/components/input/input/input.component.html +19 -16
  79. package/src/lib/components/input/input/input.component.ts +130 -53
  80. package/src/lib/components/input/input/input.types.ts +8 -0
  81. package/src/lib/components/input/input-file/file-input.component.html +65 -56
  82. package/src/lib/components/input/input-file/file-input.component.ts +276 -173
  83. package/src/lib/components/input/input-file/file-input.types.ts +2 -0
  84. package/src/lib/components/input/input-range/range-input.component.css +67 -0
  85. package/src/lib/components/input/input-range/range-input.component.html +50 -58
  86. package/src/lib/components/input/input-range/range-input.component.ts +148 -60
  87. package/src/lib/components/input/input-range/range-input.types.ts +7 -0
  88. package/src/lib/components/input/input-textarea/textarea-input.component.html +16 -7
  89. package/src/lib/components/input/input-textarea/textarea-input.component.ts +140 -50
  90. package/src/lib/components/input/input-textarea/textarea-input.types.ts +2 -0
  91. package/src/lib/components/label/label.component.html +17 -16
  92. package/src/lib/components/label/label.component.ts +70 -16
  93. package/src/lib/components/label/label.types.ts +2 -0
  94. package/src/lib/components/menu/menu-options-table/menu-options-defaults.ts +34 -0
  95. package/src/lib/components/menu/menu-options-table/options-table-menu.component.html +34 -20
  96. package/src/lib/components/menu/menu-options-table/options-table-menu.component.ts +211 -58
  97. package/src/lib/components/menu/menu-options-table/options-table-menu.types.ts +38 -0
  98. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.html +49 -52
  99. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.ts +112 -24
  100. package/src/lib/components/menu/options-coach-menu/options-coach-menu.types.ts +9 -0
  101. package/src/lib/components/mode-toggle/mode-toggle.component.html +11 -16
  102. package/src/lib/components/mode-toggle/mode-toggle.component.ts +69 -33
  103. package/src/lib/components/paginator/paginator-complete/complete-paginator.component.html +4 -4
  104. package/src/lib/components/paginator/paginator-complete/complete-paginator.component.ts +31 -7
  105. package/src/lib/components/paginator/paginator-complete/complete-paginator.types.ts +12 -0
  106. package/src/lib/components/paginator/paginator-complete/complete-paginator.util.ts +36 -0
  107. package/src/lib/components/progress-bar/progress-bar.component.css +11 -0
  108. package/src/lib/components/progress-bar/progress-bar.component.html +41 -40
  109. package/src/lib/components/progress-bar/progress-bar.component.ts +95 -11
  110. package/src/lib/components/progress-bar/progress-bar.types.ts +2 -0
  111. package/src/lib/components/select/select-dropdown/dropdown-select.component.css +6 -0
  112. package/src/lib/components/select/select-dropdown/dropdown-select.component.html +54 -44
  113. package/src/lib/components/select/select-dropdown/dropdown-select.component.ts +450 -509
  114. package/src/lib/components/select/select-dropdown/dropdown-select.types.ts +43 -0
  115. package/src/lib/components/select/select-dropdown/dropdown-select.util.ts +179 -0
  116. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.css +6 -0
  117. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.html +131 -42
  118. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.ts +491 -475
  119. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.types.ts +22 -0
  120. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.util.ts +20 -0
  121. package/src/lib/components/select/select-multi-table/multi-table-select.component.css +10 -0
  122. package/src/lib/components/select/select-multi-table/multi-table-select.component.html +76 -60
  123. package/src/lib/components/select/select-multi-table/multi-table-select.component.ts +250 -313
  124. package/src/lib/components/select/select-multi-table/multi-table-select.types.ts +10 -0
  125. package/src/lib/components/select/select-multi-table/multi-table-select.util.ts +5 -0
  126. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.css +212 -0
  127. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.html +62 -53
  128. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.ts +84 -27
  129. package/src/lib/components/sidebar/sidebar-static/static-sidebar.types.ts +2 -0
  130. package/src/lib/components/table/table-complete/complete-table.component.html +15 -17
  131. package/src/lib/components/table/table-complete/complete-table.component.ts +190 -338
  132. package/src/lib/components/table/table-complete/complete-table.types.ts +28 -0
  133. package/src/lib/components/table/table-complete/complete-table.util.ts +236 -0
  134. package/src/lib/components/table/table-complete/index.ts +2 -0
  135. package/src/lib/components/table/table-crud-complete/complete-crud-table.animations.ts +34 -0
  136. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +73 -128
  137. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +542 -829
  138. package/src/lib/components/table/table-crud-complete/complete-crud-table.types.ts +57 -0
  139. package/src/lib/components/table/table-crud-complete/complete-crud-table.util.ts +723 -0
  140. package/src/lib/components/table/table-crud-complete/index.ts +3 -0
  141. package/src/lib/components/theme-generator/theme-generator.component.css +21 -0
  142. package/src/lib/components/theme-generator/theme-generator.component.html +146 -116
  143. package/src/lib/components/theme-generator/theme-generator.component.ts +44 -24
  144. package/src/lib/components/toggle-radio/shared/toggle-options.types.ts +8 -0
  145. package/src/lib/components/toggle-radio/shared/toggle-options.util.ts +44 -0
  146. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.css +135 -0
  147. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.html +52 -0
  148. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.ts +198 -0
  149. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.types.ts +1 -0
  150. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.css +108 -0
  151. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.html +37 -0
  152. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.ts +193 -0
  153. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.types.ts +1 -0
  154. package/src/lib/components/tooltip/tooltip.directive.ts +12 -9
  155. package/src/lib/components/tooltip/tooltip.service.ts +331 -133
  156. package/src/lib/components/tooltip/tooltip.types.ts +9 -0
  157. package/src/lib/components/viewer/viewer-image/image-viewer.component.css +90 -4
  158. package/src/lib/components/viewer/viewer-image/image-viewer.component.html +52 -103
  159. package/src/lib/components/viewer/viewer-image/image-viewer.component.ts +182 -177
  160. package/src/lib/components/viewer/viewer-image/image-viewer.types.ts +3 -0
  161. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.css +177 -0
  162. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.html +74 -24
  163. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.ts +168 -15
  164. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.types.ts +1 -0
  165. package/src/styles.css +2 -2
  166. package/lib/services/static/icons.service.d.ts +0 -65
  167. package/src/lib/components/colors-config/README.md +0 -38
  168. package/src/lib/components/form/form-sidebar/sidebar-form.component.scss +0 -0
  169. package/src/lib/components/form/form-validation/validation-form.component.scss +0 -0
  170. package/src/lib/components/menu/menu-options-table/options-table-menu.component.scss +0 -0
  171. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.scss +0 -12
  172. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.scss +0 -0
  173. package/src/lib/components/toggle-radio/toggle-radio.component.html +0 -51
  174. package/src/lib/components/toggle-radio/toggle-radio.component.ts +0 -222
  175. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.scss +0 -0
  176. package/tailjng-0.1.6.tgz +0 -0
@@ -1,222 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { Component, EventEmitter, forwardRef, Input, OnChanges, OnInit, Optional, Output, SimpleChanges } from '@angular/core';
3
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import { LucideAngularModule } from 'lucide-angular';
5
- import { JIconsService, JGenericCrudService } from 'tailjng';
6
-
7
- @Component({
8
- selector: 'JToggleRadio',
9
- imports: [LucideAngularModule, CommonModule],
10
- templateUrl: './toggle-radio.component.html',
11
- styleUrl: './toggle-radio.component.css',
12
- providers: [
13
- {
14
- provide: NG_VALUE_ACCESSOR,
15
- useExisting: forwardRef(() => JToggleRadioComponent),
16
- multi: true,
17
- },
18
- ],
19
- })
20
- export class JToggleRadioComponent implements OnInit, OnChanges, ControlValueAccessor {
21
-
22
- @Input() endpoint: string = '';
23
-
24
- @Input() options: any[] = [];
25
- @Input() optionLabel = 'label';
26
- @Input() optionValue = 'value';
27
-
28
- @Input() sort: 'ASC' | 'DESC' = 'ASC';
29
- @Input() defaultFilters: { [key: string]: any } = {};
30
-
31
- @Input() loadOnInit = false;
32
- @Input() selectFirstOnLoad: boolean = false;
33
-
34
- @Input() isDisabled: boolean = false;
35
- @Input() showClear = false;
36
-
37
- @Input() classes: string = '';
38
- @Input() classesElement: string = '';
39
-
40
- @Output() selectionChange = new EventEmitter<any>();
41
-
42
- internalOptions: { value: any; label: string }[] = [];
43
- selectedValue: any = null;
44
- isLoading = false;
45
-
46
- isComponentDisabled = false;
47
-
48
- // ControlValueAccessor
49
- onChange: any = () => { };
50
- onTouched: any = () => { };
51
-
52
- constructor(
53
- public readonly iconsService: JIconsService,
54
- @Optional() private readonly genericService: JGenericCrudService | null,
55
- ) { }
56
-
57
- ngOnInit(): void {
58
- if (this.endpoint && this.loadOnInit) {
59
- this.loadOptionsFromApi();
60
- } else {
61
- this.processOptions();
62
- }
63
- }
64
-
65
- ngOnChanges(changes: SimpleChanges): void {
66
- if (changes['options'] && !this.endpoint) {
67
- this.processOptions();
68
- }
69
- }
70
-
71
-
72
-
73
- /**
74
- * Set the disabled state of the component.
75
- * This method is part of the ControlValueAccessor interface.
76
- * @param isDisabled
77
- */
78
- setDisabledState(isDisabled: boolean): void {
79
- this.isComponentDisabled = isDisabled;
80
- }
81
-
82
-
83
-
84
- /**
85
- * Load options from the API based on the endpoint and default filters.
86
- * This method fetches data from the API and processes it to set the internal options.
87
- */
88
- loadOptionsFromApi() {
89
- if (!this.genericService || !this.endpoint) return;
90
-
91
- this.isLoading = true;
92
-
93
- const params: any = {};
94
- params['sortOrder'] = this.sort;
95
-
96
- Object.keys(this.defaultFilters).forEach((key) => {
97
- params[`filter[${key}]`] = this.defaultFilters[key];
98
- });
99
-
100
- this.genericService.findAll<any>({ endpoint: this.endpoint, params }).subscribe({
101
- next: (res) => {
102
- const data = res.data[this.endpoint] || [];
103
- this.options = data;
104
- this.processOptions();
105
- this.isLoading = false;
106
-
107
- // If selectFirstOnLoad is true, select the first element
108
- if (this.selectFirstOnLoad && this.internalOptions.length > 0) {
109
- this.selectedValue = this.internalOptions[0].value;
110
- this.onChange(this.selectedValue);
111
- this.selectionChange.emit(this.selectedValue);
112
- }
113
- },
114
- error: () => (this.isLoading = false),
115
- });
116
- }
117
-
118
-
119
-
120
- /**
121
- * Get a nested value from an object using a dot-separated path.
122
- * @param obj The object to search.
123
- * @param path The dot-separated path to the desired value.
124
- * @returns The value found at the specified path, or an empty string if not found.
125
- */
126
- getNestedValue(obj: any, path: string): any {
127
- return path.split('.').reduce((acc, part) => acc && acc[part], obj) ?? '';
128
- }
129
-
130
-
131
-
132
- /**
133
- * Process the options to extract value and label.
134
- * This method checks if the options are objects and extracts the specified value and label.
135
- */
136
- processOptions() {
137
- if (this.options.length > 0 && typeof this.options[0] === 'object') {
138
-
139
- this.internalOptions = this.options.map((opt) => ({
140
- value: opt[this.optionValue],
141
- label: this.getNestedValue(opt, this.optionLabel),
142
- }));
143
-
144
- } else {
145
- this.internalOptions = this.options.map((opt) => ({
146
- value: opt,
147
- label: opt.toString(),
148
- }));
149
- }
150
- }
151
-
152
-
153
-
154
- /**
155
- * Select an option.
156
- * @param value The value of the option to select.
157
- * @returns
158
- */
159
- select(value: any) {
160
- if (this.isDisabled || this.isComponentDisabled) return;
161
- this.selectedValue = value;
162
- this.onChange(this.selectedValue);
163
- this.selectionChange.emit(this.selectedValue);
164
- }
165
-
166
-
167
-
168
- /**
169
- * Clear the selected value.
170
- */
171
- clear() {
172
- this.selectedValue = null;
173
- this.onChange(null);
174
- this.selectionChange.emit(null);
175
- }
176
-
177
-
178
-
179
- /**
180
- * Write the value to the component.
181
- * This method is part of the ControlValueAccessor interface.
182
- * It updates the selected value and notifies the change.
183
- * @param value The value to write.
184
- */
185
- writeValue(value: any): void {
186
- this.selectedValue = value;
187
- }
188
-
189
-
190
-
191
- /**
192
- * Register a callback function to be called when the value changes.
193
- * This method is part of the ControlValueAccessor interface.
194
- * @param fn
195
- */
196
- registerOnChange(fn: any): void {
197
- this.onChange = fn;
198
- }
199
-
200
-
201
-
202
- /**
203
- * Register a callback function to be called when the control is touched.
204
- * This method is part of the ControlValueAccessor interface.
205
- * @param fn The callback function to register.
206
- */
207
- registerOnTouched(fn: any): void {
208
- this.onTouched = fn;
209
- }
210
-
211
-
212
-
213
- /**
214
- * Reload the options based on the current filters.
215
- * This method can be called to refresh the options displayed in the toggle radio component.
216
- */
217
- reloadOptions() {
218
- if (!this.genericService) return;
219
- this.loadOptionsFromApi();
220
- }
221
-
222
- }
package/tailjng-0.1.6.tgz DELETED
Binary file