@tilde-nlp/ngx-common 4.0.18 → 4.0.20
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/esm2022/lib/helpers/index.mjs +1 -2
- package/esm2022/lib/notification-message/notification-message.component.mjs +2 -2
- package/esm2022/lib/pipes/language-translate/language-translate.pipe.mjs +32 -5
- package/esm2022/lib/services/index.mjs +2 -1
- package/esm2022/lib/services/language-translate/index.mjs +2 -0
- package/esm2022/lib/services/language-translate/language-translate.service.mjs +25 -0
- package/fesm2022/tilde-nlp-ngx-common.mjs +380 -366
- package/fesm2022/tilde-nlp-ngx-common.mjs.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/pipes/language-translate/language-translate.pipe.d.ts +5 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/language-translate/index.d.ts +1 -0
- package/lib/services/language-translate/language-translate.service.d.ts +10 -0
- package/package.json +1 -1
- package/esm2022/lib/helpers/language-locale.helper.mjs +0 -35
- package/lib/helpers/language-locale.helper.d.ts +0 -8
|
@@ -7,5 +7,4 @@ export * from "./conversion.helper";
|
|
|
7
7
|
export * from "./sort.helper";
|
|
8
8
|
export * from "./html.helper";
|
|
9
9
|
export * from "./resolution.helper";
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY29tbW9uL3NyYy9saWIvaGVscGVycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMseUJBQXlCLENBQUM7QUFDeEM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BQUM1QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLGVBQWUsQ0FBQztBQUM5QixjQUFjLHFCQUFxQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vbWlzc2luZy10cmFuc2xhdGlvbi5oZWxwZXJcIjtcclxuZXhwb3J0ICogZnJvbSBcIi4vc2F2ZS1maWxlLmhlbHBlclwiO1xyXG5leHBvcnQgKiBmcm9tIFwiLi9odG1sLWVsZW1lbnQtcGFyc2UuaGVscGVyXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL2F1dGgtaGVhZGVycy5oZWxwZXJcIjtcclxuZXhwb3J0ICogZnJvbSBcIi4vZmlsZS1leHRlbnNpb24uaGVscGVyXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL2NvbnZlcnNpb24uaGVscGVyXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL3NvcnQuaGVscGVyXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL2h0bWwuaGVscGVyXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL3Jlc29sdXRpb24uaGVscGVyXCI7XHJcbiJdfQ==
|
|
@@ -33,11 +33,11 @@ export class NotificationMessageComponent {
|
|
|
33
33
|
this.linkClicked.next(null);
|
|
34
34
|
}
|
|
35
35
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotificationMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NotificationMessageComponent, selector: "lib-tld-notification-message", inputs: { message: "message", inline: "inline" }, outputs: { buttonClicked: "buttonClicked", closeClicked: "closeClicked", linkClicked: "linkClicked" }, ngImport: i0, template: "<div class=\"notification-message {{className}}\">\r\n <div class=\"notification-message-container tld-default-border\" [ngClass.lt-md]=\"'mobile'\" [class.inline]=\"inline\"\r\n fxLayout=\"row\" fxLayoutAlign=\"start start\" [attr.id]=\"message.id\" aria-live=\"polite\" fxLayout=\"row\">\r\n <span class=\"material-icons-outlined message-icon\">\r\n {{iconNames[message.type]}}\r\n </span>\r\n <div class=\"items-container\" fxFlex>\r\n <div fxLayout=\"row\">\r\n <div class=\"text-container\" fxFlex>\r\n <h1 *ngIf=\"message.title\" class=\"message-title\"\r\n [innerHtml]=\"message.title | translate: message.localizationParams\"></h1>\r\n <p *ngIf=\"message.body\" class=\"message-body\">\r\n <span [innerHtml]=\"message.body | translate: message.localizationParams\"></span>\r\n <span *ngIf=\"message.support\" [innerHtml]=\"message.support | translate: message.localizationParams\"></span>\r\n </p>\r\n </div>\r\n <tld-close-button *ngIf=\"!message.hideClose\" class=\"close-button\" (tldClick)=\"closeClick()\">\r\n </tld-close-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"16px\" fxLayoutAlign=\"start center\"\r\n *ngIf=\"message.buttonText || message.linkHref || message.routerLink\">\r\n <button class=\"message-action-button\" color=\"accent\" mat-flat-button *ngIf=\"message.buttonText\"\r\n (click)=\"buttonClick()\">{{message.buttonText | translate}} </button>\r\n <a class=\"message-action-link\" *ngIf=\"message.linkHref && message.linkText\" (click)=\"linkClick()\"\r\n [attr.href]=\"message.linkHref\">{{message.linkText |\r\n translate}}</a>\r\n <a class=\"message-action-link\" *ngIf=\"message.routerLink && message.linkText\" (click)=\"linkClick()\"\r\n [routerLink]=\"[message.routerLink]\">{{message.linkText |\r\n translate}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:inline-block;width:100%}.close-button{position:absolute;top:.2em;right:1em}.mobile .close-button{top:0;right:0}.text-container{margin-right:45px}.notification-message{position:relative}.notification-message.basic .notification-message-container{background-color:var(--base-100)}.notification-message.basic .notification-message-container .close-button,.notification-message.basic .notification-message-container .message-icon{color:var(--base-40)}.notification-message.basic .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.info .notification-message-container{background-color:var(--info-light)}.notification-message.info .notification-message-container .text-container{color:var(--info-dark)}.notification-message.info .notification-message-container .message-icon{color:var(--info-primary)}.notification-message.info .notification-message-container .close-button{color:var(--info-dark)}.notification-message.info .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.error .notification-message-container{background-color:var(--error-light)}.notification-message.error .notification-message-container .close-button,.notification-message.error .notification-message-container .text-container,.notification-message.error .notification-message-container .message-icon{color:var(--error-dark)}.notification-message.error .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.warning .notification-message-container{background-color:var(--warning-light)}.notification-message.warning .notification-message-container .close-button,.notification-message.warning .notification-message-container .text-container,.notification-message.warning .notification-message-container .message-icon{color:var(--warning-dark)}.notification-message.warning .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.success .notification-message-container{background-color:var(--success-light)}.notification-message.success .notification-message-container .close-button,.notification-message.success .notification-message-container .text-container,.notification-message.success .notification-message-container .message-icon{color:var(--success-dark)}.notification-message.success .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message .notification-message-container{border-radius:4px}.notification-message .notification-message-container.mobile{padding:.6em .4em!important;border-radius:0}.notification-message .notification-message-container.mobile .items-container{margin-left:.4em!important}.notification-message .notification-message-container.mobile .items-container div+div{margin-top:.2em!important}.notification-message .notification-message-container.mobile .items-container .message-title+.message-body{margin-top:0!important}.notification-message .notification-message-container .text-container:first-child{line-height:1.5em}.notification-message .notification-message-container .text-container .message-title{font-weight:600;margin:0}.notification-message .notification-message-container .text-container .message-body{margin:0}.notification-message .notification-message-container:not(.inline){padding:1.5em}.notification-message .notification-message-container:not(.inline) .items-container{margin-left:1em}.notification-message .notification-message-container:not(.inline) .items-container div+div,.notification-message .notification-message-container:not(.inline) .items-container .message-title+.message-body{margin-top:1em}.notification-message .notification-message-container:not(.inline) .message-title{font-size:1.25em}.notification-message .notification-message-container:not(.inline) .message-body{line-height:1.5em}.notification-message .notification-message-container.inline{padding:.75em 1em}.notification-message .notification-message-container.inline .items-container{margin-left:.75em}.notification-message .notification-message-container.inline .items-container div+div{margin-top:.5em}.notification-message .notification-message-container.inline .items-container .message-title+.message-body{margin-top:.2em}.notification-message .notification-message-container.inline .message-title{font-size:1em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i4.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NotificationMessageComponent, selector: "lib-tld-notification-message", inputs: { message: "message", inline: "inline" }, outputs: { buttonClicked: "buttonClicked", closeClicked: "closeClicked", linkClicked: "linkClicked" }, ngImport: i0, template: "<div class=\"notification-message {{className}}\">\r\n <div class=\"notification-message-container tld-default-border\" [ngClass.lt-md]=\"'mobile'\" [class.inline]=\"inline\"\r\n fxLayout=\"row\" fxLayoutAlign=\"start start\" [attr.id]=\"message.id\" aria-live=\"polite\" fxLayout=\"row\">\r\n <span class=\"material-icons-outlined message-icon\">\r\n {{iconNames[message.type]}}\r\n </span>\r\n <div class=\"items-container\" fxFlex>\r\n <div fxLayout=\"row\">\r\n <div class=\"text-container\" fxFlex>\r\n <h1 *ngIf=\"message.title\" class=\"message-title\"\r\n [innerHtml]=\"message.title | translate: message.localizationParams\"></h1>\r\n <p *ngIf=\"message.body\" class=\"message-body\">\r\n <span [innerHtml]=\"message.body | translate: message.localizationParams\"></span>\r\n <span *ngIf=\"message.support\" [innerHtml]=\"message.support | translate: message.localizationParams\"></span>\r\n </p>\r\n </div>\r\n <tld-close-button *ngIf=\"!message.hideClose\" class=\"close-button\" (tldClick)=\"closeClick()\">\r\n </tld-close-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"16px\" fxLayoutAlign=\"start center\"\r\n *ngIf=\"message.buttonText || message.linkHref || message.routerLink\">\r\n <button class=\"message-action-button\" color=\"accent\" mat-flat-button *ngIf=\"message.buttonText\"\r\n (click)=\"buttonClick()\">{{message.buttonText | translate}} </button>\r\n <a class=\"message-action-link\" *ngIf=\"message.linkHref && message.linkText\" (click)=\"linkClick()\"\r\n [attr.href]=\"message.linkHref\">{{message.linkText |\r\n translate}}</a>\r\n <a class=\"message-action-link\" *ngIf=\"message.routerLink && message.linkText\" (click)=\"linkClick()\"\r\n [routerLink]=\"[message.routerLink]\">{{message.linkText |\r\n translate}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:inline-block;width:100%}.close-button{position:absolute;top:.2em;right:.2em}.mobile .close-button{top:0;right:0}.text-container{margin-right:45px}.notification-message{position:relative}.notification-message.basic .notification-message-container{background-color:var(--base-100)}.notification-message.basic .notification-message-container .close-button,.notification-message.basic .notification-message-container .message-icon{color:var(--base-40)}.notification-message.basic .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.info .notification-message-container{background-color:var(--info-light)}.notification-message.info .notification-message-container .text-container{color:var(--info-dark)}.notification-message.info .notification-message-container .message-icon{color:var(--info-primary)}.notification-message.info .notification-message-container .close-button{color:var(--info-dark)}.notification-message.info .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.error .notification-message-container{background-color:var(--error-light)}.notification-message.error .notification-message-container .close-button,.notification-message.error .notification-message-container .text-container,.notification-message.error .notification-message-container .message-icon{color:var(--error-dark)}.notification-message.error .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.warning .notification-message-container{background-color:var(--warning-light)}.notification-message.warning .notification-message-container .close-button,.notification-message.warning .notification-message-container .text-container,.notification-message.warning .notification-message-container .message-icon{color:var(--warning-dark)}.notification-message.warning .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.success .notification-message-container{background-color:var(--success-light)}.notification-message.success .notification-message-container .close-button,.notification-message.success .notification-message-container .text-container,.notification-message.success .notification-message-container .message-icon{color:var(--success-dark)}.notification-message.success .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message .notification-message-container{border-radius:4px}.notification-message .notification-message-container.mobile{padding:.6em .4em!important;border-radius:0}.notification-message .notification-message-container.mobile .items-container{margin-left:.4em!important}.notification-message .notification-message-container.mobile .items-container div+div{margin-top:.2em!important}.notification-message .notification-message-container.mobile .items-container .message-title+.message-body{margin-top:0!important}.notification-message .notification-message-container .text-container:first-child{line-height:1.5em}.notification-message .notification-message-container .text-container .message-title{font-weight:600;margin:0}.notification-message .notification-message-container .text-container .message-body{margin:0}.notification-message .notification-message-container:not(.inline){padding:1.5em}.notification-message .notification-message-container:not(.inline) .items-container{margin-left:1em}.notification-message .notification-message-container:not(.inline) .items-container div+div,.notification-message .notification-message-container:not(.inline) .items-container .message-title+.message-body{margin-top:1em}.notification-message .notification-message-container:not(.inline) .message-title{font-size:1.25em}.notification-message .notification-message-container:not(.inline) .message-body{line-height:1.5em}.notification-message .notification-message-container.inline{padding:.75em 1em}.notification-message .notification-message-container.inline .items-container{margin-left:.75em}.notification-message .notification-message-container.inline .items-container div+div{margin-top:.5em}.notification-message .notification-message-container.inline .items-container .message-title+.message-body{margin-top:.2em}.notification-message .notification-message-container.inline .message-title{font-size:1em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i4.CloseButtonComponent, selector: "tld-close-button", inputs: ["ariaCode", "disabled", "tooltip"], outputs: ["tldClick"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i6.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); }
|
|
37
37
|
}
|
|
38
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotificationMessageComponent, decorators: [{
|
|
39
39
|
type: Component,
|
|
40
|
-
args: [{ selector: 'lib-tld-notification-message', template: "<div class=\"notification-message {{className}}\">\r\n <div class=\"notification-message-container tld-default-border\" [ngClass.lt-md]=\"'mobile'\" [class.inline]=\"inline\"\r\n fxLayout=\"row\" fxLayoutAlign=\"start start\" [attr.id]=\"message.id\" aria-live=\"polite\" fxLayout=\"row\">\r\n <span class=\"material-icons-outlined message-icon\">\r\n {{iconNames[message.type]}}\r\n </span>\r\n <div class=\"items-container\" fxFlex>\r\n <div fxLayout=\"row\">\r\n <div class=\"text-container\" fxFlex>\r\n <h1 *ngIf=\"message.title\" class=\"message-title\"\r\n [innerHtml]=\"message.title | translate: message.localizationParams\"></h1>\r\n <p *ngIf=\"message.body\" class=\"message-body\">\r\n <span [innerHtml]=\"message.body | translate: message.localizationParams\"></span>\r\n <span *ngIf=\"message.support\" [innerHtml]=\"message.support | translate: message.localizationParams\"></span>\r\n </p>\r\n </div>\r\n <tld-close-button *ngIf=\"!message.hideClose\" class=\"close-button\" (tldClick)=\"closeClick()\">\r\n </tld-close-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"16px\" fxLayoutAlign=\"start center\"\r\n *ngIf=\"message.buttonText || message.linkHref || message.routerLink\">\r\n <button class=\"message-action-button\" color=\"accent\" mat-flat-button *ngIf=\"message.buttonText\"\r\n (click)=\"buttonClick()\">{{message.buttonText | translate}} </button>\r\n <a class=\"message-action-link\" *ngIf=\"message.linkHref && message.linkText\" (click)=\"linkClick()\"\r\n [attr.href]=\"message.linkHref\">{{message.linkText |\r\n translate}}</a>\r\n <a class=\"message-action-link\" *ngIf=\"message.routerLink && message.linkText\" (click)=\"linkClick()\"\r\n [routerLink]=\"[message.routerLink]\">{{message.linkText |\r\n translate}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:inline-block;width:100%}.close-button{position:absolute;top:.2em;right
|
|
40
|
+
args: [{ selector: 'lib-tld-notification-message', template: "<div class=\"notification-message {{className}}\">\r\n <div class=\"notification-message-container tld-default-border\" [ngClass.lt-md]=\"'mobile'\" [class.inline]=\"inline\"\r\n fxLayout=\"row\" fxLayoutAlign=\"start start\" [attr.id]=\"message.id\" aria-live=\"polite\" fxLayout=\"row\">\r\n <span class=\"material-icons-outlined message-icon\">\r\n {{iconNames[message.type]}}\r\n </span>\r\n <div class=\"items-container\" fxFlex>\r\n <div fxLayout=\"row\">\r\n <div class=\"text-container\" fxFlex>\r\n <h1 *ngIf=\"message.title\" class=\"message-title\"\r\n [innerHtml]=\"message.title | translate: message.localizationParams\"></h1>\r\n <p *ngIf=\"message.body\" class=\"message-body\">\r\n <span [innerHtml]=\"message.body | translate: message.localizationParams\"></span>\r\n <span *ngIf=\"message.support\" [innerHtml]=\"message.support | translate: message.localizationParams\"></span>\r\n </p>\r\n </div>\r\n <tld-close-button *ngIf=\"!message.hideClose\" class=\"close-button\" (tldClick)=\"closeClick()\">\r\n </tld-close-button>\r\n </div>\r\n <div fxLayout=\"row\" fxLayoutGap=\"16px\" fxLayoutAlign=\"start center\"\r\n *ngIf=\"message.buttonText || message.linkHref || message.routerLink\">\r\n <button class=\"message-action-button\" color=\"accent\" mat-flat-button *ngIf=\"message.buttonText\"\r\n (click)=\"buttonClick()\">{{message.buttonText | translate}} </button>\r\n <a class=\"message-action-link\" *ngIf=\"message.linkHref && message.linkText\" (click)=\"linkClick()\"\r\n [attr.href]=\"message.linkHref\">{{message.linkText |\r\n translate}}</a>\r\n <a class=\"message-action-link\" *ngIf=\"message.routerLink && message.linkText\" (click)=\"linkClick()\"\r\n [routerLink]=\"[message.routerLink]\">{{message.linkText |\r\n translate}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:inline-block;width:100%}.close-button{position:absolute;top:.2em;right:.2em}.mobile .close-button{top:0;right:0}.text-container{margin-right:45px}.notification-message{position:relative}.notification-message.basic .notification-message-container{background-color:var(--base-100)}.notification-message.basic .notification-message-container .close-button,.notification-message.basic .notification-message-container .message-icon{color:var(--base-40)}.notification-message.basic .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.info .notification-message-container{background-color:var(--info-light)}.notification-message.info .notification-message-container .text-container{color:var(--info-dark)}.notification-message.info .notification-message-container .message-icon{color:var(--info-primary)}.notification-message.info .notification-message-container .close-button{color:var(--info-dark)}.notification-message.info .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.error .notification-message-container{background-color:var(--error-light)}.notification-message.error .notification-message-container .close-button,.notification-message.error .notification-message-container .text-container,.notification-message.error .notification-message-container .message-icon{color:var(--error-dark)}.notification-message.error .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.warning .notification-message-container{background-color:var(--warning-light)}.notification-message.warning .notification-message-container .close-button,.notification-message.warning .notification-message-container .text-container,.notification-message.warning .notification-message-container .message-icon{color:var(--warning-dark)}.notification-message.warning .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message.success .notification-message-container{background-color:var(--success-light)}.notification-message.success .notification-message-container .close-button,.notification-message.success .notification-message-container .text-container,.notification-message.success .notification-message-container .message-icon{color:var(--success-dark)}.notification-message.success .notification-message-container .message-action-button{background-color:var(--base-40)}.notification-message .notification-message-container{border-radius:4px}.notification-message .notification-message-container.mobile{padding:.6em .4em!important;border-radius:0}.notification-message .notification-message-container.mobile .items-container{margin-left:.4em!important}.notification-message .notification-message-container.mobile .items-container div+div{margin-top:.2em!important}.notification-message .notification-message-container.mobile .items-container .message-title+.message-body{margin-top:0!important}.notification-message .notification-message-container .text-container:first-child{line-height:1.5em}.notification-message .notification-message-container .text-container .message-title{font-weight:600;margin:0}.notification-message .notification-message-container .text-container .message-body{margin:0}.notification-message .notification-message-container:not(.inline){padding:1.5em}.notification-message .notification-message-container:not(.inline) .items-container{margin-left:1em}.notification-message .notification-message-container:not(.inline) .items-container div+div,.notification-message .notification-message-container:not(.inline) .items-container .message-title+.message-body{margin-top:1em}.notification-message .notification-message-container:not(.inline) .message-title{font-size:1.25em}.notification-message .notification-message-container:not(.inline) .message-body{line-height:1.5em}.notification-message .notification-message-container.inline{padding:.75em 1em}.notification-message .notification-message-container.inline .items-container{margin-left:.75em}.notification-message .notification-message-container.inline .items-container div+div{margin-top:.5em}.notification-message .notification-message-container.inline .items-container .message-title+.message-body{margin-top:.2em}.notification-message .notification-message-container.inline .message-title{font-size:1em}\n"] }]
|
|
41
41
|
}], propDecorators: { message: [{
|
|
42
42
|
type: Input
|
|
43
43
|
}], buttonClicked: [{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Pipe } from '@angular/core';
|
|
2
|
-
import { LanguageLocaleHelper } from '../../helpers';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
import * as i1 from "@ngx-translate/core";
|
|
5
4
|
/**
|
|
@@ -11,12 +10,40 @@ export class LanguageTranslatePipe {
|
|
|
11
10
|
this.translate = translate;
|
|
12
11
|
this.languagesLocalizationKey = 'LANGUAGES';
|
|
13
12
|
}
|
|
14
|
-
transform(
|
|
13
|
+
transform(fullLangCode, hideRegion = false) {
|
|
14
|
+
if (!fullLangCode) {
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
17
|
+
const langCodeWithoutRegion = fullLangCode.split('-')[0];
|
|
18
|
+
const isCodeAndRegionSame = this.isLanguageCodeSameAsRegion(fullLangCode);
|
|
19
|
+
const langCodeForTranslation = isCodeAndRegionSame ? langCodeWithoutRegion : fullLangCode;
|
|
20
|
+
return this.getTranslation(langCodeForTranslation, hideRegion);
|
|
21
|
+
}
|
|
22
|
+
isLanguageCodeSameAsRegion(fullLangCode) {
|
|
23
|
+
const [code, region, extra] = fullLangCode.split('-');
|
|
24
|
+
return code === region?.toLowerCase() && !extra;
|
|
25
|
+
}
|
|
26
|
+
getTranslation(langCode, hideRegion) {
|
|
15
27
|
const languageTranslations = this.translate.instant(this.languagesLocalizationKey);
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
let translation =
|
|
29
|
+
/**
|
|
30
|
+
e.g. In case we need to display "en-GB" language code as "British" we can do this
|
|
31
|
+
by adding "EN_GB": "British" in localization files under "LANGUAGES" key.
|
|
32
|
+
*/
|
|
33
|
+
languageTranslations[langCode.toUpperCase().replace('-', '_')] ??
|
|
34
|
+
this.getLanguageTranslationFromLanguageCode(this.translate.currentLang, langCode);
|
|
35
|
+
if (hideRegion) {
|
|
36
|
+
translation = translation.split('(')[0].trim();
|
|
37
|
+
}
|
|
18
38
|
return translation;
|
|
19
39
|
}
|
|
40
|
+
getLanguageTranslationFromLanguageCode(currentLang, code) {
|
|
41
|
+
const languageNamesInCurrentLang = new Intl.DisplayNames([currentLang], { type: 'language' });
|
|
42
|
+
return this.capitalizeFirstLetter(languageNamesInCurrentLang.of(code));
|
|
43
|
+
}
|
|
44
|
+
capitalizeFirstLetter(text) {
|
|
45
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
46
|
+
}
|
|
20
47
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageTranslatePipe, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
21
48
|
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LanguageTranslatePipe, name: "languageTranslate", pure: false }); }
|
|
22
49
|
}
|
|
@@ -27,4 +54,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
27
54
|
pure: false,
|
|
28
55
|
}]
|
|
29
56
|
}], ctorParameters: function () { return [{ type: i1.TranslateService }]; } });
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
57
|
+
//# sourceMapp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mddLCB7IHR5cGU6ICdsYW5ndWFnZScgfSk7XHJcbiAgICByZXR1cm4gdGhpcy5jYXBpdGFsaXplRmlyc3RMZXR0ZXIobGFuZ3VhZ2VOYW1lc0luQ3VycmVudExhbmcub2YoY29kZSkgYXMgc3RyaW5nKTtcclxuICB9XHJcblxyXG4gIHByaXZhdGUgY2FwaXRhbGl6ZUZpcnN0TGV0dGVyKHRleHQ6IHN0cmluZyk6IHN0cmluZyB7XHJcbiAgICByZXR1cm4gdGV4dC5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHRleHQuc2xpY2UoMSk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -2,4 +2,5 @@ export * from "./icon";
|
|
|
2
2
|
export * from "./dom";
|
|
3
3
|
export * from './alert';
|
|
4
4
|
export * from './system';
|
|
5
|
-
|
|
5
|
+
export * from './language-translate';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY29tbW9uL3NyYy9saWIvc2VydmljZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxRQUFRLENBQUM7QUFDdkIsY0FBYyxPQUFPLENBQUM7QUFDdEIsY0FBYyxTQUFTLENBQUM7QUFDeEIsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxzQkFBc0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL2ljb25cIjtcclxuZXhwb3J0ICogZnJvbSBcIi4vZG9tXCI7XHJcbmV4cG9ydCAqIGZyb20gJy4vYWxlcnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL3N5c3RlbSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGFuZ3VhZ2UtdHJhbnNsYXRlJzsiXX0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from './language-translate.service';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY29tbW9uL3NyYy9saWIvc2VydmljZXMvbGFuZ3VhZ2UtdHJhbnNsYXRlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsOEJBQThCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xhbmd1YWdlLXRyYW5zbGF0ZS5zZXJ2aWNlJzsiXX0=
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { LanguageTranslatePipe } from '../../pipes';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@ngx-translate/core";
|
|
5
|
+
export class LanguageTranslateService {
|
|
6
|
+
constructor(translateService) {
|
|
7
|
+
this.translateService = translateService;
|
|
8
|
+
}
|
|
9
|
+
getLanguageCodeTranslation(code, hideRegion = false) {
|
|
10
|
+
const languageTranslate = new LanguageTranslatePipe(this.translateService);
|
|
11
|
+
return languageTranslate.transform(code, hideRegion);
|
|
12
|
+
}
|
|
13
|
+
removeRegionFromLanguageCode(code) {
|
|
14
|
+
return code.split('-')[0];
|
|
15
|
+
}
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageTranslateService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
17
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageTranslateService, providedIn: 'root' }); }
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LanguageTranslateService, decorators: [{
|
|
20
|
+
type: Injectable,
|
|
21
|
+
args: [{
|
|
22
|
+
providedIn: 'root',
|
|
23
|
+
}]
|
|
24
|
+
}], ctorParameters: function () { return [{ type: i1.TranslateService }]; } });
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ3VhZ2UtdHJhbnNsYXRlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY29tbW9uL3NyYy9saWIvc2VydmljZXMvbGFuZ3VhZ2UtdHJhbnNsYXRlL2xhbmd1YWdlLXRyYW5zbGF0ZS5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFM0MsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sYUFBYSxDQUFDOzs7QUFLcEQsTUFBTSxPQUFPLHdCQUF3QjtJQUNuQyxZQUE2QixnQkFBa0M7UUFBbEMscUJBQWdCLEdBQWhCLGdCQUFnQixDQUFrQjtJQUFHLENBQUM7SUFFbkUsMEJBQTBCLENBQUMsSUFBWSxFQUFFLFVBQVUsR0FBRyxLQUFLO1FBQ3pELE1BQU0saUJBQWlCLEdBQUcsSUFBSSxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztRQUMzRSxPQUFPLGlCQUFpQixDQUFDLFNBQVMsQ0FBQyxJQUFJLEVBQUUsVUFBVSxDQUFDLENBQUM7SUFDdkQsQ0FBQztJQUVELDRCQUE0QixDQUFDLElBQVk7UUFDdkMsT0FBTyxJQUFJLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQy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