@ng-vagabond-lab/ng-dsv 0.2.34 → 0.2.35
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/ng-vagabond-lab-ng-dsv-ds-chip.mjs +2 -2
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-item.mjs +2 -2
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-item.mjs.map +1 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-modal.mjs +4 -4
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-modal.mjs.map +1 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs +62 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs +52 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs +65 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs +113 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news.mjs +31 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-notification.mjs +177 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-notification.mjs.map +1 -0
- package/package.json +9 -1
- package/types/ng-vagabond-lab-ng-dsv-module-news.d.ts +5 -0
- package/types/ng-vagabond-lab-ng-dsv-module-notification.d.ts +79 -0
|
@@ -24,13 +24,13 @@ class DsvChipComponent extends DsvBaseColorComponent {
|
|
|
24
24
|
this.delete.emit();
|
|
25
25
|
}
|
|
26
26
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvChipComponent, isStandalone: true, selector: "dsv-chip", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { delete: "delete" }, host: { properties: { "class": "classes()" } }, usesInheritance: true, ngImport: i0, template: "<span>\n {{ text() | translate }}\n <ng-content />\n</span>\n@if (isDelete()) {\n <dsv-button icon=\"ri-delete-bin-line\" variant=\"text\" color=\"inherit\" (callback)=\"doDelete()\" />\n}\n", styles: [":host{-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;padding:6px 15px;border-radius:15px;font-size:1rem;font-weight:
|
|
27
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvChipComponent, isStandalone: true, selector: "dsv-chip", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { delete: "delete" }, host: { properties: { "class": "classes()" } }, usesInheritance: true, ngImport: i0, template: "<span>\n {{ text() | translate }}\n <ng-content />\n</span>\n@if (isDelete()) {\n <dsv-button icon=\"ri-delete-bin-line\" variant=\"text\" color=\"inherit\" (callback)=\"doDelete()\" />\n}\n", styles: [":host{-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;padding:6px 15px;border-radius:15px;font-size:1rem;font-weight:600}:host.with-delete{padding:0 5px 0 20px}:host:empty{display:none}\n"], dependencies: [{ kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
28
28
|
}
|
|
29
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvChipComponent, decorators: [{
|
|
30
30
|
type: Component,
|
|
31
31
|
args: [{ selector: 'dsv-chip', imports: [DsvButtonComponent, TranslatePipe], host: {
|
|
32
32
|
'[class]': 'classes()',
|
|
33
|
-
}, template: "<span>\n {{ text() | translate }}\n <ng-content />\n</span>\n@if (isDelete()) {\n <dsv-button icon=\"ri-delete-bin-line\" variant=\"text\" color=\"inherit\" (callback)=\"doDelete()\" />\n}\n", styles: [":host{-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;padding:6px 15px;border-radius:15px;font-size:1rem;font-weight:
|
|
33
|
+
}, template: "<span>\n {{ text() | translate }}\n <ng-content />\n</span>\n@if (isDelete()) {\n <dsv-button icon=\"ri-delete-bin-line\" variant=\"text\" color=\"inherit\" (callback)=\"doDelete()\" />\n}\n", styles: [":host{-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;padding:6px 15px;border-radius:15px;font-size:1rem;font-weight:600}:host.with-delete{padding:0 5px 0 20px}:host:empty{display:none}\n"] }]
|
|
34
34
|
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], delete: [{ type: i0.Output, args: ["delete"] }] } });
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -34,11 +34,11 @@ class DsvItemComponent {
|
|
|
34
34
|
this.isCallback() && this.callback.emit();
|
|
35
35
|
}
|
|
36
36
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvItemComponent, isStandalone: true, selector: "dsv-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, nb: { classPropertyName: "nb", publicName: "nb", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, small: { classPropertyName: "small", publicName: "small", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "callback" }, ngImport: i0, template: "<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n", styles: [":host{--a-margin: 5px 10px;--a-padding: 10px;--a-color: inherit;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}:host a{margin:var(--a-margin);padding:var(--a-padding);color:var(--a-color);display:flex;justify-content:space-between;cursor:pointer}:host a span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host a dsv-chip{font-size:.8rem;padding:3px 7px;min-width:10px}:host a:hover{background-color:#d9d9d9}:host i{margin-right:10px}:host .text{font-size:1rem;font-weight:700}:host .text.small{margin-left:20px}:host.active .small{--a-color: #6e6e6e}:host:not(.active) .small{--a-color: #aeaeae}:host-context(body.dark) a:hover{background-color:#313131!important}:host-context(body.dark) a dsv-chip{color:var(--text)!important}:host-context(body.dark).active .small{--a-color: #aeaeae}:host-context(body.dark):not(.active) .small{--a-color: #6e6e6e}\n"], dependencies: [{ kind: "component", type: DsvChipComponent, selector: "dsv-chip", inputs: ["text"], outputs: ["delete"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvItemComponent, isStandalone: true, selector: "dsv-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, nb: { classPropertyName: "nb", publicName: "nb", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, small: { classPropertyName: "small", publicName: "small", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "callback" }, ngImport: i0, template: "<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n", styles: [":host{--a-margin: 5px 10px;--a-padding: 10px;--a-color: inherit;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}:host a{margin:var(--a-margin);padding:var(--a-padding);color:var(--a-color);display:flex;justify-content:space-between;cursor:pointer}:host a span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host a dsv-chip{font-size:.8rem;padding:3px 7px;min-width:10px}:host a:hover{background-color:#d9d9d9}:host i{margin-right:10px}:host .text{font-size:1rem;font-weight:700}:host .text.small{margin-left:20px}:host.active .small{--a-color: #6e6e6e}:host:not(.active) .small{--a-color: #aeaeae}:host:not(.active) .small dsv-chip{opacity:.5}:host-context(body.dark) a:hover{background-color:#313131!important}:host-context(body.dark) a dsv-chip{color:var(--button-text)!important}:host-context(body.dark).active .small{--a-color: #aeaeae}:host-context(body.dark):not(.active) .small{--a-color: #6e6e6e}\n"], dependencies: [{ kind: "component", type: DsvChipComponent, selector: "dsv-chip", inputs: ["text"], outputs: ["delete"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
38
38
|
}
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvItemComponent, decorators: [{
|
|
40
40
|
type: Component,
|
|
41
|
-
args: [{ selector: 'dsv-item', imports: [DsvChipComponent, TranslatePipe], template: "<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n", styles: [":host{--a-margin: 5px 10px;--a-padding: 10px;--a-color: inherit;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}:host a{margin:var(--a-margin);padding:var(--a-padding);color:var(--a-color);display:flex;justify-content:space-between;cursor:pointer}:host a span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host a dsv-chip{font-size:.8rem;padding:3px 7px;min-width:10px}:host a:hover{background-color:#d9d9d9}:host i{margin-right:10px}:host .text{font-size:1rem;font-weight:700}:host .text.small{margin-left:20px}:host.active .small{--a-color: #6e6e6e}:host:not(.active) .small{--a-color: #aeaeae}:host-context(body.dark) a:hover{background-color:#313131!important}:host-context(body.dark) a dsv-chip{color:var(--text)!important}:host-context(body.dark).active .small{--a-color: #aeaeae}:host-context(body.dark):not(.active) .small{--a-color: #6e6e6e}\n"] }]
|
|
41
|
+
args: [{ selector: 'dsv-item', imports: [DsvChipComponent, TranslatePipe], template: "<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n", styles: [":host{--a-margin: 5px 10px;--a-padding: 10px;--a-color: inherit;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}:host a{margin:var(--a-margin);padding:var(--a-padding);color:var(--a-color);display:flex;justify-content:space-between;cursor:pointer}:host a span{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host a dsv-chip{font-size:.8rem;padding:3px 7px;min-width:10px}:host a:hover{background-color:#d9d9d9}:host i{margin-right:10px}:host .text{font-size:1rem;font-weight:700}:host .text.small{margin-left:20px}:host.active .small{--a-color: #6e6e6e}:host:not(.active) .small{--a-color: #aeaeae}:host:not(.active) .small dsv-chip{opacity:.5}:host-context(body.dark) a:hover{background-color:#313131!important}:host-context(body.dark) a dsv-chip{color:var(--button-text)!important}:host-context(body.dark).active .small{--a-color: #aeaeae}:host-context(body.dark):not(.active) .small{--a-color: #6e6e6e}\n"] }]
|
|
42
42
|
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], nb: [{ type: i0.Input, args: [{ isSignal: true, alias: "nb", required: false }] }], url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }], small: [{ type: i0.Input, args: [{ isSignal: true, alias: "small", required: false }] }], callback: [{ type: i0.Output, args: ["callback"] }] } });
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-vagabond-lab-ng-dsv-ds-item.mjs","sources":["../../../projects/ng-dsv/ds/item/component/item.component.ts","../../../projects/ng-dsv/ds/item/component/item.component.html","../../../projects/ng-dsv/ds/item/ng-vagabond-lab-ng-dsv-ds-item.ts"],"sourcesContent":["import { Component, effect, inject, input, output, signal } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { isCallback } from '@ng-vagabond-lab/ng-dsv/base';\nimport { DsvChipComponent } from '@ng-vagabond-lab/ng-dsv/ds/chip';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n@Component({\n selector: 'dsv-item',\n imports: [DsvChipComponent, TranslatePipe],\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n})\nexport class DsvItemComponent {\n readonly router = inject(Router);\n\n readonly icon = input<string>('');\n readonly text = input<string>('');\n readonly nb = input<number>(-1);\n readonly url = input<string>();\n readonly small = input<boolean>(false);\n\n readonly callback = output<void>();\n\n readonly isCallback = signal<boolean>(false);\n\n constructor() {\n effect(() => {\n this.isCallback.set(isCallback(this.callback));\n });\n }\n\n doClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n if (this.url()) {\n this.router.navigate([this.url()]);\n }\n this.isCallback() && this.callback.emit();\n }\n}\n","<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAYa,gBAAgB,CAAA;AAChB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAEvB,IAAI,GAAG,KAAK,CAAS,EAAE;6EAAC;IACxB,IAAI,GAAG,KAAK,CAAS,EAAE;6EAAC;AACxB,IAAA,EAAE,GAAG,KAAK,CAAS,CAAC,CAAC;2EAAC;AACtB,IAAA,GAAG,GAAG,KAAK;uFAAU;IACrB,KAAK,GAAG,KAAK,CAAU,KAAK;8EAAC;IAE7B,QAAQ,GAAG,MAAM,EAAQ;IAEzB,UAAU,GAAG,MAAM,CAAU,KAAK;mFAAC;AAE5C,IAAA,WAAA,GAAA;QACI,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAClD,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,OAAO,CAAC,KAAY,EAAA;QAChB,KAAK,C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AAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECZ7B,uXAYA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-ds-item.mjs","sources":["../../../projects/ng-dsv/ds/item/component/item.component.ts","../../../projects/ng-dsv/ds/item/component/item.component.html","../../../projects/ng-dsv/ds/item/ng-vagabond-lab-ng-dsv-ds-item.ts"],"sourcesContent":["import { Component, effect, inject, input, output, signal } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { isCallback } from '@ng-vagabond-lab/ng-dsv/base';\nimport { DsvChipComponent } from '@ng-vagabond-lab/ng-dsv/ds/chip';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n@Component({\n selector: 'dsv-item',\n imports: [DsvChipComponent, TranslatePipe],\n templateUrl: './item.component.html',\n styleUrls: ['./item.component.scss'],\n})\nexport class DsvItemComponent {\n readonly router = inject(Router);\n\n readonly icon = input<string>('');\n readonly text = input<string>('');\n readonly nb = input<number>(-1);\n readonly url = input<string>();\n readonly small = input<boolean>(false);\n\n readonly callback = output<void>();\n\n readonly isCallback = signal<boolean>(false);\n\n constructor() {\n effect(() => {\n this.isCallback.set(isCallback(this.callback));\n });\n }\n\n doClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n if (this.url()) {\n this.router.navigate([this.url()]);\n }\n this.isCallback() && this.callback.emit();\n }\n}\n","<a [href]=\"this.url() ?? '#'\" class=\"text\" (click)=\"doClick($event)\" [class.small]=\"small()\">\n <span>\n @if (icon()) {\n <i class=\"ri-{{ icon() }}-line\"></i>\n }\n {{ text() | translate }}\n </span>\n @if (nb() >= 0) {\n <dsv-chip color=\"secondary\">{{ nb() }}</dsv-chip>\n }\n</a>\n<ng-content></ng-content>\n","/**\n * Generated bundle index. Do not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;"}
|
|
@@ -60,13 +60,13 @@ class DsvModalComponent {
|
|
|
60
60
|
this.modalService.close(this.id());
|
|
61
61
|
}
|
|
62
62
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
63
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: DsvModalComponent, isStandalone: true, selector: "dsv-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, titleText: { classPropertyName: "titleText", publicName: "titleText", isSignal: true, isRequired: true, transformFunction: null }, canEchap: { classPropertyName: "canEchap", publicName: "canEchap", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, ngImport: i0, template: "<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{--modal-top: 35%;--modal-left: 25%;--modal-width: 50%;--modal-height: auto;--modal-min-height: 150px;--modal-max-height: 50vh;--modal-overlay-z-index: 100;--modal-z-index: 101;--modal-content-padding: 25px 10px 20px;--modal-overflow: auto;position:absolute}:host .modal-overlay{position:fixed;z-index:-1;opacity:0;background-color:oklab(0% none none / .8);width:100%;height:100%;top:0;right:0}:host .modal-overlay.open{z-index:var(--modal-overlay-z-index);opacity:1}:host .modal{position:fixed;z-index:-1;opacity:0;top:var(--modal-top);left:var(--modal-left);width:var(--modal-width);height:var(--modal-height);min-height:var(--modal-min-height);background:var(--background);display:flex;flex-direction:column}:host .modal.open{z-index:var(--modal-z-index);opacity:1}:host .modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px;background:var(--background-header);border-bottom:1px outset var(--border)}:host .modal .modal-content{flex:1;overflow:var(--modal-overflow);scrollbar-width:thin;padding:var(--modal-content-padding);background:var(--background-card);max-height:var(--modal-max-height);position:relative}:host .modal .modal-footer-wrapper:not(:empty){padding:10px;background:var(--background-card)}@media screen and (min-width:1000px){:host{--modal-left: calc(25% + 120px) !important}}@media screen and (max-width:750px){:host{--modal-width: calc(100% - 16px) !important;--modal-left: 8px !important}}\n"], dependencies: [{ kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }] });
|
|
63
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: DsvModalComponent, isStandalone: true, selector: "dsv-modal", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, titleText: { classPropertyName: "titleText", publicName: "titleText", isSignal: true, isRequired: true, transformFunction: null }, canEchap: { classPropertyName: "canEchap", publicName: "canEchap", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, ngImport: i0, template: "<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{--modal-top: 35%;--modal-left: 25%;--modal-width: 50%;--modal-height: auto;--modal-min-height: 150px;--modal-max-height: 50vh;--modal-overlay-z-index: 100;--modal-z-index: 101;--modal-content-padding: 25px 10px 20px;--modal-overflow: auto;position:absolute}:host .modal-overlay{position:fixed;z-index:-1;opacity:0;background-color:oklab(0% none none / .8);width:100%;height:100%;top:0;right:0}:host .modal-overlay.open{z-index:var(--modal-overlay-z-index);opacity:1}:host .modal{position:fixed;z-index:-1;opacity:0;top:var(--modal-top);left:var(--modal-left);width:var(--modal-width);height:var(--modal-height);min-height:var(--modal-min-height);background:var(--background);display:flex;flex-direction:column}:host .modal.open{z-index:var(--modal-z-index);opacity:1}:host .modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px;background:var(--background-header);border-bottom:1px outset var(--border)}:host .modal .modal-header b{font-size:1.15rem}:host .modal .modal-content{flex:1;overflow:var(--modal-overflow);scrollbar-width:thin;padding:var(--modal-content-padding);background:var(--background-card);max-height:var(--modal-max-height);position:relative}:host .modal .modal-footer-wrapper:not(:empty){padding:10px;background:var(--background-card)}@media screen and (min-width:1000px){:host{--modal-left: calc(25% + 120px) !important}}@media screen and (max-width:750px){:host{--modal-width: calc(100% - 16px) !important;--modal-left: 8px !important}}\n"], dependencies: [{ kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }] });
|
|
64
64
|
}
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvModalComponent, decorators: [{
|
|
66
66
|
type: Component,
|
|
67
67
|
args: [{ selector: 'dsv-modal', imports: [DsvButtonComponent], host: {
|
|
68
68
|
'(document:keydown.escape)': 'onEscapeKey()',
|
|
69
|
-
}, template: "<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{--modal-top: 35%;--modal-left: 25%;--modal-width: 50%;--modal-height: auto;--modal-min-height: 150px;--modal-max-height: 50vh;--modal-overlay-z-index: 100;--modal-z-index: 101;--modal-content-padding: 25px 10px 20px;--modal-overflow: auto;position:absolute}:host .modal-overlay{position:fixed;z-index:-1;opacity:0;background-color:oklab(0% none none / .8);width:100%;height:100%;top:0;right:0}:host .modal-overlay.open{z-index:var(--modal-overlay-z-index);opacity:1}:host .modal{position:fixed;z-index:-1;opacity:0;top:var(--modal-top);left:var(--modal-left);width:var(--modal-width);height:var(--modal-height);min-height:var(--modal-min-height);background:var(--background);display:flex;flex-direction:column}:host .modal.open{z-index:var(--modal-z-index);opacity:1}:host .modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px;background:var(--background-header);border-bottom:1px outset var(--border)}:host .modal .modal-content{flex:1;overflow:var(--modal-overflow);scrollbar-width:thin;padding:var(--modal-content-padding);background:var(--background-card);max-height:var(--modal-max-height);position:relative}:host .modal .modal-footer-wrapper:not(:empty){padding:10px;background:var(--background-card)}@media screen and (min-width:1000px){:host{--modal-left: calc(25% + 120px) !important}}@media screen and (max-width:750px){:host{--modal-width: calc(100% - 16px) !important;--modal-left: 8px !important}}\n"] }]
|
|
69
|
+
}, template: "<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n", styles: [":host{--modal-top: 35%;--modal-left: 25%;--modal-width: 50%;--modal-height: auto;--modal-min-height: 150px;--modal-max-height: 50vh;--modal-overlay-z-index: 100;--modal-z-index: 101;--modal-content-padding: 25px 10px 20px;--modal-overflow: auto;position:absolute}:host .modal-overlay{position:fixed;z-index:-1;opacity:0;background-color:oklab(0% none none / .8);width:100%;height:100%;top:0;right:0}:host .modal-overlay.open{z-index:var(--modal-overlay-z-index);opacity:1}:host .modal{position:fixed;z-index:-1;opacity:0;top:var(--modal-top);left:var(--modal-left);width:var(--modal-width);height:var(--modal-height);min-height:var(--modal-min-height);background:var(--background);display:flex;flex-direction:column}:host .modal.open{z-index:var(--modal-z-index);opacity:1}:host .modal .modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px;background:var(--background-header);border-bottom:1px outset var(--border)}:host .modal .modal-header b{font-size:1.15rem}:host .modal .modal-content{flex:1;overflow:var(--modal-overflow);scrollbar-width:thin;padding:var(--modal-content-padding);background:var(--background-card);max-height:var(--modal-max-height);position:relative}:host .modal .modal-footer-wrapper:not(:empty){padding:10px;background:var(--background-card)}@media screen and (min-width:1000px){:host{--modal-left: calc(25% + 120px) !important}}@media screen and (max-width:750px){:host{--modal-width: calc(100% - 16px) !important;--modal-left: 8px !important}}\n"] }]
|
|
70
70
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], titleText: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleText", required: true }] }], canEchap: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEchap", required: false }] }] } });
|
|
71
71
|
|
|
72
72
|
class DsvModalAlertComponent {
|
|
@@ -97,11 +97,11 @@ class DsvModalAlertComponent {
|
|
|
97
97
|
this.modalService.close(this.id());
|
|
98
98
|
}
|
|
99
99
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvModalAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
100
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvModalAlertComponent, isStandalone: true, selector: "dsv-modal-alert", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, titleText: { classPropertyName: "titleText", publicName: "titleText", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, button: { classPropertyName: "button", publicName: "button", isSignal: true, isRequired: false, transformFunction: null }, buttonClose: { classPropertyName: "buttonClose", publicName: "buttonClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "callback" }, ngImport: i0, template: "<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"
|
|
100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: DsvModalAlertComponent, isStandalone: true, selector: "dsv-modal-alert", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, titleText: { classPropertyName: "titleText", publicName: "titleText", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, button: { classPropertyName: "button", publicName: "button", isSignal: true, isRequired: false, transformFunction: null }, buttonClose: { classPropertyName: "buttonClose", publicName: "buttonClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "callback" }, ngImport: i0, template: "<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"secondary\" variant=\"outlined\">\n {{ buttonClose()! | translate }}\n </dsv-button>\n }\n <dsv-button (callback)=\"doClick()\" color=\"secondary\">\n {{ button() | translate }}\n </dsv-button>\n </div>\n</dsv-modal>\n", styles: [":host{position:absolute}:host .modal-footer{display:flex;gap:.5rem;justify-content:flex-end}:host dsv-modal{--modal-overlay-z-index: 110 !important;--modal-z-index: 111 !important}\n"], dependencies: [{ kind: "component", type: DsvModalComponent, selector: "dsv-modal", inputs: ["id", "class", "titleText", "canEchap"] }, { kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
101
101
|
}
|
|
102
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DsvModalAlertComponent, decorators: [{
|
|
103
103
|
type: Component,
|
|
104
|
-
args: [{ selector: 'dsv-modal-alert', imports: [DsvModalComponent, DsvButtonComponent, TranslatePipe], template: "<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"
|
|
104
|
+
args: [{ selector: 'dsv-modal-alert', imports: [DsvModalComponent, DsvButtonComponent, TranslatePipe], template: "<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"secondary\" variant=\"outlined\">\n {{ buttonClose()! | translate }}\n </dsv-button>\n }\n <dsv-button (callback)=\"doClick()\" color=\"secondary\">\n {{ button() | translate }}\n </dsv-button>\n </div>\n</dsv-modal>\n", styles: [":host{position:absolute}:host .modal-footer{display:flex;gap:.5rem;justify-content:flex-end}:host dsv-modal{--modal-overlay-z-index: 110 !important;--modal-z-index: 111 !important}\n"] }]
|
|
105
105
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], titleText: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleText", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], button: [{ type: i0.Input, args: [{ isSignal: true, alias: "button", required: false }] }], buttonClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonClose", required: false }] }], callback: [{ type: i0.Output, args: ["callback"] }] } });
|
|
106
106
|
|
|
107
107
|
class DsvModalButtonComponent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-vagabond-lab-ng-dsv-ds-modal.mjs","sources":["../../../projects/ng-dsv/ds/modal/service/modal.service.ts","../../../projects/ng-dsv/ds/modal/component/modal.component.ts","../../../projects/ng-dsv/ds/modal/component/modal.component.html","../../../projects/ng-dsv/ds/modal/component/alert/modal-alert.component.ts","../../../projects/ng-dsv/ds/modal/component/alert/modal-alert.component.html","../../../projects/ng-dsv/ds/modal/component/button/modal-button.component.ts","../../../projects/ng-dsv/ds/modal/component/button/modal-button.component.html","../../../projects/ng-dsv/ds/modal/ng-vagabond-lab-ng-dsv-ds-modal.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private readonly states = signal<Map<string, boolean>>(new Map());\n\n getSignal(id: string): boolean {\n return this.states().get(id) ?? false;\n }\n\n open(id: string): void {\n this.states.update((map) => new Map(map).set(id, true));\n }\n\n close(id: string): void {\n this.states.update((map) => new Map(map).set(id, false));\n }\n\n toggle(id: string): void {\n this.states.update((map) => new Map(map).set(id, !map.get(id)));\n }\n\n closeAll(): void {\n this.states.set(new Map());\n }\n}\n","import { Component, effect, inject, input, signal } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { MenuService } from '@ng-vagabond-lab/ng-dsv/ds/menu';\nimport { ModalService } from '../service/modal.service';\n\n@Component({\n selector: 'dsv-modal',\n imports: [DsvButtonComponent],\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n host: {\n '(document:keydown.escape)': 'onEscapeKey()',\n },\n})\nexport class DsvModalComponent {\n readonly modalService = inject(ModalService);\n readonly menuService = inject(MenuService);\n\n readonly id = input.required<string>();\n readonly class = input<string>('');\n readonly titleText = input.required<string>();\n readonly canEchap = input<boolean>(true);\n\n readonly isOpen = signal<boolean>(false);\n\n constructor() {\n effect(() => {\n this.isOpen.set(this.modalService.getSignal(this.id()) ?? false);\n if (this.isOpen()) {\n this.menuService.isMenuOpen.set(false);\n }\n });\n }\n\n onEscapeKey(): void {\n if (this.isOpen() && this.canEchap()) {\n this.close();\n }\n }\n\n close(): void {\n this.modalService.close(this.id());\n }\n}\n","<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n","import { Component, effect, inject, input, output, signal } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ModalService } from '../../service/modal.service';\nimport { DsvModalComponent } from '../modal.component';\n\n@Component({\n selector: 'dsv-modal-alert',\n imports: [DsvModalComponent, DsvButtonComponent, TranslatePipe],\n templateUrl: './modal-alert.component.html',\n styleUrls: ['./modal-alert.component.scss'],\n})\nexport class DsvModalAlertComponent {\n readonly id = input.required<string>();\n readonly titleText = input<string>('title');\n readonly text = input<string>('text');\n readonly button = input<string>('button');\n readonly buttonClose = input<string>();\n readonly callback = output<void>();\n\n readonly isOpen = signal<boolean>(false);\n\n readonly modalService = inject(ModalService);\n\n constructor() {\n effect(() => {\n this.isOpen.set(this.modalService.getSignal(this.id() ?? false));\n });\n }\n\n doClick(): void {\n this.modalService.toggle(this.id());\n this.callback.emit();\n }\n\n doClickClose(): void {\n this.modalService.close(this.id());\n }\n}\n","<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"error\">\n {{ buttonClose()! | translate }}\n </dsv-button>\n }\n <dsv-button (callback)=\"doClick()\" color=\"secondary\">\n {{ button() | translate }}\n </dsv-button>\n </div>\n</dsv-modal>\n","import { Component, inject, input, output } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { ButtonVariantType, ColorType } from '@ng-vagabond-lab/ng-dsv/type';\nimport { ModalService } from '../../service/modal.service';\n\n@Component({\n selector: 'dsv-modal-button',\n imports: [DsvButtonComponent],\n templateUrl: './modal-button.component.html',\n styleUrls: ['../../../button/component/button.component.scss', './modal-button.component.scss'],\n})\nexport class DsvModalButtonComponent {\n readonly modalService = inject(ModalService);\n\n readonly modalName = input.required<string>();\n readonly icon = input<string>('');\n readonly variant = input<ButtonVariantType>('contained');\n readonly text = input<string>('');\n readonly color = input<ColorType>('primary');\n\n readonly callback = output<void>();\n\n doToogle(): void {\n this.callback.emit();\n this.modalService.toggle(this.modalName());\n }\n}\n","<dsv-button\n [color]=\"color()\"\n [libelle]=\"text()\"\n [icon]=\"icon()\"\n [variant]=\"variant()\"\n (callback)=\"doToogle()\"\n/>\n<ng-content></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAGa,YAAY,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAuB,IAAI,GAAG,EAAE;+EAAC;AAEjE,IAAA,SAAS,CAAC,EAAU,EAA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,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECXpC,oLAQA,EAAA,MAAA,EAAA,CAAA,o3DAAA,EAAA,+iCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDDc,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAInB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;+BACI,kBAAkB,EAAA,OAAA,EACnB,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAA,oLAAA,EAAA,MAAA,EAAA,CAAA,o3DAAA,EAAA,+iCAAA,CAAA,EAAA;;;AEPjC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-ds-modal.mjs","sources":["../../../projects/ng-dsv/ds/modal/service/modal.service.ts","../../../projects/ng-dsv/ds/modal/component/modal.component.ts","../../../projects/ng-dsv/ds/modal/component/modal.component.html","../../../projects/ng-dsv/ds/modal/component/alert/modal-alert.component.ts","../../../projects/ng-dsv/ds/modal/component/alert/modal-alert.component.html","../../../projects/ng-dsv/ds/modal/component/button/modal-button.component.ts","../../../projects/ng-dsv/ds/modal/component/button/modal-button.component.html","../../../projects/ng-dsv/ds/modal/ng-vagabond-lab-ng-dsv-ds-modal.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class ModalService {\n private readonly states = signal<Map<string, boolean>>(new Map());\n\n getSignal(id: string): boolean {\n return this.states().get(id) ?? false;\n }\n\n open(id: string): void {\n this.states.update((map) => new Map(map).set(id, true));\n }\n\n close(id: string): void {\n this.states.update((map) => new Map(map).set(id, false));\n }\n\n toggle(id: string): void {\n this.states.update((map) => new Map(map).set(id, !map.get(id)));\n }\n\n closeAll(): void {\n this.states.set(new Map());\n }\n}\n","import { Component, effect, inject, input, signal } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { MenuService } from '@ng-vagabond-lab/ng-dsv/ds/menu';\nimport { ModalService } from '../service/modal.service';\n\n@Component({\n selector: 'dsv-modal',\n imports: [DsvButtonComponent],\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n host: {\n '(document:keydown.escape)': 'onEscapeKey()',\n },\n})\nexport class DsvModalComponent {\n readonly modalService = inject(ModalService);\n readonly menuService = inject(MenuService);\n\n readonly id = input.required<string>();\n readonly class = input<string>('');\n readonly titleText = input.required<string>();\n readonly canEchap = input<boolean>(true);\n\n readonly isOpen = signal<boolean>(false);\n\n constructor() {\n effect(() => {\n this.isOpen.set(this.modalService.getSignal(this.id()) ?? false);\n if (this.isOpen()) {\n this.menuService.isMenuOpen.set(false);\n }\n });\n }\n\n onEscapeKey(): void {\n if (this.isOpen() && this.canEchap()) {\n this.close();\n }\n }\n\n close(): void {\n this.modalService.close(this.id());\n }\n}\n","<div\n class=\"modal-overlay\"\n [class.open]=\"isOpen()\"\n></div>\n<div\n [class]=\"'modal ' + class()\"\n [class.open]=\"isOpen()\"\n>\n <div class=\"modal-header\">\n <b>{{ titleText() }}</b>\n <dsv-button\n (callback)=\"close()\"\n variant=\"text\"\n color=\"inherit\"\n >\n X\n </dsv-button>\n </div>\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"modal-footer-wrapper\">\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n</div>\n","import { Component, effect, inject, input, output, signal } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ModalService } from '../../service/modal.service';\nimport { DsvModalComponent } from '../modal.component';\n\n@Component({\n selector: 'dsv-modal-alert',\n imports: [DsvModalComponent, DsvButtonComponent, TranslatePipe],\n templateUrl: './modal-alert.component.html',\n styleUrls: ['./modal-alert.component.scss'],\n})\nexport class DsvModalAlertComponent {\n readonly id = input.required<string>();\n readonly titleText = input<string>('title');\n readonly text = input<string>('text');\n readonly button = input<string>('button');\n readonly buttonClose = input<string>();\n readonly callback = output<void>();\n\n readonly isOpen = signal<boolean>(false);\n\n readonly modalService = inject(ModalService);\n\n constructor() {\n effect(() => {\n this.isOpen.set(this.modalService.getSignal(this.id() ?? false));\n });\n }\n\n doClick(): void {\n this.modalService.toggle(this.id());\n this.callback.emit();\n }\n\n doClickClose(): void {\n this.modalService.close(this.id());\n }\n}\n","<dsv-modal [id]=\"id()\" [titleText]=\"titleText()\">\n {{ text() }}\n <div class=\"modal-footer\">\n @if (buttonClose()) {\n <dsv-button (callback)=\"doClickClose()\" color=\"secondary\" variant=\"outlined\">\n {{ buttonClose()! | translate }}\n </dsv-button>\n }\n <dsv-button (callback)=\"doClick()\" color=\"secondary\">\n {{ button() | translate }}\n </dsv-button>\n </div>\n</dsv-modal>\n","import { Component, inject, input, output } from '@angular/core';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { ButtonVariantType, ColorType } from '@ng-vagabond-lab/ng-dsv/type';\nimport { ModalService } from '../../service/modal.service';\n\n@Component({\n selector: 'dsv-modal-button',\n imports: [DsvButtonComponent],\n templateUrl: './modal-button.component.html',\n styleUrls: ['../../../button/component/button.component.scss', './modal-button.component.scss'],\n})\nexport class DsvModalButtonComponent {\n readonly modalService = inject(ModalService);\n\n readonly modalName = input.required<string>();\n readonly icon = input<string>('');\n readonly variant = input<ButtonVariantType>('contained');\n readonly text = input<string>('');\n readonly color = input<ColorType>('primary');\n\n readonly callback = output<void>();\n\n doToogle(): void {\n this.callback.emit();\n this.modalService.toggle(this.modalName());\n }\n}\n","<dsv-button\n [color]=\"color()\"\n [libelle]=\"text()\"\n [icon]=\"icon()\"\n [variant]=\"variant()\"\n (callback)=\"doToogle()\"\n/>\n<ng-content></ng-content>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAGa,YAAY,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAuB,IAAI,GAAG,EAAE;+EAAC;AAEjE,IAAA,SAAS,CAAC,EAAU,EAAA;QAChB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK;IACzC;AAEA,IAAA,IAAI,CAAC,EAAU,EAAA;QACX,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3D;AAEA,IAAA,KAAK,CAAC,EAAU,EAAA;QACZ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5D;AAEA,IAAA,MAAM,CAAC,EAAU,EAAA;AACb,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,IAAI,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YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDDc,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAInB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBANnC,SAAS;+BACI,kBAAkB,EAAA,OAAA,EACnB,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAA,oLAAA,EAAA,MAAA,EAAA,CAAA,o3DAAA,EAAA,+iCAAA,CAAA,EAAA;;;AEPjC;;AAEG;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, effect, Component } from '@angular/core';
|
|
3
|
+
import { form, required, validate } from '@angular/forms/signals';
|
|
4
|
+
import { RouterLink } from '@angular/router';
|
|
5
|
+
import { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';
|
|
6
|
+
import { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';
|
|
7
|
+
import { requiredTrim, DsvFormSignalComponent, DsvFormSignalInputComponent, DsvFormSignalCheckboxComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/signal';
|
|
8
|
+
import { NewsContainer } from './ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs';
|
|
9
|
+
|
|
10
|
+
class NewsFormContainer extends NewsContainer {
|
|
11
|
+
newsForm = form(signal(this.news()), (path) => {
|
|
12
|
+
required(path.title);
|
|
13
|
+
required(path.resume);
|
|
14
|
+
required(path.description);
|
|
15
|
+
validate(path.title, requiredTrim);
|
|
16
|
+
validate(path.resume, requiredTrim);
|
|
17
|
+
validate(path.description, requiredTrim);
|
|
18
|
+
});
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
effect(() => {
|
|
22
|
+
if (this.news()) {
|
|
23
|
+
this.newsForm().reset(this.news());
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.newsForm().reset({
|
|
27
|
+
title: '',
|
|
28
|
+
image: '',
|
|
29
|
+
tags: '',
|
|
30
|
+
resume: '',
|
|
31
|
+
description: '',
|
|
32
|
+
user: this.authService.userConnected(),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
doSubmit() {
|
|
38
|
+
if (this.newsForm().valid()) {
|
|
39
|
+
this.newsService.createOrUpdate(this.newsForm().value(), (data) => {
|
|
40
|
+
this.routerService.router.navigate(['news', data.id]);
|
|
41
|
+
document.getElementById('main-scroll')?.scrollTo(0, 0);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsFormContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: NewsFormContainer, isStandalone: true, selector: "app-news-form", usesInheritance: true, ngImport: i0, template: "<dsv-card>\n <dsv-card-header>\n <dsv-button\n class=\"round\"\n icon=\"ri-arrow-left-s-line\"\n color=\"inherit\"\n [routerLink]=\"news()?.id ? '/news/' + news()?.id : '/news'\"\n />\n <h1>{{ news()?.id ? 'Modifier' : 'Cr\u00E9er' }} une news</h1>\n </dsv-card-header>\n <dsv-form-signal [form]=\"newsForm\" (callback)=\"doSubmit()\" (callbackBack)=\"routerService.goBack()\">\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"title\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"image\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"tags\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"resume\" type=\"textarea\" class=\"resume\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"description\" type=\"textarea\" />\n <dsv-form-signal-checkbox [form]=\"newsForm\" fieldName=\"active\" />\n </dsv-form-signal>\n</dsv-card>\n", styles: [":host dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px}:host dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-form-signal-input{--input-height: 300px;--input-max-height: 300px}:host dsv-form-signal-input.resume{--input-height: 160px}\n"], dependencies: [{ kind: "component", type: DsvCardComponent, selector: "dsv-card", inputs: ["border"] }, { kind: "component", type: DsvFormSignalComponent, selector: "dsv-form-signal", inputs: ["form", "urlBack", "textValid", "formValid"], outputs: ["callbackBack", "callback"] }, { kind: "component", type: DsvFormSignalInputComponent, selector: "dsv-form-signal-input", inputs: ["type", "icon", "withError"] }, { kind: "component", type: DsvCardHeaderComponent, selector: "dsv-card-header" }, { kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: DsvFormSignalCheckboxComponent, selector: "dsv-form-signal-checkbox" }] });
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsFormContainer, decorators: [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{ selector: 'app-news-form', imports: [
|
|
51
|
+
DsvCardComponent,
|
|
52
|
+
DsvFormSignalComponent,
|
|
53
|
+
DsvFormSignalInputComponent,
|
|
54
|
+
DsvCardHeaderComponent,
|
|
55
|
+
DsvButtonComponent,
|
|
56
|
+
RouterLink,
|
|
57
|
+
DsvFormSignalCheckboxComponent,
|
|
58
|
+
], template: "<dsv-card>\n <dsv-card-header>\n <dsv-button\n class=\"round\"\n icon=\"ri-arrow-left-s-line\"\n color=\"inherit\"\n [routerLink]=\"news()?.id ? '/news/' + news()?.id : '/news'\"\n />\n <h1>{{ news()?.id ? 'Modifier' : 'Cr\u00E9er' }} une news</h1>\n </dsv-card-header>\n <dsv-form-signal [form]=\"newsForm\" (callback)=\"doSubmit()\" (callbackBack)=\"routerService.goBack()\">\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"title\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"image\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"tags\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"resume\" type=\"textarea\" class=\"resume\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"description\" type=\"textarea\" />\n <dsv-form-signal-checkbox [form]=\"newsForm\" fieldName=\"active\" />\n </dsv-form-signal>\n</dsv-card>\n", styles: [":host dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px}:host dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-form-signal-input{--input-height: 300px;--input-max-height: 300px}:host dsv-form-signal-input.resume{--input-height: 160px}\n"] }]
|
|
59
|
+
}], ctorParameters: () => [] });
|
|
60
|
+
|
|
61
|
+
export { NewsFormContainer };
|
|
62
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs","sources":["../../../projects/ng-dsv/module/news/container/form/news-form.container.ts","../../../projects/ng-dsv/module/news/container/form/news-form.container.html"],"sourcesContent":["import { Component, effect, signal } from '@angular/core';\nimport { form, required, validate } from '@angular/forms/signals';\nimport { RouterLink } from '@angular/router';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';\nimport {\n DsvFormSignalCheckboxComponent,\n DsvFormSignalComponent,\n DsvFormSignalInputComponent,\n requiredTrim,\n} from '@ng-vagabond-lab/ng-dsv/ds/form/signal';\nimport { NewsDto } from '../../dto/news.dto';\nimport { NewsContainer } from '../news.container';\n\n@Component({\n selector: 'app-news-form',\n imports: [\n DsvCardComponent,\n DsvFormSignalComponent,\n DsvFormSignalInputComponent,\n DsvCardHeaderComponent,\n DsvButtonComponent,\n RouterLink,\n DsvFormSignalCheckboxComponent,\n ],\n templateUrl: './news-form.container.html',\n styleUrl: './news-form.container.scss',\n})\nexport class NewsFormContainer extends NewsContainer {\n readonly newsForm = form(signal<NewsDto>(this.news()!), (path) => {\n required(path.title);\n required(path.resume);\n required(path.description);\n validate(path.title, requiredTrim);\n validate(path.resume, requiredTrim);\n validate(path.description, requiredTrim);\n });\n\n constructor() {\n super();\n effect(() => {\n if (this.news()) {\n this.newsForm().reset(this.news());\n } else {\n this.newsForm().reset({\n title: '',\n image: '',\n tags: '',\n resume: '',\n description: '',\n user: this.authService.userConnected()!,\n } as NewsDto);\n }\n });\n }\n\n doSubmit() {\n if (this.newsForm().valid()) {\n this.newsService.createOrUpdate(this.newsForm().value(), (data: NewsDto) => {\n this.routerService.router.navigate(['news', data.id]);\n document.getElementById('main-scroll')?.scrollTo(0, 0);\n });\n }\n }\n}\n","<dsv-card>\n <dsv-card-header>\n <dsv-button\n class=\"round\"\n icon=\"ri-arrow-left-s-line\"\n color=\"inherit\"\n [routerLink]=\"news()?.id ? '/news/' + news()?.id : '/news'\"\n />\n <h1>{{ news()?.id ? 'Modifier' : 'Créer' }} une news</h1>\n </dsv-card-header>\n <dsv-form-signal [form]=\"newsForm\" (callback)=\"doSubmit()\" (callbackBack)=\"routerService.goBack()\">\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"title\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"image\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"tags\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"resume\" type=\"textarea\" class=\"resume\" />\n <dsv-form-signal-input [form]=\"newsForm\" fieldName=\"description\" type=\"textarea\" />\n <dsv-form-signal-checkbox [form]=\"newsForm\" fieldName=\"active\" />\n </dsv-form-signal>\n</dsv-card>\n"],"names":[],"mappings":";;;;;;;;;AA4BM,MAAO,iBAAkB,SAAQ,aAAa,CAAA;AACvC,IAAA,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAU,IAAI,CAAC,IAAI,EAAG,CAAC,EAAE,CAAC,IAAI,KAAI;AAC7D,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AACpB,QAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACrB,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;AAC1B,QAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC;AAClC,QAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC;AACnC,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC;AAC5C,IAAA,CAAC,CAAC;AAEF,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,EAAE;QACP,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;gBACb,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACtC;iBAAO;AACH,gBAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;AAClB,oBAAA,KAAK,EAAE,EAAE;AACT,oBAAA,KAAK,EAAE,EAAE;AACT,oBAAA,IAAI,EAAE,EAAE;AACR,oBAAA,MAAM,EAAE,EAAE;AACV,oBAAA,WAAW,EAAE,EAAE;AACf,oBAAA,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,aA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A,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC3B,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACtB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAClB,UAAU,kPACV,8BAA8B,EAAA,QAAA,EAAA,0BAAA,EAAA,CAAA,EAAA,CAAA;;2FAKzB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAChB;wBACL,gBAAgB;wBAChB,sBAAsB;wBACtB,2BAA2B;wBAC3B,sBAAsB;wBACtB,kBAAkB;wBAClB,UAAU;wBACV,8BAA8B;AACjC,qBAAA,EAAA,QAAA,EAAA,6+BAAA,EAAA,MAAA,EAAA,CAAA,6RAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, inject, computed } from '@angular/core';
|
|
3
|
+
import { RouterLink } from '@angular/router';
|
|
4
|
+
import { BaseSearchContainer } from '@ng-vagabond-lab/ng-dsv/base';
|
|
5
|
+
import { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';
|
|
6
|
+
import { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';
|
|
7
|
+
import { DsvFormReactiveSearchbarComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/reactive';
|
|
8
|
+
import { DsvScrollInfiniteContainer } from '@ng-vagabond-lab/ng-dsv/ds/scroll';
|
|
9
|
+
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
10
|
+
import { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';
|
|
11
|
+
import { RouterInternalPipe } from '@ng-vagabond-lab/ng-dsv/router';
|
|
12
|
+
import { N as NewsMarkdownContainer, a as NewsListService } from './ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs';
|
|
13
|
+
|
|
14
|
+
class NewsCardResumeComponent {
|
|
15
|
+
news = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "news" }] : /* istanbul ignore next */ []));
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsCardResumeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NewsCardResumeComponent, isStandalone: true, selector: "app-news-card-resume", inputs: { news: { classPropertyName: "news", publicName: "news", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<dsv-card [routerLink]=\"'/news/' + news()?.id\">\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <app-news-markdown-container [data]=\"news()?.resume\" />\n <a [href]=\"'/news/' + news()?.id\" dsvLink>Lire la suite...</a>\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px}:host dsv-card{position:relative}:host dsv-card h1{margin:0}:host dsv-card h2{margin:0 0 5px}:host dsv-card img{width:calc(100% + 20px)}:host dsv-card .news-image{margin:0 0 5px;width:100%}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px;margin:0 0 10px}:host dsv-card dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-card dsv-card-header h1,:host dsv-card dsv-card-header h2{flex:1}:host app-news-markdown-container{margin:20px 0}\n", ":host{margin:0;width:100%;min-height:200px!important}:host,:host a{display:flex;width:100%}\n"], dependencies: [{ kind: "component", type: DsvCardComponent, selector: "dsv-card", inputs: ["border"] }, { kind: "directive", type: RouterInternalPipe, selector: "a[dsvLink]", outputs: ["dsvLink"] }, { kind: "component", type: NewsMarkdownContainer, selector: "app-news-markdown-container", inputs: ["data"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "pipe", type: DateFormatPipe, name: "formatDate" }] });
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsCardResumeComponent, decorators: [{
|
|
21
|
+
type: Component,
|
|
22
|
+
args: [{ selector: 'app-news-card-resume', imports: [DsvCardComponent, DateFormatPipe, RouterInternalPipe, NewsMarkdownContainer, RouterLink], template: "<dsv-card [routerLink]=\"'/news/' + news()?.id\">\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <app-news-markdown-container [data]=\"news()?.resume\" />\n <a [href]=\"'/news/' + news()?.id\" dsvLink>Lire la suite...</a>\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px}:host dsv-card{position:relative}:host dsv-card h1{margin:0}:host dsv-card h2{margin:0 0 5px}:host dsv-card img{width:calc(100% + 20px)}:host dsv-card .news-image{margin:0 0 5px;width:100%}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px;margin:0 0 10px}:host dsv-card dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-card dsv-card-header h1,:host dsv-card dsv-card-header h2{flex:1}:host app-news-markdown-container{margin:20px 0}\n", ":host{margin:0;width:100%;min-height:200px!important}:host,:host a{display:flex;width:100%}\n"] }]
|
|
23
|
+
}], propDecorators: { news: [{ type: i0.Input, args: [{ isSignal: true, alias: "news", required: false }] }] } });
|
|
24
|
+
|
|
25
|
+
class NewsListContainer extends BaseSearchContainer {
|
|
26
|
+
newsListService;
|
|
27
|
+
auhService = inject(AuthService);
|
|
28
|
+
isAdmin = computed(() => this.auhService.hasRole('ADMIN'), /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "isAdmin" }] : /* istanbul ignore next */ []));
|
|
30
|
+
constructor(newsListService) {
|
|
31
|
+
super(newsListService);
|
|
32
|
+
this.newsListService = newsListService;
|
|
33
|
+
this.seoService.setMeta('Les dernières news', 'Retrouver les dernières news sur movie-keeper.fr', '/images/logo.png');
|
|
34
|
+
}
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsListContainer, deps: [{ token: NewsListService }], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NewsListContainer, isStandalone: true, selector: "app-news-list", usesInheritance: true, ngImport: i0, template: "<dsv-card>\n <dsv-card-header>\n <h2>\n <i class=\"ri-file-list-3-line\"></i> News\n @if (newsListService.total()) {\n ({{ newsListService.total() }})\n }\n </h2>\n @if (isAdmin()) {\n <dsv-button icon=\"ri-add-line\" color=\"secondary\" variant=\"outlined\" routerLink=\"/news/create\" />\n }\n </dsv-card-header>\n <dsv-form-reactive-searchbar [search]=\"newsListService.search()\" (callbackSearch)=\"doSearch($event)\" />\n</dsv-card>\n\n@if (newsListService.news().length === 0 && (!newsListService.isLoading() || newsListService.stopFetch())) {\n <dsv-card>\n <p>Aucun r\u00E9sultat trouv\u00E9</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite\n #scroll\n class=\"card-miniature\"\n [loading]=\"newsListService.isLoading()\"\n (callback)=\"doFetch()\"\n >\n @for (news of newsListService.news(); track news.id) {\n <app-news-card-resume [news]=\"news\">\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news?.id\"\n />\n }\n </app-news-card-resume>\n }\n <ng-template #skeleton> </ng-template>\n </dsv-scroll-infinite>\n}\n", styles: [":host{display:flex;flex-direction:column;overflow:hidden}:host dsv-card{margin:5px;width:calc(100% - 10px);gap:5px}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;margin:0 0 5px}:host dsv-card dsv-card-header h2{margin:0;flex:1}:host dsv-card dsv-form-reactive-searchbar{margin:0}:host dsv-scroll-infinite app-news-card-resume{width:calc(50% - 10px)}@media screen and (max-width:600px){:host dsv-scroll-infinite app-news-card-resume{width:100%}}\n"], dependencies: [{ kind: "component", type: DsvCardComponent, selector: "dsv-card", inputs: ["border"] }, { kind: "component", type: DsvFormReactiveSearchbarComponent, selector: "dsv-form-reactive-searchbar", inputs: ["search"], outputs: ["callbackSearch"] }, { kind: "component", type: DsvScrollInfiniteContainer, selector: "dsv-scroll-infinite", inputs: ["bottomOffset", "loading", "id"], outputs: ["callback"] }, { kind: "component", type: NewsCardResumeComponent, selector: "app-news-card-resume", inputs: ["news"] }, { kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "component", type: DsvCardHeaderComponent, selector: "dsv-card-header" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsListContainer, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'app-news-list', imports: [
|
|
41
|
+
DsvCardComponent,
|
|
42
|
+
DsvFormReactiveSearchbarComponent,
|
|
43
|
+
DsvScrollInfiniteContainer,
|
|
44
|
+
NewsCardResumeComponent,
|
|
45
|
+
DsvButtonComponent,
|
|
46
|
+
DsvCardHeaderComponent,
|
|
47
|
+
RouterLink,
|
|
48
|
+
], template: "<dsv-card>\n <dsv-card-header>\n <h2>\n <i class=\"ri-file-list-3-line\"></i> News\n @if (newsListService.total()) {\n ({{ newsListService.total() }})\n }\n </h2>\n @if (isAdmin()) {\n <dsv-button icon=\"ri-add-line\" color=\"secondary\" variant=\"outlined\" routerLink=\"/news/create\" />\n }\n </dsv-card-header>\n <dsv-form-reactive-searchbar [search]=\"newsListService.search()\" (callbackSearch)=\"doSearch($event)\" />\n</dsv-card>\n\n@if (newsListService.news().length === 0 && (!newsListService.isLoading() || newsListService.stopFetch())) {\n <dsv-card>\n <p>Aucun r\u00E9sultat trouv\u00E9</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite\n #scroll\n class=\"card-miniature\"\n [loading]=\"newsListService.isLoading()\"\n (callback)=\"doFetch()\"\n >\n @for (news of newsListService.news(); track news.id) {\n <app-news-card-resume [news]=\"news\">\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news?.id\"\n />\n }\n </app-news-card-resume>\n }\n <ng-template #skeleton> </ng-template>\n </dsv-scroll-infinite>\n}\n", styles: [":host{display:flex;flex-direction:column;overflow:hidden}:host dsv-card{margin:5px;width:calc(100% - 10px);gap:5px}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;margin:0 0 5px}:host dsv-card dsv-card-header h2{margin:0;flex:1}:host dsv-card dsv-form-reactive-searchbar{margin:0}:host dsv-scroll-infinite app-news-card-resume{width:calc(50% - 10px)}@media screen and (max-width:600px){:host dsv-scroll-infinite app-news-card-resume{width:100%}}\n"] }]
|
|
49
|
+
}], ctorParameters: () => [{ type: NewsListService }] });
|
|
50
|
+
|
|
51
|
+
export { NewsListContainer };
|
|
52
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs","sources":["../../../projects/ng-dsv/module/news/component/card/resume/news-card-resume.component.ts","../../../projects/ng-dsv/module/news/component/card/resume/news-card-resume.component.html","../../../projects/ng-dsv/module/news/container/list/news-list.container.ts","../../../projects/ng-dsv/module/news/container/list/news-list.container.html"],"sourcesContent":["import { Component, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';\nimport { DsvCardComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';\nimport { RouterInternalPipe } from '@ng-vagabond-lab/ng-dsv/router';\nimport { NewsMarkdownContainer } from '../../../container/markdown/news-markdown.container';\nimport { NewsDto } from '../../../dto/news.dto';\n\n@Component({\n selector: 'app-news-card-resume',\n imports: [DsvCardComponent, DateFormatPipe, RouterInternalPipe, NewsMarkdownContainer, RouterLink],\n templateUrl: './news-card-resume.component.html',\n styleUrls: ['../news-card.component.scss', './news-card-resume.component.scss'],\n})\nexport class NewsCardResumeComponent {\n readonly news = input<NewsDto>();\n}\n","<dsv-card [routerLink]=\"'/news/' + news()?.id\">\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <app-news-markdown-container [data]=\"news()?.resume\" />\n <a [href]=\"'/news/' + news()?.id\" dsvLink>Lire la suite...</a>\n</dsv-card>\n","import { Component, computed, inject } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { BaseSearchContainer } from '@ng-vagabond-lab/ng-dsv/base';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';\nimport { DsvFormReactiveSearchbarComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/reactive';\nimport { DsvScrollInfiniteContainer } from '@ng-vagabond-lab/ng-dsv/ds/scroll';\nimport { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';\nimport { NewsCardResumeComponent } from '../../component/card/resume/news-card-resume.component';\nimport { NewsDto } from '../../dto/news.dto';\nimport { NewsListService } from '../../service/list/news-list.service';\n\n@Component({\n selector: 'app-news-list',\n imports: [\n DsvCardComponent,\n DsvFormReactiveSearchbarComponent,\n DsvScrollInfiniteContainer,\n NewsCardResumeComponent,\n DsvButtonComponent,\n DsvCardHeaderComponent,\n RouterLink,\n ],\n templateUrl: './news-list.container.html',\n styleUrl: './news-list.container.scss',\n})\nexport class NewsListContainer extends BaseSearchContainer<NewsListService, NewsDto> {\n readonly auhService = inject(AuthService);\n\n readonly isAdmin = computed<boolean>(() => this.auhService.hasRole('ADMIN'));\n\n constructor(public newsListService: NewsListService) {\n super(newsListService);\n this.seoService.setMeta(\n 'Les dernières news',\n 'Retrouver les dernières news sur movie-keeper.fr',\n '/images/logo.png',\n );\n }\n}\n","<dsv-card>\n <dsv-card-header>\n <h2>\n <i class=\"ri-file-list-3-line\"></i> News\n @if (newsListService.total()) {\n ({{ newsListService.total() }})\n }\n </h2>\n @if (isAdmin()) {\n <dsv-button icon=\"ri-add-line\" color=\"secondary\" variant=\"outlined\" routerLink=\"/news/create\" />\n }\n </dsv-card-header>\n <dsv-form-reactive-searchbar [search]=\"newsListService.search()\" (callbackSearch)=\"doSearch($event)\" />\n</dsv-card>\n\n@if (newsListService.news().length === 0 && (!newsListService.isLoading() || newsListService.stopFetch())) {\n <dsv-card>\n <p>Aucun résultat trouvé</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite\n #scroll\n class=\"card-miniature\"\n [loading]=\"newsListService.isLoading()\"\n (callback)=\"doFetch()\"\n >\n @for (news of newsListService.news(); track news.id) {\n <app-news-card-resume [news]=\"news\">\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news?.id\"\n />\n }\n </app-news-card-resume>\n }\n <ng-template #skeleton> </ng-template>\n </dsv-scroll-infinite>\n}\n"],"names":["i1.NewsListService"],"mappings":";;;;;;;;;;;;;MAca,uBAAuB,CAAA;AACvB,IAAA,IAAI,GAAG,KAAK;wFAAW;uGADvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECdpC,2cASA,EAAA,MAAA,EAAA,CAAA,uiBAAA,EAAA,+FAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDCc,gBAAgB,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAkB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,q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A,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAKL,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAd7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAChB;wBACL,gBAAgB;wBAChB,iCAAiC;wBACjC,0BAA0B;wBAC1B,uBAAuB;wBACvB,kBAAkB;wBAClB,sBAAsB;wBACtB,UAAU;AACb,qBAAA,EAAA,QAAA,EAAA,i6CAAA,EAAA,MAAA,EAAA,CAAA,meAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, Component, Injectable } from '@angular/core';
|
|
3
|
+
import { RouterService } from '@ng-vagabond-lab/ng-dsv/router';
|
|
4
|
+
import { MarkdownComponent } from 'ngx-markdown';
|
|
5
|
+
import { BaseSearchService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
6
|
+
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
7
|
+
|
|
8
|
+
class NewsMarkdownContainer {
|
|
9
|
+
routerService = inject(RouterService);
|
|
10
|
+
data = input('', /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
12
|
+
handleClick(event) {
|
|
13
|
+
const target = event.target;
|
|
14
|
+
const anchor = target.closest('a');
|
|
15
|
+
if (anchor) {
|
|
16
|
+
const href = anchor.getAttribute('href');
|
|
17
|
+
if (href?.startsWith('/') || href?.includes('movie-keeper.fr')) {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
const path = href.replace('https://movie-keeper.fr', '');
|
|
21
|
+
this.routerService.router.navigate([path]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsMarkdownContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NewsMarkdownContainer, isStandalone: true, selector: "app-news-markdown-container", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (data()) {\n <markdown\n class=\"markdown\"\n [data]=\"data()\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleClick($event)\"\n />\n}\n", styles: [":host{display:flex}\n"], dependencies: [{ kind: "component", type: MarkdownComponent, selector: "markdown, [markdown]", inputs: ["data", "src", "disableSanitizer", "inline", "clipboard", "clipboardButtonComponent", "clipboardButtonTemplate", "emoji", "katex", "katexOptions", "mermaid", "mermaidOptions", "lineHighlight", "line", "lineOffset", "lineNumbers", "start", "commandLine", "filterOutput", "host", "prompt", "output", "user"], outputs: ["error", "load", "ready"] }] });
|
|
27
|
+
}
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsMarkdownContainer, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{ selector: 'app-news-markdown-container', imports: [MarkdownComponent], template: "@if (data()) {\n <markdown\n class=\"markdown\"\n [data]=\"data()\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleClick($event)\"\n />\n}\n", styles: [":host{display:flex}\n"] }]
|
|
31
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }] } });
|
|
32
|
+
|
|
33
|
+
class NewsListService extends BaseSearchService {
|
|
34
|
+
authService = inject(AuthService);
|
|
35
|
+
news = this.datas;
|
|
36
|
+
getEndPoint() {
|
|
37
|
+
return '/news/findBy';
|
|
38
|
+
}
|
|
39
|
+
getParams() {
|
|
40
|
+
let fields = '(title%And|Description%)AndActive>>creationDateDesc';
|
|
41
|
+
let values = this.search() + ',' + this.search() + ',true';
|
|
42
|
+
if (this.authService.isAdmin()) {
|
|
43
|
+
fields = '(title%And|Description%)>>creationDateDesc';
|
|
44
|
+
values = this.search() + ',' + this.search() + '';
|
|
45
|
+
}
|
|
46
|
+
return ('&fields=' +
|
|
47
|
+
encodeURIComponent(fields) +
|
|
48
|
+
'&values=' +
|
|
49
|
+
values +
|
|
50
|
+
'&first=' +
|
|
51
|
+
(this.page() - 1) +
|
|
52
|
+
'&max=20');
|
|
53
|
+
}
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsListService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
55
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsListService, providedIn: 'root' });
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsListService, decorators: [{
|
|
58
|
+
type: Injectable,
|
|
59
|
+
args: [{
|
|
60
|
+
providedIn: 'root',
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
export { NewsMarkdownContainer as N, NewsListService as a };
|
|
65
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs","sources":["../../../projects/ng-dsv/module/news/container/markdown/news-markdown.container.ts","../../../projects/ng-dsv/module/news/container/markdown/news-markdown.container.html","../../../projects/ng-dsv/module/news/service/list/news-list.service.ts"],"sourcesContent":["import { Component, inject, input } from '@angular/core';\nimport { RouterService } from '@ng-vagabond-lab/ng-dsv/router';\nimport { MarkdownComponent } from 'ngx-markdown';\n\n@Component({\n selector: 'app-news-markdown-container',\n imports: [MarkdownComponent],\n templateUrl: './news-markdown.container.html',\n styleUrl: './news-markdown.container.scss',\n})\nexport class NewsMarkdownContainer {\n readonly routerService = inject(RouterService);\n\n readonly data = input<string | undefined>('');\n\n handleClick(event: MouseEvent | KeyboardEvent) {\n const target = event.target as HTMLElement;\n const anchor = target.closest('a');\n\n if (anchor) {\n const href = anchor.getAttribute('href');\n if (href?.startsWith('/') || href?.includes('movie-keeper.fr')) {\n event.preventDefault();\n event.stopPropagation();\n const path = href.replace('https://movie-keeper.fr', '');\n this.routerService.router.navigate([path]);\n }\n }\n }\n}\n","@if (data()) {\n <markdown\n class=\"markdown\"\n [data]=\"data()\"\n (click)=\"handleClick($event)\"\n (keydown)=\"handleClick($event)\"\n />\n}\n","import { inject, Injectable } from '@angular/core';\nimport { BaseSearchService } from '@ng-vagabond-lab/ng-dsv/base/service';\nimport { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';\nimport { NewsDto } from '../../dto/news.dto';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NewsListService extends BaseSearchService<NewsDto> {\n readonly authService = inject(AuthService);\n\n readonly news = this.datas;\n\n override getEndPoint(): string {\n return '/news/findBy';\n }\n\n override getParams(): string {\n let fields = '(title%And|Description%)AndActive>>creationDateDesc';\n let values = this.search() + ',' + this.search() + ',true';\n if (this.authService.isAdmin()) {\n fields = '(title%And|Description%)>>creationDateDesc';\n values = this.search() + ',' + this.search() + '';\n }\n return (\n '&fields=' +\n encodeURIComponent(fields) +\n '&values=' +\n values +\n '&first=' +\n (this.page() - 1) +\n '&max=20'\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;MAUa,qBAAqB,CAAA;AACrB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IAErC,IAAI,GAAG,KAAK,CAAqB,EAAE;6EAAC;AAE7C,IAAA,WAAW,CAAC,KAAiC,EAAA;AACzC,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB;QAC1C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,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFZ,MAAM,EAAA,CAAA;;2FAET,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, inject, Injectable, signal, computed, effect } from '@angular/core';
|
|
3
|
+
import { RouterLink } from '@angular/router';
|
|
4
|
+
import { BaseRouteContainer } from '@ng-vagabond-lab/ng-dsv/base';
|
|
5
|
+
import { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';
|
|
6
|
+
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
7
|
+
import { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';
|
|
8
|
+
import { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';
|
|
9
|
+
import { N as NewsMarkdownContainer, a as NewsListService } from './ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs';
|
|
10
|
+
import { BaseFetchService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
11
|
+
import { StoreMap } from '@ng-vagabond-lab/ng-dsv/storage';
|
|
12
|
+
|
|
13
|
+
class NewsCardComponent {
|
|
14
|
+
news = input(/* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [undefined, { debugName: "news" }] : /* istanbul ignore next */ []));
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NewsCardComponent, isStandalone: true, selector: "app-news-card", inputs: { news: { classPropertyName: "news", publicName: "news", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<dsv-card>\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <dsv-card-header>\n <dsv-button class=\"round\" icon=\"ri-arrow-left-s-line\" color=\"inherit\" routerLink=\"/news\" />\n <h1 [class.error]=\"!news()?.active\">{{ news()?.title }}</h1>\n <ng-content select=\".update-button\"></ng-content>\n </dsv-card-header>\n <span class=\"subtitle\">\n @if (news()?.creationDate) {\n Le {{ news()?.creationDate! | formatDate: true }}\n }\n </span>\n <app-news-markdown-container [data]=\"news()?.description\" />\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px}:host dsv-card{position:relative}:host dsv-card h1{margin:0}:host dsv-card h2{margin:0 0 5px}:host dsv-card img{width:calc(100% + 20px)}:host dsv-card .news-image{margin:0 0 5px;width:100%}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px;margin:0 0 10px}:host dsv-card dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-card dsv-card-header h1,:host dsv-card dsv-card-header h2{flex:1}:host app-news-markdown-container{margin:20px 0}\n"], dependencies: [{ kind: "component", type: DsvCardComponent, selector: "dsv-card", inputs: ["border"] }, { kind: "component", type: NewsMarkdownContainer, selector: "app-news-markdown-container", inputs: ["data"] }, { kind: "component", type: DsvCardHeaderComponent, selector: "dsv-card-header" }, { kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "pipe", type: DateFormatPipe, name: "formatDate" }] });
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsCardComponent, decorators: [{
|
|
20
|
+
type: Component,
|
|
21
|
+
args: [{ selector: 'app-news-card', imports: [
|
|
22
|
+
DsvCardComponent,
|
|
23
|
+
DateFormatPipe,
|
|
24
|
+
NewsMarkdownContainer,
|
|
25
|
+
DsvCardHeaderComponent,
|
|
26
|
+
DsvButtonComponent,
|
|
27
|
+
RouterLink,
|
|
28
|
+
], template: "<dsv-card>\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <dsv-card-header>\n <dsv-button class=\"round\" icon=\"ri-arrow-left-s-line\" color=\"inherit\" routerLink=\"/news\" />\n <h1 [class.error]=\"!news()?.active\">{{ news()?.title }}</h1>\n <ng-content select=\".update-button\"></ng-content>\n </dsv-card-header>\n <span class=\"subtitle\">\n @if (news()?.creationDate) {\n Le {{ news()?.creationDate! | formatDate: true }}\n }\n </span>\n <app-news-markdown-container [data]=\"news()?.description\" />\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px}:host dsv-card{position:relative}:host dsv-card h1{margin:0}:host dsv-card h2{margin:0 0 5px}:host dsv-card img{width:calc(100% + 20px)}:host dsv-card .news-image{margin:0 0 5px;width:100%}:host dsv-card dsv-card-header{display:flex;flex-direction:row;align-items:center;gap:5px;margin:0 0 10px}:host dsv-card dsv-card-header dsv-button.round{--button-border-radius: 50%}:host dsv-card dsv-card-header h1,:host dsv-card dsv-card-header h2{flex:1}:host app-news-markdown-container{margin:20px 0}\n"] }]
|
|
29
|
+
}], propDecorators: { news: [{ type: i0.Input, args: [{ isSignal: true, alias: "news", required: false }] }] } });
|
|
30
|
+
|
|
31
|
+
class NewsService extends BaseFetchService {
|
|
32
|
+
newsListService = inject(NewsListService);
|
|
33
|
+
news = new StoreMap();
|
|
34
|
+
doFetchNews(newsId) {
|
|
35
|
+
const url = '/news/' + newsId;
|
|
36
|
+
const data = this.getDataFromState(url);
|
|
37
|
+
if (data) {
|
|
38
|
+
this.initNews(newsId, data);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.apiService.get(url, (data) => {
|
|
42
|
+
this.setDataToState(url, data);
|
|
43
|
+
this.initNews(newsId, data);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
initNews(newsId, data) {
|
|
47
|
+
this.news.set(newsId, data);
|
|
48
|
+
}
|
|
49
|
+
createOrUpdate(news, callback) {
|
|
50
|
+
const toast = "La news '" + news.title + "' a bien été " + (news.id ? 'mise a jour' : 'créer') + '.';
|
|
51
|
+
this.apiService.createOrUpdate('news', news, (data) => {
|
|
52
|
+
this.news.set(data.id, data);
|
|
53
|
+
this.newsListService.fetchByPage(this.newsListService.search(), 1);
|
|
54
|
+
callback?.(data);
|
|
55
|
+
}, toast);
|
|
56
|
+
}
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsService, providedIn: 'root' });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsService, decorators: [{
|
|
61
|
+
type: Injectable,
|
|
62
|
+
args: [{
|
|
63
|
+
providedIn: 'root',
|
|
64
|
+
}]
|
|
65
|
+
}] });
|
|
66
|
+
|
|
67
|
+
class NewsContainer extends BaseRouteContainer {
|
|
68
|
+
auhService = inject(AuthService);
|
|
69
|
+
newsService = inject(NewsService);
|
|
70
|
+
newsId = signal(0, /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "newsId" }] : /* istanbul ignore next */ []));
|
|
72
|
+
news = signal(undefined, /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "news" }] : /* istanbul ignore next */ []));
|
|
74
|
+
isAdmin = computed(() => this.auhService.hasRole('ADMIN'), /* @ts-ignore */
|
|
75
|
+
...(ngDevMode ? [{ debugName: "isAdmin" }] : /* istanbul ignore next */ []));
|
|
76
|
+
constructor() {
|
|
77
|
+
super();
|
|
78
|
+
effect(() => {
|
|
79
|
+
const newsId = Number(this.routeParams()?.['newsId']);
|
|
80
|
+
if (Number.isInteger(newsId)) {
|
|
81
|
+
this.newsId?.set(newsId);
|
|
82
|
+
if (this.newsService.news.get(newsId)) {
|
|
83
|
+
const news = this.newsService.news.get(newsId);
|
|
84
|
+
this.seoService.setMeta(news?.title, news?.resume, news?.image);
|
|
85
|
+
}
|
|
86
|
+
else if (this.authService.canFetch()) {
|
|
87
|
+
this.newsService.doFetchNews(newsId);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
effect(() => {
|
|
92
|
+
if (this.newsId() && this.newsService.news.data()) {
|
|
93
|
+
this.news.set(this.newsService.news.get(this.newsId()));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async doShare(news) {
|
|
98
|
+
await globalThis.navigator.share({
|
|
99
|
+
title: news.title,
|
|
100
|
+
text: news.resume,
|
|
101
|
+
url: 'https://movie-keeper.fr/news/' + news.id,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NewsContainer, isStandalone: true, selector: "app-news", usesInheritance: true, ngImport: i0, template: "<app-news-card [news]=\"news()\">\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-share-line\"\n (callback)=\"doShare(news()!)\"\n />\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news()?.id\"\n />\n }\n</app-news-card>\n", styles: [":host{display:flex}\n"], dependencies: [{ kind: "component", type: NewsCardComponent, selector: "app-news-card", inputs: ["news"] }, { kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NewsContainer, decorators: [{
|
|
108
|
+
type: Component,
|
|
109
|
+
args: [{ selector: 'app-news', imports: [NewsCardComponent, DsvButtonComponent, RouterLink], template: "<app-news-card [news]=\"news()\">\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-share-line\"\n (callback)=\"doShare(news()!)\"\n />\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news()?.id\"\n />\n }\n</app-news-card>\n", styles: [":host{display:flex}\n"] }]
|
|
110
|
+
}], ctorParameters: () => [] });
|
|
111
|
+
|
|
112
|
+
export { NewsContainer };
|
|
113
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs","sources":["../../../projects/ng-dsv/module/news/component/card/news-card.component.ts","../../../projects/ng-dsv/module/news/component/card/news-card.component.html","../../../projects/ng-dsv/module/news/service/news.service.ts","../../../projects/ng-dsv/module/news/container/news.container.ts","../../../projects/ng-dsv/module/news/container/news.container.html"],"sourcesContent":["import { Component, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';\nimport { NewsMarkdownContainer } from '../../container/markdown/news-markdown.container';\nimport { NewsDto } from '../../dto/news.dto';\n\n@Component({\n selector: 'app-news-card',\n imports: [\n DsvCardComponent,\n DateFormatPipe,\n NewsMarkdownContainer,\n DsvCardHeaderComponent,\n DsvButtonComponent,\n RouterLink,\n ],\n templateUrl: './news-card.component.html',\n styleUrl: './news-card.component.scss',\n})\nexport class NewsCardComponent {\n readonly news = input<NewsDto>();\n}\n","<dsv-card>\n @if (news()?.image) {\n <img class=\"news-image\" [src]=\"news()?.image\" alt=\"\" />\n }\n <dsv-card-header>\n <dsv-button class=\"round\" icon=\"ri-arrow-left-s-line\" color=\"inherit\" routerLink=\"/news\" />\n <h1 [class.error]=\"!news()?.active\">{{ news()?.title }}</h1>\n <ng-content select=\".update-button\"></ng-content>\n </dsv-card-header>\n <span class=\"subtitle\">\n @if (news()?.creationDate) {\n Le {{ news()?.creationDate! | formatDate: true }}\n }\n </span>\n <app-news-markdown-container [data]=\"news()?.description\" />\n</dsv-card>\n","import { inject, Injectable } from '@angular/core';\nimport { ID } from '@ng-vagabond-lab/ng-dsv/api';\nimport { BaseFetchService } from '@ng-vagabond-lab/ng-dsv/base/service';\nimport { StoreMap } from '@ng-vagabond-lab/ng-dsv/storage';\nimport { NewsDto } from '../dto/news.dto';\nimport { NewsListService } from './list/news-list.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NewsService extends BaseFetchService<NewsDto> {\n readonly newsListService = inject(NewsListService);\n readonly news = new StoreMap<ID, NewsDto>();\n\n doFetchNews(newsId: number): void {\n const url = '/news/' + newsId;\n const data = this.getDataFromState(url);\n if (data) {\n this.initNews(newsId, data);\n return;\n }\n this.apiService.get<NewsDto>(url, (data) => {\n this.setDataToState(url, data);\n this.initNews(newsId, data);\n });\n }\n\n initNews(newsId: ID, data: NewsDto) {\n this.news.set(newsId, data);\n }\n\n createOrUpdate(news: NewsDto, callback?: (data: NewsDto) => void) {\n const toast = \"La news '\" + news.title + \"' a bien été \" + (news.id ? 'mise a jour' : 'créer') + '.';\n this.apiService.createOrUpdate<NewsDto>(\n 'news',\n news,\n (data) => {\n this.news.set(data.id, data);\n this.newsListService.fetchByPage(this.newsListService.search(), 1);\n callback?.(data);\n },\n toast,\n );\n }\n}\n","import { Component, computed, effect, inject, signal } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { BaseRouteContainer } from '@ng-vagabond-lab/ng-dsv/base';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';\nimport { NewsCardComponent } from '../component/card/news-card.component';\nimport { NewsDto } from '../dto/news.dto';\nimport { NewsService } from '../service/news.service';\n\n@Component({\n selector: 'app-news',\n imports: [NewsCardComponent, DsvButtonComponent, RouterLink],\n templateUrl: './news.container.html',\n styleUrl: './news.container.scss',\n})\nexport class NewsContainer extends BaseRouteContainer {\n readonly auhService = inject(AuthService);\n readonly newsService = inject(NewsService);\n\n readonly newsId = signal<number>(0);\n readonly news = signal<NewsDto | undefined>(undefined);\n\n readonly isAdmin = computed<boolean>(() => this.auhService.hasRole('ADMIN'));\n\n constructor() {\n super();\n effect(() => {\n const newsId = Number(this.routeParams()?.['newsId']);\n if (Number.isInteger(newsId)) {\n this.newsId?.set(newsId);\n if (this.newsService.news.get(newsId)) {\n const news = this.newsService.news.get(newsId);\n this.seoService.setMeta(news?.title!, news?.resume!, news?.image);\n } else if (this.authService.canFetch()) {\n this.newsService.doFetchNews(newsId);\n }\n }\n });\n effect(() => {\n if (this.newsId() && this.newsService.news.data()) {\n this.news.set(this.newsService.news.get(this.newsId()));\n }\n });\n }\n\n async doShare(news: NewsDto): Promise<void> {\n await globalThis.navigator.share({\n title: news.title,\n text: news.resume,\n url: 'https://movie-keeper.fr/news/' + news.id,\n });\n }\n}\n","<app-news-card [news]=\"news()\">\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-share-line\"\n (callback)=\"doShare(news()!)\"\n />\n @if (isAdmin()) {\n <dsv-button\n class=\"update-button\"\n color=\"secondary\"\n variant=\"outlined\"\n icon=\"ri-tools-line\"\n [routerLink]=\"'/news/update/' + news()?.id\"\n />\n }\n</app-news-card>\n"],"names":[],"mappings":";;;;;;;;;;;;MAqBa,iBAAiB,CAAA;AACjB,IAAA,IAAI,GAAG,KAAK;wFAAW;uGADvB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrB9B,qoBAgBA,EAAA,MAAA,EAAA,CAAA,uiBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDLQ,gBAAgB,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAEhB,qBAAqB,EAAA,QAAA,EAAA,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,2fAAA,EAAA,MAAA,EAAA,CAAA,uBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { authGuard } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
2
|
+
|
|
3
|
+
const NewsRoute = [
|
|
4
|
+
{
|
|
5
|
+
path: '',
|
|
6
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs').then((m) => m.NewsListContainer),
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
path: 'create',
|
|
10
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs').then((m) => m.NewsFormContainer),
|
|
11
|
+
canActivate: [authGuard('ADMIN')],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
path: 'update/:newsId',
|
|
15
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs').then((m) => m.NewsFormContainer),
|
|
16
|
+
canActivate: [authGuard('ADMIN')],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
path: ':newsId',
|
|
20
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs').then((m) => m.NewsContainer),
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
//export * from './component/card/news-card.component';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Generated bundle index. Do not edit.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export { NewsRoute };
|
|
31
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news.mjs","sources":["../../../projects/ng-dsv/module/news/route/news.route.ts","../../../projects/ng-dsv/module/news/public-api.ts","../../../projects/ng-dsv/module/news/ng-vagabond-lab-ng-dsv-module-news.ts"],"sourcesContent":["import { Routes } from '@angular/router';\nimport { authGuard } from '@ng-vagabond-lab/ng-dsv/module/auth';\n\nexport const NewsRoute: Routes = [\n {\n path: '',\n loadComponent: () => import('../container/list/news-list.container').then((m) => m.NewsListContainer),\n },\n {\n path: 'create',\n loadComponent: () => import('../container/form/news-form.container').then((m) => m.NewsFormContainer),\n canActivate: [authGuard('ADMIN')],\n },\n {\n path: 'update/:newsId',\n loadComponent: () => import('../container/form/news-form.container').then((m) => m.NewsFormContainer),\n canActivate: [authGuard('ADMIN')],\n },\n {\n path: ':newsId',\n loadComponent: () => import('../container/news.container').then((m) => m.NewsContainer),\n },\n];\n","//export * from './component/card/news-card.component';\nexport * from './route/news.route';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAGO,MAAM,SAAS,GAAW;AAC7B,IAAA;AACI,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,aAAa,EAAE,MAAM,OAAO,uEAAuC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AACxG,KAAA;AACD,IAAA;AACI,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,aAAa,EAAE,MAAM,OAAO,uEAAuC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AACrG,QAAA,WAAW,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACpC,KAAA;AACD,IAAA;AACI,QAAA,IAAI,EAAE,gBAAgB;AACtB,QAAA,aAAa,EAAE,MAAM,OAAO,uEAAuC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AACrG,QAAA,WAAW,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACpC,KAAA;AACD,IAAA;AACI,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,aAAa,EAAE,MAAM,OAAO,kEAA6B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;AAC1F,KAAA;;;ACrBL;;ACAA;;AAEG;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, viewChild, signal, effect, Component, Injectable, inject } from '@angular/core';
|
|
3
|
+
import { form } from '@angular/forms/signals';
|
|
4
|
+
import { RouterLink } from '@angular/router';
|
|
5
|
+
import { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';
|
|
6
|
+
import { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';
|
|
7
|
+
import { DsvFormSignalCheckboxComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/signal';
|
|
8
|
+
import { DsvChipComponent } from '@ng-vagabond-lab/ng-dsv/ds/chip';
|
|
9
|
+
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
10
|
+
import { BaseSearchService, BaseApiService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
11
|
+
import { RouterService } from '@ng-vagabond-lab/ng-dsv/router';
|
|
12
|
+
import { BaseSearchContainer } from '@ng-vagabond-lab/ng-dsv/base';
|
|
13
|
+
import { DsvCardComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';
|
|
14
|
+
import { DsvFormReactiveSearchbarComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/reactive';
|
|
15
|
+
import { DsvModalAlertComponent, DsvModalButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/modal';
|
|
16
|
+
import { DsvScrollInfiniteContainer } from '@ng-vagabond-lab/ng-dsv/ds/scroll';
|
|
17
|
+
|
|
18
|
+
class NotificationComponent {
|
|
19
|
+
notification = input(/* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [undefined, { debugName: "notification" }] : /* istanbul ignore next */ []));
|
|
21
|
+
readonly = input(false, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
23
|
+
callback = output();
|
|
24
|
+
checkboxRef = viewChild('checkbox', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "checkboxRef" }] : /* istanbul ignore next */ []));
|
|
26
|
+
url = signal('', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "url" }] : /* istanbul ignore next */ []));
|
|
28
|
+
readForm = form(signal({
|
|
29
|
+
read: this.notification()?.read,
|
|
30
|
+
}));
|
|
31
|
+
constructor() {
|
|
32
|
+
effect(() => {
|
|
33
|
+
this.url.set(new URL(this.notification()?.url).pathname);
|
|
34
|
+
});
|
|
35
|
+
effect(() => {
|
|
36
|
+
this.readForm().reset({
|
|
37
|
+
read: this.notification()?.read,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
triggerCheckbox() {
|
|
42
|
+
this.checkboxRef()?.nativeElement.querySelector('input').click();
|
|
43
|
+
}
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NotificationComponent, isStandalone: true, selector: "app-notification", inputs: { notification: { classPropertyName: "notification", publicName: "notification", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { callback: "callback" }, viewQueries: [{ propertyName: "checkboxRef", first: true, predicate: ["checkbox"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!readonly()) {\n <div #checkbox>\n <dsv-form-signal-checkbox\n [form]=\"readForm\"\n fieldName=\"read\"\n [withLabel]=\"false\"\n (callbackChange)=\"callback.emit(notification()!)\"\n />\n </div>\n}\n\n<div\n class=\"notification-content\"\n [class.readonly]=\"readonly()\"\n (click)=\"triggerCheckbox()\"\n (keyup)=\"triggerCheckbox()\"\n>\n <b [class.read]=\"!notification()?.read && !readonly()\">\n <span class=\"subtitle\">{{ notification()?.creationDate! | formatDate: true }} : </span>\n {{ notification()?.title }}\n </b>\n <span>{{ notification()?.message }}</span>\n</div>\n\n@if (!readonly()) {\n <dsv-button icon=\"ri-external-link-line\" color=\"secondary\" [routerLink]=\"url()\" [prevent]=\"false\" />\n}\n", styles: [":host{display:flex;flex-direction:row;gap:15px;background:var(--background-card);padding:10px;border-bottom:1px solid var(--border);align-items:center}:host .notification-content{cursor:pointer;display:flex;flex-direction:column;gap:5px;flex:1}:host .notification-content b{margin:5px 0}:host .notification-content.readonly{cursor:default}:host .notification-content .read{color:var(--secondary)}:host dsv-form-signal-checkbox{padding:0!important;margin-bottom:0!important;max-width:30px}:host dsv-button{--button-border-radius: 50%}\n"], dependencies: [{ kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: DsvFormSignalCheckboxComponent, selector: "dsv-form-signal-checkbox" }, { kind: "pipe", type: DateFormatPipe, name: "formatDate" }] });
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
48
|
+
type: Component,
|
|
49
|
+
args: [{ selector: 'app-notification', imports: [DateFormatPipe, DsvButtonComponent, RouterLink, DsvFormSignalCheckboxComponent], template: "@if (!readonly()) {\n <div #checkbox>\n <dsv-form-signal-checkbox\n [form]=\"readForm\"\n fieldName=\"read\"\n [withLabel]=\"false\"\n (callbackChange)=\"callback.emit(notification()!)\"\n />\n </div>\n}\n\n<div\n class=\"notification-content\"\n [class.readonly]=\"readonly()\"\n (click)=\"triggerCheckbox()\"\n (keyup)=\"triggerCheckbox()\"\n>\n <b [class.read]=\"!notification()?.read && !readonly()\">\n <span class=\"subtitle\">{{ notification()?.creationDate! | formatDate: true }} : </span>\n {{ notification()?.title }}\n </b>\n <span>{{ notification()?.message }}</span>\n</div>\n\n@if (!readonly()) {\n <dsv-button icon=\"ri-external-link-line\" color=\"secondary\" [routerLink]=\"url()\" [prevent]=\"false\" />\n}\n", styles: [":host{display:flex;flex-direction:row;gap:15px;background:var(--background-card);padding:10px;border-bottom:1px solid var(--border);align-items:center}:host .notification-content{cursor:pointer;display:flex;flex-direction:column;gap:5px;flex:1}:host .notification-content b{margin:5px 0}:host .notification-content.readonly{cursor:default}:host .notification-content .read{color:var(--secondary)}:host dsv-form-signal-checkbox{padding:0!important;margin-bottom:0!important;max-width:30px}:host dsv-button{--button-border-radius: 50%}\n"] }]
|
|
50
|
+
}], ctorParameters: () => [], propDecorators: { notification: [{ type: i0.Input, args: [{ isSignal: true, alias: "notification", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], callback: [{ type: i0.Output, args: ["callback"] }], checkboxRef: [{ type: i0.ViewChild, args: ['checkbox', { isSignal: true }] }] } });
|
|
51
|
+
|
|
52
|
+
class NotificationSearchService extends BaseSearchService {
|
|
53
|
+
notifications = this.datas;
|
|
54
|
+
getEndPoint() {
|
|
55
|
+
return '/notification/search';
|
|
56
|
+
}
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationSearchService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationSearchService, providedIn: 'root' });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationSearchService, decorators: [{
|
|
61
|
+
type: Injectable,
|
|
62
|
+
args: [{ providedIn: 'root' }]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
class NotificationService extends BaseApiService {
|
|
66
|
+
notificationSearchService = inject(NotificationSearchService);
|
|
67
|
+
routerService = inject(RouterService);
|
|
68
|
+
nbRead = signal(0, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "nbRead" }] : /* istanbul ignore next */ []));
|
|
70
|
+
fetchNbRead() {
|
|
71
|
+
this.apiService.get('/notification/count', (data) => {
|
|
72
|
+
if (data !== this.nbRead()) {
|
|
73
|
+
this.notificationSearchService.notifications.set([]);
|
|
74
|
+
this.notificationSearchService.search.set('');
|
|
75
|
+
this.notificationSearchService.page.set(1);
|
|
76
|
+
}
|
|
77
|
+
this.nbRead.set(Number(data));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
readAll(callback) {
|
|
81
|
+
this.apiService.put('/notification/read-all', {}, () => {
|
|
82
|
+
this.nbRead.set(0);
|
|
83
|
+
callback();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
notificationRead(notification) {
|
|
87
|
+
this.apiService.put('/notification/read/' + notification.id, {}, () => {
|
|
88
|
+
this.nbRead.update((nb) => nb + (notification.read ? -1 : 1));
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
92
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationService, decorators: [{
|
|
95
|
+
type: Injectable,
|
|
96
|
+
args: [{ providedIn: 'root' }]
|
|
97
|
+
}] });
|
|
98
|
+
|
|
99
|
+
class NotificationButtonContainer {
|
|
100
|
+
authService = inject(AuthService);
|
|
101
|
+
notificationService = inject(NotificationService);
|
|
102
|
+
nbRead = signal('', /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "nbRead" }] : /* istanbul ignore next */ []));
|
|
104
|
+
constructor() {
|
|
105
|
+
effect(() => {
|
|
106
|
+
const nbRead = this.notificationService.nbRead();
|
|
107
|
+
if (nbRead > 99) {
|
|
108
|
+
this.nbRead.set('99+');
|
|
109
|
+
}
|
|
110
|
+
else if (nbRead > 0) {
|
|
111
|
+
this.nbRead.set(nbRead.toString());
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.nbRead.set('');
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationButtonContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
119
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NotificationButtonContainer, isStandalone: true, selector: "app-notification-button-container", ngImport: i0, template: "@if (nbRead()) {\n <dsv-chip color=\"secondary\" [text]=\"nbRead()\" routerLink=\"/notification\" />\n}\n<dsv-button\n icon=\"ri-notification-line\"\n routerLink=\"/notification\"\n variant=\"text\"\n color=\"inherit\"\n [prevent]=\"false\"\n/>\n", styles: [":host{position:relative}:host dsv-chip{cursor:pointer;position:absolute;top:-5px;right:-5px;z-index:1;padding:1px 5px;min-width:10px;border-radius:15px;font-size:.9rem;font-weight:300}\n"], dependencies: [{ kind: "component", type: DsvButtonComponent, selector: "dsv-button", inputs: ["libelle", "routerLink", "icon", "iconEnd", "disabled", "noHover", "type", "prevent"], outputs: ["callback"] }, { kind: "component", type: DsvChipComponent, selector: "dsv-chip", inputs: ["text"], outputs: ["delete"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
120
|
+
}
|
|
121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationButtonContainer, decorators: [{
|
|
122
|
+
type: Component,
|
|
123
|
+
args: [{ selector: 'app-notification-button-container', imports: [DsvButtonComponent, DsvChipComponent, RouterLink], template: "@if (nbRead()) {\n <dsv-chip color=\"secondary\" [text]=\"nbRead()\" routerLink=\"/notification\" />\n}\n<dsv-button\n icon=\"ri-notification-line\"\n routerLink=\"/notification\"\n variant=\"text\"\n color=\"inherit\"\n [prevent]=\"false\"\n/>\n", styles: [":host{position:relative}:host dsv-chip{cursor:pointer;position:absolute;top:-5px;right:-5px;z-index:1;padding:1px 5px;min-width:10px;border-radius:15px;font-size:.9rem;font-weight:300}\n"] }]
|
|
124
|
+
}], ctorParameters: () => [] });
|
|
125
|
+
|
|
126
|
+
class NotificationContainer extends BaseSearchContainer {
|
|
127
|
+
notificationSearchService;
|
|
128
|
+
notificationService = inject(NotificationService);
|
|
129
|
+
constructor(notificationSearchService) {
|
|
130
|
+
super(notificationSearchService);
|
|
131
|
+
this.notificationSearchService = notificationSearchService;
|
|
132
|
+
this.requiredRole.set('USER');
|
|
133
|
+
}
|
|
134
|
+
doRead(notificaton) {
|
|
135
|
+
notificaton.read = !notificaton.read;
|
|
136
|
+
this.notificationService.notificationRead(notificaton);
|
|
137
|
+
}
|
|
138
|
+
doReadAll() {
|
|
139
|
+
this.notificationService.readAll(() => {
|
|
140
|
+
this.notificationSearchService.notifications.update((notifications) => [
|
|
141
|
+
...notifications.map((notification) => ({ ...notification, read: true })),
|
|
142
|
+
]);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationContainer, deps: [{ token: NotificationSearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: NotificationContainer, isStandalone: true, selector: "app-notification-container", usesInheritance: true, ngImport: i0, template: "<dsv-card>\n <div class=\"notification-header\">\n <h2>\n Notifications\n @if (notificationSearchService.total()) {\n <span> ({{ notificationSearchService.total() }})</span>\n }\n </h2>\n <dsv-modal-button\n modalName=\"notification-read-all\"\n text=\"Tout lire ({{ notificationService.nbRead() }})\"\n color=\"secondary\"\n variant=\"outlined\"\n ></dsv-modal-button>\n <dsv-modal-alert\n id=\"notification-read-all\"\n titleText=\"Lire toutes les notifications\"\n text=\"Voulez-vous vraiment lire toute les notifications ?\"\n button=\"Oui\"\n buttonClose=\"Non\"\n (callback)=\"doReadAll()\"\n ></dsv-modal-alert>\n </div>\n <div>\n <dsv-form-reactive-searchbar\n [search]=\"notificationSearchService.search()\"\n (callbackSearch)=\"doSearch($event)\"\n />\n </div>\n</dsv-card>\n\n@if (\n notificationSearchService.notifications().length === 0 &&\n (!notificationSearchService.isLoading() || notificationSearchService.stopFetch())\n) {\n <dsv-card>\n <p>Aucun r\u00E9sultat trouv\u00E9</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite [loading]=\"notificationSearchService.isLoading()\" (callback)=\"doFetch()\">\n @for (notification of notificationSearchService.notifications(); track notification.id) {\n <app-notification [notification]=\"notification\" (callback)=\"doRead($event)\" />\n }\n </dsv-scroll-infinite>\n}\n", styles: [":host{display:flex;overflow:hidden;flex-direction:column}:host dsv-card{margin:0 5px 5px;width:calc(100% - 10px);gap:10px}:host dsv-card h2{margin:0}:host dsv-card dsv-form-reactive-searchbar{margin:0}:host .notification-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between}:host dsv-scroll-infinite{flex-direction:column;border-radius:5px}\n"], dependencies: [{ kind: "component", type: DsvCardComponent, selector: "dsv-card", inputs: ["border"] }, { kind: "component", type: DsvScrollInfiniteContainer, selector: "dsv-scroll-infinite", inputs: ["bottomOffset", "loading", "id"], outputs: ["callback"] }, { kind: "component", type: NotificationComponent, selector: "app-notification", inputs: ["notification", "readonly"], outputs: ["callback"] }, { kind: "component", type: DsvModalAlertComponent, selector: "dsv-modal-alert", inputs: ["id", "titleText", "text", "button", "buttonClose"], outputs: ["callback"] }, { kind: "component", type: DsvModalButtonComponent, selector: "dsv-modal-button", inputs: ["modalName", "icon", "variant", "text", "color"], outputs: ["callback"] }, { kind: "component", type: DsvFormReactiveSearchbarComponent, selector: "dsv-form-reactive-searchbar", inputs: ["search"], outputs: ["callbackSearch"] }] });
|
|
147
|
+
}
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: NotificationContainer, decorators: [{
|
|
149
|
+
type: Component,
|
|
150
|
+
args: [{ selector: 'app-notification-container', imports: [
|
|
151
|
+
DsvCardComponent,
|
|
152
|
+
DsvScrollInfiniteContainer,
|
|
153
|
+
NotificationComponent,
|
|
154
|
+
DsvModalAlertComponent,
|
|
155
|
+
DsvModalButtonComponent,
|
|
156
|
+
DsvFormReactiveSearchbarComponent,
|
|
157
|
+
], template: "<dsv-card>\n <div class=\"notification-header\">\n <h2>\n Notifications\n @if (notificationSearchService.total()) {\n <span> ({{ notificationSearchService.total() }})</span>\n }\n </h2>\n <dsv-modal-button\n modalName=\"notification-read-all\"\n text=\"Tout lire ({{ notificationService.nbRead() }})\"\n color=\"secondary\"\n variant=\"outlined\"\n ></dsv-modal-button>\n <dsv-modal-alert\n id=\"notification-read-all\"\n titleText=\"Lire toutes les notifications\"\n text=\"Voulez-vous vraiment lire toute les notifications ?\"\n button=\"Oui\"\n buttonClose=\"Non\"\n (callback)=\"doReadAll()\"\n ></dsv-modal-alert>\n </div>\n <div>\n <dsv-form-reactive-searchbar\n [search]=\"notificationSearchService.search()\"\n (callbackSearch)=\"doSearch($event)\"\n />\n </div>\n</dsv-card>\n\n@if (\n notificationSearchService.notifications().length === 0 &&\n (!notificationSearchService.isLoading() || notificationSearchService.stopFetch())\n) {\n <dsv-card>\n <p>Aucun r\u00E9sultat trouv\u00E9</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite [loading]=\"notificationSearchService.isLoading()\" (callback)=\"doFetch()\">\n @for (notification of notificationSearchService.notifications(); track notification.id) {\n <app-notification [notification]=\"notification\" (callback)=\"doRead($event)\" />\n }\n </dsv-scroll-infinite>\n}\n", styles: [":host{display:flex;overflow:hidden;flex-direction:column}:host dsv-card{margin:0 5px 5px;width:calc(100% - 10px);gap:10px}:host dsv-card h2{margin:0}:host dsv-card dsv-form-reactive-searchbar{margin:0}:host .notification-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between}:host dsv-scroll-infinite{flex-direction:column;border-radius:5px}\n"] }]
|
|
158
|
+
}], ctorParameters: () => [{ type: NotificationSearchService }] });
|
|
159
|
+
|
|
160
|
+
var notification_container = /*#__PURE__*/Object.freeze({
|
|
161
|
+
__proto__: null,
|
|
162
|
+
NotificationContainer: NotificationContainer
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const NotificationRoute = [
|
|
166
|
+
{
|
|
167
|
+
path: '',
|
|
168
|
+
loadComponent: () => Promise.resolve().then(function () { return notification_container; }).then((m) => m.NotificationContainer),
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Generated bundle index. Do not edit.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export { NotificationButtonContainer, NotificationComponent, NotificationContainer, NotificationRoute, NotificationSearchService, NotificationService };
|
|
177
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-notification.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-notification.mjs","sources":["../../../projects/ng-dsv/module/notification/component/notification.component.ts","../../../projects/ng-dsv/module/notification/component/notification.component.html","../../../projects/ng-dsv/module/notification/service/notification-search.service.ts","../../../projects/ng-dsv/module/notification/service/notification.service.ts","../../../projects/ng-dsv/module/notification/container/button/notification-button.container.ts","../../../projects/ng-dsv/module/notification/container/button/notification-button.container.html","../../../projects/ng-dsv/module/notification/container/notification.container.ts","../../../projects/ng-dsv/module/notification/container/notification.container.html","../../../projects/ng-dsv/module/notification/route/notification.route.ts","../../../projects/ng-dsv/module/notification/ng-vagabond-lab-ng-dsv-module-notification.ts"],"sourcesContent":["import { Component, effect, ElementRef, input, output, signal, viewChild } from '@angular/core';\nimport { form } from '@angular/forms/signals';\nimport { RouterLink } from '@angular/router';\nimport { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { DsvFormSignalCheckboxComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/signal';\nimport { NotificationDto } from '../dto/notification.dto';\n\n@Component({\n selector: 'app-notification',\n imports: [DateFormatPipe, DsvButtonComponent, RouterLink, DsvFormSignalCheckboxComponent],\n templateUrl: './notification.component.html',\n styleUrls: ['./notification.component.scss'],\n})\nexport class NotificationComponent {\n readonly notification = input<NotificationDto>();\n readonly readonly = input<boolean>(false);\n\n readonly callback = output<NotificationDto>();\n\n readonly checkboxRef = viewChild<ElementRef>('checkbox');\n\n readonly url = signal<string>('');\n\n readonly readForm = form(\n signal({\n read: this.notification()?.read,\n }),\n );\n\n constructor() {\n effect(() => {\n this.url.set(new URL(this.notification()?.url!).pathname);\n });\n effect(() => {\n this.readForm().reset({\n read: this.notification()?.read,\n });\n });\n }\n\n triggerCheckbox(): void {\n this.checkboxRef()?.nativeElement.querySelector('input').click();\n }\n}\n","@if (!readonly()) {\n <div #checkbox>\n <dsv-form-signal-checkbox\n [form]=\"readForm\"\n fieldName=\"read\"\n [withLabel]=\"false\"\n (callbackChange)=\"callback.emit(notification()!)\"\n />\n </div>\n}\n\n<div\n class=\"notification-content\"\n [class.readonly]=\"readonly()\"\n (click)=\"triggerCheckbox()\"\n (keyup)=\"triggerCheckbox()\"\n>\n <b [class.read]=\"!notification()?.read && !readonly()\">\n <span class=\"subtitle\">{{ notification()?.creationDate! | formatDate: true }} : </span>\n {{ notification()?.title }}\n </b>\n <span>{{ notification()?.message }}</span>\n</div>\n\n@if (!readonly()) {\n <dsv-button icon=\"ri-external-link-line\" color=\"secondary\" [routerLink]=\"url()\" [prevent]=\"false\" />\n}\n","import { Injectable } from '@angular/core';\nimport { BaseSearchService } from '@ng-vagabond-lab/ng-dsv/base/service';\nimport { NotificationDto } from '../dto/notification.dto';\n\n@Injectable({ providedIn: 'root' })\nexport class NotificationSearchService extends BaseSearchService<NotificationDto> {\n readonly notifications = this.datas;\n\n override getEndPoint(): string {\n return '/notification/search';\n }\n}\n","import { inject, Injectable, signal } from '@angular/core';\nimport { JSONObject } from '@ng-vagabond-lab/ng-dsv/api';\nimport { BaseApiService } from '@ng-vagabond-lab/ng-dsv/base/service';\nimport { RouterService } from '@ng-vagabond-lab/ng-dsv/router';\nimport { NotificationDto } from '../dto/notification.dto';\nimport { NotificationSearchService } from './notification-search.service';\n\n@Injectable({ providedIn: 'root' })\nexport class NotificationService extends BaseApiService {\n readonly notificationSearchService = inject(NotificationSearchService);\n readonly routerService = inject(RouterService);\n\n readonly nbRead = signal<number>(0);\n\n fetchNbRead(): void {\n this.apiService.get<number>('/notification/count', (data) => {\n if (data !== this.nbRead()) {\n this.notificationSearchService.notifications.set([]);\n this.notificationSearchService.search.set('');\n this.notificationSearchService.page.set(1);\n }\n this.nbRead.set(Number(data));\n });\n }\n\n readAll(callback: () => void): void {\n this.apiService.put<JSONObject>('/notification/read-all', {}, () => {\n this.nbRead.set(0);\n callback();\n });\n }\n\n notificationRead(notification: NotificationDto): void {\n this.apiService.put('/notification/read/' + notification.id, {}, () => {\n this.nbRead.update((nb) => nb + (notification.read ? -1 : 1));\n });\n }\n}\n","import { Component, effect, inject, signal } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';\nimport { DsvChipComponent } from '@ng-vagabond-lab/ng-dsv/ds/chip';\nimport { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';\nimport { NotificationService } from '../../service/notification.service';\n\n@Component({\n selector: 'app-notification-button-container',\n imports: [DsvButtonComponent, DsvChipComponent, RouterLink],\n templateUrl: './notification-button.container.html',\n styleUrls: ['./notification-button.container.scss'],\n})\nexport class NotificationButtonContainer {\n readonly authService = inject(AuthService);\n readonly notificationService = inject(NotificationService);\n\n readonly nbRead = signal<string>('');\n\n constructor() {\n effect(() => {\n const nbRead = this.notificationService.nbRead();\n if (nbRead > 99) {\n this.nbRead.set('99+');\n } else if (nbRead > 0) {\n this.nbRead.set(nbRead.toString());\n } else {\n this.nbRead.set('');\n }\n });\n }\n}\n","@if (nbRead()) {\n <dsv-chip color=\"secondary\" [text]=\"nbRead()\" routerLink=\"/notification\" />\n}\n<dsv-button\n icon=\"ri-notification-line\"\n routerLink=\"/notification\"\n variant=\"text\"\n color=\"inherit\"\n [prevent]=\"false\"\n/>\n","import { Component, inject } from '@angular/core';\nimport { BaseSearchContainer } from '@ng-vagabond-lab/ng-dsv/base';\nimport { DsvCardComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';\nimport { DsvFormReactiveSearchbarComponent } from '@ng-vagabond-lab/ng-dsv/ds/form/reactive';\nimport { DsvModalAlertComponent, DsvModalButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/modal';\nimport { DsvScrollInfiniteContainer } from '@ng-vagabond-lab/ng-dsv/ds/scroll';\nimport { NotificationComponent } from '../component/notification.component';\nimport { NotificationDto } from '../dto/notification.dto';\nimport { NotificationSearchService } from '../service/notification-search.service';\nimport { NotificationService } from '../service/notification.service';\n\n@Component({\n selector: 'app-notification-container',\n imports: [\n DsvCardComponent,\n DsvScrollInfiniteContainer,\n NotificationComponent,\n DsvModalAlertComponent,\n DsvModalButtonComponent,\n DsvFormReactiveSearchbarComponent,\n ],\n templateUrl: './notification.container.html',\n styleUrls: ['./notification.container.scss'],\n})\nexport class NotificationContainer extends BaseSearchContainer<NotificationSearchService, NotificationDto> {\n readonly notificationService = inject(NotificationService);\n\n constructor(public notificationSearchService: NotificationSearchService) {\n super(notificationSearchService);\n this.requiredRole.set('USER');\n }\n\n doRead(notificaton: NotificationDto): void {\n notificaton.read = !notificaton.read;\n this.notificationService.notificationRead(notificaton);\n }\n\n doReadAll(): void {\n this.notificationService.readAll(() => {\n this.notificationSearchService.notifications.update((notifications) => [\n ...notifications.map((notification) => ({ ...notification, read: true })),\n ]);\n });\n }\n}\n","<dsv-card>\n <div class=\"notification-header\">\n <h2>\n Notifications\n @if (notificationSearchService.total()) {\n <span> ({{ notificationSearchService.total() }})</span>\n }\n </h2>\n <dsv-modal-button\n modalName=\"notification-read-all\"\n text=\"Tout lire ({{ notificationService.nbRead() }})\"\n color=\"secondary\"\n variant=\"outlined\"\n ></dsv-modal-button>\n <dsv-modal-alert\n id=\"notification-read-all\"\n titleText=\"Lire toutes les notifications\"\n text=\"Voulez-vous vraiment lire toute les notifications ?\"\n button=\"Oui\"\n buttonClose=\"Non\"\n (callback)=\"doReadAll()\"\n ></dsv-modal-alert>\n </div>\n <div>\n <dsv-form-reactive-searchbar\n [search]=\"notificationSearchService.search()\"\n (callbackSearch)=\"doSearch($event)\"\n />\n </div>\n</dsv-card>\n\n@if (\n notificationSearchService.notifications().length === 0 &&\n (!notificationSearchService.isLoading() || notificationSearchService.stopFetch())\n) {\n <dsv-card>\n <p>Aucun résultat trouvé</p>\n </dsv-card>\n} @else {\n <dsv-scroll-infinite [loading]=\"notificationSearchService.isLoading()\" (callback)=\"doFetch()\">\n @for (notification of notificationSearchService.notifications(); track notification.id) {\n <app-notification [notification]=\"notification\" (callback)=\"doRead($event)\" />\n }\n </dsv-scroll-infinite>\n}\n","import { Routes } from '@angular/router';\n\nexport const NotificationRoute: Routes = [\n {\n path: '',\n loadComponent: () =>\n import('../container/notification.container').then((m) => m.NotificationContainer),\n },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NotificationSearchService"],"mappings":";;;;;;;;;;;;;;;;;MAca,qBAAqB,CAAA;AACrB,IAAA,YAAY,GAAG,KAAK;gGAAmB;IACvC,QAAQ,GAAG,KAAK,CAAU,KAAK;iFAAC;IAEhC,QAAQ,GAAG,MAAM,EAAmB;IAEpC,WAAW,GAAG,SAAS,CAAa,UAAU;oFAAC;IAE/C,GAAG,GAAG,MAAM,CAAS,EAAE;4EAAC;AAExB,IAAA,QAAQ,GAAG,IAAI,CACpB,MAAM,CAAC;AACH,QAAA,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI;AAClC,KAAA,CAAC,CACL;AAED,IAAA,WAAA,GAAA;QACI,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,GAAI,CAAC,CAAC,QAAQ,CAAC;AAC7D,QAAA,CAAC,CAAC;QACF,MAAM,CAAC,MAAK;AACR,YAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;AAClB,gBAAA,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI;AAClC,aAAA,CAAC;AACN,QAAA,CAAC,CAAC;IACN;IAEA,eAAe,GAAA;AACX,QAAA,IAAI,CAAC,WAAW,EAAE,EAAE,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE;IACpE;uGA7BS,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,YAAA,EAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,U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1B,qBAAqB;wBACrB,sBAAsB;wBACtB,uBAAuB;wBACvB,iCAAiC;AACpC,qBAAA,EAAA,QAAA,EAAA,gmDAAA,EAAA,MAAA,EAAA,CAAA,2XAAA,CAAA,EAAA;;;;;;;;AElBE,MAAM,iBAAiB,GAAW;AACrC,IAAA;AACI,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,aAAa,EAAE,MACX,sEAA6C,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;AACzF,KAAA;;;ACPL;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-vagabond-lab/ng-dsv",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.35",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0"
|
|
@@ -159,6 +159,14 @@
|
|
|
159
159
|
"types": "./types/ng-vagabond-lab-ng-dsv-module-contact.d.ts",
|
|
160
160
|
"default": "./fesm2022/ng-vagabond-lab-ng-dsv-module-contact.mjs"
|
|
161
161
|
},
|
|
162
|
+
"./module/news": {
|
|
163
|
+
"types": "./types/ng-vagabond-lab-ng-dsv-module-news.d.ts",
|
|
164
|
+
"default": "./fesm2022/ng-vagabond-lab-ng-dsv-module-news.mjs"
|
|
165
|
+
},
|
|
166
|
+
"./module/notification": {
|
|
167
|
+
"types": "./types/ng-vagabond-lab-ng-dsv-module-notification.d.ts",
|
|
168
|
+
"default": "./fesm2022/ng-vagabond-lab-ng-dsv-module-notification.mjs"
|
|
169
|
+
},
|
|
162
170
|
"./platform": {
|
|
163
171
|
"types": "./types/ng-vagabond-lab-ng-dsv-platform.d.ts",
|
|
164
172
|
"default": "./fesm2022/ng-vagabond-lab-ng-dsv-platform.mjs"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as _angular_forms_signals from '@angular/forms/signals';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ElementRef } from '@angular/core';
|
|
4
|
+
import { ApiDto } from '@ng-vagabond-lab/ng-dsv/api';
|
|
5
|
+
import { UserDto, AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
6
|
+
import { BaseSearchService, BaseApiService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
7
|
+
import { RouterService } from '@ng-vagabond-lab/ng-dsv/router';
|
|
8
|
+
import { BaseSearchContainer } from '@ng-vagabond-lab/ng-dsv/base';
|
|
9
|
+
import { Routes } from '@angular/router';
|
|
10
|
+
|
|
11
|
+
interface NotificationDto extends ApiDto {
|
|
12
|
+
entityId: number;
|
|
13
|
+
title: string;
|
|
14
|
+
message: string;
|
|
15
|
+
url: string;
|
|
16
|
+
read: boolean;
|
|
17
|
+
superType: string;
|
|
18
|
+
type: string;
|
|
19
|
+
category: string;
|
|
20
|
+
user: UserDto;
|
|
21
|
+
users: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class NotificationComponent {
|
|
25
|
+
readonly notification: i0.InputSignal<NotificationDto | undefined>;
|
|
26
|
+
readonly readonly: i0.InputSignal<boolean>;
|
|
27
|
+
readonly callback: i0.OutputEmitterRef<NotificationDto>;
|
|
28
|
+
readonly checkboxRef: i0.Signal<ElementRef<any> | undefined>;
|
|
29
|
+
readonly url: i0.WritableSignal<string>;
|
|
30
|
+
readonly readForm: _angular_forms_signals.FieldTree<{
|
|
31
|
+
read: boolean | undefined;
|
|
32
|
+
}, string | number, "writable">;
|
|
33
|
+
constructor();
|
|
34
|
+
triggerCheckbox(): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NotificationComponent, "app-notification", never, { "notification": { "alias": "notification"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, { "callback": "callback"; }, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class NotificationSearchService extends BaseSearchService<NotificationDto> {
|
|
40
|
+
readonly notifications: i0.WritableSignal<NotificationDto[]>;
|
|
41
|
+
getEndPoint(): string;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationSearchService, never>;
|
|
43
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationSearchService>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class NotificationService extends BaseApiService {
|
|
47
|
+
readonly notificationSearchService: NotificationSearchService;
|
|
48
|
+
readonly routerService: RouterService;
|
|
49
|
+
readonly nbRead: i0.WritableSignal<number>;
|
|
50
|
+
fetchNbRead(): void;
|
|
51
|
+
readAll(callback: () => void): void;
|
|
52
|
+
notificationRead(notification: NotificationDto): void;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
54
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NotificationService>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class NotificationButtonContainer {
|
|
58
|
+
readonly authService: AuthService;
|
|
59
|
+
readonly notificationService: NotificationService;
|
|
60
|
+
readonly nbRead: i0.WritableSignal<string>;
|
|
61
|
+
constructor();
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationButtonContainer, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NotificationButtonContainer, "app-notification-button-container", never, {}, {}, never, never, true, never>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class NotificationContainer extends BaseSearchContainer<NotificationSearchService, NotificationDto> {
|
|
67
|
+
notificationSearchService: NotificationSearchService;
|
|
68
|
+
readonly notificationService: NotificationService;
|
|
69
|
+
constructor(notificationSearchService: NotificationSearchService);
|
|
70
|
+
doRead(notificaton: NotificationDto): void;
|
|
71
|
+
doReadAll(): void;
|
|
72
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotificationContainer, never>;
|
|
73
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NotificationContainer, "app-notification-container", never, {}, {}, never, never, true, never>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare const NotificationRoute: Routes;
|
|
77
|
+
|
|
78
|
+
export { NotificationButtonContainer, NotificationComponent, NotificationContainer, NotificationRoute, NotificationSearchService, NotificationService };
|
|
79
|
+
export type { NotificationDto };
|