@arsedizioni/ars-utils 22.5.37 → 22.5.39
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 +11 -5
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +44 -44
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs +11 -82
- package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-core.mjs +48 -48
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +42 -42
- package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +15 -15
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +118 -0
- package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +17 -378
- package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +368 -0
- package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -0
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +18 -18
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +10 -10
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +12 -12
- package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +61 -61
- package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +6 -6
- package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +9 -9
- package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +9 -9
- package/package.json +9 -1
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +3 -2
- package/types/arsedizioni-ars-utils-core.date.d.ts +4 -37
- package/types/arsedizioni-ars-utils-ui.controls.d.ts +3 -147
- package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +49 -0
- package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +136 -0
- package/types/arsedizioni-ars-utils-ui.navigation.d.ts +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DestroyRef, ChangeDetectorRef, ChangeDetectionStrategy, Component, HostListener, Directive } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { MatCalendar, MatDatepickerInput, MatStartDate, MatEndDate } from '@angular/material/datepicker';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A blank calendar header that hides the month/year navigation controls.
|
|
8
|
+
* Used when an inline calendar should render without any navigation UI.
|
|
9
|
+
*/
|
|
10
|
+
class CalendarEmptyHeader {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.destroyRef = inject(DestroyRef);
|
|
13
|
+
this.calendar = inject((MatCalendar));
|
|
14
|
+
this.changeDetector = inject(ChangeDetectorRef);
|
|
15
|
+
// Re-run change detection whenever the calendar's internal state changes
|
|
16
|
+
// (e.g. active date, selected date) so the blank header stays in sync.
|
|
17
|
+
this.calendar.stateChanges
|
|
18
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
19
|
+
.subscribe(() => this.changeDetector.markForCheck());
|
|
20
|
+
}
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CalendarEmptyHeader, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.4", type: CalendarEmptyHeader, isStandalone: true, selector: "ng-component", ngImport: i0, template: '<div></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: CalendarEmptyHeader, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{
|
|
27
|
+
template: '<div></div>',
|
|
28
|
+
standalone: true,
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
30
|
+
}]
|
|
31
|
+
}], ctorParameters: () => [] });
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Works around a MatDatepicker/Signal Forms interop bug.
|
|
35
|
+
*
|
|
36
|
+
* `MatDatepickerInputBase._onInput()` only notifies its registered validator-change
|
|
37
|
+
* callback from the branch it does not take when the parsed date is null. Signal
|
|
38
|
+
* Forms recomputes CVA parse errors from that callback or from a model value
|
|
39
|
+
* change, and neither happens while the user erases an unparseable date one
|
|
40
|
+
* character at a time (the model is already `null`, so the signal write is a
|
|
41
|
+
* no-op). The stale `matDatepickerParse` error therefore survives on an empty
|
|
42
|
+
* field. Notifying on every keystroke re-runs the datepicker validators.
|
|
43
|
+
*/
|
|
44
|
+
class MatDatepickerParseErrorFixDirective {
|
|
45
|
+
constructor() {
|
|
46
|
+
this.singleDate = inject(MatDatepickerInput, {
|
|
47
|
+
optional: true,
|
|
48
|
+
self: true,
|
|
49
|
+
});
|
|
50
|
+
this.startDate = inject(MatStartDate, {
|
|
51
|
+
optional: true,
|
|
52
|
+
self: true,
|
|
53
|
+
});
|
|
54
|
+
this.endDate = inject(MatEndDate, {
|
|
55
|
+
optional: true,
|
|
56
|
+
self: true,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Re-runs the datepicker validators after Material has updated its internal
|
|
61
|
+
* parse flag.
|
|
62
|
+
*
|
|
63
|
+
* @returns Nothing.
|
|
64
|
+
*/
|
|
65
|
+
onInput() {
|
|
66
|
+
// Deferred: Material updates `_lastValueValid` in its own `input` host
|
|
67
|
+
// listener, and host listener order across directives is not guaranteed.
|
|
68
|
+
queueMicrotask(() => this.revalidate());
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Notifies the validator-change callback of this input and, for range parts,
|
|
72
|
+
* of the sibling input as well.
|
|
73
|
+
*
|
|
74
|
+
* @returns Nothing.
|
|
75
|
+
*/
|
|
76
|
+
revalidate() {
|
|
77
|
+
const host = this.singleDate ?? this.startDate ?? this.endDate;
|
|
78
|
+
if (!host) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
host._validatorOnChange();
|
|
82
|
+
const rangePart = this.startDate ?? this.endDate;
|
|
83
|
+
if (!rangePart) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const rangeInput = rangePart._rangeInput;
|
|
87
|
+
const sibling = this.startDate ? rangeInput._endInput : rangeInput._startInput;
|
|
88
|
+
sibling?._validatorOnChange();
|
|
89
|
+
}
|
|
90
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MatDatepickerParseErrorFixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
91
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: MatDatepickerParseErrorFixDirective, isStandalone: true, selector: "input[matDatepicker], input[matStartDate], input[matEndDate]", host: { listeners: { "input": "onInput()" } }, ngImport: i0 }); }
|
|
92
|
+
}
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: MatDatepickerParseErrorFixDirective, decorators: [{
|
|
94
|
+
type: Directive,
|
|
95
|
+
args: [{
|
|
96
|
+
selector: 'input[matDatepicker], input[matStartDate], input[matEndDate]',
|
|
97
|
+
}]
|
|
98
|
+
}], propDecorators: { onInput: [{
|
|
99
|
+
type: HostListener,
|
|
100
|
+
args: ['input']
|
|
101
|
+
}] } });
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
* Public API Surface of @arsedizioni/ars-utils/ui.controls.date
|
|
105
|
+
*
|
|
106
|
+
* Everything that touches `@angular/material/datepicker`. Kept OUT of `ui.controls` on purpose:
|
|
107
|
+
* `MatDatepickerParseErrorFixDirective` is twenty lines, but `ui.controls` is a single file in the
|
|
108
|
+
* published bundle, so any of its symbols that survives tree-shaking shares the chunk placement of
|
|
109
|
+
* all the others. `ui.dialogs.prompt` needs only this directive, and must not link the file that
|
|
110
|
+
* carries `mat-chips` with it.
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Generated bundle index. Do not edit.
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
export { CalendarEmptyHeader, MatDatepickerParseErrorFixDirective };
|
|
118
|
+
//# sourceMappingURL=arsedizioni-ars-utils-ui.controls.date.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arsedizioni-ars-utils-ui.controls.date.mjs","sources":["../../../projects/ars-utils/ui.controls.date/calendar-empty-header/calendar-empy-header.component.ts","../../../projects/ars-utils/ui.controls.date/date-picker/datepicker-fix.directive.ts","../../../projects/ars-utils/ui.controls.date/public_api.ts","../../../projects/ars-utils/ui.controls.date/arsedizioni-ars-utils-ui.controls.date.ts"],"sourcesContent":["import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, inject } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { MatCalendar } from '@angular/material/datepicker';\r\n\r\n/**\r\n * A blank calendar header that hides the month/year navigation controls.\r\n * Used when an inline calendar should render without any navigation UI.\r\n */\r\n@Component({\r\n template: '<div></div>',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class CalendarEmptyHeader<D> {\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly calendar = inject(MatCalendar<D>);\r\n private readonly changeDetector = inject(ChangeDetectorRef);\r\n\r\n constructor() {\r\n // Re-run change detection whenever the calendar's internal state changes\r\n // (e.g. active date, selected date) so the blank header stays in sync.\r\n this.calendar.stateChanges\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(() => this.changeDetector.markForCheck());\r\n }\r\n}\r\n","import { Directive, HostListener, inject } from '@angular/core';\r\nimport { MatDatepickerInput, MatEndDate, MatStartDate } from '@angular/material/datepicker';\r\n\r\n/** Callback Material date inputs expose so their validators can be re-run on demand. */\r\ninterface RevalidatableDateInput {\r\n _validatorOnChange: () => void;\r\n}\r\n\r\n/**\r\n * Works around a MatDatepicker/Signal Forms interop bug.\r\n *\r\n * `MatDatepickerInputBase._onInput()` only notifies its registered validator-change\r\n * callback from the branch it does not take when the parsed date is null. Signal\r\n * Forms recomputes CVA parse errors from that callback or from a model value\r\n * change, and neither happens while the user erases an unparseable date one\r\n * character at a time (the model is already `null`, so the signal write is a\r\n * no-op). The stale `matDatepickerParse` error therefore survives on an empty\r\n * field. Notifying on every keystroke re-runs the datepicker validators.\r\n */\r\n@Directive({\r\n selector: 'input[matDatepicker], input[matStartDate], input[matEndDate]',\r\n})\r\nexport class MatDatepickerParseErrorFixDirective {\r\n private readonly singleDate = inject<MatDatepickerInput<unknown>>(MatDatepickerInput, {\r\n optional: true,\r\n self: true,\r\n });\r\n private readonly startDate = inject<MatStartDate<unknown>>(MatStartDate, {\r\n optional: true,\r\n self: true,\r\n });\r\n private readonly endDate = inject<MatEndDate<unknown>>(MatEndDate, {\r\n optional: true,\r\n self: true,\r\n });\r\n\r\n /**\r\n * Re-runs the datepicker validators after Material has updated its internal\r\n * parse flag.\r\n *\r\n * @returns Nothing.\r\n */\r\n @HostListener('input')\r\n protected onInput(): void {\r\n // Deferred: Material updates `_lastValueValid` in its own `input` host\r\n // listener, and host listener order across directives is not guaranteed.\r\n queueMicrotask(() => this.revalidate());\r\n }\r\n\r\n /**\r\n * Notifies the validator-change callback of this input and, for range parts,\r\n * of the sibling input as well.\r\n *\r\n * @returns Nothing.\r\n */\r\n private revalidate(): void {\r\n const host = this.singleDate ?? this.startDate ?? this.endDate;\r\n if (!host) {\r\n return;\r\n }\r\n (host as unknown as RevalidatableDateInput)._validatorOnChange();\r\n\r\n const rangePart = this.startDate ?? this.endDate;\r\n if (!rangePart) {\r\n return;\r\n }\r\n const rangeInput = rangePart._rangeInput;\r\n const sibling = this.startDate ? rangeInput._endInput : rangeInput._startInput;\r\n (sibling as unknown as RevalidatableDateInput | undefined)?._validatorOnChange();\r\n }\r\n}","/*\n * Public API Surface of @arsedizioni/ars-utils/ui.controls.date\n *\n * Everything that touches `@angular/material/datepicker`. Kept OUT of `ui.controls` on purpose:\n * `MatDatepickerParseErrorFixDirective` is twenty lines, but `ui.controls` is a single file in the\n * published bundle, so any of its symbols that survives tree-shaking shares the chunk placement of\n * all the others. `ui.dialogs.prompt` needs only this directive, and must not link the file that\n * carries `mat-chips` with it.\n */\nexport * from './calendar-empty-header/calendar-empy-header.component';\nexport * from './date-picker/datepicker-fix.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAIA;;;AAGG;MAMU,mBAAmB,CAAA;AAK9B,IAAA,WAAA,GAAA;AAJiB,QAAA,IAAA,CAAA,UAAU,GAAO,MAAM,CAAC,UAAU,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAS,MAAM,EAAC,WAAc,EAAC;AACvC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;QAKzD,IAAI,CAAC,QAAQ,CAAC;AACX,aAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;aACxC,SAAS,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACxD;8GAXW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,wEAJlB,aAAa,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAId,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE,uBAAuB,CAAC;AAC5C,iBAAA;;;ACJD;;;;;;;;;;AAUG;MAIU,mCAAmC,CAAA;AAHhD,IAAA,WAAA,GAAA;AAIoB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA8B,kBAAkB,EAAE;AACrF,YAAA,QAAQ,EAA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