@dflat-core/web 1.7.2094 → 1.7.2096
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/dflat-core-web-core-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-services.mjs +358 -4
- package/fesm2022/dflat-core-web-core-services.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core-ux.mjs +63 -27
- package/fesm2022/dflat-core-web-core-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-core.mjs +4 -2
- package/fesm2022/dflat-core-web-core.mjs.map +1 -1
- package/fesm2022/dflat-core-web-meta-model.mjs.map +1 -1
- package/fesm2022/dflat-core-web-meta-ux.mjs +11 -3
- package/fesm2022/dflat-core-web-meta-ux.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-data.mjs +3 -3
- package/fesm2022/dflat-core-web-system-data.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-model.mjs +3 -3
- package/fesm2022/dflat-core-web-system-root.mjs +46 -48
- package/fesm2022/dflat-core-web-system-root.mjs.map +1 -1
- package/fesm2022/dflat-core-web-system-ux.mjs +144 -135
- package/fesm2022/dflat-core-web-system-ux.mjs.map +1 -1
- package/package.json +1 -1
- package/types/dflat-core-web-core-model.d.ts +10 -0
- package/types/dflat-core-web-core-services.d.ts +146 -1
- package/types/dflat-core-web-core-ux.d.ts +20 -8
- package/types/dflat-core-web-core.d.ts +31 -0
- package/types/dflat-core-web-meta-model.d.ts +5 -1
- package/types/dflat-core-web-system-data.d.ts +6 -5
- package/types/dflat-core-web-system-model.d.ts +4 -3
- package/types/dflat-core-web-system-root.d.ts +47 -3
- package/types/dflat-core-web-system-ux.d.ts +14 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dflat-core-web-core-model.mjs","names":[],"sources":["../../core-model/src/lib/core-model.module.ts","../../core-model/src/lib/model/interface.generated.ts","../../core-model/src/lib/interface.ts","../../core-model/src/lib/model/model.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [],\r\n exports: []\r\n})\r\nexport class CoreModelModule {}\r\n","export interface ViewModel {\r\n}\r\n\r\nexport interface ExtendedProperty {\r\n EntityId? : number;\r\n FieldType? : number;\r\n PropertyId? : number;\r\n PropertyName? : string;\r\n Value? : string;\r\n}\r\n\r\nexport interface PagingViewModel {\r\n EnablePaging? : boolean;\r\n Offset? : number;\r\n SortColumn? : string;\r\n SortDirection? : string;\r\n SpecificSortClause? : string;\r\n Take? : number;\r\n}\r\n\r\nexport interface EntityViewModel extends ViewModel {\r\n ExtendedProperties? : ExtendedProperty[];\r\n Id? : number;\r\n IsEditable? : boolean;\r\n IsSelected? : boolean;\r\n IsStorable? : boolean;\r\n Name? : string;\r\n RowVersion? : string;\r\n}\r\n\r\nexport enum ValidatorTypes {\r\n None = 0,\r\n MaxLength = 1,\r\n MinLength = 2,\r\n Max = 4,\r\n Min = 8,\r\n Email = 16,\r\n Required = 32,\r\n Unicity = 64,\r\n Nullable = 128,\r\n}\r\n\r\nexport interface FilterViewModel extends PagingViewModel {\r\n AdditionalFilter? : string;\r\n AdditionalQuery? : string;\r\n AggregateClause? : string;\r\n BrandId? : number;\r\n CustomFieldIds? : string;\r\n Id? : number;\r\n IsCsvExport? : boolean;\r\n Keywords? : string;\r\n ViewQuery? : string;\r\n}\r\n\r\nexport interface TextWithStyle {\r\n GreenText? : string;\r\n RedText? : string;\r\n YellowText? : string;\r\n}\r\n\r\nexport interface INode {\r\n Childrens? : INode[];\r\n Code? : string;\r\n Description? : string;\r\n Id? : number;\r\n ParentId? : number;\r\n UniqueName? : string;\r\n}\r\n\r\nexport enum FilterType {\r\n String = 0,\r\n Integer = 1,\r\n Date = 2,\r\n ComboBox = 3,\r\n CheckBox = 4,\r\n Email = 5,\r\n WeekNumber = 6,\r\n Text = 7,\r\n Custom = 8,\r\n RadioButton = 9,\r\n TextZoneWithButton = 10,\r\n HorizComboBox = 11,\r\n TextWithButton = 12,\r\n DropFileZone = 13,\r\n DateTime = 14,\r\n Password = 15,\r\n TreeSelector = 16,\r\n Decimal = 17,\r\n}\r\n\r\nexport interface FieldValidators {\r\n MaxLength? : number;\r\n MaxValue? : number;\r\n MinValue? : number;\r\n ValidatorType? : ValidatorTypes;\r\n}\r\n\r\nexport interface EntityFilterViewModel<T> extends FilterViewModel {\r\n}\r\n\r\nexport enum ConditionalResults {\r\n Hide = 0,\r\n ReadOnly = 1,\r\n}\r\n\r\nexport enum ColumnSpans {\r\n Single = 0,\r\n Full = 1,\r\n}\r\n\r\nexport interface FieldDescriptor {\r\n BoolConditioningFieldValue? : boolean;\r\n ButtonLabel? : string;\r\n CascadeDependency? : boolean;\r\n CascadeDependencyProperty? : string;\r\n ColumnIndex? : number;\r\n ColumnSpan? : ColumnSpans;\r\n ConditionalResult? : ConditionalResults;\r\n ConditioningField? : string;\r\n ConditioningFieldValue? : number[];\r\n CurrentFilters? : any;\r\n Data? : any;\r\n DataFilter? : FilterViewModel;\r\n Description? : string;\r\n DisplayMember? : string;\r\n ExportPropertyName? : string;\r\n FieldValidators? : FieldValidators;\r\n FilterDistinct? : boolean;\r\n FilterType? : FilterType;\r\n HideSelected? : boolean;\r\n Highlight? : boolean;\r\n InputType? : string;\r\n IsClearable? : boolean;\r\n IsConditional? : boolean;\r\n IsConditioning? : boolean;\r\n IsExtendedProperty? : boolean;\r\n IsHidden? : boolean;\r\n IsStatic? : boolean;\r\n KeepPlace? : boolean;\r\n Label? : string;\r\n ModalEntityKey? : string;\r\n ModalOnly? : boolean;\r\n ModalPropertyName? : string;\r\n ModalPropertyValue? : string;\r\n ModalTitle? : string;\r\n ModalTriggerIdProperty? : string;\r\n ModalTriggerIdPropertyValue? : string;\r\n MultipleSelection? : boolean;\r\n NotDefaultRequired? : boolean;\r\n OriginalData? : any;\r\n PropertyLength? : number;\r\n PropertyName? : string;\r\n ReadOnly? : boolean;\r\n Required? : boolean;\r\n TextWithStyle? : TextWithStyle;\r\n ToolTip? : string;\r\n ValueMember? : string;\r\n}\r\n\r\nexport interface BasicNode {\r\n Childrens? : INode[];\r\n Code? : string;\r\n Description? : string;\r\n Id? : number;\r\n ParentId? : number;\r\n UniqueName? : string;\r\n}\r\n\r\nexport enum ApiErrorTypes {\r\n Unknown = 0,\r\n DatabaseError = 1,\r\n SystemError = 2,\r\n UserError = 3,\r\n}\r\n\r\nexport interface TreeItem<T> {\r\n checked? : boolean;\r\n children? : TreeItem<T>[];\r\n childrenCount? : number;\r\n text? : string;\r\n value? : number;\r\n}\r\n\r\nexport interface Section {\r\n FieldViewModels? : FieldDescriptor[];\r\n IsCustomFieldSection? : boolean;\r\n IsFileSection? : boolean;\r\n IsTrackRecordSection? : boolean;\r\n Name? : string;\r\n}\r\n\r\nexport interface Display {\r\n baseUrl? : string;\r\n completingCaracter? : string;\r\n currency? : string;\r\n enumMap? : string[];\r\n format? : string;\r\n handleError? : boolean;\r\n imagePath? : string;\r\n imgBase? : string;\r\n multiplier? : number;\r\n nullCaseText? : string;\r\n sourceProperty? : string;\r\n type? : string;\r\n width? : number;\r\n}\r\n\r\nexport interface ApiError {\r\n ApiErrorType? : ApiErrorTypes;\r\n ErrorCode? : number;\r\n Message? : string;\r\n StackTrace? : string;\r\n}\r\n\r\nexport enum ActionDisplay {\r\n Button = 0,\r\n TextAndButton = 1,\r\n}\r\n\r\n\r\nexport interface TabToSave<TResult> {\r\n Data? : TResult[];\r\n TitleOfTab? : string;\r\n}\r\n\r\nexport interface SaveResult {\r\n DisplayMessage? : boolean;\r\n Error? : ApiError;\r\n ErrorMessage? : string;\r\n Id? : number;\r\n RowVersion? : string;\r\n Success? : boolean;\r\n Warnings? : string[];\r\n}\r\n\r\nexport interface ColumnDescriptor {\r\n Display? : Display;\r\n Expression? : string;\r\n FieldName? : string;\r\n IsComputed? : boolean;\r\n IsFilterEnabled? : boolean;\r\n IsNumericExpression? : boolean;\r\n Name? : string;\r\n Property? : string;\r\n TableAlias? : string;\r\n ToolTipProperty? : string;\r\n}\r\n\r\nexport interface AggregationValue {\r\n Key? : string;\r\n Value? : any;\r\n}\r\n\r\nexport interface ActionDescriptor {\r\n ActionDisplay? : ActionDisplay;\r\n Description? : string;\r\n FormDescriptor? : Section[];\r\n Icon? : string;\r\n IconUrl? : string;\r\n Label? : string;\r\n Name? : string;\r\n RequestType? : string;\r\n}\r\n\r\nexport interface SaveResults<TResult> extends SaveResult {\r\n SaveErrorEntities? : TResult[];\r\n}\r\n\r\nexport interface RunActionContext {\r\n Action? : ActionDescriptor;\r\n CorrelationId? : string;\r\n EntityIds? : number[];\r\n EntityKey? : string;\r\n File? : any;\r\n FileId? : number;\r\n FormValue? : any;\r\n RequestId? : number;\r\n}\r\n\r\nexport interface PagedList<T> {\r\n Aggregates? : AggregationValue[];\r\n Skip? : number;\r\n Take? : number;\r\n TotalRowCount? : number;\r\n Values? : T[];\r\n}\r\n\r\nexport enum ImageFormats {\r\n Undefined = 0,\r\n JPG = 1,\r\n PNG = 2,\r\n GIF = 3,\r\n TIFF = 4,\r\n BMP = 5,\r\n SVG = 6,\r\n}\r\n\r\nexport interface FilterDescriptor extends FieldDescriptor {\r\n DisplayImage? : boolean;\r\n}\r\n\r\nexport interface ExportModel<T> {\r\n Columns? : ColumnDescriptor[];\r\n Filter? : T;\r\n}\r\n\r\nexport interface EntityWithSpecifics<TResult> {\r\n Entity? : TResult;\r\n Tabs? : TabToSave<TResult>[];\r\n}\r\n\r\nexport interface EntityViewModelWithFields<T> {\r\n FieldSections? : Section[];\r\n HiddenSections? : string[];\r\n SpecificSection? : any;\r\n ViewModel? : T;\r\n}\r\n\r\nexport interface EntityImage {\r\n EntityId? : number;\r\n Url? : string;\r\n}\r\n\r\nexport interface DistinctValuesResult {\r\n HasMore? : boolean;\r\n Values? : any[];\r\n}\r\n\r\nexport enum TextSearch {\r\n Contains = 0,\r\n StartsWith = 1,\r\n EndsWith = 2,\r\n}\r\n\r\nexport enum ExportType {\r\n CSV = 0,\r\n EXCEL = 1,\r\n}\r\n\r\nexport enum AggregateFunction {\r\n Count = 0,\r\n Sum = 1,\r\n Min = 2,\r\n Max = 3,\r\n Avg = 4,\r\n}\r\n\r\nexport enum ActionResultStatus {\r\n OK = 0,\r\n KO = 1,\r\n}\r\n\r\n","import { Utilities } from '@dflat-core/web/core';\r\nimport { ComponentRef, TemplateRef, Type } from '@angular/core';\r\n\r\nimport { ActionDescriptor, ColumnDescriptor, EntityViewModel, EntityViewModelWithFields, FieldDescriptor, FieldValidators, FilterDescriptor, FilterViewModel } from './model/interface.generated';\r\n\r\nexport interface IIdentifiable {\r\n Id?: number;\r\n}\r\n\r\nexport class UserUpdatedMessage {\r\n constructor(public userKey: string) { }\r\n}\r\n\r\n/**\r\n * Message du bus : un profil de présentation partagé (par défaut, par rôle ou par fournisseur) a\r\n * été modifié (signal PresentationChanged du hub, envoyé par le serveur après son enregistrement).\r\n * Le cache d'initialisation de l'entité est vidé et les grilles ouvertes rechargent leurs colonnes.\r\n */\r\nexport class PresentationChangedMessage {\r\n /**\r\n * @param entityName Nom de l'entité du profil (ex. Company), ou null : toutes les entités.\r\n * @param stamp Nouvel horodatage du cache client annoncé par le serveur.\r\n */\r\n constructor(public entityName: string | null, public stamp?: number) { }\r\n\r\n /**\r\n * Vrai si le message concerne l'écran de clé entityKey : même nom sans tenir compte de la\r\n * casse ni du suffixe View (un écran porte sur la table ou sur sa vue principale).\r\n */\r\n concerns(entityKey: string): boolean {\r\n if (this.entityName === null || this.entityName === undefined || this.entityName === '') {\r\n return true;\r\n }\r\n const normalize = (name: string) => (name ?? '').toLowerCase().replace(/view$/, '');\r\n return normalize(this.entityName) === normalize(entityKey);\r\n }\r\n}\r\n\r\n/**\r\n * Message du bus : un formulaire enregistré en base a été modifié (signal FormChanged du hub,\r\n * envoyé par le serveur après l'enregistrement d'un formulaire, d'une section ou d'un champ).\r\n * Le cache d'initialisation de l'entité est vidé et les écrans ouverts rechargent leur formulaire.\r\n */\r\nexport class FormChangedMessage {\r\n /**\r\n * @param entityName Nom de l'entité du formulaire (ex. Country), ou null : tous les formulaires.\r\n * @param stamp Nouvel horodatage du cache client annoncé par le serveur.\r\n */\r\n constructor(public entityName: string | null, public stamp?: number) { }\r\n\r\n /**\r\n * Vrai si le message concerne l'écran de clé entityKey : même nom sans tenir compte de la\r\n * casse ni du suffixe View (un écran porte sur la table ou sur sa vue principale).\r\n */\r\n concerns(entityKey: string): boolean {\r\n if (this.entityName === null || this.entityName === undefined || this.entityName === '') {\r\n return true;\r\n }\r\n const normalize = (name: string) => (name ?? '').toLowerCase().replace(/view$/, '');\r\n return normalize(this.entityName) === normalize(entityKey);\r\n }\r\n}\r\n\r\n/**\r\n * Avancement du chargement par pages d'une source volumineuse de tableau de bord (message DashboardLoadProgress du hub,\r\n * ou action sur le chargement dans ce navigateur) : les widgets qui l'attendent affichent l'avancement et relisent leurs\r\n * données quand il est terminé.\r\n */\r\nexport class DashboardLoadProgressMessage {\r\n /**\r\n * @param loadId Identifiant du chargement.\r\n * @param loadedRows Lignes déjà chargées.\r\n * @param totalRows Lignes à charger.\r\n * @param progress Avancement, en pourcentage.\r\n * @param state État : Running, Paused, Done, Cancelled ou Error.\r\n */\r\n constructor(public loadId: string, public loadedRows: number, public totalRows: number, public progress: number, public state: string) { }\r\n}\r\n\r\n/**\r\n * Étape du serveur pour les tableaux de bord (message DashboardActivity du hub) : comptage et lecture d'une source,\r\n * combinaisons des filtres, calcul d'un widget..., avec la durée des étapes terminées. Affichée par le journal du tableau.\r\n */\r\nexport class DashboardActivityMessage {\r\n /**\r\n * @param metaEntityId Source concernée, ou null.\r\n * @param message Ce que fait le serveur.\r\n * @param date Heure du serveur.\r\n */\r\n constructor(public metaEntityId: number | null, public message: string, public date: Date) { }\r\n}\r\n\r\n/**\r\n * Contenu du cache des tableaux de bord modifié côté API (message DashboardCacheChanged du hub), avec son nouvel état\r\n * (DashboardCacheInfo), ou null s'il est à relire.\r\n */\r\nexport class DashboardCacheChangedMessage {\r\n /** @param info État du cache (DashboardCacheInfo), ou null. */\r\n constructor(public info: any = null) { }\r\n}\r\n\r\n/**\r\n * Message du bus : message diffusé par le serveur (signal BroadcastMessage du hub, envoyé à un compte ou à tous).\r\n * Une application s'y abonne et filtre par nom : bus.of(BroadcastMessage).pipe(filter(m => m.is('MonEvenement'))).\r\n */\r\nexport class BroadcastMessage {\r\n /**\r\n * @param name Nom du message (événement ou titre), choisi par le serveur.\r\n * @param message Contenu : texte ou JSON.\r\n */\r\n constructor(public name: string, public message: string) { }\r\n\r\n /** Vrai si le message porte ce nom (casse comprise). */\r\n is(name: string): boolean {\r\n return this.name === name;\r\n }\r\n\r\n /** Contenu analysé en JSON, ou null s'il est vide ou n'est pas du JSON valide. */\r\n json<T = any>(): T | null {\r\n if (this.message === null || this.message === undefined || this.message === '') {\r\n return null;\r\n }\r\n try {\r\n return JSON.parse(this.message) as T;\r\n } catch {\r\n return null;\r\n }\r\n }\r\n}\r\n\r\nexport interface IUserCredential extends IIdentifiable {\r\n AccessToken: string; \r\n RefreshToken: string; \r\n Username?: string; \r\n FirstName?: string; \r\n LastName?: string;\r\n Email?: string;\r\n IsAdmin?: boolean;\r\n IsDelivery?: boolean;\r\n IsPartner?: boolean;\r\n PhoneNumber?: string;\r\n IsActive?: boolean;\r\n IsPartnerActive?: boolean;\r\n IsDeliveryActive?: boolean;\r\n\r\n Id?: number;\r\n CompanyId?: number;\r\n Permissions: string[];\r\n ProfileImageUrl: string;\r\n AvatarUrl: string;\r\n\r\n /** Le second facteur est demandé : aucun jeton, le code s'envoie avec TwoFactorChallenge (Connexion, B.5.8). */\r\n TwoFactorRequired?: boolean;\r\n /** Jeton de la connexion en attente du second facteur. */\r\n TwoFactorChallenge?: string;\r\n /** La politique impose la double authentification à ce compte, qui ne l'a pas encore. */\r\n TwoFactorSetupRequired?: boolean;\r\n /** Jeton d'appareil de confiance, à garder par le navigateur. */\r\n TrustedDeviceToken?: string;\r\n}\r\n\r\n/** Moyens de connexion proposés par l'écran de connexion (Account/GetLoginOptions, Connexion, B.5.8). */\r\nexport interface ILoginOptions {\r\n /** La connexion par un lien envoyé par e-mail est activée. */\r\n LoginLinkEnabled?: boolean;\r\n /** La demande de lien exige un captcha. */\r\n LoginLinkCaptcha?: boolean;\r\n /** Fournisseurs externes configurés. */\r\n Providers?: IExternalLoginProvider[];\r\n}\r\n/** Fournisseur d'identité externe proposé à l'écran de connexion (Account/GetLoginProviders). */\r\nexport interface IExternalLoginProvider {\r\n /** Google, Microsoft ou Apple. */\r\n Provider: string;\r\n /** Identifiant de l'application chez le fournisseur. */\r\n ClientId: string;\r\n /** Microsoft seulement : locataire du point d'accès (common par défaut). */\r\n TenantId?: string;\r\n /** Google seulement : identifiant client iOS, pour la connexion native dans l'application iPhone. */\r\n IosClientId?: string;\r\n}\r\n\r\nexport class User implements IUserCredential {\r\n \r\n public AccessToken: string;\r\n public RefreshToken: string;\r\n public Username?: string;\r\n public FirstName?: string;\r\n public LastName?: string;\r\n public Email?: string;\r\n public PhoneNumber?: string;\r\n public IsAdmin?: boolean;\r\n public IsDelivery?: boolean;\r\n public IsPartner?: boolean;\r\n public Id?: number;\r\n public CompanyId?: number;\r\n public Permissions: string[];\r\n public ProfileImageUrl: string;\r\n public IsActive?: boolean;\r\n public IsPartnerActive?: boolean;\r\n public IsDeliveryActive?: boolean;\r\n public IsConnected: boolean = false;\r\n public AvatarUrl: string;\r\n \r\n public constructor(data: IUserCredential) {\r\n this.Username = data.Username;\r\n this.FirstName = data.FirstName;\r\n this.LastName = data.LastName;\r\n this.Email = data.Email;\r\n this.PhoneNumber = data.PhoneNumber;\r\n this.ProfileImageUrl = data.ProfileImageUrl;\r\n this.IsAdmin = data.IsAdmin;\r\n this.IsPartner = data.IsPartner;\r\n this.IsDelivery = data.IsDelivery;\r\n this.IsAdmin = data.IsAdmin;\r\n this.IsPartner = data.IsPartner;\r\n this.IsDelivery = data.IsDelivery;\r\n this.IsActive = data.IsActive;\r\n this.IsPartnerActive = data.IsPartnerActive;\r\n this.IsDeliveryActive = data.IsDeliveryActive;\r\n this.Id = data.Id;\r\n this.CompanyId = data.CompanyId;\r\n this.AccessToken = data.AccessToken;\r\n this.AvatarUrl = data.AvatarUrl;\r\n }\r\n \r\n\r\n public getName() {\r\n return this.FirstName + ' ' + this.LastName;\r\n }\r\n\r\n \r\n}\r\n\r\n\r\nexport interface INotification {\r\n id:string;\r\n content: string;\r\n class: string;\r\n link: string;\r\n entityType:string;\r\n entityId?:number;\r\n}\r\n \r\nexport class Notification implements INotification {\r\n public id:string;\r\n public content: string;\r\n public class: string;\r\n public link: string;\r\n public entityType:string;\r\n public entityId?:number\r\n public constructor(data: Partial<INotification> = {}) {\r\n this.id = data.id || '';\r\n this.content = data.content || '';\r\n this.class = data.class || '';\r\n this.link = data.link || '';\r\n this.entityType = data.entityType || '';\r\n this.entityId = data.entityId;\r\n }\r\n}\r\n\r\nexport class ChannelData<T> {\r\n Channel: string;\r\n Data: T;\r\n\r\n public constructor(channel: string, data: T) {\r\n this.Channel= channel;\r\n this.Data= data;\r\n }\r\n}\r\n\r\nexport class IMessage {\r\n Channel: string;\r\n Data: any;\r\n}\r\n\r\nexport class Message implements IMessage \r\n{\r\n Channel: string;\r\n Data: any;\r\n\r\n public constructor(channel: string, data: any) {\r\n this.Channel= channel;\r\n this.Data= data;\r\n }\r\n}\r\nexport interface NumberDictionary<T> {\r\n [Key: number]: T;\r\n}\r\nexport interface Dictionary<T> {\r\n [Key: string]: T;\r\n}\r\n\r\n\r\n\r\nexport class NumberDictionnaryWrapper<T> {\r\n\r\n dictionary: NumberDictionary<T> = {};\r\n get(key: number) {\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKey(key: number) {\r\n if (typeof this.dictionary[key] === \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nexport class DictionnaryWrapper<T> {\r\n\r\n dictionary: Dictionary<T> = {};\r\n get(key: string) {\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKey(key: string) {\r\n if (typeof this.dictionary[key] === \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n getPartKey(key: string) {\r\n\r\n if (typeof this.dictionary[key] === \"undefined\" ) {\r\n let keyFound = Object.keys(this.dictionary).find(obj => key.includes(obj));\r\n if(keyFound) {\r\n key = keyFound\r\n }\r\n }\r\n\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKeyOrPartKey(key: string) {\r\n let routeFound = Object.keys(this.dictionary).find(obj => key.includes(obj));\r\n \r\n if(!Utilities.IsNil(routeFound)){\r\n return true;\r\n }\r\n\r\n if (typeof this.dictionary[key] === \"undefined\" ) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n getValues() {\r\n return Object.keys(this.dictionary).map(key => this.dictionary[key]);\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n// export interface FilterDescriptor {\r\n// FieldValidators?: FieldValidators;\r\n// Label?: string;\r\n// FilterType?: FilterType;\r\n// PropertyName?: string;\r\n// DisplayMember?: string;\r\n// ValueMember?: string;\r\n// Data?: any;\r\n// Highlight?: boolean;\r\n// ToolTip?: string;\r\n// IsStatic?: boolean;\r\n// Required?: boolean;\r\n// NotDefaultRequired?: boolean;\r\n// ReadOnly?: boolean;\r\n// IsHidden?: boolean;\r\n// KeepPlace?: boolean;\r\n// IsConditioning?: boolean;\r\n// IsConditional?: boolean;\r\n// ConditioningField?: string;\r\n// ConditioningFieldValue?: number;\r\n// BoolConditioningFieldValue?: boolean;\r\n// OriginalData?: any;\r\n// CascadeDependency?: boolean;\r\n// CascadeDependencyProperty?: string;\r\n// FilterDistinct?: boolean;\r\n// MultipleSelection?: boolean;\r\n// HideSelected?: boolean;\r\n// ColumnSpan?: ColumnSpans;\r\n// ColumnIndex?: number;\r\n// InputType?: string;\r\n// CurrentFilters?: {};\r\n\r\n// ModalEntityKey?: string;\r\n// ModalPropertyName?: string;\r\n// ModalPropertyValue?: string;\r\n// ModalTitle?: string;\r\n// }\r\n\r\n\r\n\r\nexport interface SpecificSection {\r\n Name?: string,\r\n IconUrl?:string,\r\n Template?: Type<any> | TemplateRef<any> | ComponentRef<any> | any,\r\n Context?: {},\r\n Data?: any[],\r\n Component?: any,\r\n refreshFunction?: () => void\r\n}\r\nexport interface SectionError {\r\n Name?: string,\r\n FieldValidators?: FieldValidators;\r\n Errors?: string[]\r\n}\r\n\r\nexport interface IFilterDescriptorExtra {\r\n Field?: FilterDescriptor;\r\n DisplayedValue?: string;\r\n}\r\n\r\nexport interface TextZoneButtonEvent {\r\n Field: FieldDescriptor;\r\n Value: string;\r\n }\r\n \r\n export interface FieldEvent {\r\n Field: FieldDescriptor;\r\n Event: Event;\r\n }\r\n \r\n export interface EntityConfig {\r\n actions: ActionDescriptor[];\r\n columns: ColumnDescriptor[];\r\n emptyFilter: FilterViewModel;\r\n filterDescriptors: FilterDescriptor[];\r\n viewModel: EntityViewModelWithFields<EntityViewModel>;\r\n }\r\n\r\n // export interface CachedConfig {\r\n // timestamp: number;\r\n // config : EntityConfig;\r\n // }\r\n\r\n export interface PropertyEditorEvent {\r\n field: FieldDescriptor;\r\n value: any;\r\n type: 'value' | 'pending' | 'file' | 'selector' | 'button'| 'reset';\r\n }","export class HistoryItem {\r\n date: string;\r\n hour: string;\r\n url: string;\r\n icon1: string;\r\n menu1: string;\r\n icon2: string;\r\n menu2: string;\r\n}\r\n\r\nexport enum FilterOperator {\r\n Contains = 0,\r\n StartsWith = 1,\r\n EndsWith = 2,\r\n Equals = 3\r\n}\r\nexport interface FilterClause {\r\n PropertyName : string;\r\n FilterValue : string;\r\n Operator : FilterOperator;\r\n /** Valeurs cochées dans le menu « Filtre avancé » de la colonne (condition « dans la liste »). */\r\n FilterValues? : string[];\r\n}\r\n\r\nexport interface FilterRow {\r\n ClausesByPropertyName : Map<string, FilterClause>;\r\n}\r\n\r\nexport interface FilterQuery {\r\n Rows : FilterRow[];\r\n}\r\n\r\nexport enum CustomFieldTypes {\r\n String = 0,\r\n Integer =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A,EAAA"}
|
|
1
|
+
{"version":3,"file":"dflat-core-web-core-model.mjs","names":[],"sources":["../../core-model/src/lib/core-model.module.ts","../../core-model/src/lib/model/interface.generated.ts","../../core-model/src/lib/interface.ts","../../core-model/src/lib/model/model.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [],\r\n exports: []\r\n})\r\nexport class CoreModelModule {}\r\n","export interface ViewModel {\r\n}\r\n\r\nexport interface ExtendedProperty {\r\n EntityId? : number;\r\n FieldType? : number;\r\n PropertyId? : number;\r\n PropertyName? : string;\r\n Value? : string;\r\n}\r\n\r\nexport interface PagingViewModel {\r\n EnablePaging? : boolean;\r\n Offset? : number;\r\n SortColumn? : string;\r\n SortDirection? : string;\r\n SpecificSortClause? : string;\r\n Take? : number;\r\n}\r\n\r\nexport interface EntityViewModel extends ViewModel {\r\n ExtendedProperties? : ExtendedProperty[];\r\n Id? : number;\r\n IsEditable? : boolean;\r\n IsSelected? : boolean;\r\n IsStorable? : boolean;\r\n Name? : string;\r\n RowVersion? : string;\r\n}\r\n\r\nexport enum ValidatorTypes {\r\n None = 0,\r\n MaxLength = 1,\r\n MinLength = 2,\r\n Max = 4,\r\n Min = 8,\r\n Email = 16,\r\n Required = 32,\r\n Unicity = 64,\r\n Nullable = 128,\r\n}\r\n\r\nexport interface FilterViewModel extends PagingViewModel {\r\n AdditionalFilter? : string;\r\n AdditionalQuery? : string;\r\n AggregateClause? : string;\r\n BrandId? : number;\r\n CustomFieldIds? : string;\r\n Id? : number;\r\n IsCsvExport? : boolean;\r\n Keywords? : string;\r\n ViewQuery? : string;\r\n}\r\n\r\nexport interface TextWithStyle {\r\n GreenText? : string;\r\n RedText? : string;\r\n YellowText? : string;\r\n}\r\n\r\nexport interface INode {\r\n Childrens? : INode[];\r\n Code? : string;\r\n Description? : string;\r\n Id? : number;\r\n ParentId? : number;\r\n UniqueName? : string;\r\n}\r\n\r\nexport enum FilterType {\r\n String = 0,\r\n Integer = 1,\r\n Date = 2,\r\n ComboBox = 3,\r\n CheckBox = 4,\r\n Email = 5,\r\n WeekNumber = 6,\r\n Text = 7,\r\n Custom = 8,\r\n RadioButton = 9,\r\n TextZoneWithButton = 10,\r\n HorizComboBox = 11,\r\n TextWithButton = 12,\r\n DropFileZone = 13,\r\n DateTime = 14,\r\n Password = 15,\r\n TreeSelector = 16,\r\n Decimal = 17,\r\n}\r\n\r\nexport interface FieldValidators {\r\n MaxLength? : number;\r\n MaxValue? : number;\r\n MinValue? : number;\r\n ValidatorType? : ValidatorTypes;\r\n}\r\n\r\nexport interface EntityFilterViewModel<T> extends FilterViewModel {\r\n}\r\n\r\nexport enum ConditionalResults {\r\n Hide = 0,\r\n ReadOnly = 1,\r\n}\r\n\r\nexport enum ColumnSpans {\r\n Single = 0,\r\n Full = 1,\r\n}\r\n\r\nexport interface FieldDescriptor {\r\n BoolConditioningFieldValue? : boolean;\r\n ButtonLabel? : string;\r\n CascadeDependency? : boolean;\r\n CascadeDependencyProperty? : string;\r\n ColumnIndex? : number;\r\n ColumnSpan? : ColumnSpans;\r\n ConditionalResult? : ConditionalResults;\r\n ConditioningField? : string;\r\n ConditioningFieldValue? : number[];\r\n CurrentFilters? : any;\r\n Data? : any;\r\n DataFilter? : FilterViewModel;\r\n Description? : string;\r\n DisplayMember? : string;\r\n ExportPropertyName? : string;\r\n FieldValidators? : FieldValidators;\r\n FilterDistinct? : boolean;\r\n FilterType? : FilterType;\r\n HideSelected? : boolean;\r\n Highlight? : boolean;\r\n InputType? : string;\r\n IsClearable? : boolean;\r\n IsConditional? : boolean;\r\n IsConditioning? : boolean;\r\n IsExtendedProperty? : boolean;\r\n IsHidden? : boolean;\r\n IsStatic? : boolean;\r\n KeepPlace? : boolean;\r\n Label? : string;\r\n ModalEntityKey? : string;\r\n ModalOnly? : boolean;\r\n ModalPropertyName? : string;\r\n ModalPropertyValue? : string;\r\n ModalTitle? : string;\r\n ModalTriggerIdProperty? : string;\r\n ModalTriggerIdPropertyValue? : string;\r\n MultipleSelection? : boolean;\r\n NotDefaultRequired? : boolean;\r\n OriginalData? : any;\r\n PropertyLength? : number;\r\n PropertyName? : string;\r\n ReadOnly? : boolean;\r\n Required? : boolean;\r\n TextWithStyle? : TextWithStyle;\r\n ToolTip? : string;\r\n ValueMember? : string;\r\n}\r\n\r\nexport interface BasicNode {\r\n Childrens? : INode[];\r\n Code? : string;\r\n Description? : string;\r\n Id? : number;\r\n ParentId? : number;\r\n UniqueName? : string;\r\n}\r\n\r\nexport enum ApiErrorTypes {\r\n Unknown = 0,\r\n DatabaseError = 1,\r\n SystemError = 2,\r\n UserError = 3,\r\n}\r\n\r\nexport interface TreeItem<T> {\r\n checked? : boolean;\r\n children? : TreeItem<T>[];\r\n childrenCount? : number;\r\n text? : string;\r\n value? : number;\r\n}\r\n\r\nexport interface Section {\r\n FieldViewModels? : FieldDescriptor[];\r\n IsCustomFieldSection? : boolean;\r\n IsFileSection? : boolean;\r\n IsTrackRecordSection? : boolean;\r\n Name? : string;\r\n}\r\n\r\nexport interface Display {\r\n baseUrl? : string;\r\n completingCaracter? : string;\r\n currency? : string;\r\n enumMap? : string[];\r\n format? : string;\r\n handleError? : boolean;\r\n imagePath? : string;\r\n imgBase? : string;\r\n multiplier? : number;\r\n nullCaseText? : string;\r\n sourceProperty? : string;\r\n type? : string;\r\n width? : number;\r\n}\r\n\r\nexport interface ApiError {\r\n ApiErrorType? : ApiErrorTypes;\r\n ErrorCode? : number;\r\n Message? : string;\r\n StackTrace? : string;\r\n}\r\n\r\nexport enum ActionDisplay {\r\n Button = 0,\r\n TextAndButton = 1,\r\n}\r\n\r\n\r\nexport interface TabToSave<TResult> {\r\n Data? : TResult[];\r\n TitleOfTab? : string;\r\n}\r\n\r\nexport interface SaveResult {\r\n DisplayMessage? : boolean;\r\n Error? : ApiError;\r\n ErrorMessage? : string;\r\n Id? : number;\r\n RowVersion? : string;\r\n Success? : boolean;\r\n Warnings? : string[];\r\n}\r\n\r\nexport interface ColumnDescriptor {\r\n Display? : Display;\r\n Expression? : string;\r\n FieldName? : string;\r\n IsComputed? : boolean;\r\n IsFilterEnabled? : boolean;\r\n IsNumericExpression? : boolean;\r\n IsSortEnabled? : boolean;\r\n Name? : string;\r\n Property? : string;\r\n TableAlias? : string;\r\n ToolTipProperty? : string;\r\n}\r\n\r\nexport interface AggregationValue {\r\n Key? : string;\r\n Value? : any;\r\n}\r\n\r\nexport interface ActionDescriptor {\r\n ActionDisplay? : ActionDisplay;\r\n Description? : string;\r\n FormDescriptor? : Section[];\r\n Icon? : string;\r\n IconUrl? : string;\r\n Label? : string;\r\n Name? : string;\r\n RequestType? : string;\r\n}\r\n\r\nexport interface SaveResults<TResult> extends SaveResult {\r\n SaveErrorEntities? : TResult[];\r\n}\r\n\r\nexport interface RunActionContext {\r\n Action? : ActionDescriptor;\r\n CorrelationId? : string;\r\n EntityIds? : number[];\r\n EntityKey? : string;\r\n File? : any;\r\n FileId? : number;\r\n FormValue? : any;\r\n RequestId? : number;\r\n}\r\n\r\nexport interface PagedList<T> {\r\n Aggregates? : AggregationValue[];\r\n Skip? : number;\r\n Take? : number;\r\n TotalRowCount? : number;\r\n Values? : T[];\r\n}\r\n\r\nexport enum ImageFormats {\r\n Undefined = 0,\r\n JPG = 1,\r\n PNG = 2,\r\n GIF = 3,\r\n TIFF = 4,\r\n BMP = 5,\r\n SVG = 6,\r\n}\r\n\r\nexport interface FilterDescriptor extends FieldDescriptor {\r\n DisplayImage? : boolean;\r\n}\r\n\r\nexport interface ExportModel<T> {\r\n Columns? : ColumnDescriptor[];\r\n Filter? : T;\r\n}\r\n\r\nexport interface EntityWithSpecifics<TResult> {\r\n Entity? : TResult;\r\n Tabs? : TabToSave<TResult>[];\r\n}\r\n\r\nexport interface EntityViewModelWithFields<T> {\r\n FieldSections? : Section[];\r\n HiddenSections? : string[];\r\n SpecificSection? : any;\r\n ViewModel? : T;\r\n}\r\n\r\nexport interface EntityImage {\r\n EntityId? : number;\r\n Url? : string;\r\n}\r\n\r\nexport interface DistinctValuesResult {\r\n HasMore? : boolean;\r\n Values? : any[];\r\n}\r\n\r\nexport enum TextSearch {\r\n Contains = 0,\r\n StartsWith = 1,\r\n EndsWith = 2,\r\n}\r\n\r\nexport enum ExportType {\r\n CSV = 0,\r\n EXCEL = 1,\r\n}\r\n\r\nexport enum AggregateFunction {\r\n Count = 0,\r\n Sum = 1,\r\n Min = 2,\r\n Max = 3,\r\n Avg = 4,\r\n}\r\n\r\nexport enum ActionResultStatus {\r\n OK = 0,\r\n KO = 1,\r\n}\r\n\r\n","import { Utilities } from '@dflat-core/web/core';\r\nimport { ComponentRef, TemplateRef, Type } from '@angular/core';\r\n\r\nimport { ActionDescriptor, ColumnDescriptor, EntityViewModel, EntityViewModelWithFields, FieldDescriptor, FieldValidators, FilterDescriptor, FilterViewModel } from './model/interface.generated';\r\n\r\nexport interface IIdentifiable {\r\n Id?: number;\r\n}\r\n\r\n/**\r\n * Valeur d'un paramètre éditée par un champ de paramètre (mot de passe, texte...) : le sous-ensemble de\r\n * ParameterValueView (meta-model) dont les composants communs ont besoin, sans dépendre de meta-model\r\n * (Dépendances des modules, D.1).\r\n */\r\nexport interface ParameterFieldValue {\r\n Id?: number;\r\n Value?: any;\r\n}\r\n\r\nexport class UserUpdatedMessage {\r\n constructor(public userKey: string) { }\r\n}\r\n\r\n/**\r\n * Message du bus : un profil de présentation partagé (par défaut, par rôle ou par fournisseur) a\r\n * été modifié (signal PresentationChanged du hub, envoyé par le serveur après son enregistrement).\r\n * Le cache d'initialisation de l'entité est vidé et les grilles ouvertes rechargent leurs colonnes.\r\n */\r\nexport class PresentationChangedMessage {\r\n /**\r\n * @param entityName Nom de l'entité du profil (ex. Company), ou null : toutes les entités.\r\n * @param stamp Nouvel horodatage du cache client annoncé par le serveur.\r\n */\r\n constructor(public entityName: string | null, public stamp?: number) { }\r\n\r\n /**\r\n * Vrai si le message concerne l'écran de clé entityKey : même nom sans tenir compte de la\r\n * casse ni du suffixe View (un écran porte sur la table ou sur sa vue principale).\r\n */\r\n concerns(entityKey: string): boolean {\r\n if (this.entityName === null || this.entityName === undefined || this.entityName === '') {\r\n return true;\r\n }\r\n const normalize = (name: string) => (name ?? '').toLowerCase().replace(/view$/, '');\r\n return normalize(this.entityName) === normalize(entityKey);\r\n }\r\n}\r\n\r\n/**\r\n * Message du bus : un formulaire enregistré en base a été modifié (signal FormChanged du hub,\r\n * envoyé par le serveur après l'enregistrement d'un formulaire, d'une section ou d'un champ).\r\n * Le cache d'initialisation de l'entité est vidé et les écrans ouverts rechargent leur formulaire.\r\n */\r\nexport class FormChangedMessage {\r\n /**\r\n * @param entityName Nom de l'entité du formulaire (ex. Country), ou null : tous les formulaires.\r\n * @param stamp Nouvel horodatage du cache client annoncé par le serveur.\r\n */\r\n constructor(public entityName: string | null, public stamp?: number) { }\r\n\r\n /**\r\n * Vrai si le message concerne l'écran de clé entityKey : même nom sans tenir compte de la\r\n * casse ni du suffixe View (un écran porte sur la table ou sur sa vue principale).\r\n */\r\n concerns(entityKey: string): boolean {\r\n if (this.entityName === null || this.entityName === undefined || this.entityName === '') {\r\n return true;\r\n }\r\n const normalize = (name: string) => (name ?? '').toLowerCase().replace(/view$/, '');\r\n return normalize(this.entityName) === normalize(entityKey);\r\n }\r\n}\r\n\r\n/**\r\n * Avancement du chargement par pages d'une source volumineuse de tableau de bord (message DashboardLoadProgress du hub,\r\n * ou action sur le chargement dans ce navigateur) : les widgets qui l'attendent affichent l'avancement et relisent leurs\r\n * données quand il est terminé.\r\n */\r\nexport class DashboardLoadProgressMessage {\r\n /**\r\n * @param loadId Identifiant du chargement.\r\n * @param loadedRows Lignes déjà chargées.\r\n * @param totalRows Lignes à charger.\r\n * @param progress Avancement, en pourcentage.\r\n * @param state État : Running, Paused, Done, Cancelled ou Error.\r\n */\r\n constructor(public loadId: string, public loadedRows: number, public totalRows: number, public progress: number, public state: string) { }\r\n}\r\n\r\n/**\r\n * Étape du serveur pour les tableaux de bord (message DashboardActivity du hub) : comptage et lecture d'une source,\r\n * combinaisons des filtres, calcul d'un widget..., avec la durée des étapes terminées. Affichée par le journal du tableau.\r\n */\r\nexport class DashboardActivityMessage {\r\n /**\r\n * @param metaEntityId Source concernée, ou null.\r\n * @param message Ce que fait le serveur.\r\n * @param date Heure du serveur.\r\n */\r\n constructor(public metaEntityId: number | null, public message: string, public date: Date) { }\r\n}\r\n\r\n/**\r\n * Contenu du cache des tableaux de bord modifié côté API (message DashboardCacheChanged du hub), avec son nouvel état\r\n * (DashboardCacheInfo), ou null s'il est à relire.\r\n */\r\nexport class DashboardCacheChangedMessage {\r\n /** @param info État du cache (DashboardCacheInfo), ou null. */\r\n constructor(public info: any = null) { }\r\n}\r\n\r\n/**\r\n * Message du bus : message diffusé par le serveur (signal BroadcastMessage du hub, envoyé à un compte ou à tous).\r\n * Une application s'y abonne et filtre par nom : bus.of(BroadcastMessage).pipe(filter(m => m.is('MonEvenement'))).\r\n */\r\nexport class BroadcastMessage {\r\n /**\r\n * @param name Nom du message (événement ou titre), choisi par le serveur.\r\n * @param message Contenu : texte ou JSON.\r\n */\r\n constructor(public name: string, public message: string) { }\r\n\r\n /** Vrai si le message porte ce nom (casse comprise). */\r\n is(name: string): boolean {\r\n return this.name === name;\r\n }\r\n\r\n /** Contenu analysé en JSON, ou null s'il est vide ou n'est pas du JSON valide. */\r\n json<T = any>(): T | null {\r\n if (this.message === null || this.message === undefined || this.message === '') {\r\n return null;\r\n }\r\n try {\r\n return JSON.parse(this.message) as T;\r\n } catch {\r\n return null;\r\n }\r\n }\r\n}\r\n\r\nexport interface IUserCredential extends IIdentifiable {\r\n AccessToken: string; \r\n RefreshToken: string; \r\n Username?: string; \r\n FirstName?: string; \r\n LastName?: string;\r\n Email?: string;\r\n IsAdmin?: boolean;\r\n IsDelivery?: boolean;\r\n IsPartner?: boolean;\r\n PhoneNumber?: string;\r\n IsActive?: boolean;\r\n IsPartnerActive?: boolean;\r\n IsDeliveryActive?: boolean;\r\n\r\n Id?: number;\r\n CompanyId?: number;\r\n Permissions: string[];\r\n ProfileImageUrl: string;\r\n AvatarUrl: string;\r\n\r\n /** Le second facteur est demandé : aucun jeton, le code s'envoie avec TwoFactorChallenge (Connexion, B.5.8). */\r\n TwoFactorRequired?: boolean;\r\n /** Jeton de la connexion en attente du second facteur. */\r\n TwoFactorChallenge?: string;\r\n /** La politique impose la double authentification à ce compte, qui ne l'a pas encore. */\r\n TwoFactorSetupRequired?: boolean;\r\n /** Jeton d'appareil de confiance, à garder par le navigateur. */\r\n TrustedDeviceToken?: string;\r\n}\r\n\r\n/** Moyens de connexion proposés par l'écran de connexion (Account/GetLoginOptions, Connexion, B.5.8). */\r\nexport interface ILoginOptions {\r\n /** La connexion par un lien envoyé par e-mail est activée. */\r\n LoginLinkEnabled?: boolean;\r\n /** La demande de lien exige un captcha. */\r\n LoginLinkCaptcha?: boolean;\r\n /** Fournisseurs externes configurés. */\r\n Providers?: IExternalLoginProvider[];\r\n}\r\n/** Fournisseur d'identité externe proposé à l'écran de connexion (Account/GetLoginProviders). */\r\nexport interface IExternalLoginProvider {\r\n /** Google, Microsoft ou Apple. */\r\n Provider: string;\r\n /** Identifiant de l'application chez le fournisseur. */\r\n ClientId: string;\r\n /** Microsoft seulement : locataire du point d'accès (common par défaut). */\r\n TenantId?: string;\r\n /** Google seulement : identifiant client iOS, pour la connexion native dans l'application iPhone. */\r\n IosClientId?: string;\r\n}\r\n\r\nexport class User implements IUserCredential {\r\n \r\n public AccessToken: string;\r\n public RefreshToken: string;\r\n public Username?: string;\r\n public FirstName?: string;\r\n public LastName?: string;\r\n public Email?: string;\r\n public PhoneNumber?: string;\r\n public IsAdmin?: boolean;\r\n public IsDelivery?: boolean;\r\n public IsPartner?: boolean;\r\n public Id?: number;\r\n public CompanyId?: number;\r\n public Permissions: string[];\r\n public ProfileImageUrl: string;\r\n public IsActive?: boolean;\r\n public IsPartnerActive?: boolean;\r\n public IsDeliveryActive?: boolean;\r\n public IsConnected: boolean = false;\r\n public AvatarUrl: string;\r\n \r\n public constructor(data: IUserCredential) {\r\n this.Username = data.Username;\r\n this.FirstName = data.FirstName;\r\n this.LastName = data.LastName;\r\n this.Email = data.Email;\r\n this.PhoneNumber = data.PhoneNumber;\r\n this.ProfileImageUrl = data.ProfileImageUrl;\r\n this.IsAdmin = data.IsAdmin;\r\n this.IsPartner = data.IsPartner;\r\n this.IsDelivery = data.IsDelivery;\r\n this.IsAdmin = data.IsAdmin;\r\n this.IsPartner = data.IsPartner;\r\n this.IsDelivery = data.IsDelivery;\r\n this.IsActive = data.IsActive;\r\n this.IsPartnerActive = data.IsPartnerActive;\r\n this.IsDeliveryActive = data.IsDeliveryActive;\r\n this.Id = data.Id;\r\n this.CompanyId = data.CompanyId;\r\n this.AccessToken = data.AccessToken;\r\n this.AvatarUrl = data.AvatarUrl;\r\n }\r\n \r\n\r\n public getName() {\r\n return this.FirstName + ' ' + this.LastName;\r\n }\r\n\r\n \r\n}\r\n\r\n\r\nexport interface INotification {\r\n id:string;\r\n content: string;\r\n class: string;\r\n link: string;\r\n entityType:string;\r\n entityId?:number;\r\n}\r\n \r\nexport class Notification implements INotification {\r\n public id:string;\r\n public content: string;\r\n public class: string;\r\n public link: string;\r\n public entityType:string;\r\n public entityId?:number\r\n public constructor(data: Partial<INotification> = {}) {\r\n this.id = data.id || '';\r\n this.content = data.content || '';\r\n this.class = data.class || '';\r\n this.link = data.link || '';\r\n this.entityType = data.entityType || '';\r\n this.entityId = data.entityId;\r\n }\r\n}\r\n\r\nexport class ChannelData<T> {\r\n Channel: string;\r\n Data: T;\r\n\r\n public constructor(channel: string, data: T) {\r\n this.Channel= channel;\r\n this.Data= data;\r\n }\r\n}\r\n\r\nexport class IMessage {\r\n Channel: string;\r\n Data: any;\r\n}\r\n\r\nexport class Message implements IMessage \r\n{\r\n Channel: string;\r\n Data: any;\r\n\r\n public constructor(channel: string, data: any) {\r\n this.Channel= channel;\r\n this.Data= data;\r\n }\r\n}\r\nexport interface NumberDictionary<T> {\r\n [Key: number]: T;\r\n}\r\nexport interface Dictionary<T> {\r\n [Key: string]: T;\r\n}\r\n\r\n\r\n\r\nexport class NumberDictionnaryWrapper<T> {\r\n\r\n dictionary: NumberDictionary<T> = {};\r\n get(key: number) {\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKey(key: number) {\r\n if (typeof this.dictionary[key] === \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\nexport class DictionnaryWrapper<T> {\r\n\r\n dictionary: Dictionary<T> = {};\r\n get(key: string) {\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKey(key: string) {\r\n if (typeof this.dictionary[key] === \"undefined\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n getPartKey(key: string) {\r\n\r\n if (typeof this.dictionary[key] === \"undefined\" ) {\r\n let keyFound = Object.keys(this.dictionary).find(obj => key.includes(obj));\r\n if(keyFound) {\r\n key = keyFound\r\n }\r\n }\r\n\r\n return this.dictionary[key];\r\n }\r\n\r\n containsKeyOrPartKey(key: string) {\r\n let routeFound = Object.keys(this.dictionary).find(obj => key.includes(obj));\r\n \r\n if(!Utilities.IsNil(routeFound)){\r\n return true;\r\n }\r\n\r\n if (typeof this.dictionary[key] === \"undefined\" ) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n getValues() {\r\n return Object.keys(this.dictionary).map(key => this.dictionary[key]);\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n// export interface FilterDescriptor {\r\n// FieldValidators?: FieldValidators;\r\n// Label?: string;\r\n// FilterType?: FilterType;\r\n// PropertyName?: string;\r\n// DisplayMember?: string;\r\n// ValueMember?: string;\r\n// Data?: any;\r\n// Highlight?: boolean;\r\n// ToolTip?: string;\r\n// IsStatic?: boolean;\r\n// Required?: boolean;\r\n// NotDefaultRequired?: boolean;\r\n// ReadOnly?: boolean;\r\n// IsHidden?: boolean;\r\n// KeepPlace?: boolean;\r\n// IsConditioning?: boolean;\r\n// IsConditional?: boolean;\r\n// ConditioningField?: string;\r\n// ConditioningFieldValue?: number;\r\n// BoolConditioningFieldValue?: boolean;\r\n// OriginalData?: any;\r\n// CascadeDependency?: boolean;\r\n// CascadeDependencyProperty?: string;\r\n// FilterDistinct?: boolean;\r\n// MultipleSelection?: boolean;\r\n// HideSelected?: boolean;\r\n// ColumnSpan?: ColumnSpans;\r\n// ColumnIndex?: number;\r\n// InputType?: string;\r\n// CurrentFilters?: {};\r\n\r\n// ModalEntityKey?: string;\r\n// ModalPropertyName?: string;\r\n// ModalPropertyValue?: string;\r\n// ModalTitle?: string;\r\n// }\r\n\r\n\r\n\r\nexport interface SpecificSection {\r\n Name?: string,\r\n IconUrl?:string,\r\n Template?: Type<any> | TemplateRef<any> | ComponentRef<any> | any,\r\n Context?: {},\r\n Data?: any[],\r\n Component?: any,\r\n refreshFunction?: () => void\r\n}\r\nexport interface SectionError {\r\n Name?: string,\r\n FieldValidators?: FieldValidators;\r\n Errors?: string[]\r\n}\r\n\r\nexport interface IFilterDescriptorExtra {\r\n Field?: FilterDescriptor;\r\n DisplayedValue?: string;\r\n}\r\n\r\nexport interface TextZoneButtonEvent {\r\n Field: FieldDescriptor;\r\n Value: string;\r\n }\r\n \r\n export interface FieldEvent {\r\n Field: FieldDescriptor;\r\n Event: Event;\r\n }\r\n \r\n export interface EntityConfig {\r\n actions: ActionDescriptor[];\r\n columns: ColumnDescriptor[];\r\n emptyFilter: FilterViewModel;\r\n filterDescriptors: FilterDescriptor[];\r\n viewModel: EntityViewModelWithFields<EntityViewModel>;\r\n }\r\n\r\n // export interface CachedConfig {\r\n // timestamp: number;\r\n // config : EntityConfig;\r\n // }\r\n\r\n export interface PropertyEditorEvent {\r\n field: FieldDescriptor;\r\n value: any;\r\n type: 'value' | 'pending' | 'file' | 'selector' | 'button'| 'reset';\r\n }","export class HistoryItem {\r\n date: string;\r\n hour: string;\r\n url: string;\r\n icon1: string;\r\n menu1: string;\r\n icon2: string;\r\n menu2: string;\r\n}\r\n\r\nexport enum FilterOperator {\r\n Contains = 0,\r\n StartsWith = 1,\r\n EndsWith = 2,\r\n Equals = 3\r\n}\r\nexport interface FilterClause {\r\n PropertyName : string;\r\n FilterValue : string;\r\n Operator : FilterOperator;\r\n /** Valeurs cochées dans le menu « Filtre avancé » de la colonne (condition « dans la liste »). */\r\n FilterValues? : string[];\r\n}\r\n\r\nexport interface FilterRow {\r\n ClausesByPropertyName : Map<string, FilterClause>;\r\n}\r\n\r\nexport interface FilterQuery {\r\n Rows : FilterRow[];\r\n}\r\n\r\nexport enum CustomFieldTypes {\r\n String = 0,\r\n Integer = 1,\r\n Date = 2,\r\n ComboBox = 3,\r\n Checkbox = 4,\r\n Email = 5,\r\n WeekNumber = 6,\r\n Text = 7,\r\n Custom = 8,\r\n Number = 9,\r\n}"],"mappings":";;;;AASA,IAAa,kBAAb,MAAa,gBAAe;CAAf;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAf;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,SAAA,CAJhB,YAAY;EAAA,CAAA;CAAA;CAIX;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,SAAA,CAJhB,YAAY;EAAA,CAAA;CAAA;;AAIX,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAL3B,MAAA;EAAS,MAAA,CAAA;GACR,SAAS,CAAC,YAAY;GACtB,cAAc,CAAA;GACd,SAAS,CAAA;EACV,CAAA;;;ACsBD,IAAY;CAAZ,SAAY,gBAAc;CACtB,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,eAAA,KAA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AsB1B,IAAY;CAAZ,SAAY,kBAAgB;CACxB,iBAAA,iBAAA,YAAA,KAAA;CACA,iBAAA,iBAAA,aAAA,KAAA;CACA,iBAAA,iBAAA,UAAA,KAAA;CACA,iBAAA,iBAAA,cAAA,KAAA;CACA,iBAAA,iBAAA,cAAA,KAAA;CACA,iBAAA,iBAAA,WAAA,KAAA;CACA,iBAAA,iBAAA,gBAAA,KAAA;CACA,iBAAA,iBAAA,UAAA,KAAA;CACA,iBAAA,iBAAA,YAAA,KAAA;CACA,iBAAA,iBAAA,YAAA,KAAA;AACJ,EAAA,CAXY,qBAAA,mBAAgB,CAAA,EAAA"}
|
|
@@ -3,11 +3,11 @@ import { EnsureModuleLoadedOnceGuard, Utilities } from "@dflat-core/web/core";
|
|
|
3
3
|
import { ApiErrorTypes, BroadcastMessage, CoreModelModule, DashboardActivityMessage, DashboardCacheChangedMessage, DashboardLoadProgressMessage, DictionnaryWrapper, FormChangedMessage, Notification, PresentationChangedMessage, User, UserUpdatedMessage } from "@dflat-core/web/core-model";
|
|
4
4
|
import { CommonModule } from "@angular/common";
|
|
5
5
|
import * as i3 from "@angular/common/http";
|
|
6
|
-
import { HttpErrorResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi, withXhr } from "@angular/common/http";
|
|
6
|
+
import { HttpClient, HttpErrorResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi, withXhr } from "@angular/common/http";
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
import { EventEmitter, Inject, Injectable, InjectionToken, NgModule, Optional, SkipSelf } from "@angular/core";
|
|
8
|
+
import { EventEmitter, Inject, Injectable, InjectionToken, NgModule, Optional, Pipe, SkipSelf, computed, inject, signal } from "@angular/core";
|
|
9
9
|
import jwt_decode from "jwt-decode";
|
|
10
|
-
import { BehaviorSubject, ReplaySubject, Subject, empty, throwError, timer } from "rxjs";
|
|
10
|
+
import { BehaviorSubject, ReplaySubject, Subject, empty, firstValueFrom, throwError, timeout, timer } from "rxjs";
|
|
11
11
|
import { catchError, filter, finalize, map, shareReplay } from "rxjs/operators";
|
|
12
12
|
import * as i4 from "@angular/router";
|
|
13
13
|
import * as i1 from "@angular/platform-browser";
|
|
@@ -2252,6 +2252,360 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2252
2252
|
}]
|
|
2253
2253
|
}]
|
|
2254
2254
|
});
|
|
2255
|
-
|
|
2255
|
+
function formatMessage(message, params, culture) {
|
|
2256
|
+
if (message == null) return "";
|
|
2257
|
+
if (message.indexOf("{") < 0) return message;
|
|
2258
|
+
try {
|
|
2259
|
+
return render(message, params ?? {}, culture, null);
|
|
2260
|
+
} catch {
|
|
2261
|
+
return message;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
function render(message, params, culture, count) {
|
|
2265
|
+
let result = "";
|
|
2266
|
+
let i = 0;
|
|
2267
|
+
while (i < message.length) {
|
|
2268
|
+
const c = message[i];
|
|
2269
|
+
if (c === "#" && count !== null) {
|
|
2270
|
+
result += formatNumber(count, culture);
|
|
2271
|
+
i++;
|
|
2272
|
+
} else if (c === "{") {
|
|
2273
|
+
const end = matchingBrace(message, i);
|
|
2274
|
+
result += renderArgument(message.substring(i + 1, end), params, culture, count);
|
|
2275
|
+
i = end + 1;
|
|
2276
|
+
} else {
|
|
2277
|
+
result += c;
|
|
2278
|
+
i++;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
return result;
|
|
2282
|
+
}
|
|
2283
|
+
function renderArgument(body, params, culture, count) {
|
|
2284
|
+
const firstComma = body.indexOf(",");
|
|
2285
|
+
if (firstComma < 0) {
|
|
2286
|
+
const name = body.trim();
|
|
2287
|
+
const value = params[name];
|
|
2288
|
+
return value === void 0 || value === null ? `{${name}}` : String(value);
|
|
2289
|
+
}
|
|
2290
|
+
const name = body.substring(0, firstComma).trim();
|
|
2291
|
+
const rest = body.substring(firstComma + 1);
|
|
2292
|
+
const secondComma = rest.indexOf(",");
|
|
2293
|
+
const type = (secondComma < 0 ? rest : rest.substring(0, secondComma)).trim();
|
|
2294
|
+
const options = parseOptions(secondComma < 0 ? "" : rest.substring(secondComma + 1));
|
|
2295
|
+
const value = params[name];
|
|
2296
|
+
if (type === "plural") {
|
|
2297
|
+
const n = Number(value);
|
|
2298
|
+
return render(options.get(`=${n}`) ?? options.get(new Intl.PluralRules(culture).select(n)) ?? options.get("other") ?? "", params, culture, n);
|
|
2299
|
+
}
|
|
2300
|
+
if (type === "select") return render(options.get(String(value)) ?? options.get("other") ?? "", params, culture, count);
|
|
2301
|
+
return value === void 0 || value === null ? `{${name}}` : String(value);
|
|
2302
|
+
}
|
|
2303
|
+
function parseOptions(text) {
|
|
2304
|
+
const options = /* @__PURE__ */ new Map();
|
|
2305
|
+
let i = 0;
|
|
2306
|
+
while (i < text.length) {
|
|
2307
|
+
while (i < text.length && /\s/.test(text[i])) i++;
|
|
2308
|
+
const start = i;
|
|
2309
|
+
while (i < text.length && text[i] !== "{" && !/\s/.test(text[i])) i++;
|
|
2310
|
+
const key = text.substring(start, i);
|
|
2311
|
+
while (i < text.length && text[i] !== "{") i++;
|
|
2312
|
+
if (i >= text.length) break;
|
|
2313
|
+
const end = matchingBrace(text, i);
|
|
2314
|
+
options.set(key, text.substring(i + 1, end));
|
|
2315
|
+
i = end + 1;
|
|
2316
|
+
}
|
|
2317
|
+
return options;
|
|
2318
|
+
}
|
|
2319
|
+
function matchingBrace(text, start) {
|
|
2320
|
+
let depth = 0;
|
|
2321
|
+
for (let i = start; i < text.length; i++) if (text[i] === "{") depth++;
|
|
2322
|
+
else if (text[i] === "}") {
|
|
2323
|
+
depth--;
|
|
2324
|
+
if (depth === 0) return i;
|
|
2325
|
+
}
|
|
2326
|
+
throw new Error("Accolade non fermée");
|
|
2327
|
+
}
|
|
2328
|
+
function formatNumber(n, culture) {
|
|
2329
|
+
try {
|
|
2330
|
+
return new Intl.NumberFormat(culture).format(n);
|
|
2331
|
+
} catch {
|
|
2332
|
+
return String(n);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
var TranslationStore = class TranslationStore {
|
|
2336
|
+
constructor() {
|
|
2337
|
+
this.memory = /* @__PURE__ */ new Map();
|
|
2338
|
+
this.database = null;
|
|
2339
|
+
}
|
|
2340
|
+
static {
|
|
2341
|
+
this.DATABASE = "dflat-translations";
|
|
2342
|
+
}
|
|
2343
|
+
static {
|
|
2344
|
+
this.STORE = "dictionaries";
|
|
2345
|
+
}
|
|
2346
|
+
async get(culture) {
|
|
2347
|
+
const db = await this.open();
|
|
2348
|
+
if (!db) return this.memory.get(culture) ?? null;
|
|
2349
|
+
return new Promise((resolve) => {
|
|
2350
|
+
try {
|
|
2351
|
+
const request = db.transaction(TranslationStore.STORE, "readonly").objectStore(TranslationStore.STORE).get(culture);
|
|
2352
|
+
request.onsuccess = () => resolve(request.result ?? this.memory.get(culture) ?? null);
|
|
2353
|
+
request.onerror = () => resolve(this.memory.get(culture) ?? null);
|
|
2354
|
+
} catch {
|
|
2355
|
+
resolve(this.memory.get(culture) ?? null);
|
|
2356
|
+
}
|
|
2357
|
+
});
|
|
2358
|
+
}
|
|
2359
|
+
async set(dictionary) {
|
|
2360
|
+
this.memory.set(dictionary.culture, dictionary);
|
|
2361
|
+
const db = await this.open();
|
|
2362
|
+
if (!db) return;
|
|
2363
|
+
await new Promise((resolve) => {
|
|
2364
|
+
try {
|
|
2365
|
+
const transaction = db.transaction(TranslationStore.STORE, "readwrite");
|
|
2366
|
+
transaction.objectStore(TranslationStore.STORE).put(dictionary, dictionary.culture);
|
|
2367
|
+
transaction.oncomplete = () => resolve();
|
|
2368
|
+
transaction.onerror = () => resolve();
|
|
2369
|
+
} catch {
|
|
2370
|
+
resolve();
|
|
2371
|
+
}
|
|
2372
|
+
});
|
|
2373
|
+
}
|
|
2374
|
+
open() {
|
|
2375
|
+
if (!this.database) this.database = new Promise((resolve) => {
|
|
2376
|
+
try {
|
|
2377
|
+
if (typeof indexedDB === "undefined") {
|
|
2378
|
+
resolve(null);
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
const request = indexedDB.open(TranslationStore.DATABASE, 1);
|
|
2382
|
+
request.onupgradeneeded = () => request.result.createObjectStore(TranslationStore.STORE);
|
|
2383
|
+
request.onsuccess = () => resolve(request.result);
|
|
2384
|
+
request.onerror = () => resolve(null);
|
|
2385
|
+
request.onblocked = () => resolve(null);
|
|
2386
|
+
} catch {
|
|
2387
|
+
resolve(null);
|
|
2388
|
+
}
|
|
2389
|
+
});
|
|
2390
|
+
return this.database;
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
const DFLAT_TRANSLATION_CONFIG = new InjectionToken("DFLAT_TRANSLATION_CONFIG");
|
|
2394
|
+
var TranslationService = class TranslationService {
|
|
2395
|
+
constructor() {
|
|
2396
|
+
this.http = inject(HttpClient);
|
|
2397
|
+
this.config = inject(DFLAT_TRANSLATION_CONFIG, { optional: true }) ?? {};
|
|
2398
|
+
this.store = new TranslationStore();
|
|
2399
|
+
this.dictionary = signal(null, ...ngDevMode ? [{ debugName: "dictionary" }] : /* istanbul ignore next */ []);
|
|
2400
|
+
this.languageList = signal(null, ...ngDevMode ? [{ debugName: "languageList" }] : /* istanbul ignore next */ []);
|
|
2401
|
+
this.culture = computed(() => this.dictionary()?.culture ?? null, ...ngDevMode ? [{ debugName: "culture" }] : /* istanbul ignore next */ []);
|
|
2402
|
+
this.version = computed(() => this.dictionary()?.version ?? null, ...ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []);
|
|
2403
|
+
this.languages = computed(() => this.languageList()?.languages ?? [], ...ngDevMode ? [{ debugName: "languages" }] : /* istanbul ignore next */ []);
|
|
2404
|
+
}
|
|
2405
|
+
static {
|
|
2406
|
+
this.currentCulture = null;
|
|
2407
|
+
}
|
|
2408
|
+
static {
|
|
2409
|
+
this.CHOSEN_CULTURE_KEY = "dflat_culture";
|
|
2410
|
+
}
|
|
2411
|
+
get apiUrl() {
|
|
2412
|
+
return `${ServerUrl.apiUrl}/translations`;
|
|
2413
|
+
}
|
|
2414
|
+
async init() {
|
|
2415
|
+
const requested = this.chosenCulture() ?? this.browserCulture();
|
|
2416
|
+
const local = requested ? await this.store.get(requested) : null;
|
|
2417
|
+
if (local) {
|
|
2418
|
+
this.apply(local);
|
|
2419
|
+
this.refresh(requested);
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
await this.load(requested, this.config.startupTimeoutMs ?? 5e3);
|
|
2423
|
+
}
|
|
2424
|
+
async use(culture) {
|
|
2425
|
+
this.saveChosenCulture(culture);
|
|
2426
|
+
const local = await this.store.get(culture);
|
|
2427
|
+
if (local) {
|
|
2428
|
+
this.apply(local);
|
|
2429
|
+
this.refresh(culture);
|
|
2430
|
+
return;
|
|
2431
|
+
}
|
|
2432
|
+
await this.load(culture, null);
|
|
2433
|
+
}
|
|
2434
|
+
async loadLanguages() {
|
|
2435
|
+
if (!this.languageList()) try {
|
|
2436
|
+
this.languageList.set(await firstValueFrom(this.http.get(`${this.apiUrl}/languages`)));
|
|
2437
|
+
} catch {
|
|
2438
|
+
return null;
|
|
2439
|
+
}
|
|
2440
|
+
return this.languageList();
|
|
2441
|
+
}
|
|
2442
|
+
translate(key, params) {
|
|
2443
|
+
const dictionary = this.dictionary();
|
|
2444
|
+
const message = dictionary?.entries?.[key];
|
|
2445
|
+
if (message === void 0) return key;
|
|
2446
|
+
return formatMessage(message, params, dictionary.culture);
|
|
2447
|
+
}
|
|
2448
|
+
has(key) {
|
|
2449
|
+
return this.dictionary()?.entries?.[key] !== void 0;
|
|
2450
|
+
}
|
|
2451
|
+
async refresh(culture) {
|
|
2452
|
+
try {
|
|
2453
|
+
const current = await firstValueFrom(this.http.get(`${this.apiUrl}/${encodeURIComponent(culture ?? "")}/version`));
|
|
2454
|
+
const shown = this.dictionary();
|
|
2455
|
+
if (shown && shown.culture === current.culture && shown.version === current.version) return;
|
|
2456
|
+
await this.download(current.culture, current.version);
|
|
2457
|
+
} catch {}
|
|
2458
|
+
}
|
|
2459
|
+
async load(culture, timeoutMs) {
|
|
2460
|
+
try {
|
|
2461
|
+
const version = this.http.get(`${this.apiUrl}/${encodeURIComponent(culture ?? "")}/version`);
|
|
2462
|
+
const current = await firstValueFrom(timeoutMs ? version.pipe(timeout(timeoutMs)) : version);
|
|
2463
|
+
await this.download(current.culture, current.version);
|
|
2464
|
+
} catch {
|
|
2465
|
+
const bundled = await this.loadBundle(culture ?? this.config.defaultCulture ?? "fr-FR") ?? await this.loadBundle(this.config.defaultCulture ?? "fr-FR");
|
|
2466
|
+
if (bundled) this.apply(bundled);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
async download(culture, version) {
|
|
2470
|
+
const dictionary = await firstValueFrom(this.http.get(`${this.apiUrl}/${encodeURIComponent(culture)}?v=${encodeURIComponent(version)}`));
|
|
2471
|
+
await this.store.set(dictionary);
|
|
2472
|
+
this.apply(dictionary);
|
|
2473
|
+
}
|
|
2474
|
+
async loadBundle(culture) {
|
|
2475
|
+
if (!this.config.bundlePath) return null;
|
|
2476
|
+
try {
|
|
2477
|
+
return await firstValueFrom(this.http.get(this.config.bundlePath.replace("{culture}", culture)));
|
|
2478
|
+
} catch {
|
|
2479
|
+
return null;
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
apply(dictionary) {
|
|
2483
|
+
this.dictionary.set(dictionary);
|
|
2484
|
+
TranslationService.currentCulture = dictionary.culture;
|
|
2485
|
+
if (typeof document !== "undefined" && document.documentElement) document.documentElement.lang = dictionary.culture;
|
|
2486
|
+
}
|
|
2487
|
+
chosenCulture() {
|
|
2488
|
+
try {
|
|
2489
|
+
return localStorage.getItem(TranslationService.CHOSEN_CULTURE_KEY);
|
|
2490
|
+
} catch {
|
|
2491
|
+
return null;
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
saveChosenCulture(culture) {
|
|
2495
|
+
try {
|
|
2496
|
+
localStorage.setItem(TranslationService.CHOSEN_CULTURE_KEY, culture);
|
|
2497
|
+
} catch {}
|
|
2498
|
+
}
|
|
2499
|
+
browserCulture() {
|
|
2500
|
+
if (typeof navigator === "undefined") return null;
|
|
2501
|
+
return navigator.languages?.[0] ?? navigator.language ?? null;
|
|
2502
|
+
}
|
|
2503
|
+
static {
|
|
2504
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2505
|
+
minVersion: "12.0.0",
|
|
2506
|
+
version: "22.2.1",
|
|
2507
|
+
ngImport: i0,
|
|
2508
|
+
type: TranslationService,
|
|
2509
|
+
deps: [],
|
|
2510
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2511
|
+
});
|
|
2512
|
+
}
|
|
2513
|
+
static {
|
|
2514
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2515
|
+
minVersion: "12.0.0",
|
|
2516
|
+
version: "22.2.1",
|
|
2517
|
+
ngImport: i0,
|
|
2518
|
+
type: TranslationService,
|
|
2519
|
+
providedIn: "root"
|
|
2520
|
+
});
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2524
|
+
minVersion: "12.0.0",
|
|
2525
|
+
version: "22.2.1",
|
|
2526
|
+
ngImport: i0,
|
|
2527
|
+
type: TranslationService,
|
|
2528
|
+
decorators: [{
|
|
2529
|
+
type: Injectable,
|
|
2530
|
+
args: [{ providedIn: "root" }]
|
|
2531
|
+
}]
|
|
2532
|
+
});
|
|
2533
|
+
var TranslatePipe = class TranslatePipe {
|
|
2534
|
+
constructor() {
|
|
2535
|
+
this.translation = inject(TranslationService);
|
|
2536
|
+
}
|
|
2537
|
+
transform(key, params) {
|
|
2538
|
+
if (!key) return "";
|
|
2539
|
+
return this.translation.translate(key, params);
|
|
2540
|
+
}
|
|
2541
|
+
static {
|
|
2542
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2543
|
+
minVersion: "12.0.0",
|
|
2544
|
+
version: "22.2.1",
|
|
2545
|
+
ngImport: i0,
|
|
2546
|
+
type: TranslatePipe,
|
|
2547
|
+
deps: [],
|
|
2548
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
2549
|
+
});
|
|
2550
|
+
}
|
|
2551
|
+
static {
|
|
2552
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
2553
|
+
minVersion: "14.0.0",
|
|
2554
|
+
version: "22.2.1",
|
|
2555
|
+
ngImport: i0,
|
|
2556
|
+
type: TranslatePipe,
|
|
2557
|
+
isStandalone: true,
|
|
2558
|
+
name: "t",
|
|
2559
|
+
pure: false
|
|
2560
|
+
});
|
|
2561
|
+
}
|
|
2562
|
+
};
|
|
2563
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2564
|
+
minVersion: "12.0.0",
|
|
2565
|
+
version: "22.2.1",
|
|
2566
|
+
ngImport: i0,
|
|
2567
|
+
type: TranslatePipe,
|
|
2568
|
+
decorators: [{
|
|
2569
|
+
type: Pipe,
|
|
2570
|
+
args: [{
|
|
2571
|
+
name: "t",
|
|
2572
|
+
standalone: true,
|
|
2573
|
+
pure: false
|
|
2574
|
+
}]
|
|
2575
|
+
}]
|
|
2576
|
+
});
|
|
2577
|
+
var AcceptLanguageInterceptor = class AcceptLanguageInterceptor {
|
|
2578
|
+
intercept(req, next) {
|
|
2579
|
+
const culture = TranslationService.currentCulture;
|
|
2580
|
+
if (culture && req.url.startsWith(ServerUrl.apiUrl) && !req.headers.has("Accept-Language")) req = req.clone({ setHeaders: { "Accept-Language": culture } });
|
|
2581
|
+
return next.handle(req);
|
|
2582
|
+
}
|
|
2583
|
+
static {
|
|
2584
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
2585
|
+
minVersion: "12.0.0",
|
|
2586
|
+
version: "22.2.1",
|
|
2587
|
+
ngImport: i0,
|
|
2588
|
+
type: AcceptLanguageInterceptor,
|
|
2589
|
+
deps: [],
|
|
2590
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
static {
|
|
2594
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2595
|
+
minVersion: "12.0.0",
|
|
2596
|
+
version: "22.2.1",
|
|
2597
|
+
ngImport: i0,
|
|
2598
|
+
type: AcceptLanguageInterceptor
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2603
|
+
minVersion: "12.0.0",
|
|
2604
|
+
version: "22.2.1",
|
|
2605
|
+
ngImport: i0,
|
|
2606
|
+
type: AcceptLanguageInterceptor,
|
|
2607
|
+
decorators: [{ type: Injectable }]
|
|
2608
|
+
});
|
|
2609
|
+
export { AcceptLanguageInterceptor, AppConfiguration, AppKeys, ApplicationMenuService, AuthGuard, AuthInterceptor, AuthService, AuthTokenType, BreadcrumbService, BusMessageService, CanActivateGuard, CoreServicesModule, DFLAT_TRANSLATION_CONFIG, ExternalLoginService, FilterService, GeolocationService, HeadersService, HubService, InitCacheService, LocalStoreManager, MODULE_MENU_SERVICES, MenuItem, MenuService, MessagesService, NotificationMqService, NotificationsService, PermissionService, ScreenService, ServerUrl, TranslatePipe, TranslationService, TranslationStore, UserService, formatMessage, trimChar };
|
|
2256
2610
|
|
|
2257
2611
|
//# sourceMappingURL=dflat-core-web-core-services.mjs.map
|