@eqproject/eqp-dynamic-module 2.11.5 → 2.11.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.
- package/README.md +4 -0
- package/esm2020/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.mjs +3 -3
- package/esm2020/lib/components/private/dynamic-module-field-extra-fix/dynamic-module-field-extra-fix.component.mjs +3 -3
- package/esm2020/lib/components/private/field-graphics-editor/field-graphics-editor.component.mjs +115 -27
- package/esm2020/lib/components/private/field-templates/date-field-template/date-field-template.component.mjs +28 -6
- package/esm2020/lib/components/private/field-templates/image-field-selector-template/image-field-selector-template.component.mjs +25 -5
- package/esm2020/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.mjs +12 -3
- package/esm2020/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.mjs +26 -4
- package/esm2020/lib/components/private/field-templates/text-field-template/text-field-template.component.mjs +28 -6
- package/esm2020/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.mjs +27 -5
- package/esm2020/lib/components/private/form-records/list-form-record/list-form-record.component.mjs +1 -1
- package/esm2020/lib/components/private/form-records/list-view-form-record/list-view-form-record.component.mjs +1 -1
- package/esm2020/lib/components/private/form-statistics/filter-form-statistic/filter-form-statistic.component.mjs +1 -1
- package/esm2020/lib/components/private/form-statistics/filter-templates/text-filter-template/text-filter-template.component.mjs +3 -3
- package/esm2020/lib/components/private/form-statistics/filter-templates/textarea-filter-template/textarea-filter-template.component.mjs +3 -3
- package/esm2020/lib/components/private/trigger-creator/trigger-templates/text-trigger-template/text-trigger-template.component.mjs +3 -3
- package/esm2020/lib/components/private/trigger-creator/trigger-templates/textarea-trigger-template/textarea-trigger-template.component.mjs +3 -3
- package/esm2020/lib/directives/speech-to-text/speech-to-text.directive.mjs +7 -2
- package/esm2020/lib/utils/css-property-catalog.mjs +45 -2
- package/esm2020/lib/utils/field-style-catalog.mjs +45 -19
- package/esm2020/lib/utils/floating-label-styles.mjs +155 -0
- package/esm2020/lib/utils/refresh-outline-notch.mjs +38 -0
- package/fesm2015/eqproject-eqp-dynamic-module.mjs +799 -339
- package/fesm2015/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/fesm2020/eqproject-eqp-dynamic-module.mjs +779 -325
- package/fesm2020/eqproject-eqp-dynamic-module.mjs.map +1 -1
- package/lib/components/private/field-graphics-editor/field-graphics-editor.component.d.ts +19 -1
- package/lib/components/private/field-templates/image-field-selector-template/image-field-selector-template.component.d.ts +6 -2
- package/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.d.ts +6 -2
- package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +6 -2
- package/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.d.ts +6 -2
- package/lib/directives/speech-to-text/speech-to-text.directive.d.ts +3 -1
- package/lib/utils/css-property-catalog.d.ts +25 -0
- package/lib/utils/field-style-catalog.d.ts +5 -0
- package/lib/utils/floating-label-styles.d.ts +73 -0
- package/lib/utils/refresh-outline-notch.d.ts +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rimisura la label di un mat-form-field "outline" e riallinea l'apertura nel bordo.
|
|
3
|
+
*
|
|
4
|
+
* Material misura la label solo alla creazione del campo: se poi gli stili iniettati
|
|
5
|
+
* cambiano font, spaziatura o larghezza della descrizione, l'apertura resta stretta
|
|
6
|
+
* e la label sollevata viene tagliata.
|
|
7
|
+
*/
|
|
8
|
+
export function refreshOutlineNotch(formField) {
|
|
9
|
+
if (!formField) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
// Attende che il browser applichi il nuovo tag <style> prima di misurare
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
formField._refreshOutlineNotchWidth();
|
|
15
|
+
// Il form field è OnPush: senza questo la nuova larghezza non arriva al bordo
|
|
16
|
+
formField._changeDetectorRef?.markForCheck();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Rimisura la label ogni volta che si solleva o torna dentro la casella: le due posizioni
|
|
21
|
+
* possono avere grafiche diverse, e Material misurerebbe quella a riposo anche per il bordo.
|
|
22
|
+
* Restituisce l'osservatore, da scollegare nell'ngOnDestroy.
|
|
23
|
+
*/
|
|
24
|
+
export function watchOutlineNotch(formField) {
|
|
25
|
+
const host = formField?._elementRef?.nativeElement;
|
|
26
|
+
if (!host || typeof MutationObserver === 'undefined') {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const observer = new MutationObserver((mutations) => {
|
|
30
|
+
const labelChanged = mutations.some((m) => m.target.classList?.contains('mdc-floating-label'));
|
|
31
|
+
if (labelChanged) {
|
|
32
|
+
refreshOutlineNotch(formField);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
observer.observe(host, { attributes: true, attributeFilter: ['class'], subtree: true });
|
|
36
|
+
return observer;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVmcmVzaC1vdXRsaW5lLW5vdGNoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZXFwLWR5bmFtaWMtbW9kdWxlL3NyYy9saWIvdXRpbHMvcmVmcmVzaC1vdXRsaW5lLW5vdGNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxtQkFBbUIsQ0FBQyxTQUFtQztJQUNuRSxJQUFJLENBQUMsU0FBUyxFQUFFO1FBQUUsT0FBTztLQUFFO0lBRTNCLHlFQUF5RTtJQUN6RSxVQUFVLENBQUMsR0FBRyxFQUFFO1FBQ1osU0FBUyxDQUFDLHlCQUF5QixFQUFFLENBQUM7UUFDdEMsOEVBQThFO1FBQzdFLFNBQWlCLENBQUMsa0JBQWtCLEVBQUUsWUFB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