@kirbydesign/extensions-angular 1.3.0 → 2.0.0
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/kirbydesign-extensions-angular-image-banner.mjs +59 -9
- package/fesm2022/kirbydesign-extensions-angular-image-banner.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-localization.mjs +35 -35
- package/fesm2022/kirbydesign-extensions-angular-localization.mjs.map +1 -1
- package/fesm2022/kirbydesign-extensions-angular-skeleton-loader.mjs +3 -3
- package/image-banner/image-banner-height.directive.d.ts +19 -0
- package/image-banner/image-banner.component.d.ts +7 -1
- package/image-banner/index.d.ts +1 -0
- package/localization/amount/amount-service-formatter.d.ts +3 -3
- package/localization/amount/amount.pipe.d.ts +1 -1
- package/localization/amount/amount.service.d.ts +1 -1
- package/localization/date-time/abstract-timezone-compensating.pipe.d.ts +1 -1
- package/localization/date-time/date-only/date-only.pipe.d.ts +1 -1
- package/localization/date-time/time-only/time-only.pipe.d.ts +1 -1
- package/localization/date-time/time-or-date/time-or-date.pipe.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i5 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, Component, Input, HostBinding, Output } from '@angular/core';
|
|
5
|
-
import * as
|
|
4
|
+
import { inject, ElementRef, Renderer2, Directive, EventEmitter, Component, Input, HostBinding, Output } from '@angular/core';
|
|
5
|
+
import * as i3 from '@kirbydesign/designsystem/card';
|
|
6
6
|
import { CardModule } from '@kirbydesign/designsystem/card';
|
|
7
7
|
import { ButtonComponent } from '@kirbydesign/designsystem/button';
|
|
8
|
-
import * as
|
|
8
|
+
import * as i4 from '@kirbydesign/designsystem/icon';
|
|
9
9
|
import { IconModule } from '@kirbydesign/designsystem/icon';
|
|
10
10
|
import * as i1 from '@kirbydesign/designsystem/shared';
|
|
11
|
+
import { ResizeObserverService } from '@kirbydesign/designsystem/shared';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @Description Temporary directive to ensure correct scroll position behavior on Safari.
|
|
15
|
+
*
|
|
16
|
+
* When navigating between stacked pages, scroll position is not correctly restored on Safari,
|
|
17
|
+
* when the nested kirby-card element uses containment and the host element does not have an explicit height.
|
|
18
|
+
*/
|
|
19
|
+
class ImageBannerHeightDirective {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.currentHeight = 0;
|
|
22
|
+
this.host = inject(ElementRef);
|
|
23
|
+
this.resizeObserverService = inject(ResizeObserverService);
|
|
24
|
+
this.renderer = inject(Renderer2);
|
|
25
|
+
}
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
this.resizeObserverService.observe(this.host, (entry) => this.setCardHeightOnHost(entry));
|
|
28
|
+
}
|
|
29
|
+
ngOnDestroy() {
|
|
30
|
+
this.resizeObserverService.unobserve(this.host);
|
|
31
|
+
}
|
|
32
|
+
setCardHeightOnHost(entry) {
|
|
33
|
+
const hostElement = entry.target;
|
|
34
|
+
const card = hostElement.querySelector('kirby-card');
|
|
35
|
+
const cardHeight = card?.getBoundingClientRect().height;
|
|
36
|
+
if (!hostElement || !cardHeight)
|
|
37
|
+
return;
|
|
38
|
+
if (cardHeight === this.currentHeight)
|
|
39
|
+
return;
|
|
40
|
+
this.currentHeight = cardHeight;
|
|
41
|
+
this.renderer.setStyle(hostElement, 'min-height', `${cardHeight}px`);
|
|
42
|
+
}
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ImageBannerHeightDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
44
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: ImageBannerHeightDirective, isStandalone: true, selector: "[kirbyImageBannerResize]", ngImport: i0 }); }
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ImageBannerHeightDirective, decorators: [{
|
|
47
|
+
type: Directive,
|
|
48
|
+
args: [{
|
|
49
|
+
selector: `[kirbyImageBannerResize]`,
|
|
50
|
+
}]
|
|
51
|
+
}] });
|
|
11
52
|
|
|
12
53
|
class ImageBannerComponent {
|
|
13
54
|
constructor(translations) {
|
|
@@ -24,6 +65,10 @@ class ImageBannerComponent {
|
|
|
24
65
|
* If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.
|
|
25
66
|
*/
|
|
26
67
|
this.dismissClick = new EventEmitter();
|
|
68
|
+
/**
|
|
69
|
+
* If the input imagePath results in an error, it will be reflected in this output.
|
|
70
|
+
*/
|
|
71
|
+
this.imageError = new EventEmitter();
|
|
27
72
|
}
|
|
28
73
|
bannerClicked(event) {
|
|
29
74
|
const eventTarget = event.target;
|
|
@@ -35,12 +80,15 @@ class ImageBannerComponent {
|
|
|
35
80
|
dismissClicked(event) {
|
|
36
81
|
this.dismissClick.emit(event);
|
|
37
82
|
}
|
|
38
|
-
|
|
39
|
-
|
|
83
|
+
onImageError($event) {
|
|
84
|
+
this.imageError.emit($event);
|
|
85
|
+
}
|
|
86
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ImageBannerComponent, deps: [{ token: i1.TranslationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
87
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: ImageBannerComponent, isStandalone: true, selector: "kirby-x-image-banner", inputs: { title: "title", imagePath: "imagePath", bodyText: "bodyText", actionButtonText: "actionButtonText", externalLink: "externalLink", backgroundBlur: "backgroundBlur" }, outputs: { bannerClick: "bannerClick", dismissClick: "dismissClick", imageError: "imageError" }, host: { properties: { "class": "this.backgroundBlur" } }, hostDirectives: [{ directive: ImageBannerHeightDirective }], ngImport: i0, template: "<kirby-card *ngIf=\"externalLink\" [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\">\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<kirby-card\n *ngIf=\"!externalLink\"\n [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\"\n (click)=\"bannerClicked($event)\"\n>\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<ng-template #sharedCardContent>\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <!-- When an external link is supplied, this anchor tag expands and fills the entire banner so users can click anywhere or focus the banner -->\n <a *ngIf=\"externalLink\" class=\"main-content-anchor\" [href]=\"externalLink\" target=\"_blank\"></a>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"main-content-header\">\n <p class=\"kirby-text-normal-bold header-text\">\n @if (title) {\n {{ title }}\n } @else {\n <ng-content select=\"[title]\"></ng-content>\n }\n </p>\n </div>\n\n <div class=\"main-content-body\">\n <div class=\"main-content-body-text\">\n <span class=\"kirby-text-small body-text\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </span>\n </div>\n\n <ng-container *ngIf=\"externalLink\">\n <!-- On large screens we also show a button-like anchor tag in addition to the entire banner anchor -->\n <a\n kirby-button\n class=\"main-content-body-action-text\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"!actionButtonText\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <div class=\"main-content-body-action-link\">\n <kirby-icon name=\"link\"></kirby-icon>\n </div>\n </ng-container>\n\n <button\n class=\"main-content-body-action-text\"\n kirby-button\n *ngIf=\"actionButtonText && !externalLink\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"dismiss\" *ngIf=\"dismissClick.observed\">\n <button\n kirby-button\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n size=\"xs\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(60px) brightness(.8)}:host(.light) .blur-image{filter:blur(60px) brightness(1.3)}.blur-image-wrapper{position:absolute;inset:-180px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center}kirby-card{container-name:banner;container-type:inline-size;height:100%}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;flex-direction:column;padding:12px 0 8px 8px;overflow:hidden}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}.main-content:has(.header-text:empty):has(.body-text:empty){padding-block-start:0}.main-content:has(.body-text:empty):has(.header-text:empty){padding-block-end:0}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-anchor{position:absolute;inset:0}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-bottom:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;justify-content:space-between;gap:16px;height:100%}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:block;overflow:hidden;max-height:40px;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px;max-height:64px}}.main-content-body-action-text{display:none}@container banner (width >= 600px){.main-content-body-action-text{align-self:start;display:inline-flex;margin:0}}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CardModule }, { kind: "component", type: i3.CardComponent, selector: "kirby-card", inputs: ["title", "subtitle", "backgroundImageUrl", "hasPadding", "sizes", "variant"] }, { kind: "directive", type: i3.CardAsButtonDirective, selector: "kirby-card[click]" }, { kind: "directive", type: i1.ThemeColorDirective, selector: "kirby-avatar[themeColor], kirby-card[themeColor], kirby-icon[themeColor], kirby-progress-circle-ring[themeColor], kirby-modal-footer[themeColor], kirby-empty-state[themeColor]", inputs: ["themeColor"] }, { kind: "component", type: ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "ngmodule", type: IconModule }, { kind: "component", type: i4.IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
40
88
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ImageBannerComponent, decorators: [{
|
|
42
90
|
type: Component,
|
|
43
|
-
args: [{ selector: 'kirby-x-image-banner', imports: [CardModule, ButtonComponent, IconModule, CommonModule], template: "<kirby-card *ngIf=\"externalLink\" [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\">\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<kirby-card\n *ngIf=\"!externalLink\"\n [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\"\n (click)=\"bannerClicked($event)\"\n>\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<ng-template #sharedCardContent>\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <!-- When an external link is supplied, this anchor tag expands and fills the entire banner so users can click anywhere or focus the banner -->\n <a *ngIf=\"externalLink\" class=\"main-content-anchor\" [href]=\"externalLink\" target=\"_blank\"></a>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"main-content-header\">\n <p class=\"kirby-text-normal-bold header-text\">\n @if (title) {\n {{ title }}\n } @else {\n <ng-content select=\"[title]\"></ng-content>\n }\n </p>\n </div>\n\n <div class=\"main-content-body\">\n <div class=\"main-content-body-text\">\n <span class=\"kirby-text-small body-text\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </span>\n </div>\n\n <ng-container *ngIf=\"externalLink\">\n <!-- On large screens we also show a button-like anchor tag in addition to the entire banner anchor -->\n <a\n kirby-button\n class=\"main-content-body-action-text\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"!actionButtonText\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <div class=\"main-content-body-action-link\">\n <kirby-icon name=\"link\"></kirby-icon>\n </div>\n </ng-container>\n\n <button\n class=\"main-content-body-action-text\"\n kirby-button\n *ngIf=\"actionButtonText && !externalLink\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"dismiss\" *ngIf=\"dismissClick.observed\">\n <button\n kirby-button\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n size=\"xs\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:block
|
|
91
|
+
args: [{ selector: 'kirby-x-image-banner', imports: [CardModule, ButtonComponent, IconModule, CommonModule], hostDirectives: [ImageBannerHeightDirective], template: "<kirby-card *ngIf=\"externalLink\" [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\">\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<kirby-card\n *ngIf=\"!externalLink\"\n [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\"\n (click)=\"bannerClicked($event)\"\n>\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<ng-template #sharedCardContent>\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <!-- When an external link is supplied, this anchor tag expands and fills the entire banner so users can click anywhere or focus the banner -->\n <a *ngIf=\"externalLink\" class=\"main-content-anchor\" [href]=\"externalLink\" target=\"_blank\"></a>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"main-content-header\">\n <p class=\"kirby-text-normal-bold header-text\">\n @if (title) {\n {{ title }}\n } @else {\n <ng-content select=\"[title]\"></ng-content>\n }\n </p>\n </div>\n\n <div class=\"main-content-body\">\n <div class=\"main-content-body-text\">\n <span class=\"kirby-text-small body-text\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </span>\n </div>\n\n <ng-container *ngIf=\"externalLink\">\n <!-- On large screens we also show a button-like anchor tag in addition to the entire banner anchor -->\n <a\n kirby-button\n class=\"main-content-body-action-text\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"!actionButtonText\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <div class=\"main-content-body-action-link\">\n <kirby-icon name=\"link\"></kirby-icon>\n </div>\n </ng-container>\n\n <button\n class=\"main-content-body-action-text\"\n kirby-button\n *ngIf=\"actionButtonText && !externalLink\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"dismiss\" *ngIf=\"dismissClick.observed\">\n <button\n kirby-button\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n size=\"xs\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n</ng-template>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(60px) brightness(.8)}:host(.light) .blur-image{filter:blur(60px) brightness(1.3)}.blur-image-wrapper{position:absolute;inset:-180px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center}kirby-card{container-name:banner;container-type:inline-size;height:100%}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;flex-direction:column;padding:12px 0 8px 8px;overflow:hidden}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}.main-content:has(.header-text:empty):has(.body-text:empty){padding-block-start:0}.main-content:has(.body-text:empty):has(.header-text:empty){padding-block-end:0}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-anchor{position:absolute;inset:0}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-bottom:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;justify-content:space-between;gap:16px;height:100%}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:block;overflow:hidden;max-height:40px;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px;max-height:64px}}.main-content-body-action-text{display:none}@container banner (width >= 600px){.main-content-body-action-text{align-self:start;display:inline-flex;margin:0}}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}\n"] }]
|
|
44
92
|
}], ctorParameters: () => [{ type: i1.TranslationService }], propDecorators: { title: [{
|
|
45
93
|
type: Input
|
|
46
94
|
}], imagePath: [{
|
|
@@ -60,11 +108,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
60
108
|
type: Output
|
|
61
109
|
}], dismissClick: [{
|
|
62
110
|
type: Output
|
|
111
|
+
}], imageError: [{
|
|
112
|
+
type: Output
|
|
63
113
|
}] } });
|
|
64
114
|
|
|
65
115
|
/**
|
|
66
116
|
* Generated bundle index. Do not edit.
|
|
67
117
|
*/
|
|
68
118
|
|
|
69
|
-
export { ImageBannerComponent };
|
|
119
|
+
export { ImageBannerComponent, ImageBannerHeightDirective };
|
|
70
120
|
//# sourceMappingURL=kirbydesign-extensions-angular-image-banner.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kirbydesign-extensions-angular-image-banner.mjs","sources":["../../image-banner/src/image-banner.component.ts","../../image-banner/src/image-banner.component.html","../../image-banner/src/kirbydesign-extensions-angular-image-banner.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\nimport { CardModule } from '@kirbydesign/designsystem/card';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { IconModule } from '@kirbydesign/designsystem/icon';\nimport { TranslationService } from '@kirbydesign/designsystem/shared';\n\n@Component({\n selector: 'kirby-x-image-banner',\n imports: [CardModule, ButtonComponent, IconModule, CommonModule],\n templateUrl: './image-banner.component.html',\n styleUrl: './image-banner.component.scss',\n})\nexport class ImageBannerComponent {\n /**\n * The title placed inside the image banners header.\n */\n @Input() title: string | undefined;\n\n /**\n * The image shown on the banner, and used for the background blur effect.\n */\n @Input() imagePath: string | undefined;\n\n /**\n * The body text placed below the title.\n */\n @Input() bodyText: string | undefined;\n\n /**\n * The text of the button in the content area of the image banner.\n */\n @Input() actionButtonText: string | undefined;\n\n /**\n * When an external link is supplied the entire banner will be an anchor-tag and navigate when activated.\n */\n @Input() externalLink: string | undefined;\n\n /**\n * The blur-effect used for the background.\n */\n @HostBinding('class')\n @Input()\n backgroundBlur: 'dark' | 'light' | 'none' = 'dark';\n\n /**\n * Emitted every time the banner is activated. The entire banner is interactive, and will be activated by click and keyboard interaction.\n */\n @Output() bannerClick = new EventEmitter<Event>();\n\n /**\n * If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.\n */\n @Output() dismissClick = new EventEmitter<Event>();\n\n constructor(public translations: TranslationService) {}\n\n public bannerClicked(event: Event) {\n const eventTarget = event.target as HTMLElement;\n const dismissButtonClicked = eventTarget.closest('.dismiss');\n if (dismissButtonClicked) return;\n this.bannerClick.emit(event);\n }\n\n public dismissClicked(event: Event) {\n this.dismissClick.emit(event);\n }\n}\n","<kirby-card *ngIf=\"externalLink\" [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\">\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<kirby-card\n *ngIf=\"!externalLink\"\n [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\"\n (click)=\"bannerClicked($event)\"\n>\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<ng-template #sharedCardContent>\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <!-- When an external link is supplied, this anchor tag expands and fills the entire banner so users can click anywhere or focus the banner -->\n <a *ngIf=\"externalLink\" class=\"main-content-anchor\" [href]=\"externalLink\" target=\"_blank\"></a>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"main-content-header\">\n <p class=\"kirby-text-normal-bold header-text\">\n @if (title) {\n {{ title }}\n } @else {\n <ng-content select=\"[title]\"></ng-content>\n }\n </p>\n </div>\n\n <div class=\"main-content-body\">\n <div class=\"main-content-body-text\">\n <span class=\"kirby-text-small body-text\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </span>\n </div>\n\n <ng-container *ngIf=\"externalLink\">\n <!-- On large screens we also show a button-like anchor tag in addition to the entire banner anchor -->\n <a\n kirby-button\n class=\"main-content-body-action-text\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"!actionButtonText\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <div class=\"main-content-body-action-link\">\n <kirby-icon name=\"link\"></kirby-icon>\n </div>\n </ng-container>\n\n <button\n class=\"main-content-body-action-text\"\n kirby-button\n *ngIf=\"actionButtonText && !externalLink\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"dismiss\" *ngIf=\"dismissClick.observed\">\n <button\n kirby-button\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n size=\"xs\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAaa,oBAAoB,CAAA;AA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gBAOD,cAAc,EAAA,CAAA;sBAFb,WAAW;uBAAC,OAAO;;sBACnB;gBAMS,WAAW,EAAA,CAAA;sBAApB;gBAKS,YAAY,EAAA,CAAA;sBAArB;;;AEtDH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"kirbydesign-extensions-angular-image-banner.mjs","sources":["../../image-banner/src/image-banner-height.directive.ts","../../image-banner/src/image-banner.component.ts","../../image-banner/src/image-banner.component.html","../../image-banner/src/kirbydesign-extensions-angular-image-banner.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';\nimport { ResizeObserverService } from '@kirbydesign/designsystem/shared';\n\n/**\n * @Description Temporary directive to ensure correct scroll position behavior on Safari.\n *\n * When navigating between stacked pages, scroll position is not correctly restored on Safari,\n * when the nested kirby-card element uses containment and the host element does not have an explicit height.\n */\n@Directive({\n selector: `[kirbyImageBannerResize]`,\n})\nexport class ImageBannerHeightDirective implements OnInit, OnDestroy {\n private currentHeight: number = 0;\n private host = inject(ElementRef);\n private resizeObserverService = inject(ResizeObserverService);\n private renderer = inject(Renderer2);\n\n ngOnInit() {\n this.resizeObserverService.observe(this.host, (entry) => this.setCardHeightOnHost(entry));\n }\n\n ngOnDestroy() {\n this.resizeObserverService.unobserve(this.host);\n }\n\n private setCardHeightOnHost(entry: ResizeObserverEntry) {\n const hostElement = entry.target as HTMLElement;\n const card = hostElement.querySelector('kirby-card');\n const cardHeight = card?.getBoundingClientRect().height;\n\n if (!hostElement || !cardHeight) return;\n if (cardHeight === this.currentHeight) return;\n\n this.currentHeight = cardHeight;\n this.renderer.setStyle(hostElement, 'min-height', `${cardHeight}px`);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\nimport { CardModule } from '@kirbydesign/designsystem/card';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { IconModule } from '@kirbydesign/designsystem/icon';\nimport { TranslationService } from '@kirbydesign/designsystem/shared';\nimport { ImageBannerHeightDirective } from './image-banner-height.directive';\n\n@Component({\n selector: 'kirby-x-image-banner',\n imports: [CardModule, ButtonComponent, IconModule, CommonModule],\n hostDirectives: [ImageBannerHeightDirective],\n templateUrl: './image-banner.component.html',\n styleUrl: './image-banner.component.scss',\n})\nexport class ImageBannerComponent {\n /**\n * The title placed inside the image banners header.\n */\n @Input() title: string | undefined;\n\n /**\n * The image shown on the banner, and used for the background blur effect.\n */\n @Input() imagePath: string | undefined;\n\n /**\n * The body text placed below the title.\n */\n @Input() bodyText: string | undefined;\n\n /**\n * The text of the button in the content area of the image banner.\n */\n @Input() actionButtonText: string | undefined;\n\n /**\n * When an external link is supplied the entire banner will be an anchor-tag and navigate when activated.\n */\n @Input() externalLink: string | undefined;\n\n /**\n * The blur-effect used for the background.\n */\n @HostBinding('class')\n @Input()\n backgroundBlur: 'dark' | 'light' | 'none' = 'dark';\n\n /**\n * Emitted every time the banner is activated. The entire banner is interactive, and will be activated by click and keyboard interaction.\n */\n @Output() bannerClick = new EventEmitter<Event>();\n\n /**\n * If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.\n */\n @Output() dismissClick = new EventEmitter<Event>();\n\n /**\n * If the input imagePath results in an error, it will be reflected in this output.\n */\n @Output()\n imageError = new EventEmitter<ErrorEvent>();\n\n constructor(public translations: TranslationService) {}\n\n public bannerClicked(event: Event) {\n const eventTarget = event.target as HTMLElement;\n const dismissButtonClicked = eventTarget.closest('.dismiss');\n if (dismissButtonClicked) return;\n this.bannerClick.emit(event);\n }\n\n public dismissClicked(event: Event) {\n this.dismissClick.emit(event);\n }\n\n public onImageError($event: ErrorEvent) {\n this.imageError.emit($event);\n }\n}\n","<kirby-card *ngIf=\"externalLink\" [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\">\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<kirby-card\n *ngIf=\"!externalLink\"\n [themeColor]=\"backgroundBlur === 'none' ? 'white' : 'dark'\"\n (click)=\"bannerClicked($event)\"\n>\n <ng-container *ngTemplateOutlet=\"sharedCardContent\"></ng-container>\n</kirby-card>\n\n<ng-template #sharedCardContent>\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <!-- When an external link is supplied, this anchor tag expands and fills the entire banner so users can click anywhere or focus the banner -->\n <a *ngIf=\"externalLink\" class=\"main-content-anchor\" [href]=\"externalLink\" target=\"_blank\"></a>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"main-content-header\">\n <p class=\"kirby-text-normal-bold header-text\">\n @if (title) {\n {{ title }}\n } @else {\n <ng-content select=\"[title]\"></ng-content>\n }\n </p>\n </div>\n\n <div class=\"main-content-body\">\n <div class=\"main-content-body-text\">\n <span class=\"kirby-text-small body-text\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </span>\n </div>\n\n <ng-container *ngIf=\"externalLink\">\n <!-- On large screens we also show a button-like anchor tag in addition to the entire banner anchor -->\n <a\n kirby-button\n class=\"main-content-body-action-text\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"!actionButtonText\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <div class=\"main-content-body-action-link\">\n <kirby-icon name=\"link\"></kirby-icon>\n </div>\n </ng-container>\n\n <button\n class=\"main-content-body-action-text\"\n kirby-button\n *ngIf=\"actionButtonText && !externalLink\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"dismiss\" *ngIf=\"dismissClick.observed\">\n <button\n kirby-button\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n size=\"xs\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.ImageBannerHeightDirective"],"mappings":";;;;;;;;;;;;AAGA;;;;;AAKG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAa,CAAA,aAAA,GAAW,CAAC;AACzB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACrD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAqBrC;IAnBC,QAAQ,GAAA;QACN,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;;IAG3F,WAAW,GAAA;QACT,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;;AAGzC,IAAA,mBAAmB,CAAC,KAA0B,EAAA;AACpD,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAqB;QAC/C,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,EAAE,qBAAqB,EAAE,CAAC,MAAM;AAEvD,QAAA,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU;YAAE;AACjC,QAAA,IAAI,UAAU,KAAK,IAAI,CAAC,aAAa;YAAE;AAEvC,QAAA,IAAI,CAAC,aAAa,GAAG,UAAU;A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,EAAA,IAAA,EAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKpD,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EACvB,OAAA,EAAA,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,CAAC,EAChD,cAAA,EAAA,CAAC,0BAA0B,CAAC,EAAA,QAAA,EAAA,mnGAAA,EAAA,MAAA,EAAA,CAAA,0tFAAA,CAAA,EAAA;uFAQnC,KAAK,EAAA,CAAA;sBAAb;gBAKQ,SAAS,EAAA,CAAA;sBAAjB;gBAKQ,QAAQ,EAAA,CAAA;sBAAhB;gBAKQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAKQ,YAAY,EAAA,CAAA;sBAApB;gBAOD,cAAc,EAAA,CAAA;sBAFb,WAAW;uBAAC,OAAO;;sBACnB;gBAMS,WAAW,EAAA,CAAA;sBAApB;gBAKS,YAAY,EAAA,CAAA;sBAArB;gBAMD,UAAU,EAAA,CAAA;sBADT;;;AE7DH;;AAEG;;;;"}
|
|
@@ -33,7 +33,7 @@ class AbstractTimezoneCompensatingPipe {
|
|
|
33
33
|
if (!time) {
|
|
34
34
|
return '';
|
|
35
35
|
}
|
|
36
|
-
const date = typeof time === 'number' ? new Date(time) : time;
|
|
36
|
+
const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;
|
|
37
37
|
const timeZone = this.config.timeZone;
|
|
38
38
|
const options = this.getIntlOptions(formatPattern);
|
|
39
39
|
const formatter = new Intl.DateTimeFormat(this.locale, { ...options, timeZone });
|
|
@@ -89,10 +89,10 @@ class DateOnlyPipe extends AbstractTimezoneCompensatingPipe {
|
|
|
89
89
|
transform(input) {
|
|
90
90
|
return this.format(input, DateFormats.SHORT_DATE_FORMAT);
|
|
91
91
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
93
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateOnlyPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
93
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: DateOnlyPipe, isStandalone: true, name: "dateOnly" }); }
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: DateOnlyPipe, decorators: [{
|
|
96
96
|
type: Pipe,
|
|
97
97
|
args: [{
|
|
98
98
|
name: 'dateOnly',
|
|
@@ -122,10 +122,10 @@ class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe {
|
|
|
122
122
|
throw new Error(`Unable to derive format from "${format}"`);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
126
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
125
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TimeOnlyPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
126
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: TimeOnlyPipe, isStandalone: true, name: "timeOnly" }); }
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TimeOnlyPipe, decorators: [{
|
|
129
129
|
type: Pipe,
|
|
130
130
|
args: [{
|
|
131
131
|
name: 'timeOnly',
|
|
@@ -146,7 +146,7 @@ class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe {
|
|
|
146
146
|
if (!time) {
|
|
147
147
|
return '';
|
|
148
148
|
}
|
|
149
|
-
const date = typeof time === 'number' ? new Date(time) : time;
|
|
149
|
+
const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;
|
|
150
150
|
const today = new Date();
|
|
151
151
|
const sameDay = date.getFullYear() === today.getFullYear() &&
|
|
152
152
|
date.getMonth() === today.getMonth() &&
|
|
@@ -160,10 +160,10 @@ class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe {
|
|
|
160
160
|
}
|
|
161
161
|
return this.format(date, format);
|
|
162
162
|
}
|
|
163
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
164
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
163
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TimeOrDatePipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
164
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: TimeOrDatePipe, isStandalone: true, name: "timeOrDate" }); }
|
|
165
165
|
}
|
|
166
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
166
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TimeOrDatePipe, decorators: [{
|
|
167
167
|
type: Pipe,
|
|
168
168
|
args: [{
|
|
169
169
|
name: 'timeOrDate',
|
|
@@ -181,10 +181,10 @@ class FormatNumberService {
|
|
|
181
181
|
}
|
|
182
182
|
return formatNumber(value, this.localeId, digitsInfo);
|
|
183
183
|
}
|
|
184
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
185
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberService, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
185
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberService, providedIn: 'root' }); }
|
|
186
186
|
}
|
|
187
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberService, decorators: [{
|
|
188
188
|
type: Injectable,
|
|
189
189
|
args: [{
|
|
190
190
|
providedIn: 'root',
|
|
@@ -201,10 +201,10 @@ class FormatNumberPipe {
|
|
|
201
201
|
transform(value, digitsInfo = '1.2-2') {
|
|
202
202
|
return this.formatNumberService.formatNumber(value, digitsInfo);
|
|
203
203
|
}
|
|
204
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
205
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberPipe, deps: [{ token: FormatNumberService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
205
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberPipe, isStandalone: true, name: "formatNumber" }); }
|
|
206
206
|
}
|
|
207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FormatNumberPipe, decorators: [{
|
|
208
208
|
type: Pipe,
|
|
209
209
|
args: [{
|
|
210
210
|
name: 'formatNumber',
|
|
@@ -212,7 +212,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
212
212
|
}]
|
|
213
213
|
}], ctorParameters: () => [{ type: FormatNumberService }] });
|
|
214
214
|
|
|
215
|
-
function formatAmount(amount,
|
|
215
|
+
function formatAmount(amount, locale, nativeCurrency, amountServiceConfiguration) {
|
|
216
216
|
const config = deriveConfiguration(amountServiceConfiguration);
|
|
217
217
|
let formattedAmount = formatNumber(amount && amount.amount, locale, config.digitsInfo);
|
|
218
218
|
if (config.stripSign) {
|
|
@@ -242,7 +242,7 @@ function deriveCurrencyCode(config, amount, nativeCurrency) {
|
|
|
242
242
|
}
|
|
243
243
|
return currencyCodeToAppend || '';
|
|
244
244
|
}
|
|
245
|
-
function deriveConfiguration(configuration) {
|
|
245
|
+
function deriveConfiguration(configuration = {}) {
|
|
246
246
|
const config = {
|
|
247
247
|
showCurrencyCode: '',
|
|
248
248
|
digitsInfo: '1.2-2',
|
|
@@ -275,12 +275,12 @@ class AmountService {
|
|
|
275
275
|
currencyCode: '',
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
-
return formatAmount(amount,
|
|
278
|
+
return formatAmount(amount, this.locale, this.config.nativeCurrency, amountServiceConfiguration);
|
|
279
279
|
}
|
|
280
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
281
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
280
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
281
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountService, providedIn: 'root' }); }
|
|
282
282
|
}
|
|
283
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountService, decorators: [{
|
|
284
284
|
type: Injectable,
|
|
285
285
|
args: [{
|
|
286
286
|
providedIn: 'root',
|
|
@@ -313,10 +313,10 @@ class AmountPipe {
|
|
|
313
313
|
transform(amount, amountServiceConfiguration) {
|
|
314
314
|
return this.amountService.formatAmount(amount, amountServiceConfiguration);
|
|
315
315
|
}
|
|
316
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
317
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
316
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountPipe, deps: [{ token: AmountService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
317
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: AmountPipe, isStandalone: true, name: "amount" }); }
|
|
318
318
|
}
|
|
319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
319
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountPipe, decorators: [{
|
|
320
320
|
type: Pipe,
|
|
321
321
|
args: [{
|
|
322
322
|
name: 'amount',
|
|
@@ -340,10 +340,10 @@ class AccountNumberPipe {
|
|
|
340
340
|
transform(value) {
|
|
341
341
|
return formatAccountNumber(value);
|
|
342
342
|
}
|
|
343
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
344
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AccountNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
344
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: AccountNumberPipe, isStandalone: true, name: "accountNumber" }); }
|
|
345
345
|
}
|
|
346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AccountNumberPipe, decorators: [{
|
|
347
347
|
type: Pipe,
|
|
348
348
|
args: [{
|
|
349
349
|
name: 'accountNumber',
|
|
@@ -376,10 +376,10 @@ class PhoneNumberService {
|
|
|
376
376
|
return formattedNumber;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
380
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
379
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
380
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberService, providedIn: 'root' }); }
|
|
381
381
|
}
|
|
382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberService, decorators: [{
|
|
383
383
|
type: Injectable,
|
|
384
384
|
args: [{
|
|
385
385
|
providedIn: 'root',
|
|
@@ -400,10 +400,10 @@ class PhoneNumberPipe {
|
|
|
400
400
|
transform(phoneNumber, chunk = 2, showCountryCode) {
|
|
401
401
|
return this.phoneNumberService.formatPhoneNumber(phoneNumber, chunk, showCountryCode);
|
|
402
402
|
}
|
|
403
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
404
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.
|
|
403
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberPipe, deps: [{ token: PhoneNumberService }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
404
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberPipe, isStandalone: true, name: "phoneNumber" }); }
|
|
405
405
|
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
406
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: PhoneNumberPipe, decorators: [{
|
|
407
407
|
type: Pipe,
|
|
408
408
|
args: [{
|
|
409
409
|
name: 'phoneNumber',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kirbydesign-extensions-angular-localization.mjs","sources":["../../localization/src/date-time/date-formats.ts","../../localization/src/di-tokens.ts","../../localization/src/date-time/abstract-timezone-compensating.pipe.ts","../../localization/src/date-time/date-only/date-only.pipe.ts","../../localization/src/date-time/time-only/time-only.pipe.ts","../../localization/src/date-time/time-or-date/time-or-date.pipe.ts","../../localization/src/number/format-number.service.ts","../../localization/src/number/format-number.pipe.ts","../../localization/src/amount/amount-service-formatter.ts","../../localization/src/amount/amount.service.ts","../../localization/src/amount/amount.pipe.ts","../../localization/src/account-number/account-number-service-formatter.ts","../../localization/src/account-number/account-number.pipe.ts","../../localization/src/phone-number/phone-number.service.ts","../../localization/src/phone-number/phone-number.pipe.ts","../../localization/src/kirbydesign-extensions-angular-localization.ts"],"sourcesContent":["export class DateFormats {\n static readonly SHORT_DATE_FORMAT = 'dd.MM.yyyy';\n static readonly MEDIUM_DATE_FORMAT = 'd. MMMM y';\n static readonly MEDIUM_LETTER_DATE_FORMAT = 'dd. MMM yyyy';\n static readonly SHORT_TIME_FORMAT = 'HH:mm';\n static readonly MEDIUM_TIME_FORMAT = 'HH:mm:ss';\n static readonly SHORT_DATE_MEDIUM_TIME_FORMAT = `${DateFormats.SHORT_DATE_FORMAT} ${DateFormats.MEDIUM_TIME_FORMAT}`;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const KIRBY_EXTENSIONS_LOCALIZATION_TOKEN =\n new InjectionToken<KirbyExtensionsLocalizationToken>('KIRBY_EXTENSIONS_LOCALIZATION_TOKEN');\n\nexport function provideKirbyExtensionsLocalizationToken(\n factory: () => KirbyExtensionsLocalizationToken\n) {\n return {\n provide: KIRBY_EXTENSIONS_LOCALIZATION_TOKEN,\n useFactory: factory,\n };\n}\n\ninterface KirbyExtensionsLocalizationToken {\n /**\n * @example 'DKK | kr. | EUR'\n */\n nativeCurrency: string;\n /**\n * Default language for the application. Used to determine if the phone number country code should be shown, if not specified as input, based on the locale.\n * @example 'da'\n */\n defaultLang: string;\n /**\n * Default phone country code\n * @example '+45'\n */\n countryCode: string;\n /**\n * Default timezone for the application\n * @example 'Europe/Copenhagen'\n */\n timeZone: string;\n}\n","import { inject, LOCALE_ID, PipeTransform } from '@angular/core';\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { DateFormats } from './date-formats';\n\n/**\n * Abstract implementation of pipe that should format dates, and compensate for time-zone offset.\n *\n * This class provides tools for formatting dates (and timestamps) in a time zone\n */\nexport abstract class AbstractTimezoneCompensatingPipe implements PipeTransform {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n abstract transform(value: unknown, ...args: unknown[]): unknown;\n\n protected format(time: number | Date, formatPattern: string): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' ? new Date(time) : time;\n\n const timeZone = this.config.timeZone;\n const options = this.getIntlOptions(formatPattern);\n\n const formatter = new Intl.DateTimeFormat(this.locale, { ...options, timeZone });\n let formattedDate = formatter.format(date);\n\n // Capitalize month abbreviation and remove trailing period for `MEDIUM_LETTER_DATE_FORMAT`\n if (formatPattern === DateFormats.MEDIUM_LETTER_DATE_FORMAT) {\n formattedDate = formattedDate.replace(\n /(\\d{2}\\.\\s)(\\w+)\\.(\\s\\d{4})/,\n (_, day, month, year) => {\n return `${day}${month.charAt(0).toUpperCase()}${month.slice(1)}${year}`;\n }\n );\n }\n\n if (\n formatPattern === DateFormats.SHORT_TIME_FORMAT ||\n formatPattern === DateFormats.MEDIUM_TIME_FORMAT\n ) {\n formattedDate = formattedDate.replace(/\\./g, ':');\n }\n\n return formattedDate;\n }\n\n private getIntlOptions(formatPattern: string): Intl.DateTimeFormatOptions {\n switch (formatPattern) {\n case DateFormats.SHORT_DATE_FORMAT:\n return { year: 'numeric', month: '2-digit', day: '2-digit' };\n\n case DateFormats.MEDIUM_DATE_FORMAT:\n return { year: 'numeric', month: 'long', day: 'numeric' };\n\n case DateFormats.MEDIUM_LETTER_DATE_FORMAT:\n return {\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n };\n\n case DateFormats.SHORT_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', hour12: false };\n\n case DateFormats.MEDIUM_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };\n\n case DateFormats.SHORT_DATE_MEDIUM_TIME_FORMAT:\n return {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n\n default:\n throw new Error(`Unsupported format pattern: ${formatPattern}`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp as a date.\n */\n@Pipe({\n name: 'dateOnly',\n standalone: true,\n})\nexport class DateOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date): string {\n return this.format(input, DateFormats.SHORT_DATE_FORMAT);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\nexport type TimeOnlyFormat = 'short' | 'medium';\n\n/**\n * Formats a given timestamp as a time.\n *\n * Timestamps can be formatted as 2 variants:\n * - 'short' being 'HH:mm' (hours and minutes)\n * - 'medium' being 'HH:mm:ss' (as above, but with seconds appended)\n *\n */\n@Pipe({\n name: 'timeOnly',\n standalone: true,\n})\nexport class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date, format: TimeOnlyFormat = 'short'): string {\n return this.format(input, this.getFormat(format));\n }\n\n private getFormat(format: TimeOnlyFormat): string {\n switch (format) {\n case 'short':\n return DateFormats.SHORT_TIME_FORMAT;\n case 'medium':\n return DateFormats.MEDIUM_TIME_FORMAT;\n default:\n throw new Error(`Unable to derive format from \"${format}\"`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp so that:\n * - If timestamp is of \"today\", it's formatted as time with hours and minutes (eg. 23:56)\n * - If timestamp is different from \"today\", it's formatted as date with \"day of month\", month and year (eg. 28.02.2020)\n *\n * All formatting and parsing is expect to be handled in \"Europe/Copenhagen\" time zone and with\n * the locale provided by `LOCALE_ID`.\n */\n\n@Pipe({\n name: 'timeOrDate',\n standalone: true,\n})\nexport class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(\n time: number | Date,\n showSeconds = false,\n formatMonth: 'month-as-digits' | 'month-as-letters' = 'month-as-digits'\n ): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' ? new Date(time) : time;\n\n const today = new Date();\n const sameDay =\n date.getFullYear() === today.getFullYear() &&\n date.getMonth() === today.getMonth() &&\n date.getDate() === today.getDate();\n\n let format = DateFormats.SHORT_DATE_FORMAT;\n\n if (formatMonth === 'month-as-letters') {\n format = DateFormats.MEDIUM_LETTER_DATE_FORMAT;\n }\n\n if (sameDay) {\n format = showSeconds ? DateFormats.MEDIUM_TIME_FORMAT : DateFormats.SHORT_TIME_FORMAT;\n }\n\n return this.format(date, format);\n }\n}\n","import { formatNumber } from '@angular/common';\nimport { Inject, Injectable, LOCALE_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormatNumberService {\n constructor(@Inject(LOCALE_ID) private localeId: string) {}\n\n public formatNumber(value: number, digitsInfo: string) {\n if (value == null) {\n return '';\n }\n\n return formatNumber(value, this.localeId, digitsInfo);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { FormatNumberService } from './format-number.service';\n\n@Pipe({\n name: 'formatNumber',\n standalone: true,\n})\nexport class FormatNumberPipe implements PipeTransform {\n constructor(private formatNumberService: FormatNumberService) {}\n\n transform(value: number, digitsInfo = '1.2-2') {\n return this.formatNumberService.formatNumber(value, digitsInfo);\n }\n}\n","import { formatNumber } from '@angular/common';\n\nimport { Amount } from './amount.model';\n\nexport function formatAmount(\n amount: Amount,\n amountServiceConfiguration: AmountServiceConfiguration,\n locale: string,\n nativeCurrency: string\n) {\n const config = deriveConfiguration(amountServiceConfiguration);\n\n let formattedAmount = formatNumber(amount && amount.amount, locale, config.digitsInfo);\n\n if (config.stripSign) {\n formattedAmount = formattedAmount.replace('-', '').trim();\n }\n\n const currencyCodeToAppend = deriveCurrencyCode(config, amount, nativeCurrency);\n\n if (!currencyCodeToAppend) {\n return formattedAmount;\n }\n if (config.currencyCodePosition === 'postfix') {\n return formattedAmount + ' ' + currencyCodeToAppend;\n } else {\n return currencyCodeToAppend + ' ' + formattedAmount;\n }\n}\n\nexport function deriveCurrencyCode(\n config: AmountServiceConfiguration,\n amount: Amount,\n nativeCurrency: string\n) {\n let currencyCodeToAppend;\n\n if (config.showCurrencyCode) {\n if (config.showCurrencyCode === 'alwaysShowCurrency') {\n currencyCodeToAppend = amount && amount.currencyCode;\n } else if (config.showCurrencyCode === 'showForeignCurrency') {\n currencyCodeToAppend =\n amount && amount.currencyCode !== nativeCurrency ? amount.currencyCode : '';\n }\n }\n\n return currencyCodeToAppend || '';\n}\n\nexport function deriveConfiguration(configuration: AmountServiceConfiguration) {\n const config: AmountServiceConfiguration = {\n showCurrencyCode: '',\n digitsInfo: '1.2-2',\n stripSign: false,\n };\n\n return Object.assign({}, config, configuration);\n}\n\nexport type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency';\nexport type CurrencyCodePosition = '' | 'prefix' | 'postfix';\n\nexport interface AmountServiceConfiguration {\n /**\n * - '' - don't output CurrencyCode\n * - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency\n * - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency\n */\n showCurrencyCode: ShowCurrencyCode;\n /**\n * The position of the currency code in the formatted amount\n * - 'postfix' - output CurrencyCode after the formatted amount, eg. 1.234,56 EUR\n * - 'prefix' - output CurrencyCode before the formatted amount, eg. DKK 1.234,56\n */\n currencyCodePosition?: CurrencyCodePosition;\n /**\n * A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n */\n digitsInfo?: string;\n /**\n * Remove the minus sign from the formatted amount and trim any leading or trailing whitespace.\n */\n stripSign?: boolean;\n /**\n * The string to return if the amount is empty\n */\n returnValueOnEmptyAmount?: string;\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { Amount } from './amount.model';\nimport {\n AmountServiceConfiguration,\n deriveConfiguration,\n formatAmount,\n} from './amount-service-formatter';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AmountService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration}\n *\n * The number is always formatted according to Angular LOCALE_ID\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n\n formatAmount(amount: Amount, amountServiceConfiguration: AmountServiceConfiguration) {\n if (amount == undefined) {\n const config = deriveConfiguration(amountServiceConfiguration);\n if (config.returnValueOnEmptyAmount) {\n return config.returnValueOnEmptyAmount;\n }\n amount = {\n amount: 0.0,\n currencyCode: '',\n };\n }\n\n return formatAmount(\n amount,\n amountServiceConfiguration,\n this.locale,\n this.config.nativeCurrency\n );\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Amount } from './amount.model';\nimport { AmountService } from './amount.service';\nimport { AmountServiceConfiguration } from './amount-service-formatter';\n\n/**\n * Configuration object for the amount-pipe. The configuration object can be used to control\n * the formatting of the amount, and can be passed as an argument to the amount-pipe when used on an {@link Amount}.\n * - `showCurrencyCode`: Controls whether the currency code should be displayed or not.\n * - `''`: Don't output currency code\n * - `alwaysShowCurrency`: Always show currency code, regardless of presentation currency\n * - `showForeignCurrency`: Only show currency code if it differs from the presentation currency\n * - `digitsInfo`: A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n * - `stripSign`: Controls whether the minus sign should be stripped from a negative amount.\n * - `currencyCodePosition`: Controls the position of the currency code in the formatted amount.\n * - `postfix`: Output currency code after the formatted amount, e.g. 1.234,56 EUR\n * - `prefix`: Output currency code before the formatted amount, e.g. DKK 1.234,56\n */\n@Pipe({\n name: 'amount',\n standalone: true,\n})\nexport class AmountPipe implements PipeTransform {\n constructor(private amountService: AmountService) {}\n\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration} (or a number of arguments, for backwards compatibility).\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n transform(amount: Amount, amountServiceConfiguration: AmountServiceConfiguration) {\n return this.amountService.formatAmount(amount, amountServiceConfiguration);\n }\n}\n","import { AccountNumber } from './account-number.model';\n\nexport function formatAccountNumber(value: AccountNumber): string {\n return `${value.regNo.padStart(4, '0')} ${value.accountNo.replace(/^0+/, '')}`;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AccountNumber } from './account-number.model';\nimport { formatAccountNumber } from './account-number-service-formatter';\n\n/**\n * Pipe that formats a {@link AccountNumber}-object to a common format.\n */\n@Pipe({\n name: 'accountNumber',\n standalone: true,\n})\nexport class AccountNumberPipe implements PipeTransform {\n /**\n * Formats the {@link AccountNumber} to a common format.\n *\n * @param value the {@link AccountNumber} to format\n */\n transform(value: AccountNumber): string | undefined {\n return formatAccountNumber(value);\n }\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { PhoneNumber } from './phone-number';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhoneNumberService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n private static chunkUpPhoneNumber(str: string, chunk: number): string {\n return str.match(new RegExp(`.{1,${chunk}}`, 'g'))?.join(' ') ?? '';\n }\n\n formatPhoneNumber(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n const countryCode =\n typeof phoneNumber === 'string' ? this.config.countryCode : phoneNumber.countryCode;\n const number = typeof phoneNumber === 'string' ? phoneNumber : phoneNumber.number;\n\n if (!/^\\d+$/.test(number)) {\n return;\n }\n\n if (showCountryCode === undefined) {\n showCountryCode = !this.locale.match(`${this.config.defaultLang}.*`);\n }\n\n const formattedNumber = PhoneNumberService.chunkUpPhoneNumber(number, chunk);\n\n if (showCountryCode) {\n return `${countryCode} ${formattedNumber}`;\n } else {\n return formattedNumber;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { PhoneNumber } from './phone-number';\nimport { PhoneNumberService } from './phone-number.service';\n\n@Pipe({\n name: 'phoneNumber',\n standalone: true,\n})\nexport class PhoneNumberPipe implements PipeTransform {\n constructor(private phoneNumberService: PhoneNumberService) {}\n\n /**\n * Transforms a phone number, chunked up with spaces between the chunks and the country code in front, if desired.\n *\n * @param phoneNumber A PhoneNumber or a string representation of a phone number\n * @param chunk The chunk size used to split up the phone number with spaces\n * @param showCountryCode Show the country code in front of the phone number. If a string representation is supplied, the KIRBY_EXTENSIONS_LOCALIZATION_TOKEN.countryCode is used.\n */\n transform(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n return this.phoneNumberService.formatPhoneNumber(phoneNumber, chunk, showCountryCode);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FormatNumberService","i1.AmountService","i1.PhoneNumberService"],"mappings":";;;;MAAa,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AU,EAAE,MAAM;AACnB,iBAAA;;;MCEY,eAAe,CAAA;AAC1B,IAAA,WAAA,CAAoB,kBAAsC,EAAA;QAAtC,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB;;AAEtC;;;;;;AAMG;AACH,IAAA,SAAS,CACP,WAAiC,EACjC,KAAK,GAAG,CAAC,EACT,eAAyB,EAAA;AAEzB,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,EAAE,eAAe,CAAC;;8GAf5E,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,kBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"kirbydesign-extensions-angular-localization.mjs","sources":["../../localization/src/date-time/date-formats.ts","../../localization/src/di-tokens.ts","../../localization/src/date-time/abstract-timezone-compensating.pipe.ts","../../localization/src/date-time/date-only/date-only.pipe.ts","../../localization/src/date-time/time-only/time-only.pipe.ts","../../localization/src/date-time/time-or-date/time-or-date.pipe.ts","../../localization/src/number/format-number.service.ts","../../localization/src/number/format-number.pipe.ts","../../localization/src/amount/amount-service-formatter.ts","../../localization/src/amount/amount.service.ts","../../localization/src/amount/amount.pipe.ts","../../localization/src/account-number/account-number-service-formatter.ts","../../localization/src/account-number/account-number.pipe.ts","../../localization/src/phone-number/phone-number.service.ts","../../localization/src/phone-number/phone-number.pipe.ts","../../localization/src/kirbydesign-extensions-angular-localization.ts"],"sourcesContent":["export class DateFormats {\n static readonly SHORT_DATE_FORMAT = 'dd.MM.yyyy';\n static readonly MEDIUM_DATE_FORMAT = 'd. MMMM y';\n static readonly MEDIUM_LETTER_DATE_FORMAT = 'dd. MMM yyyy';\n static readonly SHORT_TIME_FORMAT = 'HH:mm';\n static readonly MEDIUM_TIME_FORMAT = 'HH:mm:ss';\n static readonly SHORT_DATE_MEDIUM_TIME_FORMAT = `${DateFormats.SHORT_DATE_FORMAT} ${DateFormats.MEDIUM_TIME_FORMAT}`;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const KIRBY_EXTENSIONS_LOCALIZATION_TOKEN =\n new InjectionToken<KirbyExtensionsLocalizationToken>('KIRBY_EXTENSIONS_LOCALIZATION_TOKEN');\n\nexport function provideKirbyExtensionsLocalizationToken(\n factory: () => KirbyExtensionsLocalizationToken\n) {\n return {\n provide: KIRBY_EXTENSIONS_LOCALIZATION_TOKEN,\n useFactory: factory,\n };\n}\n\ninterface KirbyExtensionsLocalizationToken {\n /**\n * @example 'DKK | kr. | EUR'\n */\n nativeCurrency: string;\n /**\n * Default language for the application. Used to determine if the phone number country code should be shown, if not specified as input, based on the locale.\n * @example 'da'\n */\n defaultLang: string;\n /**\n * Default phone country code\n * @example '+45'\n */\n countryCode: string;\n /**\n * Default timezone for the application\n * @example 'Europe/Copenhagen'\n */\n timeZone: string;\n}\n","import { inject, LOCALE_ID, PipeTransform } from '@angular/core';\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { DateFormats } from './date-formats';\n\n/**\n * Abstract implementation of pipe that should format dates, and compensate for time-zone offset.\n *\n * This class provides tools for formatting dates (and timestamps) in a time zone\n */\nexport abstract class AbstractTimezoneCompensatingPipe implements PipeTransform {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n abstract transform(value: unknown, ...args: unknown[]): unknown;\n\n protected format(time: number | Date | string, formatPattern: string): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const timeZone = this.config.timeZone;\n const options = this.getIntlOptions(formatPattern);\n\n const formatter = new Intl.DateTimeFormat(this.locale, { ...options, timeZone });\n let formattedDate = formatter.format(date);\n\n // Capitalize month abbreviation and remove trailing period for `MEDIUM_LETTER_DATE_FORMAT`\n if (formatPattern === DateFormats.MEDIUM_LETTER_DATE_FORMAT) {\n formattedDate = formattedDate.replace(\n /(\\d{2}\\.\\s)(\\w+)\\.(\\s\\d{4})/,\n (_, day, month, year) => {\n return `${day}${month.charAt(0).toUpperCase()}${month.slice(1)}${year}`;\n }\n );\n }\n\n if (\n formatPattern === DateFormats.SHORT_TIME_FORMAT ||\n formatPattern === DateFormats.MEDIUM_TIME_FORMAT\n ) {\n formattedDate = formattedDate.replace(/\\./g, ':');\n }\n\n return formattedDate;\n }\n\n private getIntlOptions(formatPattern: string): Intl.DateTimeFormatOptions {\n switch (formatPattern) {\n case DateFormats.SHORT_DATE_FORMAT:\n return { year: 'numeric', month: '2-digit', day: '2-digit' };\n\n case DateFormats.MEDIUM_DATE_FORMAT:\n return { year: 'numeric', month: 'long', day: 'numeric' };\n\n case DateFormats.MEDIUM_LETTER_DATE_FORMAT:\n return {\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n };\n\n case DateFormats.SHORT_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', hour12: false };\n\n case DateFormats.MEDIUM_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };\n\n case DateFormats.SHORT_DATE_MEDIUM_TIME_FORMAT:\n return {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n\n default:\n throw new Error(`Unsupported format pattern: ${formatPattern}`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp as a date.\n */\n@Pipe({\n name: 'dateOnly',\n standalone: true,\n})\nexport class DateOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string): string {\n return this.format(input, DateFormats.SHORT_DATE_FORMAT);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\nexport type TimeOnlyFormat = 'short' | 'medium';\n\n/**\n * Formats a given timestamp as a time.\n *\n * Timestamps can be formatted as 2 variants:\n * - 'short' being 'HH:mm' (hours and minutes)\n * - 'medium' being 'HH:mm:ss' (as above, but with seconds appended)\n *\n */\n@Pipe({\n name: 'timeOnly',\n standalone: true,\n})\nexport class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string, format: TimeOnlyFormat = 'short'): string {\n return this.format(input, this.getFormat(format));\n }\n\n private getFormat(format: TimeOnlyFormat): string {\n switch (format) {\n case 'short':\n return DateFormats.SHORT_TIME_FORMAT;\n case 'medium':\n return DateFormats.MEDIUM_TIME_FORMAT;\n default:\n throw new Error(`Unable to derive format from \"${format}\"`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp so that:\n * - If timestamp is of \"today\", it's formatted as time with hours and minutes (eg. 23:56)\n * - If timestamp is different from \"today\", it's formatted as date with \"day of month\", month and year (eg. 28.02.2020)\n *\n * All formatting and parsing is expect to be handled in \"Europe/Copenhagen\" time zone and with\n * the locale provided by `LOCALE_ID`.\n */\n\n@Pipe({\n name: 'timeOrDate',\n standalone: true,\n})\nexport class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(\n time: number | Date | string,\n showSeconds = false,\n formatMonth: 'month-as-digits' | 'month-as-letters' = 'month-as-digits'\n ): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const today = new Date();\n const sameDay =\n date.getFullYear() === today.getFullYear() &&\n date.getMonth() === today.getMonth() &&\n date.getDate() === today.getDate();\n\n let format = DateFormats.SHORT_DATE_FORMAT;\n\n if (formatMonth === 'month-as-letters') {\n format = DateFormats.MEDIUM_LETTER_DATE_FORMAT;\n }\n\n if (sameDay) {\n format = showSeconds ? DateFormats.MEDIUM_TIME_FORMAT : DateFormats.SHORT_TIME_FORMAT;\n }\n\n return this.format(date, format);\n }\n}\n","import { formatNumber } from '@angular/common';\nimport { Inject, Injectable, LOCALE_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormatNumberService {\n constructor(@Inject(LOCALE_ID) private localeId: string) {}\n\n public formatNumber(value: number, digitsInfo: string) {\n if (value == null) {\n return '';\n }\n\n return formatNumber(value, this.localeId, digitsInfo);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { FormatNumberService } from './format-number.service';\n\n@Pipe({\n name: 'formatNumber',\n standalone: true,\n})\nexport class FormatNumberPipe implements PipeTransform {\n constructor(private formatNumberService: FormatNumberService) {}\n\n transform(value: number, digitsInfo = '1.2-2') {\n return this.formatNumberService.formatNumber(value, digitsInfo);\n }\n}\n","import { formatNumber } from '@angular/common';\n\nimport { Amount } from './amount.model';\n\nexport function formatAmount(\n amount: Amount,\n locale: string,\n nativeCurrency: string,\n amountServiceConfiguration?: AmountServiceConfiguration\n) {\n const config = deriveConfiguration(amountServiceConfiguration);\n\n let formattedAmount = formatNumber(amount && amount.amount, locale, config.digitsInfo);\n\n if (config.stripSign) {\n formattedAmount = formattedAmount.replace('-', '').trim();\n }\n\n const currencyCodeToAppend = deriveCurrencyCode(config, amount, nativeCurrency);\n\n if (!currencyCodeToAppend) {\n return formattedAmount;\n }\n if (config.currencyCodePosition === 'postfix') {\n return formattedAmount + ' ' + currencyCodeToAppend;\n } else {\n return currencyCodeToAppend + ' ' + formattedAmount;\n }\n}\n\nexport function deriveCurrencyCode(\n config: AmountServiceConfiguration,\n amount: Amount,\n nativeCurrency: string\n) {\n let currencyCodeToAppend;\n\n if (config.showCurrencyCode) {\n if (config.showCurrencyCode === 'alwaysShowCurrency') {\n currencyCodeToAppend = amount && amount.currencyCode;\n } else if (config.showCurrencyCode === 'showForeignCurrency') {\n currencyCodeToAppend =\n amount && amount.currencyCode !== nativeCurrency ? amount.currencyCode : '';\n }\n }\n\n return currencyCodeToAppend || '';\n}\n\nexport function deriveConfiguration(configuration: AmountServiceConfiguration = {}) {\n const config: AmountServiceConfiguration = {\n showCurrencyCode: '',\n digitsInfo: '1.2-2',\n stripSign: false,\n };\n\n return Object.assign({}, config, configuration);\n}\n\nexport type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency';\nexport type CurrencyCodePosition = '' | 'prefix' | 'postfix';\n\nexport interface AmountServiceConfiguration {\n /**\n * - '' - don't output CurrencyCode\n * - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency\n * - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency\n */\n showCurrencyCode?: ShowCurrencyCode;\n /**\n * The position of the currency code in the formatted amount\n * - 'postfix' - output CurrencyCode after the formatted amount, eg. 1.234,56 EUR\n * - 'prefix' - output CurrencyCode before the formatted amount, eg. DKK 1.234,56\n */\n currencyCodePosition?: CurrencyCodePosition;\n /**\n * A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n */\n digitsInfo?: string;\n /**\n * Remove the minus sign from the formatted amount and trim any leading or trailing whitespace.\n */\n stripSign?: boolean;\n /**\n * The string to return if the amount is empty\n */\n returnValueOnEmptyAmount?: string;\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { Amount } from './amount.model';\nimport {\n AmountServiceConfiguration,\n deriveConfiguration,\n formatAmount,\n} from './amount-service-formatter';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AmountService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration}\n *\n * The number is always formatted according to Angular LOCALE_ID\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n\n formatAmount(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n if (amount == undefined) {\n const config = deriveConfiguration(amountServiceConfiguration);\n if (config.returnValueOnEmptyAmount) {\n return config.returnValueOnEmptyAmount;\n }\n amount = {\n amount: 0.0,\n currencyCode: '',\n };\n }\n\n return formatAmount(\n amount,\n this.locale,\n this.config.nativeCurrency,\n amountServiceConfiguration\n );\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Amount } from './amount.model';\nimport { AmountService } from './amount.service';\nimport { AmountServiceConfiguration } from './amount-service-formatter';\n\n/**\n * Configuration object for the amount-pipe. The configuration object can be used to control\n * the formatting of the amount, and can be passed as an argument to the amount-pipe when used on an {@link Amount}.\n * - `showCurrencyCode`: Controls whether the currency code should be displayed or not.\n * - `''`: Don't output currency code\n * - `alwaysShowCurrency`: Always show currency code, regardless of presentation currency\n * - `showForeignCurrency`: Only show currency code if it differs from the presentation currency\n * - `digitsInfo`: A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n * - `stripSign`: Controls whether the minus sign should be stripped from a negative amount.\n * - `currencyCodePosition`: Controls the position of the currency code in the formatted amount.\n * - `postfix`: Output currency code after the formatted amount, e.g. 1.234,56 EUR\n * - `prefix`: Output currency code before the formatted amount, e.g. DKK 1.234,56\n */\n@Pipe({\n name: 'amount',\n standalone: true,\n})\nexport class AmountPipe implements PipeTransform {\n constructor(private amountService: AmountService) {}\n\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration} (or a number of arguments, for backwards compatibility).\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n transform(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n return this.amountService.formatAmount(amount, amountServiceConfiguration);\n }\n}\n","import { AccountNumber } from './account-number.model';\n\nexport function formatAccountNumber(value: AccountNumber): string {\n return `${value.regNo.padStart(4, '0')} ${value.accountNo.replace(/^0+/, '')}`;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AccountNumber } from './account-number.model';\nimport { formatAccountNumber } from './account-number-service-formatter';\n\n/**\n * Pipe that formats a {@link AccountNumber}-object to a common format.\n */\n@Pipe({\n name: 'accountNumber',\n standalone: true,\n})\nexport class AccountNumberPipe implements PipeTransform {\n /**\n * Formats the {@link AccountNumber} to a common format.\n *\n * @param value the {@link AccountNumber} to format\n */\n transform(value: AccountNumber): string | undefined {\n return formatAccountNumber(value);\n }\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { PhoneNumber } from './phone-number';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhoneNumberService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n private static chunkUpPhoneNumber(str: string, chunk: number): string {\n return str.match(new RegExp(`.{1,${chunk}}`, 'g'))?.join(' ') ?? '';\n }\n\n formatPhoneNumber(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n const countryCode =\n typeof phoneNumber === 'string' ? this.config.countryCode : phoneNumber.countryCode;\n const number = typeof phoneNumber === 'string' ? phoneNumber : phoneNumber.number;\n\n if (!/^\\d+$/.test(number)) {\n return;\n }\n\n if (showCountryCode === undefined) {\n showCountryCode = !this.locale.match(`${this.config.defaultLang}.*`);\n }\n\n const formattedNumber = PhoneNumberService.chunkUpPhoneNumber(number, chunk);\n\n if (showCountryCode) {\n return `${countryCode} ${formattedNumber}`;\n } else {\n return formattedNumber;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { PhoneNumber } from './phone-number';\nimport { PhoneNumberService } from './phone-number.service';\n\n@Pipe({\n name: 'phoneNumber',\n standalone: true,\n})\nexport class PhoneNumberPipe implements PipeTransform {\n constructor(private phoneNumberService: PhoneNumberService) {}\n\n /**\n * Transforms a phone number, chunked up with spaces between the chunks and the country code in front, if desired.\n *\n * @param phoneNumber A PhoneNumber or a string representation of a phone number\n * @param chunk The chunk size used to split up the phone number with spaces\n * @param showCountryCode Show the country code in front of the phone number. If a string representation is supplied, the KIRBY_EXTENSIONS_LOCALIZATION_TOKEN.countryCode is used.\n */\n transform(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n return this.phoneNumberService.formatPhoneNumber(phoneNumber, chunk, showCountryCode);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FormatNumberService","i1.AmountService","i1.PhoneNumberService"],"mappings":";;;;MAAa,WAAW,CAAA;aACN,IAAiB,CAAA,iBAAA,GAAG,YAAY,CAAC;aACjC,IAAkB,CAAA,kBAAA,GAAG,WAAW,CAAC;aACjC,IAAyB,CAAA,yBAAA,GAAG,cAAc,CAAC;aAC3C,IAAiB,CAAA,iBAAA,GAAG,OAAO,CAAC;aAC5B,IAAkB,CAAA,kBAAA,GAAG,UAAU,CAAC;aAChC,IAA6B,CAAA,6BAAA,GAAG,CAAG,EAAA,WAAW,CAAC,iBAAiB,IAAI,WAAW,CAAC,kBAAkB,CAAA,CAAE,CAAC;;;MCJ1G,mCAAmC,GAC9C,IAAI,cAAc,CAAmC,qCAAqC;AAEtF,SAAU,uCAAuC,CACrD,OAA+C,EAAA;IAE/C,OAAO;AACL,QAAA,OAAO,EAAE,mCAAmC;AAC5C,QAAA,UAAU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IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -19,10 +19,10 @@ class SkeletonLoaderComponent {
|
|
|
19
19
|
get _cssClass() {
|
|
20
20
|
return [this.theme, this.shape].filter((cssClass) => !!cssClass);
|
|
21
21
|
}
|
|
22
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SkeletonLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: SkeletonLoaderComponent, isStandalone: true, selector: "kirby-x-skeleton-loader", inputs: { theme: "theme", shape: "shape" }, host: { properties: { "class": "this._cssClass" } }, ngImport: i0, template: "<ion-skeleton-text animated=\"true\"></ion-skeleton-text>\n", styles: [":host{overflow:hidden;display:flex;justify-content:center;align-items:center;height:var(--kirby-font-size-n)}:host.rectangle{border-radius:var(--kirby-border-radius-xs)}:host.circle{border-radius:var(--kirby-border-radius-circle)}:host.pill{border-radius:var(--kirby-border-radius-pill)}:host.dark ion-skeleton-text{background-image:linear-gradient(to right,#ffffff29,#ffffff47,#ffffff29 50%)}:host.light ion-skeleton-text{background-image:linear-gradient(to right,#2828280f,#2828281f,#2828280f 50%)}:host-context(.kirby-color-brightness-white) ion-skeleton-text,:host-context(.kirby-color-brightness-light) ion-skeleton-text{background-image:linear-gradient(to right,#2828280f,#2828281f,#2828280f 50%)}:host-context(.kirby-color-brightness-dark) ion-skeleton-text{background-image:linear-gradient(to right,#ffffff29,#ffffff47,#ffffff29 50%)}ion-skeleton-text{position:relative;margin:0;animation-duration:1.5s;background-clip:border-box}\n"], dependencies: [{ kind: "ngmodule", type: CardModule }, { kind: "ngmodule", type: IconModule }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSkeletonText, selector: "ion-skeleton-text", inputs: ["animated"] }] }); }
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SkeletonLoaderComponent, decorators: [{
|
|
26
26
|
type: Component,
|
|
27
27
|
args: [{ selector: 'kirby-x-skeleton-loader', standalone: true, imports: [CardModule, IconModule, CommonModule, IonSkeletonText], template: "<ion-skeleton-text animated=\"true\"></ion-skeleton-text>\n", styles: [":host{overflow:hidden;display:flex;justify-content:center;align-items:center;height:var(--kirby-font-size-n)}:host.rectangle{border-radius:var(--kirby-border-radius-xs)}:host.circle{border-radius:var(--kirby-border-radius-circle)}:host.pill{border-radius:var(--kirby-border-radius-pill)}:host.dark ion-skeleton-text{background-image:linear-gradient(to right,#ffffff29,#ffffff47,#ffffff29 50%)}:host.light ion-skeleton-text{background-image:linear-gradient(to right,#2828280f,#2828281f,#2828280f 50%)}:host-context(.kirby-color-brightness-white) ion-skeleton-text,:host-context(.kirby-color-brightness-light) ion-skeleton-text{background-image:linear-gradient(to right,#2828280f,#2828281f,#2828280f 50%)}:host-context(.kirby-color-brightness-dark) ion-skeleton-text{background-image:linear-gradient(to right,#ffffff29,#ffffff47,#ffffff29 50%)}ion-skeleton-text{position:relative;margin:0;animation-duration:1.5s;background-clip:border-box}\n"] }]
|
|
28
28
|
}], propDecorators: { theme: [{
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* @Description Temporary directive to ensure correct scroll position behavior on Safari.
|
|
5
|
+
*
|
|
6
|
+
* When navigating between stacked pages, scroll position is not correctly restored on Safari,
|
|
7
|
+
* when the nested kirby-card element uses containment and the host element does not have an explicit height.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ImageBannerHeightDirective implements OnInit, OnDestroy {
|
|
10
|
+
private currentHeight;
|
|
11
|
+
private host;
|
|
12
|
+
private resizeObserverService;
|
|
13
|
+
private renderer;
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
private setCardHeightOnHost;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ImageBannerHeightDirective, never>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ImageBannerHeightDirective, "[kirbyImageBannerResize]", never, {}, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import { TranslationService } from '@kirbydesign/designsystem/shared';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./image-banner-height.directive";
|
|
4
5
|
export declare class ImageBannerComponent {
|
|
5
6
|
translations: TranslationService;
|
|
6
7
|
/**
|
|
@@ -35,9 +36,14 @@ export declare class ImageBannerComponent {
|
|
|
35
36
|
* If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.
|
|
36
37
|
*/
|
|
37
38
|
dismissClick: EventEmitter<Event>;
|
|
39
|
+
/**
|
|
40
|
+
* If the input imagePath results in an error, it will be reflected in this output.
|
|
41
|
+
*/
|
|
42
|
+
imageError: EventEmitter<ErrorEvent>;
|
|
38
43
|
constructor(translations: TranslationService);
|
|
39
44
|
bannerClicked(event: Event): void;
|
|
40
45
|
dismissClicked(event: Event): void;
|
|
46
|
+
onImageError($event: ErrorEvent): void;
|
|
41
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<ImageBannerComponent, never>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ImageBannerComponent, "kirby-x-image-banner", never, { "title": { "alias": "title"; "required": false; }; "imagePath": { "alias": "imagePath"; "required": false; }; "bodyText": { "alias": "bodyText"; "required": false; }; "actionButtonText": { "alias": "actionButtonText"; "required": false; }; "externalLink": { "alias": "externalLink"; "required": false; }; "backgroundBlur": { "alias": "backgroundBlur"; "required": false; }; }, { "bannerClick": "bannerClick"; "dismissClick": "dismissClick"; }, never, ["[title]", "[bodyText]"], true,
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ImageBannerComponent, "kirby-x-image-banner", never, { "title": { "alias": "title"; "required": false; }; "imagePath": { "alias": "imagePath"; "required": false; }; "bodyText": { "alias": "bodyText"; "required": false; }; "actionButtonText": { "alias": "actionButtonText"; "required": false; }; "externalLink": { "alias": "externalLink"; "required": false; }; "backgroundBlur": { "alias": "backgroundBlur"; "required": false; }; }, { "bannerClick": "bannerClick"; "dismissClick": "dismissClick"; "imageError": "imageError"; }, never, ["[title]", "[bodyText]"], true, [{ directive: typeof i1.ImageBannerHeightDirective; inputs: {}; outputs: {}; }]>;
|
|
43
49
|
}
|
package/image-banner/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Amount } from './amount.model';
|
|
2
|
-
export declare function formatAmount(amount: Amount,
|
|
2
|
+
export declare function formatAmount(amount: Amount, locale: string, nativeCurrency: string, amountServiceConfiguration?: AmountServiceConfiguration): string;
|
|
3
3
|
export declare function deriveCurrencyCode(config: AmountServiceConfiguration, amount: Amount, nativeCurrency: string): string;
|
|
4
|
-
export declare function deriveConfiguration(configuration
|
|
4
|
+
export declare function deriveConfiguration(configuration?: AmountServiceConfiguration): AmountServiceConfiguration;
|
|
5
5
|
export type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency';
|
|
6
6
|
export type CurrencyCodePosition = '' | 'prefix' | 'postfix';
|
|
7
7
|
export interface AmountServiceConfiguration {
|
|
@@ -10,7 +10,7 @@ export interface AmountServiceConfiguration {
|
|
|
10
10
|
* - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency
|
|
11
11
|
* - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency
|
|
12
12
|
*/
|
|
13
|
-
showCurrencyCode
|
|
13
|
+
showCurrencyCode?: ShowCurrencyCode;
|
|
14
14
|
/**
|
|
15
15
|
* The position of the currency code in the formatted amount
|
|
16
16
|
* - 'postfix' - output CurrencyCode after the formatted amount, eg. 1.234,56 EUR
|
|
@@ -25,7 +25,7 @@ export declare class AmountPipe implements PipeTransform {
|
|
|
25
25
|
* @param amount the {@link Amount} to configure
|
|
26
26
|
* @param amountServiceConfiguration
|
|
27
27
|
*/
|
|
28
|
-
transform(amount: Amount, amountServiceConfiguration
|
|
28
|
+
transform(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration): string;
|
|
29
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<AmountPipe, never>;
|
|
30
30
|
static ɵpipe: i0.ɵɵPipeDeclaration<AmountPipe, "amount", true>;
|
|
31
31
|
}
|
|
@@ -12,7 +12,7 @@ export declare class AmountService {
|
|
|
12
12
|
* @param amount the {@link Amount} to configure
|
|
13
13
|
* @param amountServiceConfiguration
|
|
14
14
|
*/
|
|
15
|
-
formatAmount(amount: Amount, amountServiceConfiguration
|
|
15
|
+
formatAmount(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration): string;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<AmountService, never>;
|
|
17
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<AmountService>;
|
|
18
18
|
}
|
|
@@ -8,6 +8,6 @@ export declare abstract class AbstractTimezoneCompensatingPipe implements PipeTr
|
|
|
8
8
|
private config;
|
|
9
9
|
private locale;
|
|
10
10
|
abstract transform(value: unknown, ...args: unknown[]): unknown;
|
|
11
|
-
protected format(time: number | Date, formatPattern: string): string;
|
|
11
|
+
protected format(time: number | Date | string, formatPattern: string): string;
|
|
12
12
|
private getIntlOptions;
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
* Formats a given timestamp as a date.
|
|
6
6
|
*/
|
|
7
7
|
export declare class DateOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {
|
|
8
|
-
transform(input: number | Date): string;
|
|
8
|
+
transform(input: number | Date | string): string;
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateOnlyPipe, never>;
|
|
10
10
|
static ɵpipe: i0.ɵɵPipeDeclaration<DateOnlyPipe, "dateOnly", true>;
|
|
11
11
|
}
|
|
@@ -11,7 +11,7 @@ export type TimeOnlyFormat = 'short' | 'medium';
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
export declare class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {
|
|
14
|
-
transform(input: number | Date, format?: TimeOnlyFormat): string;
|
|
14
|
+
transform(input: number | Date | string, format?: TimeOnlyFormat): string;
|
|
15
15
|
private getFormat;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<TimeOnlyPipe, never>;
|
|
17
17
|
static ɵpipe: i0.ɵɵPipeDeclaration<TimeOnlyPipe, "timeOnly", true>;
|
|
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
|
|
|
10
10
|
* the locale provided by `LOCALE_ID`.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {
|
|
13
|
-
transform(time: number | Date, showSeconds?: boolean, formatMonth?: 'month-as-digits' | 'month-as-letters'): string;
|
|
13
|
+
transform(time: number | Date | string, showSeconds?: boolean, formatMonth?: 'month-as-digits' | 'month-as-letters'): string;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<TimeOrDatePipe, never>;
|
|
15
15
|
static ɵpipe: i0.ɵɵPipeDeclaration<TimeOrDatePipe, "timeOrDate", true>;
|
|
16
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirbydesign/extensions-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^18.0.0 || ^19.0.0",
|
|
6
6
|
"@angular/compiler": "^18.0.0 || ^19.0.0",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"types": "./index.d.ts",
|
|
28
28
|
"default": "./fesm2022/kirbydesign-extensions-angular.mjs"
|
|
29
29
|
},
|
|
30
|
-
"./image-banner": {
|
|
31
|
-
"types": "./image-banner/index.d.ts",
|
|
32
|
-
"default": "./fesm2022/kirbydesign-extensions-angular-image-banner.mjs"
|
|
33
|
-
},
|
|
34
30
|
"./localization": {
|
|
35
31
|
"types": "./localization/index.d.ts",
|
|
36
32
|
"default": "./fesm2022/kirbydesign-extensions-angular-localization.mjs"
|
|
37
33
|
},
|
|
34
|
+
"./image-banner": {
|
|
35
|
+
"types": "./image-banner/index.d.ts",
|
|
36
|
+
"default": "./fesm2022/kirbydesign-extensions-angular-image-banner.mjs"
|
|
37
|
+
},
|
|
38
38
|
"./skeleton-loader": {
|
|
39
39
|
"types": "./skeleton-loader/index.d.ts",
|
|
40
40
|
"default": "./fesm2022/kirbydesign-extensions-angular-skeleton-loader.mjs"
|