@zambon-dev/library 1.5.0 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -23,6 +23,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
23
23
 
24
24
  ### ⚠ Breaking Changes / Migration
25
25
 
26
+ ## [1.6.0] - 2026-09-16
27
+
28
+ ### Added
29
+
30
+ - **`DisplayControls`**, which records the form controls that exist only to show a catalog
31
+ selection's label. `lib-catalog-select` works in pairs — `controlName` holds the identifier,
32
+ `displayControlName` holds the text — and it creates the second itself when a screen does not
33
+ declare one, so a form carries controls nobody wrote down. It now marks whichever control it
34
+ drives as its display, and `framework-button-filters` reads that mark to keep those out of what
35
+ it submits.
36
+
37
+ The mark is held in a `WeakSet` keyed by the control instance, not by its name: two forms may
38
+ each have an `employeeName`, and only the one a catalog select drives is a display control.
39
+ Nothing about an application changes — declaring the display control yourself still works, and
40
+ it is marked just the same.
41
+
26
42
  ## [1.5.0] - 2026-09-09
27
43
 
28
44
  ### Added
@@ -249,7 +265,8 @@ config options and the `getUserProfile()` method still exist but are no longer c
249
265
  available via [GitHub Releases](https://github.com/RicardoZambon/ZLibraries/releases) and the
250
266
  `library-v*` tags.
251
267
 
252
- [Unreleased]: https://github.com/RicardoZambon/ZLibraries/compare/library-v1.5.0...HEAD
268
+ [Unreleased]: https://github.com/RicardoZambon/ZLibraries/compare/library-v1.6.0...HEAD
269
+ [1.6.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/library-v1.6.0
253
270
  [1.5.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/library-v1.5.0
254
271
  [1.4.1]: https://github.com/RicardoZambon/ZLibraries/releases/tag/library-v1.4.1
255
272
  [1.4.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/library-v1.4.0
@@ -38,6 +38,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
38
38
  args: [{ template: '' }]
39
39
  }] });
40
40
 
41
+ class DateHelpers {
42
+ //#region Public methods
43
+ static diffDays(initialDate, finalDate) {
44
+ const initialDateOnly = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());
45
+ const finalDateOnly = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());
46
+ const diff = initialDateOnly.getTime() - finalDateOnly.getTime();
47
+ return Math.floor(diff / (1000 * 60 * 60 * 24));
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Tracks the form controls that exist only to show a catalog selection's label.
53
+ *
54
+ * `lib-catalog-select` works in pairs: the control named by `controlName` holds the identifier, and
55
+ * the one named by `displayControlName` holds the text the user reads. The second is created by the
56
+ * component itself when a screen does not declare it, so a form ends up carrying controls nobody
57
+ * wrote down — and a filters form then submits them alongside the real filters.
58
+ *
59
+ * The mark lives in a `WeakSet` keyed by the control instance rather than by its name. That is the
60
+ * only scope that is actually correct: two forms may each have an `employeeName`, and only the one
61
+ * a catalog select drives is a display control. It also keeps nothing alive.
62
+ */
63
+ class DisplayControls {
64
+ //#region Variables
65
+ static marked = new WeakSet();
66
+ //#endregion
67
+ //#region Public methods
68
+ /**
69
+ * Whether the control exists only to display a catalog selection's label.
70
+ *
71
+ * @param control The control, which may be absent.
72
+ * @returns `true` when a catalog select drives it as its display control.
73
+ */
74
+ static isDisplayControl(control) {
75
+ return !!control && DisplayControls.marked.has(control);
76
+ }
77
+ /**
78
+ * Marks the control as existing only to display a catalog selection's label.
79
+ *
80
+ * @param control The control, which may be absent.
81
+ */
82
+ static markAsDisplayControl(control) {
83
+ if (control) {
84
+ DisplayControls.marked.add(control);
85
+ }
86
+ }
87
+ }
88
+
89
+ class GuidHelper {
90
+ static generateGUID() {
91
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
92
+ const r = (Math.random() * 16) | 0;
93
+ const v = c === 'x' ? r : (r & 0x3) | 0x8;
94
+ return v.toString(16);
95
+ });
96
+ }
97
+ }
98
+
99
+ class RouterFormatter {
100
+ //#region ViewChilds, Inputs, Outputs
101
+ //#endregion
102
+ //#region Variables
103
+ //#endregion
104
+ //#region Properties
105
+ //#endregion
106
+ //#region Constructor and Angular life cycle methods
107
+ //#endregion
108
+ //#region Event handlers
109
+ //#endregion
110
+ //#region Public methods
111
+ static getURL(route) {
112
+ let parentRoute = '';
113
+ if (route.parent) {
114
+ parentRoute = this.getURL(route.parent);
115
+ }
116
+ let path = route.routeConfig?.path ?? '';
117
+ route.paramMap.keys
118
+ .forEach(k => {
119
+ path = path.replace(':' + k, k === 'view'
120
+ ? ''
121
+ : (route.paramMap.get(k) ?? ''));
122
+ });
123
+ if (!route.parent || (parentRoute !== '' && parentRoute !== '/' && route.routeConfig?.path && path)) {
124
+ parentRoute += '/';
125
+ }
126
+ return parentRoute + path;
127
+ }
128
+ }
129
+
41
130
  class CatalogService {
42
131
  //#region ViewChilds, Inputs, Outputs
43
132
  //#endregion
@@ -193,57 +282,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
193
282
  type: Injectable
194
283
  }], ctorParameters: () => [] });
195
284
 
196
- class DateHelpers {
197
- //#region Public methods
198
- static diffDays(initialDate, finalDate) {
199
- const initialDateOnly = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());
200
- const finalDateOnly = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());
201
- const diff = initialDateOnly.getTime() - finalDateOnly.getTime();
202
- return Math.floor(diff / (1000 * 60 * 60 * 24));
203
- }
204
- }
205
-
206
- class GuidHelper {
207
- static generateGUID() {
208
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
209
- const r = (Math.random() * 16) | 0;
210
- const v = c === 'x' ? r : (r & 0x3) | 0x8;
211
- return v.toString(16);
212
- });
213
- }
214
- }
215
-
216
- class RouterFormatter {
217
- //#region ViewChilds, Inputs, Outputs
218
- //#endregion
219
- //#region Variables
220
- //#endregion
221
- //#region Properties
222
- //#endregion
223
- //#region Constructor and Angular life cycle methods
224
- //#endregion
225
- //#region Event handlers
226
- //#endregion
227
- //#region Public methods
228
- static getURL(route) {
229
- let parentRoute = '';
230
- if (route.parent) {
231
- parentRoute = this.getURL(route.parent);
232
- }
233
- let path = route.routeConfig?.path ?? '';
234
- route.paramMap.keys
235
- .forEach(k => {
236
- path = path.replace(':' + k, k === 'view'
237
- ? ''
238
- : (route.paramMap.get(k) ?? ''));
239
- });
240
- if (!route.parent || (parentRoute !== '' && parentRoute !== '/' && route.routeConfig?.path && path)) {
241
- parentRoute += '/';
242
- }
243
- return parentRoute + path;
244
- }
245
- }
246
-
247
285
  class GridConfigsProvider {
248
286
  //#region ViewChilds, Inputs, Outputs
249
287
  //#endregion
@@ -1833,6 +1871,10 @@ class CatalogSelectComponent extends BaseComponent {
1833
1871
  if (!parent.get(name)) {
1834
1872
  parent.addControl(name, new FormControl(''));
1835
1873
  }
1874
+ // Marked whether this component created it or the screen declared it: what makes a control
1875
+ // a display control is being driven as one, not who wrote it down. A filters form reads the
1876
+ // mark to keep it out of what it submits.
1877
+ DisplayControls.markAsDisplayControl(parent.get(name));
1836
1878
  }
1837
1879
  });
1838
1880
  }
@@ -4013,5 +4055,5 @@ class DateValidators {
4013
4055
  * Generated bundle index. Do not edit.
4014
4056
  */
4015
4057
 
4016
- export { BaseComponent, BaseDataset, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateValidators, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, toSidebarMenuOpenMode };
4058
+ export { BaseComponent, BaseDataset, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, toSidebarMenuOpenMode };
4017
4059
  //# sourceMappingURL=zambon-dev-library.mjs.map