@lucca-front/ng 19.1.6 → 19.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.
- package/fesm2022/lucca-front-ng-form-field.mjs +34 -28
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-title.mjs +26 -17
- package/fesm2022/lucca-front-ng-title.mjs.map +1 -1
- package/form-field/form-field.component.d.ts +3 -3
- package/package.json +34 -34
- package/title/README.md +40 -46
- package/title/title-translate.service.d.ts +2 -1
- package/title/title.strategy.d.ts +15 -7
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { NgIf, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, Renderer2, contentChildren, computed,
|
|
4
|
-
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
3
|
+
import { InjectionToken, inject, Injector, Renderer2, contentChildren, computed, signal, input, booleanAttribute, model, effect, afterNextRender, forwardRef, Component, ViewEncapsulation, ElementRef, Directive, Input } from '@angular/core';
|
|
5
4
|
import { RequiredValidator, NgControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
6
5
|
import { getIntl, LuClass, ɵeffectWithDeps as _effectWithDeps, IntlParamsPipe, PortalDirective } from '@lucca-front/ng/core';
|
|
7
6
|
import { IconComponent } from '@lucca-front/ng/icon';
|
|
8
7
|
import { InlineMessageComponent } from '@lucca-front/ng/inline-message';
|
|
9
8
|
import * as i1 from '@lucca-front/ng/tooltip';
|
|
10
9
|
import { LuTooltipModule } from '@lucca-front/ng/tooltip';
|
|
11
|
-
import {
|
|
12
|
-
import { map, startWith } from 'rxjs/operators';
|
|
10
|
+
import { BehaviorSubject } from 'rxjs';
|
|
13
11
|
|
|
14
12
|
const FORM_FIELD_INSTANCE = new InjectionToken('FORM_FIELD_INSTANCE');
|
|
15
13
|
|
|
@@ -48,7 +46,10 @@ const luFormFieldTranslations = Translations;
|
|
|
48
46
|
let nextId = 0;
|
|
49
47
|
class FormFieldComponent {
|
|
50
48
|
#luClass;
|
|
49
|
+
#injector;
|
|
51
50
|
#renderer;
|
|
51
|
+
#hasInputRequired;
|
|
52
|
+
#invalidStatus;
|
|
52
53
|
#inputs;
|
|
53
54
|
get contentLength() {
|
|
54
55
|
return this.#inputs[0]?.host?.nativeElement?.value.length || 0;
|
|
@@ -72,6 +73,7 @@ class FormFieldComponent {
|
|
|
72
73
|
constructor() {
|
|
73
74
|
this.intl = getIntl(LU_FORM_FIELD_TRANSLATIONS);
|
|
74
75
|
this.#luClass = inject(LuClass);
|
|
76
|
+
this.#injector = inject(Injector);
|
|
75
77
|
this.#renderer = inject(Renderer2);
|
|
76
78
|
this.formFieldChildren = contentChildren(FormFieldComponent, { descendants: true });
|
|
77
79
|
this.requiredValidators = contentChildren(RequiredValidator, { descendants: true });
|
|
@@ -80,19 +82,8 @@ class FormFieldComponent {
|
|
|
80
82
|
this.ignoredControls = computed(() => new Set(this.formFieldChildren().flatMap((f) => f.ngControls())));
|
|
81
83
|
this.ownRequiredValidators = computed(() => this.requiredValidators().filter((c) => !this.ignoredRequiredValidators().has(c)));
|
|
82
84
|
this.ownControls = computed(() => this.ngControls().filter((c) => !this.ignoredControls().has(c)));
|
|
83
|
-
this
|
|
84
|
-
|
|
85
|
-
// We need to use startWith here so the observable will also emit when new controls are added on the fly,
|
|
86
|
-
// before they even emit any control-related event
|
|
87
|
-
startWith(void 0), map(() => [...controls]));
|
|
88
|
-
})), {
|
|
89
|
-
initialValue: [],
|
|
90
|
-
});
|
|
91
|
-
this.isInputRequired = computed(() => {
|
|
92
|
-
const hasRequiredFormControl = this.refreshedOwnControls().some((c) => c.control.hasValidator(Validators.required));
|
|
93
|
-
const hasRequiredNgModel = this.ownRequiredValidators().some((c) => booleanAttribute(c.required));
|
|
94
|
-
return hasRequiredNgModel || hasRequiredFormControl;
|
|
95
|
-
});
|
|
85
|
+
this.#hasInputRequired = signal(false);
|
|
86
|
+
this.isInputRequired = this.#hasInputRequired.asReadonly();
|
|
96
87
|
this.label = input.required();
|
|
97
88
|
/**
|
|
98
89
|
* Hide field label, while keeping it in DOM for screen readers
|
|
@@ -102,17 +93,8 @@ class FormFieldComponent {
|
|
|
102
93
|
this.inline = input(false, { transform: booleanAttribute });
|
|
103
94
|
this.statusControl = input(null);
|
|
104
95
|
this.tooltip = input(null);
|
|
105
|
-
this
|
|
106
|
-
|
|
107
|
-
if (isInvalidOverride) {
|
|
108
|
-
return isInvalidOverride;
|
|
109
|
-
}
|
|
110
|
-
const statusControlOverride = this.statusControl();
|
|
111
|
-
if (statusControlOverride) {
|
|
112
|
-
return statusControlOverride.invalid && this.refreshedOwnControls().some((c) => c.touched);
|
|
113
|
-
}
|
|
114
|
-
return this.refreshedOwnControls().some((c) => c.invalid && c.touched);
|
|
115
|
-
});
|
|
96
|
+
this.#invalidStatus = signal(false);
|
|
97
|
+
this.invalidStatus = this.#invalidStatus.asReadonly();
|
|
116
98
|
this.invalid = input(null, { transform: booleanAttribute });
|
|
117
99
|
this.inlineMessage = input(null);
|
|
118
100
|
/**
|
|
@@ -191,6 +173,30 @@ class FormFieldComponent {
|
|
|
191
173
|
ngOnDestroy() {
|
|
192
174
|
this.ready$.complete();
|
|
193
175
|
}
|
|
176
|
+
ngDoCheck() {
|
|
177
|
+
afterNextRender(() => {
|
|
178
|
+
this.#hasInputRequired.set(this.#isInputRequired());
|
|
179
|
+
this.#invalidStatus.set(this.#hasInvalidStatus());
|
|
180
|
+
}, {
|
|
181
|
+
injector: this.#injector,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
#isInputRequired() {
|
|
185
|
+
const hasRequiredFormControl = this.ownControls().some((c) => c.control?.hasValidator(Validators.required));
|
|
186
|
+
const hasRequiredNgModel = this.ownRequiredValidators().some((c) => booleanAttribute(c.required));
|
|
187
|
+
return hasRequiredNgModel || hasRequiredFormControl;
|
|
188
|
+
}
|
|
189
|
+
#hasInvalidStatus() {
|
|
190
|
+
const isInvalidOverride = this.invalid() !== undefined && this.invalid() !== null;
|
|
191
|
+
if (isInvalidOverride) {
|
|
192
|
+
return this.invalid();
|
|
193
|
+
}
|
|
194
|
+
const statusControlOverride = this.statusControl();
|
|
195
|
+
if (statusControlOverride) {
|
|
196
|
+
return statusControlOverride.invalid && this.ownControls().some((c) => c?.touched);
|
|
197
|
+
}
|
|
198
|
+
return this.ownControls().some((c) => c.invalid && c.touched);
|
|
199
|
+
}
|
|
194
200
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
195
201
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: FormFieldComponent, isStandalone: true, selector: "lu-form-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, hiddenLabel: { classPropertyName: "hiddenLabel", publicName: "hiddenLabel", isSignal: true, isRequired: false, transformFunction: null }, rolePresentationLabel: { classPropertyName: "rolePresentationLabel", publicName: "rolePresentationLabel", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, statusControl: { classPropertyName: "statusControl", publicName: "statusControl", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, inlineMessage: { classPropertyName: "inlineMessage", publicName: "inlineMessage", isSignal: true, isRequired: false, transformFunction: null }, errorInlineMessage: { classPropertyName: "errorInlineMessage", publicName: "errorInlineMessage", isSignal: true, isRequired: false, transformFunction: null }, inlineMessageState: { classPropertyName: "inlineMessageState", publicName: "inlineMessageState", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, counter: { classPropertyName: "counter", publicName: "counter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rolePresentationLabel: "rolePresentationLabelChange", layout: "layoutChange" }, providers: [
|
|
196
202
|
LuClass,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-form-field.mjs","sources":["../../../packages/ng/form-field/form-field.token.ts","../../../packages/ng/form-field/translations.ts","../../../packages/ng/form-field/form-field.translate.ts","../../../packages/ng/form-field/form-field.component.ts","../../../packages/ng/form-field/form-field.component.html","../../../packages/ng/form-field/input.directive.ts","../../../packages/ng/form-field/lucca-front-ng-form-field.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { FormFieldComponent } from './form-field.component';\n\nexport const FORM_FIELD_INSTANCE = new InjectionToken<FormFieldComponent>('FORM_FIELD_INSTANCE');\n","export const Translations = {\n\ten: {\n\t\tcounter: 'Your message is {{current}} characters long. A maximum of {{max}} characters is allowed.',\n\t},\n\tde: {\n\t\tcounter: 'Ihr Beitrag ist {{current}} Zeichen lang. Maximal sind {{max}} Zeichen erlaubt.',\n\t},\n\tfr: {\n\t\tcounter: 'Votre publication fait {{current}} caractères de long. {{max}} caractères maximum sont autorisés.',\n\t},\n\tit: {\n\t\tcounter: 'La tua pubblicazione è lunga {{current}} caratteri. È consentito un numero di massimo {{max}} caratteri.',\n\t},\n\tnl: {\n\t\tcounter: 'Uw publicatie is {{current}} tekens lang. {{max}} tekens maximaal toegestaan.',\n\t},\n\t'nl-BE': {\n\t\tcounter: 'Uw publicatie is {{current}} tekens lang. {{max}} tekens maximaal toegestaan.',\n\t},\n\tes: {\n\t\tcounter: 'Su publicación tiene {{current}} caracteres. Se permite un máximo de {{max}} caracteres.',\n\t},\n\tpt: {\n\t\tcounter: '{{current}} {{max}} A sua publicação tem um comprimento de caracteres, sendo permitido um máximo de caracteres.',\n\t},\n};\n","import { InjectionToken } from '@angular/core';\nimport { LuTranslation } from '@lucca-front/ng/core';\nimport { Translations } from './translations';\n\nexport const LU_FORM_FIELD_TRANSLATIONS = new InjectionToken('LuFormFieldTranslations', {\n\tfactory: () => luFormFieldTranslations,\n});\n\nexport interface LuFormFieldTranslations {\n\tcounter: string;\n}\n\nexport const luFormFieldTranslations: LuTranslation<LuFormFieldTranslations> = Translations;\n","import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport { booleanAttribute, Component, computed, contentChildren, effect, forwardRef, inject, input, model, OnDestroy, Renderer2, signal, ViewEncapsulation } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { AbstractControl, NgControl, ReactiveFormsModule, RequiredValidator, Validators } from '@angular/forms';\nimport { SafeHtml } from '@angular/platform-browser';\nimport { getIntl, IntlParamsPipe, LuClass, PortalContent, PortalDirective, ɵeffectWithDeps } from '@lucca-front/ng/core';\nimport { IconComponent } from '@lucca-front/ng/icon';\nimport { InlineMessageComponent, InlineMessageState } from '@lucca-front/ng/inline-message';\nimport { LuTooltipModule } from '@lucca-front/ng/tooltip';\nimport { BehaviorSubject, merge, switchMap } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\nimport { FormFieldSize } from './form-field-size';\nimport { FORM_FIELD_INSTANCE } from './form-field.token';\nimport { LU_FORM_FIELD_TRANSLATIONS } from './form-field.translate';\nimport { InputDirective } from './input.directive';\n\nlet nextId = 0;\n\n@Component({\n\tselector: 'lu-form-field',\n\tstandalone: true,\n\timports: [NgIf, NgTemplateOutlet, InlineMessageComponent, LuTooltipModule, ReactiveFormsModule, IconComponent, IntlParamsPipe, PortalDirective],\n\ttemplateUrl: './form-field.component.html',\n\tstyleUrls: ['./form-field.component.scss'],\n\tproviders: [\n\t\tLuClass,\n\t\t{\n\t\t\tprovide: FORM_FIELD_INSTANCE,\n\t\t\tuseExisting: forwardRef(() => FormFieldComponent),\n\t\t},\n\t],\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class FormFieldComponent implements OnDestroy {\n\tintl = getIntl(LU_FORM_FIELD_TRANSLATIONS);\n\n\t#luClass = inject(LuClass);\n\n\t#renderer = inject(Renderer2);\n\n\tformFieldChildren = contentChildren(FormFieldComponent, { descendants: true });\n\n\trequiredValidators = contentChildren(RequiredValidator, { descendants: true });\n\tngControls = contentChildren(NgControl, { descendants: true });\n\n\tignoredRequiredValidators = computed(() => new Set(this.formFieldChildren().flatMap((f: FormFieldComponent) => f.requiredValidators())));\n\tignoredControls = computed(() => new Set(this.formFieldChildren().flatMap((f: FormFieldComponent) => f.ngControls())));\n\n\townRequiredValidators = computed(() => this.requiredValidators().filter((c) => !this.ignoredRequiredValidators().has(c)));\n\townControls = computed(() => this.ngControls().filter((c) => !this.ignoredControls().has(c)));\n\n\trefreshedOwnControls = toSignal(\n\t\ttoObservable(this.ownControls).pipe(\n\t\t\tmap((controls) => controls.filter((c) => c.control)),\n\t\t\tswitchMap((controls) => {\n\t\t\t\treturn merge(...controls.map((c) => c.control.events)).pipe(\n\t\t\t\t\t// We need to use startWith here so the observable will also emit when new controls are added on the fly,\n\t\t\t\t\t// before they even emit any control-related event\n\t\t\t\t\tstartWith(void 0),\n\t\t\t\t\tmap(() => [...controls]),\n\t\t\t\t);\n\t\t\t}),\n\t\t),\n\t\t{\n\t\t\tinitialValue: [],\n\t\t},\n\t);\n\n\tisInputRequired = computed(() => {\n\t\tconst hasRequiredFormControl = this.refreshedOwnControls().some((c) => c.control.hasValidator(Validators.required));\n\t\tconst hasRequiredNgModel = this.ownRequiredValidators().some((c) => booleanAttribute(c.required));\n\t\treturn hasRequiredNgModel || hasRequiredFormControl;\n\t});\n\n\tlabel = input.required<PortalContent>();\n\n\t/**\n\t * Hide field label, while keeping it in DOM for screen readers\n\t */\n\thiddenLabel = input(false, { transform: booleanAttribute });\n\n\trolePresentationLabel = model(false);\n\n\tinline = input(false, { transform: booleanAttribute });\n\n\tstatusControl = input<AbstractControl | null>(null);\n\n\ttooltip = input<string | SafeHtml | null>(null);\n\n\tinvalidStatus = computed(() => {\n\t\tconst isInvalidOverride = this.invalid() !== undefined && this.invalid() !== null;\n\t\tif (isInvalidOverride) {\n\t\t\treturn isInvalidOverride;\n\t\t}\n\t\tconst statusControlOverride = this.statusControl();\n\t\tif (statusControlOverride) {\n\t\t\treturn statusControlOverride.invalid && this.refreshedOwnControls().some((c) => c.touched);\n\t\t}\n\t\treturn this.refreshedOwnControls().some((c) => c.invalid && c.touched);\n\t});\n\n\tinvalid = input<boolean | null, boolean>(null, { transform: booleanAttribute });\n\n\tinlineMessage = input<PortalContent | null>(null);\n\n\t/**\n\t * Inline message for when the control is in error state\n\t */\n\terrorInlineMessage = input<PortalContent | null>(null);\n\n\t/**\n\t * State of the inline message, will be ignored if form state is invalid\n\t */\n\tinlineMessageState = input<InlineMessageState | null>(null);\n\n\tsize = input<FormFieldSize | null>(null);\n\n\tlayout = model<'default' | 'checkable' | 'fieldset'>('default');\n\n\thasArrow = false;\n\n\t#inputs: InputDirective[] = [];\n\n\t/**\n\t * Max amount of characters allowed, defaults to 0, which means hidden, no maximum\n\t */\n\tcounter = input<number>(0);\n\n\tget contentLength(): number {\n\t\treturn (this.#inputs[0]?.host?.nativeElement as HTMLInputElement)?.value.length || 0;\n\t}\n\n\tpublic addInput(input: InputDirective) {\n\t\tthis.#inputs.push(input);\n\t\t/* We have to put this in the next cycle to make sure it'll be applied properly\n\t\t * and that it won't trigger a change detection error\n\t\t */\n\t\tsetTimeout(() => {\n\t\t\tthis.prepareInput();\n\t\t});\n\t}\n\n\tpublic get inputs(): InputDirective[] {\n\t\treturn this.#inputs;\n\t}\n\n\tid = signal<string>('');\n\n\tready$ = new BehaviorSubject<boolean>(false);\n\n\tpublic get ready(): boolean {\n\t\treturn this.ready$.value;\n\t}\n\n\t#ariaLabelledBy: string[] = [];\n\n\tconstructor() {\n\t\tɵeffectWithDeps([this.isInputRequired, this.invalidStatus], () => {\n\t\t\tthis.updateAria();\n\t\t});\n\n\t\teffect(() => {\n\t\t\tthis.#luClass.setState({\n\t\t\t\t[`mod-${this.size()}`]: !!this.size(),\n\t\t\t\t'mod-checkable': this.layout() === 'checkable',\n\t\t\t\t'form-field': this.layout() !== 'fieldset',\n\t\t\t});\n\t\t});\n\t}\n\n\taddLabelledBy(id: string, prepend = false): void {\n\t\tif (prepend) {\n\t\t\tthis.#ariaLabelledBy = [id, ...this.#ariaLabelledBy];\n\t\t} else {\n\t\t\tthis.#ariaLabelledBy = [...this.#ariaLabelledBy, id];\n\t\t}\n\t\tthis.#inputs.forEach((input) => {\n\t\t\tif (!input.standalone) {\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-labelledby', this.#ariaLabelledBy.join(' '));\n\t\t\t}\n\t\t});\n\t}\n\n\tremoveLabelledBy(id: string): void {\n\t\tthis.#ariaLabelledBy = this.#ariaLabelledBy.filter((labelledBy) => labelledBy === id);\n\t}\n\n\tprepareInput(): void {\n\t\tif (this.#inputs.length === 0) {\n\t\t\tthrow new Error('Missing input for form field, make sure to set `luInput` to your input inside lu-form-field');\n\t\t}\n\t\tthis.inputs\n\t\t\t.filter((input) => !input.standalone)\n\t\t\t.forEach((input) => {\n\t\t\t\tconst inputId = `${input.host.nativeElement.tagName.toLowerCase()}-${++nextId}`;\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'id', inputId);\n\t\t\t});\n\t\t// We're using the id from the first input available\n\t\tthis.id.set(this.#inputs[0].host.nativeElement.id);\n\t\tthis.updateAria();\n\t\tthis.ready$.next(true);\n\t}\n\n\tprivate updateAria(): void {\n\t\tthis.#inputs.forEach((input) => {\n\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-invalid', this.invalidStatus()?.toString());\n\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-required', this.isInputRequired()?.toString());\n\t\t\tif (!input.standalone) {\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-describedby', `${input.host.nativeElement.id}-message`);\n\t\t\t}\n\t\t});\n\t\tif (this.id() && !this.#ariaLabelledBy.includes(`${this.id()}-label`)) {\n\t\t\tthis.addLabelledBy(`${this.id()}-label`);\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.ready$.complete();\n\t}\n}\n","@if (layout() === 'fieldset') {\n<fieldset class=\"form-fieldset\" [class.mod-inline]=\"inline() || hasArrow\" [class.mod-S]=\"size() === 'S'\">\n\t<legend class=\"formLabel\" [class.u-mask]=\"hiddenLabel()\" attr.aria-hidden=\"{{hiddenLabel()}}\">\n\t\t<ng-container *luPortal=\"label()\"></ng-container\n\t\t><!--\n\t--><sup class=\"formLabel-required\" aria-hidden=\"true\" *ngIf=\"isInputRequired()\">*</sup>\n\t\t@if (tooltip()) {\n\t\t<lu-icon\n\t\t\tclass=\"formLabel-info\"\n\t\t\ticon=\"signHelp\"\n\t\t\t[alt]=\"'?'\"\n\t\t\t[luTooltip]=\"tooltip()\"\n\t\t\t[color]=\"invalidStatus() ? 'error' : 'inherit'\"\n\t\t></lu-icon>\n\t\t}\n\t</legend>\n\t<ng-container *ngTemplateOutlet=\"projectionTpl\"></ng-container>\n\t@if (inlineMessage() || (invalidStatus() ? errorInlineMessage() : false)) {\n\t<lu-inline-message\n\t\tid=\"{{id()}}-message\"\n\t\t[label]=\"(invalidStatus() && errorInlineMessage()) ? errorInlineMessage() : inlineMessage()\"\n\t\t[state]=\"invalidStatus() ? 'error' : inlineMessageState()\"\n\t></lu-inline-message>\n\t}\n</fieldset>\n} @else {\n<label\n\tclass=\"formLabel\"\n\t[class.is-error]=\"invalidStatus()\"\n\t[class.mod-counter]=\"counter() > 0\"\n\tid=\"{{id()}}-label\"\n\tfor=\"{{id()}}\"\n\t[class.u-mask]=\"hiddenLabel()\"\n\tattr.role=\"{{rolePresentationLabel() ? 'presentation' : null}}\"\n>\n\t<ng-container *luPortal=\"label()\"></ng-container\n\t><!--\n\t--><sup class=\"formLabel-required\" aria-hidden=\"true\" *ngIf=\"isInputRequired()\">*</sup>\n\t@if (tooltip()) {\n\t<lu-icon\n\t\tclass=\"formLabel-info\"\n\t\ticon=\"signHelp\"\n\t\t[alt]=\"'?'\"\n\t\t[luTooltip]=\"tooltip()\"\n\t\t[color]=\"invalidStatus() ? 'error' : 'inherit'\"\n\t></lu-icon>\n\t} @if (counter() > 0) {\n\t<span class=\"formLabel-counter\" [class.u-textError]=\"contentLength > counter()\" id=\"{{id()}}-counter\" aria-live=\"polite\">\n\t\t<span aria-hidden=\"true\">{{ contentLength }}/{{ counter() }}</span>\n\t\t<span class=\"u-mask\">{{ intl.counter | intlParams: { current: contentLength, max: counter() } }}</span>\n\t</span>\n\t}\n</label>\n<ng-container *ngTemplateOutlet=\"projectionTpl\"></ng-container>\n@if (inlineMessage() || (invalidStatus() ? errorInlineMessage() : false)) {\n<lu-inline-message\n\tid=\"{{id()}}-message\"\n\t[label]=\"(invalidStatus() && errorInlineMessage()) ? errorInlineMessage() : inlineMessage()\"\n\t[state]=\"invalidStatus() ? 'error' : inlineMessageState()\"\n></lu-inline-message>\n} }\n\n<ng-template #projectionTpl>\n\t<ng-content></ng-content>\n</ng-template>\n","import { booleanAttribute, Directive, ElementRef, inject, Input, OnInit } from '@angular/core';\nimport { FORM_FIELD_INSTANCE } from './form-field.token';\n\n@Directive({\n\tselector: '[luInput]',\n\tstandalone: true,\n\thost: {\n\t\t// Used to autofocus in dialog boxes, do not change except if you know what you're doing\n\t\tclass: 'luNativeInput',\n\t},\n})\nexport class InputDirective implements OnInit {\n\tpublic readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\tpublic readonly formFieldRef = inject(FORM_FIELD_INSTANCE, { optional: true });\n\n\t/**\n\t * Prevents message and label ids from being propagated, useful if the input holds its own message and label (like for radios)\n\t */\n\t@Input({ transform: booleanAttribute, alias: 'luInputStandalone' })\n\tstandalone = false;\n\n\tngOnInit(): void {\n\t\t// If the field is used as standalone, we won't have the ref provided so it'll crash\n\t\tif (this.formFieldRef) {\n\t\t\tthis.formFieldRef.addInput(this);\n\t\t}\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵeffectWithDeps"],"mappings":";;;;;;;;;;;;;MAGa,mBAAmB,GAAG,IAAI,cAAc,CAAqB,qBAAqB;;ACHxF,MAAM,YAAY,GAAG;AAC3B,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0FAA0F;AACnG,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,iFAAiF;AAC1F,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,mGAAmG;AAC5G,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0GAA0G;AACnH,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,+EAA+E;AACxF,KAAA;AACD,IAAA,OAAO,EAAE;AACR,QAAA,OAAO,EAAE,+EAA+E;AACxF,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0FAA0F;AACnG,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,iHAAiH;AAC1H,KAAA;CACD;;MCrBY,0BAA0B,GAAG,IAAI,cAAc,CAAC,yBAAyB,EAAE;AACvF,IAAA,OAAO,EAAE,MAAM,uBAAuB;AACtC,CAAA;AAMM,MAAM,uBAAuB,GAA2C;;ACI/E,IAAI,MAAM,GAAG,CAAC;MAiBD,kBAAkB,CAAA;AAG9B,IAAA,QAAQ;AAER,IAAA,SAAS;AAmFT,IAAA,OAAO;AAOP,IAAA,IAAI,aAAa,GAAA;AAChB,QAAA,OAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,aAAkC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;;AAG9E,IAAA,QAAQ,CAAC,KAAqB,EAAA;AACpC,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,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,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;;AAEL,wBAAA,KAAK,EAAE,eAAe;AACtB,qBAAA;AACD,iBAAA;8BAUA,UAAU,EAAA,CAAA;sBADT,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB,EAAE;;;ACnBnE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-form-field.mjs","sources":["../../../packages/ng/form-field/form-field.token.ts","../../../packages/ng/form-field/translations.ts","../../../packages/ng/form-field/form-field.translate.ts","../../../packages/ng/form-field/form-field.component.ts","../../../packages/ng/form-field/form-field.component.html","../../../packages/ng/form-field/input.directive.ts","../../../packages/ng/form-field/lucca-front-ng-form-field.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { FormFieldComponent } from './form-field.component';\n\nexport const FORM_FIELD_INSTANCE = new InjectionToken<FormFieldComponent>('FORM_FIELD_INSTANCE');\n","export const Translations = {\n\ten: {\n\t\tcounter: 'Your message is {{current}} characters long. A maximum of {{max}} characters is allowed.',\n\t},\n\tde: {\n\t\tcounter: 'Ihr Beitrag ist {{current}} Zeichen lang. Maximal sind {{max}} Zeichen erlaubt.',\n\t},\n\tfr: {\n\t\tcounter: 'Votre publication fait {{current}} caractères de long. {{max}} caractères maximum sont autorisés.',\n\t},\n\tit: {\n\t\tcounter: 'La tua pubblicazione è lunga {{current}} caratteri. È consentito un numero di massimo {{max}} caratteri.',\n\t},\n\tnl: {\n\t\tcounter: 'Uw publicatie is {{current}} tekens lang. {{max}} tekens maximaal toegestaan.',\n\t},\n\t'nl-BE': {\n\t\tcounter: 'Uw publicatie is {{current}} tekens lang. {{max}} tekens maximaal toegestaan.',\n\t},\n\tes: {\n\t\tcounter: 'Su publicación tiene {{current}} caracteres. Se permite un máximo de {{max}} caracteres.',\n\t},\n\tpt: {\n\t\tcounter: '{{current}} {{max}} A sua publicação tem um comprimento de caracteres, sendo permitido um máximo de caracteres.',\n\t},\n};\n","import { InjectionToken } from '@angular/core';\nimport { LuTranslation } from '@lucca-front/ng/core';\nimport { Translations } from './translations';\n\nexport const LU_FORM_FIELD_TRANSLATIONS = new InjectionToken('LuFormFieldTranslations', {\n\tfactory: () => luFormFieldTranslations,\n});\n\nexport interface LuFormFieldTranslations {\n\tcounter: string;\n}\n\nexport const luFormFieldTranslations: LuTranslation<LuFormFieldTranslations> = Translations;\n","import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tComponent,\n\tcomputed,\n\tcontentChildren,\n\tDoCheck,\n\teffect,\n\tforwardRef,\n\tinject,\n\tInjector,\n\tinput,\n\tmodel,\n\tOnDestroy,\n\tRenderer2,\n\tsignal,\n\tViewEncapsulation,\n} from '@angular/core';\nimport { AbstractControl, NgControl, ReactiveFormsModule, RequiredValidator, Validators } from '@angular/forms';\nimport { SafeHtml } from '@angular/platform-browser';\nimport { getIntl, IntlParamsPipe, LuClass, PortalContent, PortalDirective, ɵeffectWithDeps } from '@lucca-front/ng/core';\nimport { IconComponent } from '@lucca-front/ng/icon';\nimport { InlineMessageComponent, InlineMessageState } from '@lucca-front/ng/inline-message';\nimport { LuTooltipModule } from '@lucca-front/ng/tooltip';\nimport { BehaviorSubject } from 'rxjs';\nimport { FormFieldSize } from './form-field-size';\nimport { FORM_FIELD_INSTANCE } from './form-field.token';\nimport { LU_FORM_FIELD_TRANSLATIONS } from './form-field.translate';\nimport { InputDirective } from './input.directive';\n\nlet nextId = 0;\n\n@Component({\n\tselector: 'lu-form-field',\n\tstandalone: true,\n\timports: [NgIf, NgTemplateOutlet, InlineMessageComponent, LuTooltipModule, ReactiveFormsModule, IconComponent, IntlParamsPipe, PortalDirective],\n\ttemplateUrl: './form-field.component.html',\n\tstyleUrls: ['./form-field.component.scss'],\n\tproviders: [\n\t\tLuClass,\n\t\t{\n\t\t\tprovide: FORM_FIELD_INSTANCE,\n\t\t\tuseExisting: forwardRef(() => FormFieldComponent),\n\t\t},\n\t],\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class FormFieldComponent implements OnDestroy, DoCheck {\n\tintl = getIntl(LU_FORM_FIELD_TRANSLATIONS);\n\n\t#luClass = inject(LuClass);\n\t#injector = inject(Injector);\n\t#renderer = inject(Renderer2);\n\n\tformFieldChildren = contentChildren(FormFieldComponent, { descendants: true });\n\n\trequiredValidators = contentChildren(RequiredValidator, { descendants: true });\n\tngControls = contentChildren(NgControl, { descendants: true });\n\n\tignoredRequiredValidators = computed(() => new Set(this.formFieldChildren().flatMap((f) => f.requiredValidators())));\n\tignoredControls = computed(() => new Set(this.formFieldChildren().flatMap((f) => f.ngControls())));\n\n\townRequiredValidators = computed(() => this.requiredValidators().filter((c) => !this.ignoredRequiredValidators().has(c)));\n\townControls = computed(() => this.ngControls().filter((c) => !this.ignoredControls().has(c)));\n\n\t#hasInputRequired = signal(false);\n\tisInputRequired = this.#hasInputRequired.asReadonly();\n\n\tlabel = input.required<PortalContent>();\n\n\t/**\n\t * Hide field label, while keeping it in DOM for screen readers\n\t */\n\thiddenLabel = input(false, { transform: booleanAttribute });\n\n\trolePresentationLabel = model(false);\n\n\tinline = input(false, { transform: booleanAttribute });\n\n\tstatusControl = input<AbstractControl | null>(null);\n\n\ttooltip = input<string | SafeHtml | null>(null);\n\n\t#invalidStatus = signal(false);\n\tinvalidStatus = this.#invalidStatus.asReadonly();\n\n\tinvalid = input<boolean | null, boolean>(null, { transform: booleanAttribute });\n\n\tinlineMessage = input<PortalContent | null>(null);\n\n\t/**\n\t * Inline message for when the control is in error state\n\t */\n\terrorInlineMessage = input<PortalContent | null>(null);\n\n\t/**\n\t * State of the inline message, will be ignored if form state is invalid\n\t */\n\tinlineMessageState = input<InlineMessageState | null>(null);\n\n\tsize = input<FormFieldSize | null>(null);\n\n\tlayout = model<'default' | 'checkable' | 'fieldset'>('default');\n\n\thasArrow = false;\n\n\t#inputs: InputDirective[] = [];\n\n\t/**\n\t * Max amount of characters allowed, defaults to 0, which means hidden, no maximum\n\t */\n\tcounter = input<number>(0);\n\n\tget contentLength(): number {\n\t\treturn (this.#inputs[0]?.host?.nativeElement as HTMLInputElement)?.value.length || 0;\n\t}\n\n\tpublic addInput(input: InputDirective) {\n\t\tthis.#inputs.push(input);\n\t\t/* We have to put this in the next cycle to make sure it'll be applied properly\n\t\t * and that it won't trigger a change detection error\n\t\t */\n\t\tsetTimeout(() => {\n\t\t\tthis.prepareInput();\n\t\t});\n\t}\n\n\tpublic get inputs(): InputDirective[] {\n\t\treturn this.#inputs;\n\t}\n\n\tid = signal<string>('');\n\n\tready$ = new BehaviorSubject<boolean>(false);\n\n\tpublic get ready(): boolean {\n\t\treturn this.ready$.value;\n\t}\n\n\t#ariaLabelledBy: string[] = [];\n\n\tconstructor() {\n\t\tɵeffectWithDeps([this.isInputRequired, this.invalidStatus], () => {\n\t\t\tthis.updateAria();\n\t\t});\n\n\t\teffect(() => {\n\t\t\tthis.#luClass.setState({\n\t\t\t\t[`mod-${this.size()}`]: !!this.size(),\n\t\t\t\t'mod-checkable': this.layout() === 'checkable',\n\t\t\t\t'form-field': this.layout() !== 'fieldset',\n\t\t\t});\n\t\t});\n\t}\n\n\taddLabelledBy(id: string, prepend = false): void {\n\t\tif (prepend) {\n\t\t\tthis.#ariaLabelledBy = [id, ...this.#ariaLabelledBy];\n\t\t} else {\n\t\t\tthis.#ariaLabelledBy = [...this.#ariaLabelledBy, id];\n\t\t}\n\t\tthis.#inputs.forEach((input) => {\n\t\t\tif (!input.standalone) {\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-labelledby', this.#ariaLabelledBy.join(' '));\n\t\t\t}\n\t\t});\n\t}\n\n\tremoveLabelledBy(id: string): void {\n\t\tthis.#ariaLabelledBy = this.#ariaLabelledBy.filter((labelledBy) => labelledBy === id);\n\t}\n\n\tprepareInput(): void {\n\t\tif (this.#inputs.length === 0) {\n\t\t\tthrow new Error('Missing input for form field, make sure to set `luInput` to your input inside lu-form-field');\n\t\t}\n\t\tthis.inputs\n\t\t\t.filter((input) => !input.standalone)\n\t\t\t.forEach((input) => {\n\t\t\t\tconst inputId = `${input.host.nativeElement.tagName.toLowerCase()}-${++nextId}`;\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'id', inputId);\n\t\t\t});\n\t\t// We're using the id from the first input available\n\t\tthis.id.set(this.#inputs[0].host.nativeElement.id);\n\t\tthis.updateAria();\n\t\tthis.ready$.next(true);\n\t}\n\n\tprivate updateAria(): void {\n\t\tthis.#inputs.forEach((input) => {\n\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-invalid', this.invalidStatus()?.toString());\n\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-required', this.isInputRequired()?.toString());\n\t\t\tif (!input.standalone) {\n\t\t\t\tthis.#renderer.setAttribute(input.host.nativeElement, 'aria-describedby', `${input.host.nativeElement.id}-message`);\n\t\t\t}\n\t\t});\n\t\tif (this.id() && !this.#ariaLabelledBy.includes(`${this.id()}-label`)) {\n\t\t\tthis.addLabelledBy(`${this.id()}-label`);\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.ready$.complete();\n\t}\n\n\tngDoCheck(): void {\n\t\tafterNextRender(\n\t\t\t() => {\n\t\t\t\tthis.#hasInputRequired.set(this.#isInputRequired());\n\t\t\t\tthis.#invalidStatus.set(this.#hasInvalidStatus());\n\t\t\t},\n\t\t\t{\n\t\t\t\tinjector: this.#injector,\n\t\t\t},\n\t\t);\n\t}\n\n\t#isInputRequired(): boolean {\n\t\tconst hasRequiredFormControl = this.ownControls().some((c) => c.control?.hasValidator(Validators.required));\n\t\tconst hasRequiredNgModel = this.ownRequiredValidators().some((c) => booleanAttribute(c.required));\n\t\treturn hasRequiredNgModel || hasRequiredFormControl;\n\t}\n\n\t#hasInvalidStatus(): boolean {\n\t\tconst isInvalidOverride = this.invalid() !== undefined && this.invalid() !== null;\n\t\tif (isInvalidOverride) {\n\t\t\treturn this.invalid();\n\t\t}\n\t\tconst statusControlOverride = this.statusControl();\n\t\tif (statusControlOverride) {\n\t\t\treturn statusControlOverride.invalid && this.ownControls().some((c) => c?.touched);\n\t\t}\n\t\treturn this.ownControls().some((c) => c.invalid && c.touched);\n\t}\n}\n","@if (layout() === 'fieldset') {\n<fieldset class=\"form-fieldset\" [class.mod-inline]=\"inline() || hasArrow\" [class.mod-S]=\"size() === 'S'\">\n\t<legend class=\"formLabel\" [class.u-mask]=\"hiddenLabel()\" attr.aria-hidden=\"{{hiddenLabel()}}\">\n\t\t<ng-container *luPortal=\"label()\"></ng-container\n\t\t><!--\n\t--><sup class=\"formLabel-required\" aria-hidden=\"true\" *ngIf=\"isInputRequired()\">*</sup>\n\t\t@if (tooltip()) {\n\t\t<lu-icon\n\t\t\tclass=\"formLabel-info\"\n\t\t\ticon=\"signHelp\"\n\t\t\t[alt]=\"'?'\"\n\t\t\t[luTooltip]=\"tooltip()\"\n\t\t\t[color]=\"invalidStatus() ? 'error' : 'inherit'\"\n\t\t></lu-icon>\n\t\t}\n\t</legend>\n\t<ng-container *ngTemplateOutlet=\"projectionTpl\"></ng-container>\n\t@if (inlineMessage() || (invalidStatus() ? errorInlineMessage() : false)) {\n\t<lu-inline-message\n\t\tid=\"{{id()}}-message\"\n\t\t[label]=\"(invalidStatus() && errorInlineMessage()) ? errorInlineMessage() : inlineMessage()\"\n\t\t[state]=\"invalidStatus() ? 'error' : inlineMessageState()\"\n\t></lu-inline-message>\n\t}\n</fieldset>\n} @else {\n<label\n\tclass=\"formLabel\"\n\t[class.is-error]=\"invalidStatus()\"\n\t[class.mod-counter]=\"counter() > 0\"\n\tid=\"{{id()}}-label\"\n\tfor=\"{{id()}}\"\n\t[class.u-mask]=\"hiddenLabel()\"\n\tattr.role=\"{{rolePresentationLabel() ? 'presentation' : null}}\"\n>\n\t<ng-container *luPortal=\"label()\"></ng-container\n\t><!--\n\t--><sup class=\"formLabel-required\" aria-hidden=\"true\" *ngIf=\"isInputRequired()\">*</sup>\n\t@if (tooltip()) {\n\t<lu-icon\n\t\tclass=\"formLabel-info\"\n\t\ticon=\"signHelp\"\n\t\t[alt]=\"'?'\"\n\t\t[luTooltip]=\"tooltip()\"\n\t\t[color]=\"invalidStatus() ? 'error' : 'inherit'\"\n\t></lu-icon>\n\t} @if (counter() > 0) {\n\t<span class=\"formLabel-counter\" [class.u-textError]=\"contentLength > counter()\" id=\"{{id()}}-counter\" aria-live=\"polite\">\n\t\t<span aria-hidden=\"true\">{{ contentLength }}/{{ counter() }}</span>\n\t\t<span class=\"u-mask\">{{ intl.counter | intlParams: { current: contentLength, max: counter() } }}</span>\n\t</span>\n\t}\n</label>\n<ng-container *ngTemplateOutlet=\"projectionTpl\"></ng-container>\n@if (inlineMessage() || (invalidStatus() ? errorInlineMessage() : false)) {\n<lu-inline-message\n\tid=\"{{id()}}-message\"\n\t[label]=\"(invalidStatus() && errorInlineMessage()) ? errorInlineMessage() : inlineMessage()\"\n\t[state]=\"invalidStatus() ? 'error' : inlineMessageState()\"\n></lu-inline-message>\n} }\n\n<ng-template #projectionTpl>\n\t<ng-content></ng-content>\n</ng-template>\n","import { booleanAttribute, Directive, ElementRef, inject, Input, OnInit } from '@angular/core';\nimport { FORM_FIELD_INSTANCE } from './form-field.token';\n\n@Directive({\n\tselector: '[luInput]',\n\tstandalone: true,\n\thost: {\n\t\t// Used to autofocus in dialog boxes, do not change except if you know what you're doing\n\t\tclass: 'luNativeInput',\n\t},\n})\nexport class InputDirective implements OnInit {\n\tpublic readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\tpublic readonly formFieldRef = inject(FORM_FIELD_INSTANCE, { optional: true });\n\n\t/**\n\t * Prevents message and label ids from being propagated, useful if the input holds its own message and label (like for radios)\n\t */\n\t@Input({ transform: booleanAttribute, alias: 'luInputStandalone' })\n\tstandalone = false;\n\n\tngOnInit(): void {\n\t\t// If the field is used as standalone, we won't have the ref provided so it'll crash\n\t\tif (this.formFieldRef) {\n\t\t\tthis.formFieldRef.addInput(this);\n\t\t}\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵeffectWithDeps"],"mappings":";;;;;;;;;;;MAGa,mBAAmB,GAAG,IAAI,cAAc,CAAqB,qBAAqB;;ACHxF,MAAM,YAAY,GAAG;AAC3B,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0FAA0F;AACnG,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,iFAAiF;AAC1F,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,mGAAmG;AAC5G,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0GAA0G;AACnH,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,+EAA+E;AACxF,KAAA;AACD,IAAA,OAAO,EAAE;AACR,QAAA,OAAO,EAAE,+EAA+E;AACxF,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,0FAA0F;AACnG,KAAA;AACD,IAAA,EAAE,EAAE;AACH,QAAA,OAAO,EAAE,iHAAiH;AAC1H,KAAA;CACD;;MCrBY,0BAA0B,GAAG,IAAI,cAAc,CAAC,yBAAyB,EAAE;AACvF,IAAA,OAAO,EAAE,MAAM,uBAAuB;AACtC,CAAA;AAMM,MAAM,uBAAuB,GAA2C;;ACmB/E,IAAI,MAAM,GAAG,CAAC;MAiBD,kBAAkB,CAAA;AAG9B,IAAA,QAAQ;AACR,IAAA,SAAS;AACT,IAAA,SAAS;AAaT,IAAA,iBAAiB;AAkBjB,IAAA,cAAc;AAuBd,IAAA,OAAO;AAOP,IAAA,IAAI,aAAa,GAAA;AAChB,QAAA,OAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,aAAkC,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC;;AAG9E,IAAA,QAAQ,CAAC,KAA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oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;;AAEL,wBAAA,KAAK,EAAE,eAAe;AACtB,qBAAA;AACD,iBAAA;8BAUA,UAAU,EAAA,CAAA;sBADT,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB,EAAE;;;ACnBnE;;AAEG;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, Inject, NgModule, inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import { ActivationEnd, RouterModule, TitleStrategy } from '@angular/router';
|
|
5
5
|
import { BehaviorSubject, combineLatest, of } from 'rxjs';
|
|
6
6
|
import { switchMap, map, filter, distinctUntilChanged, tap } from 'rxjs/operators';
|
|
7
7
|
import * as i2 from '@angular/platform-browser';
|
|
8
|
+
import { Title } from '@angular/platform-browser';
|
|
8
9
|
|
|
9
10
|
const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken('LU_TITLE_TRANSLATE_SERVICE');
|
|
10
11
|
|
|
@@ -72,13 +73,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
72
73
|
}]
|
|
73
74
|
}] });
|
|
74
75
|
|
|
75
|
-
const APP_TITLE = new InjectionToken('APP_TITLE');
|
|
76
|
+
const ɵAPP_TITLE = new InjectionToken('APP_TITLE');
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated Use `provideLuTitleStrategy` instead.
|
|
79
|
+
*/
|
|
80
|
+
const APP_TITLE = ɵAPP_TITLE;
|
|
76
81
|
class LuTitleStrategy extends TitleStrategy {
|
|
77
|
-
constructor(
|
|
82
|
+
constructor() {
|
|
78
83
|
super();
|
|
79
|
-
this.title =
|
|
80
|
-
this.translateService =
|
|
81
|
-
this.appTitle =
|
|
84
|
+
this.title = inject(Title);
|
|
85
|
+
this.translateService = inject(LU_TITLE_TRANSLATE_SERVICE, { optional: true });
|
|
86
|
+
this.appTitle = inject(ɵAPP_TITLE);
|
|
82
87
|
this.titlePartsSubject = new BehaviorSubject(['Lucca']);
|
|
83
88
|
this.titleParts$ = this.titlePartsSubject.asObservable();
|
|
84
89
|
this.title$ = this.titleParts$.pipe(switchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))), map((parts) => parts.join(TitleSeparator)), distinctUntilChanged());
|
|
@@ -89,9 +94,9 @@ class LuTitleStrategy extends TitleStrategy {
|
|
|
89
94
|
const pageTitles = this.#getPageTitleParts(routerState.root).reverse();
|
|
90
95
|
const translatedPageTitles = uniqTitle(pageTitles)
|
|
91
96
|
.filter(({ title }) => title !== '')
|
|
92
|
-
.map(({ title, params }) => this.translateService.translate(title, params));
|
|
97
|
+
.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));
|
|
93
98
|
// Add the name app and 'Lucca' at the end of the title
|
|
94
|
-
const titleParts = [...translatedPageTitles, this.
|
|
99
|
+
const titleParts = [...translatedPageTitles, this.appTitle, 'Lucca'].filter((x) => !!x);
|
|
95
100
|
this.titlePartsSubject.next(titleParts);
|
|
96
101
|
}
|
|
97
102
|
prependTitle(title) {
|
|
@@ -107,26 +112,30 @@ class LuTitleStrategy extends TitleStrategy {
|
|
|
107
112
|
};
|
|
108
113
|
return snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];
|
|
109
114
|
}
|
|
110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: LuTitleStrategy, deps: [
|
|
115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: LuTitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
111
116
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: LuTitleStrategy, providedIn: 'root' }); }
|
|
112
117
|
}
|
|
113
118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: LuTitleStrategy, decorators: [{
|
|
114
119
|
type: Injectable,
|
|
115
120
|
args: [{ providedIn: 'root' }]
|
|
116
|
-
}], ctorParameters: () => [
|
|
117
|
-
type: Inject,
|
|
118
|
-
args: [LU_TITLE_TRANSLATE_SERVICE]
|
|
119
|
-
}] }, { type: undefined, decorators: [{
|
|
120
|
-
type: Inject,
|
|
121
|
-
args: [APP_TITLE]
|
|
122
|
-
}] }] });
|
|
121
|
+
}], ctorParameters: () => [] });
|
|
123
122
|
function uniqTitle(titleParts) {
|
|
124
123
|
return titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);
|
|
125
124
|
}
|
|
125
|
+
function provideLuTitleStrategy(options) {
|
|
126
|
+
const providers = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];
|
|
127
|
+
if (options.appTitle) {
|
|
128
|
+
providers.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });
|
|
129
|
+
}
|
|
130
|
+
if (options.translateService) {
|
|
131
|
+
providers.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });
|
|
132
|
+
}
|
|
133
|
+
return providers;
|
|
134
|
+
}
|
|
126
135
|
|
|
127
136
|
/**
|
|
128
137
|
* Generated bundle index. Do not edit.
|
|
129
138
|
*/
|
|
130
139
|
|
|
131
|
-
export { APP_TITLE, LU_TITLE_TRANSLATE_SERVICE, LuTitleModule, LuTitleService, LuTitleStrategy, TitleSeparator };
|
|
140
|
+
export { APP_TITLE, LU_TITLE_TRANSLATE_SERVICE, LuTitleModule, LuTitleService, LuTitleStrategy, TitleSeparator, provideLuTitleStrategy, ɵAPP_TITLE };
|
|
132
141
|
//# sourceMappingURL=lucca-front-ng-title.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { Inject, Injectable, InjectionToken } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const APP_TITLE = new InjectionToken('APP_TITLE');\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor(\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t\t@Inject(APP_TITLE) private appTitle: string,\n\t) {\n\t\tsuper();\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => this.translateService.translate(title, params));\n\t\t// Add the name app and 'Lucca' at the end of the title\n\t\tconst titleParts = [...translatedPageTitles, this.translateService.translate(this.appTitle), 'Lucca'].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle","i1"],"mappings":";;;;;;;;MAEa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACD5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,IAAA,WAAA,CACS,MAAc,EACd,KAAY,EACwB,gBAA0C,EAAA;QAF9E,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAK,CAAA,KAAA,GAAL,KAAK;QAC+B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB;QAVrD,IAAiB,CAAA,iBAAA,GAAG,IAAI,eAAe,CAA0C,CAAC,OAAO,CAAC,CAAC;AACnG,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;AACnD,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAC7B,SAAS,CAAC,CAAC,UAAU,KAAK,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,OAAO,IAAI,KAAK,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChH,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,cAAc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A;AAC9C,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC;AACzH;;AC1DA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string | Observable<string>;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { inject, Injectable, InjectionToken, Provider } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { BehaviorSubject, combineLatest, Observable, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const ɵAPP_TITLE = new InjectionToken<string | Observable<string>>('APP_TITLE');\n\n/**\n * @deprecated Use `provideLuTitleStrategy` instead.\n */\nexport const APP_TITLE = ɵAPP_TITLE;\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate title = inject(Title);\n\tprivate translateService = inject<ILuTitleTranslateService>(LU_TITLE_TRANSLATE_SERVICE, { optional: true });\n\tprivate appTitle = inject(ɵAPP_TITLE);\n\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor() {\n\t\tsuper();\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));\n\t\t// Add the name app and 'Lucca' at the end of the title\n\t\tconst titleParts = [...translatedPageTitles, this.appTitle, 'Lucca'].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n\nexport interface LuTitleStrategyOptions {\n\tappTitle?: () => string | Observable<string>;\n\ttranslateService?: () => ILuTitleTranslateService;\n}\n\nexport function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[] {\n\tconst providers: Provider[] = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];\n\n\tif (options.appTitle) {\n\t\tproviders.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });\n\t}\n\tif (options.translateService) {\n\t\tproviders.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });\n\t}\n\n\treturn providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle"],"mappings":";;;;;;;;;MAGa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACF5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,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EG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnDestroy } from '@angular/core';
|
|
1
|
+
import { DoCheck, OnDestroy } from '@angular/core';
|
|
2
2
|
import { AbstractControl, NgControl, RequiredValidator } from '@angular/forms';
|
|
3
3
|
import { SafeHtml } from '@angular/platform-browser';
|
|
4
4
|
import { PortalContent } from '@lucca-front/ng/core';
|
|
@@ -7,7 +7,7 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
7
7
|
import { FormFieldSize } from './form-field-size';
|
|
8
8
|
import { InputDirective } from './input.directive';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
export declare class FormFieldComponent implements OnDestroy {
|
|
10
|
+
export declare class FormFieldComponent implements OnDestroy, DoCheck {
|
|
11
11
|
#private;
|
|
12
12
|
intl: import("./form-field.translate").LuFormFieldTranslations;
|
|
13
13
|
formFieldChildren: import("@angular/core").Signal<readonly FormFieldComponent[]>;
|
|
@@ -17,7 +17,6 @@ export declare class FormFieldComponent implements OnDestroy {
|
|
|
17
17
|
ignoredControls: import("@angular/core").Signal<Set<NgControl>>;
|
|
18
18
|
ownRequiredValidators: import("@angular/core").Signal<RequiredValidator[]>;
|
|
19
19
|
ownControls: import("@angular/core").Signal<NgControl[]>;
|
|
20
|
-
refreshedOwnControls: import("@angular/core").Signal<NgControl[]>;
|
|
21
20
|
isInputRequired: import("@angular/core").Signal<boolean>;
|
|
22
21
|
label: import("@angular/core").InputSignal<PortalContent>;
|
|
23
22
|
/**
|
|
@@ -58,6 +57,7 @@ export declare class FormFieldComponent implements OnDestroy {
|
|
|
58
57
|
prepareInput(): void;
|
|
59
58
|
private updateAria;
|
|
60
59
|
ngOnDestroy(): void;
|
|
60
|
+
ngDoCheck(): void;
|
|
61
61
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
62
62
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "lu-form-field", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "hiddenLabel": { "alias": "hiddenLabel"; "required": false; "isSignal": true; }; "rolePresentationLabel": { "alias": "rolePresentationLabel"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "statusControl": { "alias": "statusControl"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "inlineMessage": { "alias": "inlineMessage"; "required": false; "isSignal": true; }; "errorInlineMessage": { "alias": "errorInlineMessage"; "required": false; "isSignal": true; }; "inlineMessageState": { "alias": "inlineMessageState"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "counter": { "alias": "counter"; "required": false; "isSignal": true; }; }, { "rolePresentationLabel": "rolePresentationLabelChange"; "layout": "layoutChange"; }, ["formFieldChildren", "requiredValidators", "ngControls"], ["*"], true, never>;
|
|
63
63
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucca-front/ng",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.7",
|
|
4
4
|
"description": "A library of icons made by the team @Lucca",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@angular/common": "^19.0.0",
|
|
27
27
|
"@angular/core": "^19.0.0",
|
|
28
28
|
"@angular/cdk": "^19.0.0",
|
|
29
|
-
"@lucca-front/icons": "19.1.
|
|
30
|
-
"@lucca-front/scss": "19.1.
|
|
29
|
+
"@lucca-front/icons": "19.1.7",
|
|
30
|
+
"@lucca-front/scss": "19.1.7",
|
|
31
31
|
"isomorphic-dompurify": "^2.17.0",
|
|
32
32
|
"date-fns": "^3.6.0",
|
|
33
33
|
"rxjs": "^7.8.0"
|
|
@@ -53,14 +53,18 @@
|
|
|
53
53
|
"types": "./animations/index.d.ts",
|
|
54
54
|
"default": "./fesm2022/lucca-front-ng-animations.mjs"
|
|
55
55
|
},
|
|
56
|
-
"./
|
|
57
|
-
"types": "./
|
|
58
|
-
"default": "./fesm2022/lucca-front-ng-
|
|
56
|
+
"./api": {
|
|
57
|
+
"types": "./api/index.d.ts",
|
|
58
|
+
"default": "./fesm2022/lucca-front-ng-api.mjs"
|
|
59
59
|
},
|
|
60
60
|
"./button": {
|
|
61
61
|
"types": "./button/index.d.ts",
|
|
62
62
|
"default": "./fesm2022/lucca-front-ng-button.mjs"
|
|
63
63
|
},
|
|
64
|
+
"./callout": {
|
|
65
|
+
"types": "./callout/index.d.ts",
|
|
66
|
+
"default": "./fesm2022/lucca-front-ng-callout.mjs"
|
|
67
|
+
},
|
|
64
68
|
"./comment": {
|
|
65
69
|
"types": "./comment/index.d.ts",
|
|
66
70
|
"default": "./fesm2022/lucca-front-ng-comment.mjs"
|
|
@@ -69,10 +73,6 @@
|
|
|
69
73
|
"types": "./core/index.d.ts",
|
|
70
74
|
"default": "./fesm2022/lucca-front-ng-core.mjs"
|
|
71
75
|
},
|
|
72
|
-
"./api": {
|
|
73
|
-
"types": "./api/index.d.ts",
|
|
74
|
-
"default": "./fesm2022/lucca-front-ng-api.mjs"
|
|
75
|
-
},
|
|
76
76
|
"./core-select": {
|
|
77
77
|
"types": "./core-select/index.d.ts",
|
|
78
78
|
"default": "./fesm2022/lucca-front-ng-core-select.mjs"
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
"types": "./department/index.d.ts",
|
|
90
90
|
"default": "./fesm2022/lucca-front-ng-department.mjs"
|
|
91
91
|
},
|
|
92
|
-
"./divider": {
|
|
93
|
-
"types": "./divider/index.d.ts",
|
|
94
|
-
"default": "./fesm2022/lucca-front-ng-divider.mjs"
|
|
95
|
-
},
|
|
96
92
|
"./dialog": {
|
|
97
93
|
"types": "./dialog/index.d.ts",
|
|
98
94
|
"default": "./fesm2022/lucca-front-ng-dialog.mjs"
|
|
99
95
|
},
|
|
96
|
+
"./divider": {
|
|
97
|
+
"types": "./divider/index.d.ts",
|
|
98
|
+
"default": "./fesm2022/lucca-front-ng-divider.mjs"
|
|
99
|
+
},
|
|
100
100
|
"./dropdown": {
|
|
101
101
|
"types": "./dropdown/index.d.ts",
|
|
102
102
|
"default": "./fesm2022/lucca-front-ng-dropdown.mjs"
|
|
@@ -109,14 +109,14 @@
|
|
|
109
109
|
"types": "./establishment/index.d.ts",
|
|
110
110
|
"default": "./fesm2022/lucca-front-ng-establishment.mjs"
|
|
111
111
|
},
|
|
112
|
-
"./form-field": {
|
|
113
|
-
"types": "./form-field/index.d.ts",
|
|
114
|
-
"default": "./fesm2022/lucca-front-ng-form-field.mjs"
|
|
115
|
-
},
|
|
116
112
|
"./fancy-box": {
|
|
117
113
|
"types": "./fancy-box/index.d.ts",
|
|
118
114
|
"default": "./fesm2022/lucca-front-ng-fancy-box.mjs"
|
|
119
115
|
},
|
|
116
|
+
"./form-field": {
|
|
117
|
+
"types": "./form-field/index.d.ts",
|
|
118
|
+
"default": "./fesm2022/lucca-front-ng-form-field.mjs"
|
|
119
|
+
},
|
|
120
120
|
"./formly": {
|
|
121
121
|
"types": "./formly/index.d.ts",
|
|
122
122
|
"default": "./fesm2022/lucca-front-ng-formly.mjs"
|
|
@@ -129,6 +129,10 @@
|
|
|
129
129
|
"types": "./icon/index.d.ts",
|
|
130
130
|
"default": "./fesm2022/lucca-front-ng-icon.mjs"
|
|
131
131
|
},
|
|
132
|
+
"./inline-message": {
|
|
133
|
+
"types": "./inline-message/index.d.ts",
|
|
134
|
+
"default": "./fesm2022/lucca-front-ng-inline-message.mjs"
|
|
135
|
+
},
|
|
132
136
|
"./input": {
|
|
133
137
|
"types": "./input/index.d.ts",
|
|
134
138
|
"default": "./fesm2022/lucca-front-ng-input.mjs"
|
|
@@ -137,10 +141,6 @@
|
|
|
137
141
|
"types": "./link/index.d.ts",
|
|
138
142
|
"default": "./fesm2022/lucca-front-ng-link.mjs"
|
|
139
143
|
},
|
|
140
|
-
"./inline-message": {
|
|
141
|
-
"types": "./inline-message/index.d.ts",
|
|
142
|
-
"default": "./fesm2022/lucca-front-ng-inline-message.mjs"
|
|
143
|
-
},
|
|
144
144
|
"./modal": {
|
|
145
145
|
"types": "./modal/index.d.ts",
|
|
146
146
|
"default": "./fesm2022/lucca-front-ng-modal.mjs"
|
|
@@ -153,6 +153,10 @@
|
|
|
153
153
|
"types": "./new-badge/index.d.ts",
|
|
154
154
|
"default": "./fesm2022/lucca-front-ng-new-badge.mjs"
|
|
155
155
|
},
|
|
156
|
+
"./number": {
|
|
157
|
+
"types": "./number/index.d.ts",
|
|
158
|
+
"default": "./fesm2022/lucca-front-ng-number.mjs"
|
|
159
|
+
},
|
|
156
160
|
"./number-format": {
|
|
157
161
|
"types": "./number-format/index.d.ts",
|
|
158
162
|
"default": "./fesm2022/lucca-front-ng-number-format.mjs"
|
|
@@ -161,10 +165,6 @@
|
|
|
161
165
|
"types": "./numeric-badge/index.d.ts",
|
|
162
166
|
"default": "./fesm2022/lucca-front-ng-numeric-badge.mjs"
|
|
163
167
|
},
|
|
164
|
-
"./number": {
|
|
165
|
-
"types": "./number/index.d.ts",
|
|
166
|
-
"default": "./fesm2022/lucca-front-ng-number.mjs"
|
|
167
|
-
},
|
|
168
168
|
"./option": {
|
|
169
169
|
"types": "./option/index.d.ts",
|
|
170
170
|
"default": "./fesm2022/lucca-front-ng-option.mjs"
|
|
@@ -177,6 +177,10 @@
|
|
|
177
177
|
"types": "./plg-push/index.d.ts",
|
|
178
178
|
"default": "./fesm2022/lucca-front-ng-plg-push.mjs"
|
|
179
179
|
},
|
|
180
|
+
"./popover": {
|
|
181
|
+
"types": "./popover/index.d.ts",
|
|
182
|
+
"default": "./fesm2022/lucca-front-ng-popover.mjs"
|
|
183
|
+
},
|
|
180
184
|
"./popover2": {
|
|
181
185
|
"types": "./popover2/index.d.ts",
|
|
182
186
|
"default": "./fesm2022/lucca-front-ng-popover2.mjs"
|
|
@@ -185,10 +189,6 @@
|
|
|
185
189
|
"types": "./popup/index.d.ts",
|
|
186
190
|
"default": "./fesm2022/lucca-front-ng-popup.mjs"
|
|
187
191
|
},
|
|
188
|
-
"./popover": {
|
|
189
|
-
"types": "./popover/index.d.ts",
|
|
190
|
-
"default": "./fesm2022/lucca-front-ng-popover.mjs"
|
|
191
|
-
},
|
|
192
192
|
"./popup-employee": {
|
|
193
193
|
"types": "./popup-employee/index.d.ts",
|
|
194
194
|
"default": "./fesm2022/lucca-front-ng-popup-employee.mjs"
|
|
@@ -237,14 +237,14 @@
|
|
|
237
237
|
"types": "./title/index.d.ts",
|
|
238
238
|
"default": "./fesm2022/lucca-front-ng-title.mjs"
|
|
239
239
|
},
|
|
240
|
-
"./tooltip": {
|
|
241
|
-
"types": "./tooltip/index.d.ts",
|
|
242
|
-
"default": "./fesm2022/lucca-front-ng-tooltip.mjs"
|
|
243
|
-
},
|
|
244
240
|
"./toast": {
|
|
245
241
|
"types": "./toast/index.d.ts",
|
|
246
242
|
"default": "./fesm2022/lucca-front-ng-toast.mjs"
|
|
247
243
|
},
|
|
244
|
+
"./tooltip": {
|
|
245
|
+
"types": "./tooltip/index.d.ts",
|
|
246
|
+
"default": "./fesm2022/lucca-front-ng-tooltip.mjs"
|
|
247
|
+
},
|
|
248
248
|
"./user": {
|
|
249
249
|
"types": "./user/index.d.ts",
|
|
250
250
|
"default": "./fesm2022/lucca-front-ng-user.mjs"
|
package/title/README.md
CHANGED
|
@@ -6,20 +6,20 @@ Add `title` properties in your routes config:
|
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
const routes: Routes = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
{
|
|
10
|
+
path: '',
|
|
11
|
+
data: {
|
|
12
|
+
title: 'Parent title',
|
|
13
|
+
},
|
|
14
|
+
children: [
|
|
15
|
+
{
|
|
16
|
+
path: ':requestId',
|
|
17
|
+
data: {
|
|
18
|
+
title: 'Sub route title',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
23
|
];
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -27,26 +27,26 @@ The service should now be able to collect all `title` properties defined for the
|
|
|
27
27
|
|
|
28
28
|
ex: `Sub route title - Parent title - YourAppName - Lucca`
|
|
29
29
|
|
|
30
|
-
For dynamic titles, the `prependTitle` method from `
|
|
30
|
+
For dynamic titles, the `prependTitle` method from `LuTitleStrategy` enables you to add a custom title.
|
|
31
31
|
In a component, you could do the following:
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
const userName: string = this.userService.getCurrentUser();
|
|
35
|
-
this.
|
|
35
|
+
this.luTitleStrategy.prependTitle(userName);
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
You can also replace the first fragment using:
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
const userName: string = this.userService.getOtherUser();
|
|
42
|
-
this.
|
|
42
|
+
this.luTitleStrategy.overrideFirstTitlePart(userName);
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Both `prependTitle` and `overrideFirstTitlePart` can also be called using `Observable<string>` :
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
48
|
const selectedUser$ = this.userStore.selected$;
|
|
49
|
-
this.
|
|
49
|
+
this.luTitleStrategy.prependTitle(selectedUser$);
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
## Quickstart
|
|
@@ -55,8 +55,14 @@ You will need to:
|
|
|
55
55
|
|
|
56
56
|
- Install `@lucca-front/ng`
|
|
57
57
|
- Create a service (`YourAppNameTranslateService`) that implements the `ILuTitleTranslateService`
|
|
58
|
-
-
|
|
59
|
-
|
|
58
|
+
- Call `provideLuTitleStrategy` in your `app.module.ts` / `app.config.ts`
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
provideLuTitleStrategy({
|
|
62
|
+
appName: () => 'YourAppName',
|
|
63
|
+
translateService: () => inject(YourAppNameTranslateService),
|
|
64
|
+
}),
|
|
65
|
+
```
|
|
60
66
|
|
|
61
67
|
### Let's start by creating the service
|
|
62
68
|
|
|
@@ -69,10 +75,10 @@ You should end up with the following if you are using `ngx-translate`:
|
|
|
69
75
|
```typescript
|
|
70
76
|
@Injectable({ providedIn: 'root' })
|
|
71
77
|
export class CoreRhTranslateService implements ILuTitleTranslateService {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
constructor(private translateService: TranslateService) {}
|
|
79
|
+
translate(key: string, args: unknown): string {
|
|
80
|
+
return this.translateService.instant(key, args);
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
```
|
|
78
84
|
|
|
@@ -81,34 +87,22 @@ or if you are using `transloco`:
|
|
|
81
87
|
```typescript
|
|
82
88
|
@Injectable({ providedIn: 'root' })
|
|
83
89
|
export class CoreRhTranslateService implements ILuTitleTranslateService {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
constructor(private translateService: TranslocoService) {}
|
|
91
|
+
translate(key: string, args: HashMap): string {
|
|
92
|
+
return this.translateService.translate(key, args);
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
```
|
|
90
96
|
|
|
91
97
|
### Adapt `app.module.ts` config
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
In the `app.module.ts`, you need to call `provideLuTitleStrategy` in the `providers` array:
|
|
94
100
|
|
|
95
101
|
```typescript
|
|
96
102
|
@NgModule({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
provide: LU_TITLE_TRANSLATE_SERVICE,
|
|
103
|
-
useExisting: YourAppNameTranslateService
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Init the `LuTitleService`
|
|
109
|
-
|
|
110
|
-
In the the `app.component.ts`, init the LuTitleService by passing the name of you app:
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
this.luTitleService.init('**YourAppName**');
|
|
103
|
+
providers: [
|
|
104
|
+
provideLuTitleStrategy({ translateService: () => inject(YourAppNameTranslateService) }),
|
|
105
|
+
]
|
|
106
|
+
})
|
|
107
|
+
export class AppModule {}
|
|
114
108
|
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
export declare const LU_TITLE_TRANSLATE_SERVICE: InjectionToken<ILuTitleTranslateService>;
|
|
3
4
|
export interface ILuTitleTranslateService {
|
|
4
|
-
translate(key: string, args?: Record<string, unknown>): string
|
|
5
|
+
translate(key: string, args?: Record<string, unknown>): string | Observable<string>;
|
|
5
6
|
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { Title } from '@angular/platform-browser';
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
3
2
|
import { RouterStateSnapshot, TitleStrategy } from '@angular/router';
|
|
4
|
-
import { ObservableInput } from 'rxjs';
|
|
3
|
+
import { Observable, ObservableInput } from 'rxjs';
|
|
5
4
|
import { ILuTitleTranslateService } from './title-translate.service';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare const APP_TITLE: InjectionToken<
|
|
6
|
+
export declare const ɵAPP_TITLE: InjectionToken<string | Observable<string>>;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `provideLuTitleStrategy` instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const APP_TITLE: InjectionToken<string | Observable<string>>;
|
|
8
11
|
export declare class LuTitleStrategy extends TitleStrategy {
|
|
9
12
|
#private;
|
|
10
13
|
private title;
|
|
11
14
|
private translateService;
|
|
12
15
|
private appTitle;
|
|
13
16
|
private titlePartsSubject;
|
|
14
|
-
titleParts$:
|
|
15
|
-
title$:
|
|
16
|
-
constructor(
|
|
17
|
+
titleParts$: Observable<(string | ObservableInput<string>)[]>;
|
|
18
|
+
title$: Observable<string>;
|
|
19
|
+
constructor();
|
|
17
20
|
updateTitle(routerState: RouterStateSnapshot): void;
|
|
18
21
|
prependTitle(title: string | ObservableInput<string>): void;
|
|
19
22
|
overrideFirstTitlePart(title: string | ObservableInput<string>): void;
|
|
20
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<LuTitleStrategy, never>;
|
|
21
24
|
static ɵprov: i0.ɵɵInjectableDeclaration<LuTitleStrategy>;
|
|
22
25
|
}
|
|
26
|
+
export interface LuTitleStrategyOptions {
|
|
27
|
+
appTitle?: () => string | Observable<string>;
|
|
28
|
+
translateService?: () => ILuTitleTranslateService;
|
|
29
|
+
}
|
|
30
|
+
export declare function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[];
|