@ng-vagabond-lab/ng-dsv 0.2.39 → 0.2.41
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/assets/global.scss +1 -0
- package/assets/style.scss +25 -2
- package/fesm2022/ng-vagabond-lab-ng-dsv-api.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-base-service.mjs +13 -13
- package/fesm2022/ng-vagabond-lab-ng-dsv-base-service.mjs.map +1 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-base.mjs +24 -24
- package/fesm2022/ng-vagabond-lab-ng-dsv-date.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-accordion.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-avatar.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-button.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-card.mjs +12 -12
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-chip.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-color.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-container.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-file.mjs +9 -9
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-form-reactive.mjs +24 -24
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-form-signal.mjs +27 -27
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-header.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-img.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-item.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-linear-progress.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-link-pipe.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-list.mjs +12 -12
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-markdown.mjs +35 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-markdown.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-menu.mjs +12 -12
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-modal.mjs +12 -12
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-paginate.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-scroll.mjs +9 -9
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-skeleton.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-tab.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-table.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-theme.mjs +9 -9
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-toast.mjs +6 -6
- package/fesm2022/ng-vagabond-lab-ng-dsv-ds-tooltip.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-environment.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-i18n.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-admin.mjs +15 -15
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-auth.mjs +9 -9
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-contact.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-D6wXpIFA.mjs +81 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-D6wXpIFA.mjs.map +1 -0
- package/fesm2022/{ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs → ng-vagabond-lab-ng-dsv-module-news-news-list.container-PtCVILsF.mjs} +19 -10
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.container-PtCVILsF.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs +38 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs.map +1 -0
- package/fesm2022/{ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs → ng-vagabond-lab-ng-dsv-module-news-news.container-D6fR0O72.mjs} +16 -13
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news.container-D6fR0O72.mjs.map +1 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news.mjs +4 -4
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-notification.mjs +15 -15
- package/fesm2022/ng-vagabond-lab-ng-dsv-platform.mjs +3 -3
- package/fesm2022/ng-vagabond-lab-ng-dsv-router.mjs +9 -9
- package/fesm2022/ng-vagabond-lab-ng-dsv-storage.mjs +7 -4
- package/fesm2022/ng-vagabond-lab-ng-dsv-storage.mjs.map +1 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-template.mjs +18 -18
- package/package.json +5 -1
- package/types/ng-vagabond-lab-ng-dsv-base-service.d.ts +1 -1
- package/types/ng-vagabond-lab-ng-dsv-base.d.ts +1 -1
- package/types/ng-vagabond-lab-ng-dsv-ds-markdown.d.ts +12 -0
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs +0 -62
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-form.container-CGfhZFgr.mjs.map +0 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.container-CkUQEI5Q.mjs.map +0 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs +0 -65
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news-list.service-CVVSV7se.mjs.map +0 -1
- package/fesm2022/ng-vagabond-lab-ng-dsv-module-news-news.container-Ce60PdDH.mjs.map +0 -1
|
@@ -8,18 +8,27 @@ import { DsvFormReactiveSearchbarComponent } from '@ng-vagabond-lab/ng-dsv/ds/fo
|
|
|
8
8
|
import { DsvScrollInfiniteContainer } from '@ng-vagabond-lab/ng-dsv/ds/scroll';
|
|
9
9
|
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
10
10
|
import { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';
|
|
11
|
+
import { DsvFileShowComponent } from '@ng-vagabond-lab/ng-dsv/ds/file';
|
|
12
|
+
import { DsvMarkdownContainer } from '@ng-vagabond-lab/ng-dsv/ds/markdown';
|
|
11
13
|
import { RouterInternalPipe } from '@ng-vagabond-lab/ng-dsv/router';
|
|
12
|
-
import { N as
|
|
14
|
+
import { N as NewsListService } from './ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs';
|
|
13
15
|
|
|
14
16
|
class NewsCardResumeComponent {
|
|
15
17
|
news = input(/* @ts-ignore */
|
|
16
18
|
...(ngDevMode ? [undefined, { debugName: "news" }] : /* istanbul ignore next */ []));
|
|
17
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
18
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsCardResumeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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 <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <dsv-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;overflow:hidden}: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: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: DsvFileShowComponent, selector: "dsv-file-show", inputs: ["url", "src", "alt"] }, { kind: "component", type: DsvMarkdownContainer, selector: "dsv-markdown-container", inputs: ["data"] }, { kind: "pipe", type: DateFormatPipe, name: "formatDate" }] });
|
|
19
21
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsCardResumeComponent, decorators: [{
|
|
21
23
|
type: Component,
|
|
22
|
-
args: [{ selector: 'app-news-card-resume', imports: [
|
|
24
|
+
args: [{ selector: 'app-news-card-resume', imports: [
|
|
25
|
+
DsvCardComponent,
|
|
26
|
+
DateFormatPipe,
|
|
27
|
+
RouterInternalPipe,
|
|
28
|
+
RouterLink,
|
|
29
|
+
DsvFileShowComponent,
|
|
30
|
+
DsvMarkdownContainer,
|
|
31
|
+
], template: "<dsv-card [routerLink]=\"'/news/' + news()?.id\">\n @if (news()?.image) {\n <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <dsv-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;overflow:hidden}: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
32
|
}], propDecorators: { news: [{ type: i0.Input, args: [{ isSignal: true, alias: "news", required: false }] }] } });
|
|
24
33
|
|
|
25
34
|
class NewsListContainer extends BaseSearchContainer {
|
|
@@ -32,10 +41,10 @@ class NewsListContainer extends BaseSearchContainer {
|
|
|
32
41
|
this.newsListService = newsListService;
|
|
33
42
|
this.seoService.setMeta('Les dernières news', 'Retrouver les dernières news sur movie-keeper.fr', '/images/logo.png');
|
|
34
43
|
}
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
36
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsListContainer, deps: [{ token: NewsListService }], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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 h2{text-transform:capitalize}: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
46
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsListContainer, decorators: [{
|
|
39
48
|
type: Component,
|
|
40
49
|
args: [{ selector: 'app-news-list', imports: [
|
|
41
50
|
DsvCardComponent,
|
|
@@ -45,8 +54,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
45
54
|
DsvButtonComponent,
|
|
46
55
|
DsvCardHeaderComponent,
|
|
47
56
|
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"] }]
|
|
57
|
+
], 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 h2{text-transform:capitalize}: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
58
|
}], ctorParameters: () => [{ type: NewsListService }] });
|
|
50
59
|
|
|
51
60
|
export { NewsListContainer };
|
|
52
|
-
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-list.container-
|
|
61
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-list.container-PtCVILsF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news-list.container-PtCVILsF.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 { DsvFileShowComponent } from '@ng-vagabond-lab/ng-dsv/ds/file';\nimport { DsvMarkdownContainer } from '@ng-vagabond-lab/ng-dsv/ds/markdown';\nimport { RouterInternalPipe } from '@ng-vagabond-lab/ng-dsv/router';\nimport { NewsDto } from '../../../dto/news.dto';\n\n@Component({\n selector: 'app-news-card-resume',\n imports: [\n DsvCardComponent,\n DateFormatPipe,\n RouterInternalPipe,\n RouterLink,\n DsvFileShowComponent,\n DsvMarkdownContainer,\n ],\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 <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\n }\n <h2 [class.error]=\"!news()?.active\">{{ news()?.title }}</h2>\n <span class=\"subtitle\">Le {{ news()?.creationDate! | formatDate: true }}</span>\n <dsv-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":";;;;;;;;;;;;;;;MAsBa,uBAAuB,CAAA;AACvB,IAAA,IAAI,GAAG,KAAK;wFAAW;uGADvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAA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{ inject, Injectable } from '@angular/core';
|
|
3
|
+
import { BaseSearchService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
4
|
+
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
5
|
+
|
|
6
|
+
class NewsListService extends BaseSearchService {
|
|
7
|
+
authService = inject(AuthService);
|
|
8
|
+
news = this.datas;
|
|
9
|
+
getEndPoint() {
|
|
10
|
+
return '/news/findBy';
|
|
11
|
+
}
|
|
12
|
+
getParams() {
|
|
13
|
+
let fields = '(title%And|Description%)AndActive>>creationDateDesc';
|
|
14
|
+
let values = this.search() + ',' + this.search() + ',true';
|
|
15
|
+
if (this.authService.isAdmin()) {
|
|
16
|
+
fields = '(title%And|Description%)>>creationDateDesc';
|
|
17
|
+
values = this.search() + ',' + this.search() + '';
|
|
18
|
+
}
|
|
19
|
+
return ('&fields=' +
|
|
20
|
+
encodeURIComponent(fields) +
|
|
21
|
+
'&values=' +
|
|
22
|
+
values +
|
|
23
|
+
'&first=' +
|
|
24
|
+
(this.page() - 1) +
|
|
25
|
+
'&max=20');
|
|
26
|
+
}
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsListService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
28
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsListService, providedIn: 'root' });
|
|
29
|
+
}
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsListService, decorators: [{
|
|
31
|
+
type: Injectable,
|
|
32
|
+
args: [{
|
|
33
|
+
providedIn: 'root',
|
|
34
|
+
}]
|
|
35
|
+
}] });
|
|
36
|
+
|
|
37
|
+
export { NewsListService as N };
|
|
38
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs","sources":["../../../projects/ng-dsv/module/news/service/list/news-list.service.ts"],"sourcesContent":["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":";;;;;AAQM,MAAO,eAAgB,SAAQ,iBAA0B,CAAA;AAClD,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAEjC,IAAA,IAAI,GAAG,IAAI,CAAC,KAAK;IAEjB,WAAW,GAAA;AAChB,QAAA,OAAO,cAAc;IACzB;IAES,SAAS,GAAA;QACd,IAAI,MAAM,GAAG,qDAAqD;AAClE,QAAA,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO;AAC1D,QAAA,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE;YAC5B,MAAM,GAAG,4CAA4C;AACrD,YAAA,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;QACrD;AACA,QAAA,QACI,UAAU;YACV,kBAAkB,CAAC,MAAM,CAAC;YAC1B,UAAU;YACV,MAAM;YACN,SAAS;AACT,aAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACjB,YAAA,SAAS;IAEjB;uGAzBS,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,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;;;;;"}
|
|
@@ -6,26 +6,29 @@ import { DsvButtonComponent } from '@ng-vagabond-lab/ng-dsv/ds/button';
|
|
|
6
6
|
import { AuthService } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
7
7
|
import { DateFormatPipe } from '@ng-vagabond-lab/ng-dsv/date';
|
|
8
8
|
import { DsvCardComponent, DsvCardHeaderComponent } from '@ng-vagabond-lab/ng-dsv/ds/card';
|
|
9
|
-
import {
|
|
9
|
+
import { DsvFileShowComponent } from '@ng-vagabond-lab/ng-dsv/ds/file';
|
|
10
|
+
import { DsvMarkdownContainer } from '@ng-vagabond-lab/ng-dsv/ds/markdown';
|
|
10
11
|
import { BaseFetchService } from '@ng-vagabond-lab/ng-dsv/base/service';
|
|
11
12
|
import { StoreMap } from '@ng-vagabond-lab/ng-dsv/storage';
|
|
13
|
+
import { N as NewsListService } from './ng-vagabond-lab-ng-dsv-module-news-news-list.service-MB7ocRqE.mjs';
|
|
12
14
|
|
|
13
15
|
class NewsCardComponent {
|
|
14
16
|
news = input(/* @ts-ignore */
|
|
15
17
|
...(ngDevMode ? [undefined, { debugName: "news" }] : /* istanbul ignore next */ []));
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
17
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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 <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\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 <dsv-markdown-container [data]=\"news()?.description\" />\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px;overflow:hidden}: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: 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: DsvFileShowComponent, selector: "dsv-file-show", inputs: ["url", "src", "alt"] }, { kind: "component", type: DsvMarkdownContainer, selector: "dsv-markdown-container", inputs: ["data"] }, { kind: "pipe", type: DateFormatPipe, name: "formatDate" }] });
|
|
18
20
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsCardComponent, decorators: [{
|
|
20
22
|
type: Component,
|
|
21
23
|
args: [{ selector: 'app-news-card', imports: [
|
|
22
24
|
DsvCardComponent,
|
|
23
25
|
DateFormatPipe,
|
|
24
|
-
NewsMarkdownContainer,
|
|
25
26
|
DsvCardHeaderComponent,
|
|
26
27
|
DsvButtonComponent,
|
|
27
28
|
RouterLink,
|
|
28
|
-
|
|
29
|
+
DsvFileShowComponent,
|
|
30
|
+
DsvMarkdownContainer,
|
|
31
|
+
], template: "<dsv-card>\n @if (news()?.image) {\n <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\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 <dsv-markdown-container [data]=\"news()?.description\" />\n</dsv-card>\n", styles: [":host{display:flex;min-height:300px;margin-right:5px;overflow:hidden}: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
32
|
}], propDecorators: { news: [{ type: i0.Input, args: [{ isSignal: true, alias: "news", required: false }] }] } });
|
|
30
33
|
|
|
31
34
|
class NewsService extends BaseFetchService {
|
|
@@ -54,10 +57,10 @@ class NewsService extends BaseFetchService {
|
|
|
54
57
|
callback?.(data);
|
|
55
58
|
}, toast);
|
|
56
59
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
58
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
61
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsService, providedIn: 'root' });
|
|
59
62
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsService, decorators: [{
|
|
61
64
|
type: Injectable,
|
|
62
65
|
args: [{
|
|
63
66
|
providedIn: 'root',
|
|
@@ -101,13 +104,13 @@ class NewsContainer extends BaseRouteContainer {
|
|
|
101
104
|
url: 'https://movie-keeper.fr/news/' + news.id,
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
105
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
108
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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
109
|
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NewsContainer, decorators: [{
|
|
108
111
|
type: Component,
|
|
109
112
|
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
113
|
}], ctorParameters: () => [] });
|
|
111
114
|
|
|
112
115
|
export { NewsContainer };
|
|
113
|
-
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news.container-
|
|
116
|
+
//# sourceMappingURL=ng-vagabond-lab-ng-dsv-module-news-news.container-D6fR0O72.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-module-news-news.container-D6fR0O72.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 { DsvFileShowComponent } from '@ng-vagabond-lab/ng-dsv/ds/file';\nimport { DsvMarkdownContainer } from '@ng-vagabond-lab/ng-dsv/ds/markdown';\nimport { NewsDto } from '../../dto/news.dto';\n\n@Component({\n selector: 'app-news-card',\n imports: [\n DsvCardComponent,\n DateFormatPipe,\n DsvCardHeaderComponent,\n DsvButtonComponent,\n RouterLink,\n DsvFileShowComponent,\n DsvMarkdownContainer,\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 <dsv-file-show url=\"/api/\" [src]=\"news()?.image ?? ''\" />\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 <dsv-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":";;;;;;;;;;;;;;MAuBa,iBAAiB,CAAA;AACjB,IAA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AAC,MAAM;AACjB,YAAA,GAAG,EAAE,+BAA+B,GAAG,IAAI,CAAC,EAAE;AACjD,SAAA,CAAC;IACN;uGApCS,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,2FCf1B,2fAkBA,EAAA,MAAA,EAAA,CAAA,uBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDPc,iBAAiB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,8KAAE,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIlD,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,WACX,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAAA,QAAA,EAAA,2fAAA,EAAA,MAAA,EAAA,CAAA,uBAAA,CAAA,EAAA;;;;;"}
|
|
@@ -3,21 +3,21 @@ import { authGuard } from '@ng-vagabond-lab/ng-dsv/module/auth';
|
|
|
3
3
|
const NewsRoute = [
|
|
4
4
|
{
|
|
5
5
|
path: '',
|
|
6
|
-
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-list.container-
|
|
6
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-list.container-PtCVILsF.mjs').then((m) => m.NewsListContainer),
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
path: 'create',
|
|
10
|
-
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-
|
|
10
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-D6wXpIFA.mjs').then((m) => m.NewsFormContainer),
|
|
11
11
|
canActivate: [authGuard('ADMIN')],
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
path: 'update/:newsId',
|
|
15
|
-
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-
|
|
15
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news-form.container-D6wXpIFA.mjs').then((m) => m.NewsFormContainer),
|
|
16
16
|
canActivate: [authGuard('ADMIN')],
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
path: ':newsId',
|
|
20
|
-
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news.container-
|
|
20
|
+
loadComponent: () => import('./ng-vagabond-lab-ng-dsv-module-news-news.container-D6fR0O72.mjs').then((m) => m.NewsContainer),
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
23
|
|
|
@@ -41,10 +41,10 @@ class NotificationComponent {
|
|
|
41
41
|
triggerCheckbox() {
|
|
42
42
|
this.checkboxRef()?.nativeElement.querySelector('input').click();
|
|
43
43
|
}
|
|
44
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
45
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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
46
|
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
48
48
|
type: Component,
|
|
49
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
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 }] }] } });
|
|
@@ -54,10 +54,10 @@ class NotificationSearchService extends BaseSearchService {
|
|
|
54
54
|
getEndPoint() {
|
|
55
55
|
return '/notification/search';
|
|
56
56
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
58
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationSearchService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationSearchService, providedIn: 'root' });
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationSearchService, decorators: [{
|
|
61
61
|
type: Injectable,
|
|
62
62
|
args: [{ providedIn: 'root' }]
|
|
63
63
|
}] });
|
|
@@ -88,10 +88,10 @@ class NotificationService extends BaseApiService {
|
|
|
88
88
|
this.nbRead.update((nb) => nb + (notification.read ? -1 : 1));
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
92
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
92
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
93
93
|
}
|
|
94
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationService, decorators: [{
|
|
95
95
|
type: Injectable,
|
|
96
96
|
args: [{ providedIn: 'root' }]
|
|
97
97
|
}] });
|
|
@@ -115,10 +115,10 @@ class NotificationButtonContainer {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
119
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationButtonContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
119
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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
120
|
}
|
|
121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationButtonContainer, decorators: [{
|
|
122
122
|
type: Component,
|
|
123
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
124
|
}], ctorParameters: () => [] });
|
|
@@ -142,10 +142,10 @@ class NotificationContainer extends BaseSearchContainer {
|
|
|
142
142
|
]);
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
146
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
145
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationContainer, deps: [{ token: NotificationSearchService }], target: i0.ɵɵFactoryTarget.Component });
|
|
146
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", 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
147
|
}
|
|
148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NotificationContainer, decorators: [{
|
|
149
149
|
type: Component,
|
|
150
150
|
args: [{ selector: 'app-notification-container', imports: [
|
|
151
151
|
DsvCardComponent,
|
|
@@ -18,10 +18,10 @@ class PlatformService {
|
|
|
18
18
|
isPlatformBrowser() {
|
|
19
19
|
return isPlatformBrowser(this.platformId);
|
|
20
20
|
}
|
|
21
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
22
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PlatformService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PlatformService, providedIn: 'root' });
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: PlatformService, decorators: [{
|
|
25
25
|
type: Injectable,
|
|
26
26
|
args: [{
|
|
27
27
|
providedIn: 'root',
|
|
@@ -14,10 +14,10 @@ class RouterExternalPipe {
|
|
|
14
14
|
event.stopPropagation();
|
|
15
15
|
this.dsvLinkExternal.emit();
|
|
16
16
|
}
|
|
17
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
18
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterExternalPipe, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.4", type: RouterExternalPipe, isStandalone: true, selector: "a[dsvLinkExternal]", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dsvLinkExternal: "dsvLinkExternal" }, host: { attributes: { "target": "_blank", "rel": "noopener noreferrer" }, listeners: { "click": "onClick($event)" }, properties: { "class": "color() + ' text bold'" } }, ngImport: i0 });
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterExternalPipe, decorators: [{
|
|
21
21
|
type: Directive,
|
|
22
22
|
args: [{
|
|
23
23
|
selector: 'a[dsvLinkExternal]',
|
|
@@ -45,10 +45,10 @@ class RouterInternalPipe {
|
|
|
45
45
|
this.dsvLink.emit();
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
49
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterInternalPipe, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
49
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.4", type: RouterInternalPipe, isStandalone: true, selector: "a[dsvLink]", outputs: { dsvLink: "dsvLink" }, host: { listeners: { "click": "onClick($event)" }, classAttribute: "text" }, ngImport: i0 });
|
|
50
50
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterInternalPipe, decorators: [{
|
|
52
52
|
type: Directive,
|
|
53
53
|
args: [{
|
|
54
54
|
selector: 'a[dsvLink]',
|
|
@@ -100,10 +100,10 @@ class RouterService {
|
|
|
100
100
|
goBack() {
|
|
101
101
|
this.location.back();
|
|
102
102
|
}
|
|
103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
104
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
104
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterService, providedIn: 'root' });
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: RouterService, decorators: [{
|
|
107
107
|
type: Injectable,
|
|
108
108
|
args: [{
|
|
109
109
|
providedIn: 'root',
|
|
@@ -37,10 +37,10 @@ class StorageService {
|
|
|
37
37
|
localStorage.clear();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
41
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StorageService, providedIn: 'root' });
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StorageService, decorators: [{
|
|
44
44
|
type: Injectable,
|
|
45
45
|
args: [{
|
|
46
46
|
providedIn: 'root',
|
|
@@ -92,7 +92,10 @@ class StoreMap {
|
|
|
92
92
|
const existing = map.get(key);
|
|
93
93
|
if (!existing)
|
|
94
94
|
return map;
|
|
95
|
-
|
|
95
|
+
const updatedValue = Array.isArray(existing) && Array.isArray(partial)
|
|
96
|
+
? [...existing, ...partial]
|
|
97
|
+
: { ...existing, ...partial };
|
|
98
|
+
return new Map(map).set(key, updatedValue);
|
|
96
99
|
});
|
|
97
100
|
}
|
|
98
101
|
setMany(entries) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-vagabond-lab-ng-dsv-storage.mjs","sources":["../../../projects/ng-dsv/storage/service/storage.service.ts","../../../projects/ng-dsv/storage/utils/storage.utils.ts","../../../projects/ng-dsv/storage/store/store.ts","../../../projects/ng-dsv/storage/store/store.map.ts","../../../projects/ng-dsv/storage/ng-vagabond-lab-ng-dsv-storage.ts"],"sourcesContent":["import { inject, Injectable, signal } from '@angular/core';\nimport { PlatformService } from '@ng-vagabond-lab/ng-dsv/platform';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class StorageService {\n readonly platformService = inject(PlatformService);\n\n readonly suffixe = signal<string>('');\n\n setItem(key: string, value: unknown): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.setItem(key + this.suffixe(), JSON.stringify(value));\n }\n }\n\n parse<T>(value: string): T | null {\n try {\n return JSON.parse(value);\n } catch (exception) {\n console.error(value, (exception as string).toString().split('\\n').slice(0, 3).join('\\n'));\n return value as T;\n }\n }\n\n getItem<T>(key: string): T | null {\n if (this.platformService.isPlatformBrowser()) {\n const item = localStorage.getItem(key + this.suffixe());\n return item ? this.parse<T>(item) : null;\n }\n return null;\n }\n\n removeItem(key: string): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.removeItem(key + this.suffixe());\n }\n }\n\n clear(): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.clear();\n }\n }\n}\n","export const removeDuplicate = <U>(datas: U[] = [], name: string = 'id'): U[] => {\n return datas.filter(\n (item, index, self) => index === self.findIndex((t) => t[name as keyof U] === item[name as keyof U]),\n );\n};\n","import { signal } from '@angular/core';\nimport { removeDuplicate } from '../utils/storage.utils';\n\nexport class Store<T> {\n readonly data = signal<T[]>([]);\n\n update(id: number, data: T, add?: T): void {\n this.data.update((values) => {\n values[id] = { ...data, ...add };\n return [...values];\n });\n }\n\n updateForPage(page: number, data: T[]): void {\n this.data.update((values) => {\n let newValues = page === 1 ? [] : [...values];\n return [...removeDuplicate([...newValues, ...data])];\n });\n }\n}\n","import { computed, signal } from '@angular/core';\n\nexport class StoreMap<K, V> {\n private readonly _data = signal<Map<K, V>>(new Map());\n\n readonly data = this._data.asReadonly();\n readonly values = computed<V[]>(() => Array.from(this._data().values()));\n readonly keys = computed<K[]>(() => Array.from(this._data().keys()));\n readonly size = computed<number>(() => this._data().size);\n\n get(key: K): V | undefined {\n return this._data().get(key);\n }\n\n has(key: K): boolean {\n return this._data().has(key);\n }\n\n set(key: K, value: V): void {\n this._data.update((map) => new Map(map).set(key, value));\n }\n
|
|
1
|
+
{"version":3,"file":"ng-vagabond-lab-ng-dsv-storage.mjs","sources":["../../../projects/ng-dsv/storage/service/storage.service.ts","../../../projects/ng-dsv/storage/utils/storage.utils.ts","../../../projects/ng-dsv/storage/store/store.ts","../../../projects/ng-dsv/storage/store/store.map.ts","../../../projects/ng-dsv/storage/ng-vagabond-lab-ng-dsv-storage.ts"],"sourcesContent":["import { inject, Injectable, signal } from '@angular/core';\nimport { PlatformService } from '@ng-vagabond-lab/ng-dsv/platform';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class StorageService {\n readonly platformService = inject(PlatformService);\n\n readonly suffixe = signal<string>('');\n\n setItem(key: string, value: unknown): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.setItem(key + this.suffixe(), JSON.stringify(value));\n }\n }\n\n parse<T>(value: string): T | null {\n try {\n return JSON.parse(value);\n } catch (exception) {\n console.error(value, (exception as string).toString().split('\\n').slice(0, 3).join('\\n'));\n return value as T;\n }\n }\n\n getItem<T>(key: string): T | null {\n if (this.platformService.isPlatformBrowser()) {\n const item = localStorage.getItem(key + this.suffixe());\n return item ? this.parse<T>(item) : null;\n }\n return null;\n }\n\n removeItem(key: string): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.removeItem(key + this.suffixe());\n }\n }\n\n clear(): void {\n if (this.platformService.isPlatformBrowser()) {\n localStorage.clear();\n }\n }\n}\n","export const removeDuplicate = <U>(datas: U[] = [], name: string = 'id'): U[] => {\n return datas.filter(\n (item, index, self) => index === self.findIndex((t) => t[name as keyof U] === item[name as keyof U]),\n );\n};\n","import { signal } from '@angular/core';\nimport { removeDuplicate } from '../utils/storage.utils';\n\nexport class Store<T> {\n readonly data = signal<T[]>([]);\n\n update(id: number, data: T, add?: T): void {\n this.data.update((values) => {\n values[id] = { ...data, ...add };\n return [...values];\n });\n }\n\n updateForPage(page: number, data: T[]): void {\n this.data.update((values) => {\n let newValues = page === 1 ? [] : [...values];\n return [...removeDuplicate([...newValues, ...data])];\n });\n }\n}\n","import { computed, signal } from '@angular/core';\n\nexport class StoreMap<K, V> {\n private readonly _data = signal<Map<K, V>>(new Map());\n\n readonly data = this._data.asReadonly();\n readonly values = computed<V[]>(() => Array.from(this._data().values()));\n readonly keys = computed<K[]>(() => Array.from(this._data().keys()));\n readonly size = computed<number>(() => this._data().size);\n\n get(key: K): V | undefined {\n return this._data().get(key);\n }\n\n has(key: K): boolean {\n return this._data().has(key);\n }\n\n set(key: K, value: V): void {\n this._data.update((map) => new Map(map).set(key, value));\n }\n patch(key: K, partial: Partial<V>): void {\n this._data.update((map) => {\n const existing = map.get(key);\n if (!existing) return map;\n\n const updatedValue =\n Array.isArray(existing) && Array.isArray(partial)\n ? ([...existing, ...partial] as unknown as V)\n : { ...existing, ...partial };\n\n return new Map(map).set(key, updatedValue);\n });\n }\n\n setMany(entries: [K, V][]): void {\n this._data.update((map) => {\n const next = new Map(map);\n entries.forEach(([k, v]) => next.set(k, v));\n return next;\n });\n }\n\n delete(key: K): void {\n this._data.update((map) => {\n const next = new Map(map);\n next.delete(key);\n return next;\n });\n }\n\n clear(): void {\n this._data.set(new Map());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,cAAc,CAAA;AACd,IAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IAEzC,OAAO,GAAG,MAAM,CAAS,EAAE;gFAAC;IAErC,OAAO,CAAC,GAAW,EAAE,KAAc,EAAA;AAC/B,QAAA,IAAI,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE;AAC1C,YAAA,YAAY,CAAC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrE;IACJ;AAEA,IAAA,KAAK,CAAI,KAAa,EAAA;AAClB,QAAA,IAAI;AACA,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5B;QAAE,OAAO,SAAS,EAAE;YAChB,OAAO,CAAC,KAAK,CAAC,KAAK,EAAG,SAAoB,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC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