@dealpos-npm/ng-dealpos-library 22.0.3 → 22.0.4
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/dealpos-npm-ng-dealpos-library-components-modal-news.mjs +3 -15
- package/fesm2022/dealpos-npm-ng-dealpos-library-components-modal-news.mjs.map +1 -1
- package/package.json +1 -5
- package/types/dealpos-npm-ng-dealpos-library-components-modal-news.d.ts +0 -3
- package/fesm2022/dealpos-npm-ng-dealpos-library-components-search-option.mjs +0 -236
- package/fesm2022/dealpos-npm-ng-dealpos-library-components-search-option.mjs.map +0 -1
- package/types/dealpos-npm-ng-dealpos-library-components-search-option.d.ts +0 -80
|
@@ -3,7 +3,6 @@ import { ChangeDetectionStrategy, Component, HostListener, Injectable, computed,
|
|
|
3
3
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from "@angular/material/dialog";
|
|
4
4
|
import { NewlinesPipe } from "@dealpos-npm/ng-dealpos-library/pipes/newlines";
|
|
5
5
|
import { BrokenImageIconFailSafeDirective } from "@dealpos-npm/ng-dealpos-library/directives/broken-image-fail-save";
|
|
6
|
-
import { DOCUMENT } from "@angular/common";
|
|
7
6
|
import { NavigationEnd, Router } from "@angular/router";
|
|
8
7
|
import { filter } from "rxjs";
|
|
9
8
|
const DEFAULT_LABELS = {
|
|
@@ -129,7 +128,7 @@ var ModalNewsComponent = class ModalNewsComponent {
|
|
|
129
128
|
host: { listeners: { "keydown": "onKeydown($event)" } },
|
|
130
129
|
ngImport: i0,
|
|
131
130
|
template: "<div class=\"news-card\" (touchstart)=\"onTouchStart($event)\" (touchend)=\"onTouchEnd($event)\">\r\n @if (item(); as news) {\r\n <div class=\"news-header\">\r\n <i class=\"fa-regular fa-newspaper news-header-icon\" aria-hidden=\"true\"></i>\r\n <h2 class=\"news-header-title\">{{ labels().headerTitle }}</h2>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close news-close\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"dismiss()\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"news-hero\">\r\n @if (isMulti()) {\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-prev\"\r\n [disabled]=\"index() === 0 && slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prev\"\r\n (click)=\"prev()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-next\"\r\n [disabled]=\"index() === total() - 1 && slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"next()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (slide()?.image || news.image) {\r\n <a\r\n class=\"news-image-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <img\r\n class=\"news-image\"\r\n [src]=\"slide()?.image || news.image\"\r\n [alt]=\"slide()?.imageAlt || slide()?.title || news.imageAlt || news.title\"\r\n draggable=\"false\"\r\n brokenImageIconFailSafe\r\n (dragstart)=\"$event.preventDefault()\"\r\n (contextmenu)=\"$event.preventDefault()\"\r\n />\r\n </a>\r\n } @else {\r\n <div class=\"news-placeholder\" aria-hidden=\"true\">\r\n <i class=\"fa fa-image\"></i>\r\n </div>\r\n }\r\n\r\n @if (isMultiSlide()) {\r\n <div class=\"news-slide-nav\">\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prevImage\"\r\n (click)=\"prevSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <span class=\"news-slide-count\" aria-hidden=\"true\">{{ slideIndex() + 1 }} / {{ slides().length }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().nextImage\"\r\n (click)=\"nextSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (isMulti()) {\r\n <div class=\"news-indicator\">\r\n <div class=\"news-dots\">\r\n @for (dot of data.items; track dot.id; let i = $index) {\r\n <button\r\n type=\"button\"\r\n class=\"news-dot\"\r\n [class.active]=\"i === index()\"\r\n [attr.aria-label]=\"labels().goToNews + ' #' + (i + 1)\"\r\n [attr.aria-current]=\"i === index() ? 'true' : null\"\r\n (click)=\"goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n <span class=\"news-count\">{{ index() + 1 }} / {{ total() }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"news-body\">\r\n <a\r\n class=\"news-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <h5 class=\"news-title\" [id]=\"titleId\">{{ slide()?.title || news.title }}</h5>\r\n </a>\r\n <p class=\"news-text\" [innerHTML]=\"(slide()?.body || news.body) | newlines\"></p>\r\n </div>\r\n\r\n <p class=\"visually-hidden\" aria-live=\"polite\">\r\n {{ index() + 1 }} / {{ total() }}@if (isMultiSlide()) { · {{ slideIndex() + 1 }} / {{ slides().length }} } —\r\n {{ slide()?.title || news.title }}\r\n </p>\r\n }\r\n</div>\r\n",
|
|
132
|
-
styles: [":host{display:block
|
|
131
|
+
styles: [":host{display:block}.news-card{border-radius:16px;overflow:hidden;background:#fff;position:relative}.news-header{display:flex;align-items:center;gap:8px;padding:14px 14px 14px 16px;background:#f1f2f4}.news-header-icon{font-size:14px;color:#111418}.news-header-title{flex:1;margin:0;font-size:15px;font-weight:600;line-height:1.2;color:#111418}.news-hero{position:relative;background:#fef3e8;padding:28px 24px}.news-close{flex:none;width:26px;height:26px;padding:0;border-radius:50%;background-color:#fff;background-size:8px;box-shadow:0 2px 8px #0000001f;opacity:1}.news-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:34px;height:34px;border:none;border-radius:50%;background:#ffffffeb;color:#343a40;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.news-nav:hover:not(:disabled){background:#fff}.news-nav:disabled{opacity:.35;cursor:default}.news-prev{left:14px}.news-next{right:14px}.news-slide-nav{position:absolute;top:12px;left:12px;z-index:3;display:flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:#0000008c;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);color:#fff}.news-slide-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:none;color:inherit;font-size:10px;cursor:pointer}.news-slide-btn:disabled{opacity:.4;cursor:default}.news-slide-count{font-size:11px;font-weight:700;white-space:nowrap}.news-indicator{position:absolute;bottom:14px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:10px;padding:6px 12px;border-radius:999px;background:#0000008c;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:3}.news-dots{display:flex;align-items:center;gap:6px}.news-dot{width:8px;height:8px;padding:0;border:none;border-radius:999px;background:#ffffff8c;cursor:pointer;transition:width .2s ease,background-color .2s ease}.news-dot.active{width:20px;background:#fff}.news-count{font-size:12px;font-weight:700;color:#fff;white-space:nowrap}.news-image-link{display:block}.news-image-link[href]{cursor:pointer}.news-link{display:inline-block;color:inherit;text-decoration:none}.news-link[href]{cursor:pointer}.news-link[href]:hover .news-title{text-decoration:underline}.news-image{display:block;width:100%;height:auto;border-radius:14px;background:#fff;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}.news-placeholder{display:flex;align-items:center;justify-content:center;min-height:180px;border:1px dashed #ced4da;border-radius:14px;background:#fff}.news-placeholder i{font-size:28px;color:#adb5bd}.news-body{padding:22px 24px 24px;background:#fff;max-height:60vh;overflow-y:auto}.news-title{margin:0 0 8px;font-size:18px;font-weight:800;color:#111418!important}.news-text{margin:0;font-size:14px;color:#343a40!important}.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}::ng-deep .news-modal-panel .mat-mdc-dialog-container{padding:0}::ng-deep .news-modal-panel .mdc-dialog__surface{padding:0;border-radius:16px;overflow:hidden;max-width:475px;background:transparent;box-shadow:0 18px 48px #00000047}::ng-deep .news-modal-backdrop{background:#000;opacity:.5}@media(max-width:768px){.news-header{padding:8px 8px 8px 12px}.news-header-title{font-size:14px}.news-close{width:24px;height:24px}.news-body{max-height:52vh;padding:18px 18px 20px}.news-hero{padding:22px 16px}.news-indicator{bottom:10px}}@media(prefers-reduced-motion:reduce){.news-nav,.news-dot{transition:none!important}}\n"],
|
|
133
132
|
dependencies: [{
|
|
134
133
|
kind: "directive",
|
|
135
134
|
type: BrokenImageIconFailSafeDirective,
|
|
@@ -161,7 +160,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
161
160
|
imports: [NewlinesPipe, BrokenImageIconFailSafeDirective],
|
|
162
161
|
changeDetection: ChangeDetectionStrategy.Eager,
|
|
163
162
|
template: "<div class=\"news-card\" (touchstart)=\"onTouchStart($event)\" (touchend)=\"onTouchEnd($event)\">\r\n @if (item(); as news) {\r\n <div class=\"news-header\">\r\n <i class=\"fa-regular fa-newspaper news-header-icon\" aria-hidden=\"true\"></i>\r\n <h2 class=\"news-header-title\">{{ labels().headerTitle }}</h2>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close news-close\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"dismiss()\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"news-hero\">\r\n @if (isMulti()) {\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-prev\"\r\n [disabled]=\"index() === 0 && slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prev\"\r\n (click)=\"prev()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-next\"\r\n [disabled]=\"index() === total() - 1 && slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"next()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (slide()?.image || news.image) {\r\n <a\r\n class=\"news-image-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <img\r\n class=\"news-image\"\r\n [src]=\"slide()?.image || news.image\"\r\n [alt]=\"slide()?.imageAlt || slide()?.title || news.imageAlt || news.title\"\r\n draggable=\"false\"\r\n brokenImageIconFailSafe\r\n (dragstart)=\"$event.preventDefault()\"\r\n (contextmenu)=\"$event.preventDefault()\"\r\n />\r\n </a>\r\n } @else {\r\n <div class=\"news-placeholder\" aria-hidden=\"true\">\r\n <i class=\"fa fa-image\"></i>\r\n </div>\r\n }\r\n\r\n @if (isMultiSlide()) {\r\n <div class=\"news-slide-nav\">\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prevImage\"\r\n (click)=\"prevSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <span class=\"news-slide-count\" aria-hidden=\"true\">{{ slideIndex() + 1 }} / {{ slides().length }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().nextImage\"\r\n (click)=\"nextSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (isMulti()) {\r\n <div class=\"news-indicator\">\r\n <div class=\"news-dots\">\r\n @for (dot of data.items; track dot.id; let i = $index) {\r\n <button\r\n type=\"button\"\r\n class=\"news-dot\"\r\n [class.active]=\"i === index()\"\r\n [attr.aria-label]=\"labels().goToNews + ' #' + (i + 1)\"\r\n [attr.aria-current]=\"i === index() ? 'true' : null\"\r\n (click)=\"goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n <span class=\"news-count\">{{ index() + 1 }} / {{ total() }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"news-body\">\r\n <a\r\n class=\"news-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <h5 class=\"news-title\" [id]=\"titleId\">{{ slide()?.title || news.title }}</h5>\r\n </a>\r\n <p class=\"news-text\" [innerHTML]=\"(slide()?.body || news.body) | newlines\"></p>\r\n </div>\r\n\r\n <p class=\"visually-hidden\" aria-live=\"polite\">\r\n {{ index() + 1 }} / {{ total() }}@if (isMultiSlide()) { · {{ slideIndex() + 1 }} / {{ slides().length }} } —\r\n {{ slide()?.title || news.title }}\r\n </p>\r\n }\r\n</div>\r\n",
|
|
164
|
-
styles: [":host{display:block
|
|
163
|
+
styles: [":host{display:block}.news-card{border-radius:16px;overflow:hidden;background:#fff;position:relative}.news-header{display:flex;align-items:center;gap:8px;padding:14px 14px 14px 16px;background:#f1f2f4}.news-header-icon{font-size:14px;color:#111418}.news-header-title{flex:1;margin:0;font-size:15px;font-weight:600;line-height:1.2;color:#111418}.news-hero{position:relative;background:#fef3e8;padding:28px 24px}.news-close{flex:none;width:26px;height:26px;padding:0;border-radius:50%;background-color:#fff;background-size:8px;box-shadow:0 2px 8px #0000001f;opacity:1}.news-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:34px;height:34px;border:none;border-radius:50%;background:#ffffffeb;color:#343a40;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.news-nav:hover:not(:disabled){background:#fff}.news-nav:disabled{opacity:.35;cursor:default}.news-prev{left:14px}.news-next{right:14px}.news-slide-nav{position:absolute;top:12px;left:12px;z-index:3;display:flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:#0000008c;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);color:#fff}.news-slide-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:none;color:inherit;font-size:10px;cursor:pointer}.news-slide-btn:disabled{opacity:.4;cursor:default}.news-slide-count{font-size:11px;font-weight:700;white-space:nowrap}.news-indicator{position:absolute;bottom:14px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:10px;padding:6px 12px;border-radius:999px;background:#0000008c;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:3}.news-dots{display:flex;align-items:center;gap:6px}.news-dot{width:8px;height:8px;padding:0;border:none;border-radius:999px;background:#ffffff8c;cursor:pointer;transition:width .2s ease,background-color .2s ease}.news-dot.active{width:20px;background:#fff}.news-count{font-size:12px;font-weight:700;color:#fff;white-space:nowrap}.news-image-link{display:block}.news-image-link[href]{cursor:pointer}.news-link{display:inline-block;color:inherit;text-decoration:none}.news-link[href]{cursor:pointer}.news-link[href]:hover .news-title{text-decoration:underline}.news-image{display:block;width:100%;height:auto;border-radius:14px;background:#fff;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}.news-placeholder{display:flex;align-items:center;justify-content:center;min-height:180px;border:1px dashed #ced4da;border-radius:14px;background:#fff}.news-placeholder i{font-size:28px;color:#adb5bd}.news-body{padding:22px 24px 24px;background:#fff;max-height:60vh;overflow-y:auto}.news-title{margin:0 0 8px;font-size:18px;font-weight:800;color:#111418!important}.news-text{margin:0;font-size:14px;color:#343a40!important}.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}::ng-deep .news-modal-panel .mat-mdc-dialog-container{padding:0}::ng-deep .news-modal-panel .mdc-dialog__surface{padding:0;border-radius:16px;overflow:hidden;max-width:475px;background:transparent;box-shadow:0 18px 48px #00000047}::ng-deep .news-modal-backdrop{background:#000;opacity:.5}@media(max-width:768px){.news-header{padding:8px 8px 8px 12px}.news-header-title{font-size:14px}.news-close{width:24px;height:24px}.news-body{max-height:52vh;padding:18px 18px 20px}.news-hero{padding:22px 16px}.news-indicator{bottom:10px}}@media(prefers-reduced-motion:reduce){.news-nav,.news-dot{transition:none!important}}\n"]
|
|
165
164
|
}]
|
|
166
165
|
}],
|
|
167
166
|
propDecorators: { onKeydown: [{
|
|
@@ -172,10 +171,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
172
171
|
var NewsModalService = class NewsModalService {
|
|
173
172
|
constructor() {
|
|
174
173
|
this.dialog = inject(MatDialog);
|
|
175
|
-
this.document = inject(DOCUMENT);
|
|
176
174
|
}
|
|
177
175
|
open(items, options) {
|
|
178
|
-
|
|
176
|
+
return this.dialog.open(ModalNewsComponent, {
|
|
179
177
|
data: {
|
|
180
178
|
items,
|
|
181
179
|
startIndex: options?.startIndex ?? 0,
|
|
@@ -189,16 +187,6 @@ var NewsModalService = class NewsModalService {
|
|
|
189
187
|
restoreFocus: true,
|
|
190
188
|
ariaLabel: options?.labels?.dialogLabel ?? "New feature announcement"
|
|
191
189
|
});
|
|
192
|
-
this.lockPageScroll(ref);
|
|
193
|
-
return ref;
|
|
194
|
-
}
|
|
195
|
-
lockPageScroll(ref) {
|
|
196
|
-
const body = this.document.body;
|
|
197
|
-
const previousOverflow = body.style.overflow;
|
|
198
|
-
body.style.overflow = "hidden";
|
|
199
|
-
ref.afterClosed().subscribe(() => {
|
|
200
|
-
body.style.overflow = previousOverflow;
|
|
201
|
-
});
|
|
202
190
|
}
|
|
203
191
|
static {
|
|
204
192
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dealpos-npm-ng-dealpos-library-components-modal-news.mjs","names":[],"sources":["../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.component.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.component.html","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.service.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal-route.util.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal-router.service.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostListener, computed, inject, signal } from '@angular/core';\r\nimport { MatDialogRef } from '@angular/material/dialog';\r\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\r\nimport { NewlinesPipe } from '@dealpos-npm/ng-dealpos-library/pipes/newlines';\r\nimport { BrokenImageIconFailSafeDirective } from '@dealpos-npm/ng-dealpos-library/directives/broken-image-fail-save';\r\nimport { NewsModalData, NewsModalItem, NewsModalLabels, NewsModalResult, NewsModalSlide } from './news-modal.types';\r\n\r\nconst DEFAULT_LABELS: Required<NewsModalLabels> = {\r\n headerTitle: \"What's New\",\r\n close: 'Close',\r\n prev: 'Previous',\r\n next: 'Next',\r\n prevImage: 'Previous image',\r\n nextImage: 'Next image',\r\n gotIt: 'Got it',\r\n goToNews: 'Go to news',\r\n dialogLabel: 'New feature announcement',\r\n};\r\n\r\nconst SWIPE_THRESHOLD = 40;\r\n\r\n@Component({\r\n selector: 'lib-modal-news',\r\n standalone: true,\r\n imports: [NewlinesPipe, BrokenImageIconFailSafeDirective],\r\n templateUrl: './news-modal.component.html',\r\n styleUrls: ['./news-modal.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n})\r\nexport class ModalNewsComponent {\r\n readonly data = inject<NewsModalData>(MAT_DIALOG_DATA);\r\n private readonly dialogRef = inject<MatDialogRef<ModalNewsComponent, NewsModalResult>>(MatDialogRef);\r\n\r\n readonly labels = computed<Required<NewsModalLabels>>(() => ({ ...DEFAULT_LABELS, ...this.data.labels }));\r\n readonly index = signal(this.data.startIndex ?? 0);\r\n readonly total = computed(() => this.data.items.length);\r\n readonly isMulti = computed(() => this.data.items.length > 1);\r\n readonly item = computed<NewsModalItem | null>(() => this.data.items[this.index()] ?? null);\r\n readonly slides = computed<NewsModalSlide[]>(() => {\r\n const item = this.item();\r\n if (!item) {\r\n return [];\r\n }\r\n return item.slides?.length ? item.slides : [item];\r\n });\r\n readonly slideIndex = signal(0);\r\n readonly slide = computed<NewsModalSlide | null>(() => this.slides()[this.slideIndex()] ?? null);\r\n readonly isMultiSlide = computed(() => this.slides().length > 1);\r\n\r\n private touchStartX = 0;\r\n\r\n readonly titleId = 'lib-modal-news-title';\r\n\r\n next(): void {\r\n this.advance(1);\r\n }\r\n\r\n prev(): void {\r\n this.advance(-1);\r\n }\r\n\r\n nextSlide(): void {\r\n this.moveSlide(1);\r\n }\r\n\r\n prevSlide(): void {\r\n this.moveSlide(-1);\r\n }\r\n\r\n goTo(i: number): void {\r\n this.move(i - this.index());\r\n }\r\n\r\n /** Close button and article links both end the same way: the item counts as read. */\r\n dismiss(): void {\r\n const item = this.item();\r\n if (!item) {\r\n this.dialogRef.close();\r\n return;\r\n }\r\n this.dialogRef.close({ action: 'dismiss', index: this.index(), item, url: item.actionUrl });\r\n }\r\n\r\n onLinkClick(): void {\r\n if (this.item()?.actionUrl) {\r\n this.dismiss();\r\n }\r\n }\r\n\r\n onTouchStart(event: TouchEvent): void {\r\n this.touchStartX = event.changedTouches[0]?.clientX ?? 0;\r\n }\r\n\r\n onTouchEnd(event: TouchEvent): void {\r\n const endX = event.changedTouches[0]?.clientX ?? 0;\r\n const dx = endX - this.touchStartX;\r\n this.touchStartX = 0;\r\n if (Math.abs(dx) < SWIPE_THRESHOLD) {\r\n return;\r\n }\r\n this.advance(dx < 0 ? 1 : -1);\r\n }\r\n\r\n @HostListener('keydown', ['$event'])\r\n onKeydown(event: KeyboardEvent): void {\r\n if (event.key === 'ArrowRight') {\r\n event.preventDefault();\r\n this.advance(1);\r\n } else if (event.key === 'ArrowLeft') {\r\n event.preventDefault();\r\n this.advance(-1);\r\n }\r\n }\r\n\r\n private advance(steps: number): void {\r\n const target = this.slideIndex() + steps;\r\n if (this.isMultiSlide() && target >= 0 && target < this.slides().length) {\r\n this.slideIndex.set(target);\r\n return;\r\n }\r\n this.move(steps);\r\n }\r\n\r\n private moveSlide(steps: number): void {\r\n const target = this.slideIndex() + steps;\r\n if (target < 0 || target >= this.slides().length) {\r\n return;\r\n }\r\n this.slideIndex.set(target);\r\n }\r\n\r\n private move(steps: number): void {\r\n const target = this.index() + steps;\r\n if (target < 0 || target >= this.total() || target === this.index()) {\r\n return;\r\n }\r\n this.index.set(target);\r\n this.slideIndex.set(0);\r\n }\r\n}\r\n","<div class=\"news-card\" (touchstart)=\"onTouchStart($event)\" (touchend)=\"onTouchEnd($event)\">\r\n @if (item(); as news) {\r\n <div class=\"news-header\">\r\n <i class=\"fa-regular fa-newspaper news-header-icon\" aria-hidden=\"true\"></i>\r\n <h2 class=\"news-header-title\">{{ labels().headerTitle }}</h2>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close news-close\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"dismiss()\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"news-hero\">\r\n @if (isMulti()) {\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-prev\"\r\n [disabled]=\"index() === 0 && slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prev\"\r\n (click)=\"prev()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-next\"\r\n [disabled]=\"index() === total() - 1 && slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"next()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (slide()?.image || news.image) {\r\n <a\r\n class=\"news-image-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <img\r\n class=\"news-image\"\r\n [src]=\"slide()?.image || news.image\"\r\n [alt]=\"slide()?.imageAlt || slide()?.title || news.imageAlt || news.title\"\r\n draggable=\"false\"\r\n brokenImageIconFailSafe\r\n (dragstart)=\"$event.preventDefault()\"\r\n (contextmenu)=\"$event.preventDefault()\"\r\n />\r\n </a>\r\n } @else {\r\n <div class=\"news-placeholder\" aria-hidden=\"true\">\r\n <i class=\"fa fa-image\"></i>\r\n </div>\r\n }\r\n\r\n @if (isMultiSlide()) {\r\n <div class=\"news-slide-nav\">\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prevImage\"\r\n (click)=\"prevSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <span class=\"news-slide-count\" aria-hidden=\"true\">{{ slideIndex() + 1 }} / {{ slides().length }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().nextImage\"\r\n (click)=\"nextSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (isMulti()) {\r\n <div class=\"news-indicator\">\r\n <div class=\"news-dots\">\r\n @for (dot of data.items; track dot.id; let i = $index) {\r\n <button\r\n type=\"button\"\r\n class=\"news-dot\"\r\n [class.active]=\"i === index()\"\r\n [attr.aria-label]=\"labels().goToNews + ' #' + (i + 1)\"\r\n [attr.aria-current]=\"i === index() ? 'true' : null\"\r\n (click)=\"goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n <span class=\"news-count\">{{ index() + 1 }} / {{ total() }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"news-body\">\r\n <a\r\n class=\"news-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <h5 class=\"news-title\" [id]=\"titleId\">{{ slide()?.title || news.title }}</h5>\r\n </a>\r\n <p class=\"news-text\" [innerHTML]=\"(slide()?.body || news.body) | newlines\"></p>\r\n </div>\r\n\r\n <p class=\"visually-hidden\" aria-live=\"polite\">\r\n {{ index() + 1 }} / {{ total() }}@if (isMultiSlide()) { · {{ slideIndex() + 1 }} / {{ slides().length }} } —\r\n {{ slide()?.title || news.title }}\r\n </p>\r\n }\r\n</div>\r\n","import { DOCUMENT } from '@angular/common';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { ModalNewsComponent } from './news-modal.component';\r\nimport { NewsModalData, NewsModalItem, NewsModalLabels, NewsModalResult } from './news-modal.types';\r\n\r\nexport interface NewsModalOpenOptions {\r\n startIndex?: number;\r\n labels?: NewsModalLabels;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NewsModalService {\r\n private readonly dialog = inject(MatDialog);\r\n private readonly document = inject(DOCUMENT);\r\n\r\n open(\r\n items: NewsModalItem[],\r\n options?: NewsModalOpenOptions,\r\n ): MatDialogRef<ModalNewsComponent, NewsModalResult | undefined> {\r\n const ref = this.dialog.open<ModalNewsComponent, NewsModalData, NewsModalResult | undefined>(\r\n ModalNewsComponent,\r\n {\r\n data: { items, startIndex: options?.startIndex ?? 0, labels: options?.labels },\r\n panelClass: 'news-modal-panel',\r\n backdropClass: 'news-modal-backdrop',\r\n width: '475px',\r\n maxWidth: '95vw',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n ariaLabel: options?.labels?.dialogLabel ?? 'New feature announcement',\r\n },\r\n );\r\n\r\n this.lockPageScroll(ref);\r\n\r\n return ref;\r\n }\r\n\r\n /** Material's block strategy only locks a document-scrolled page, so lock the body as well. */\r\n private lockPageScroll<T, R>(ref: MatDialogRef<T, R>): void {\r\n const body = this.document.body;\r\n const previousOverflow = body.style.overflow;\r\n body.style.overflow = 'hidden';\r\n ref.afterClosed().subscribe(() => {\r\n body.style.overflow = previousOverflow;\r\n });\r\n }\r\n}\r\n","/**\r\n * Case-insensitive, per-segment prefix match between a router URL and a target route.\r\n * Query string and fragment are ignored. An empty target matches everything.\r\n */\r\nexport function matchesNewsTarget(currentUrl: string, target: string): boolean {\r\n const segments = (value: string): string[] =>\r\n value\r\n .split(/[?#]/, 1)[0]\r\n .toLowerCase()\r\n .split('/')\r\n .filter((part) => part.length > 0);\r\n\r\n const current = segments(currentUrl);\r\n const wanted = segments(target);\r\n if (!wanted.length) return true;\r\n if (wanted.length > current.length) return false;\r\n return wanted.every((segment, index) => current[index] === segment);\r\n}\r\n","import { Injectable, inject, signal } from '@angular/core';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { filter } from 'rxjs';\r\nimport { NewsModalItem, NewsModalLabels } from './news-modal.types';\r\nimport { NewsModalService } from './news-modal.service';\r\nimport { matchesNewsTarget } from './news-modal-route.util';\r\n\r\nexport interface NewsModalAutoOpenOptions {\r\n startIndex?: number;\r\n labels?: NewsModalLabels;\r\n onOpen?: (items: NewsModalItem[]) => void;\r\n}\r\n\r\n/**\r\n * Opens the news modal automatically when the current route matches the `targets` of any\r\n * supplied item. Persisting \"already seen\" state is deliberately NOT handled here — the host\r\n * owns that, and can pass a getter that returns only items the user has not seen yet.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class NewsModalRouterService {\r\n private readonly router = inject(Router);\r\n private readonly newsModal = inject(NewsModalService);\r\n private readonly dialogOpen = signal(false);\r\n\r\n /**\r\n * Evaluates the items against the current URL immediately and again on every navigation.\r\n * Returns a teardown function that stops watching; it does not close an open dialog.\r\n */\r\n autoOpen(\r\n source: NewsModalItem[] | (() => NewsModalItem[]),\r\n options?: NewsModalAutoOpenOptions,\r\n ): () => void {\r\n const resolve = (): NewsModalItem[] => (typeof source === 'function' ? source() : source);\r\n\r\n const evaluate = (): void => {\r\n if (this.dialogOpen()) return;\r\n const url = this.router.url;\r\n const matched = resolve().filter(\r\n (item) => !item.targets?.length || item.targets.some((target) => matchesNewsTarget(url, target)),\r\n );\r\n if (!matched.length) return;\r\n this.dialogOpen.set(true);\r\n options?.onOpen?.(matched);\r\n this.newsModal.open(matched, options).afterClosed().subscribe(() => this.dialogOpen.set(false));\r\n };\r\n\r\n evaluate();\r\n const subscription = this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(evaluate);\r\n\r\n return () => subscription.unsubscribe();\r\n }\r\n}\r\n"],"mappings":";;;;;;;;AAOA,MAAM,iBAA4C;CAChD,aAAa;CACb,OAAO;CACP,MAAM;CACN,MAAM;CACN,WAAW;CACX,WAAW;CACX,OAAO;CACP,UAAU;CACV,aAAa;AACd;AAED,MAAM,kBAAkB;AAUxB,IAAa,qBAAb,MAAa,mBAAkB;CAR/B,cAAA;EASW,KAAA,OAAO,OAAsB,eAAe;EACpC,KAAA,YAAY,OAA0D,YAAY;EAE1F,KAAA,SAAS,gBAA2C;GAAE,GAAG;GAAgB,GAAG,KAAK,KAAK;EAAM,IAAI,GAAA,YAAA,CAAA,EAAA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":"dealpos-npm-ng-dealpos-library-components-modal-news.mjs","names":[],"sources":["../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.component.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.component.html","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal.service.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal-route.util.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-news/src/news-modal-router.service.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostListener, computed, inject, signal } from '@angular/core';\r\nimport { MatDialogRef } from '@angular/material/dialog';\r\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\r\nimport { NewlinesPipe } from '@dealpos-npm/ng-dealpos-library/pipes/newlines';\r\nimport { BrokenImageIconFailSafeDirective } from '@dealpos-npm/ng-dealpos-library/directives/broken-image-fail-save';\r\nimport { NewsModalData, NewsModalItem, NewsModalLabels, NewsModalResult, NewsModalSlide } from './news-modal.types';\r\n\r\nconst DEFAULT_LABELS: Required<NewsModalLabels> = {\r\n headerTitle: \"What's New\",\r\n close: 'Close',\r\n prev: 'Previous',\r\n next: 'Next',\r\n prevImage: 'Previous image',\r\n nextImage: 'Next image',\r\n gotIt: 'Got it',\r\n goToNews: 'Go to news',\r\n dialogLabel: 'New feature announcement',\r\n};\r\n\r\nconst SWIPE_THRESHOLD = 40;\r\n\r\n@Component({\r\n selector: 'lib-modal-news',\r\n standalone: true,\r\n imports: [NewlinesPipe, BrokenImageIconFailSafeDirective],\r\n templateUrl: './news-modal.component.html',\r\n styleUrls: ['./news-modal.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n})\r\nexport class ModalNewsComponent {\r\n readonly data = inject<NewsModalData>(MAT_DIALOG_DATA);\r\n private readonly dialogRef = inject<MatDialogRef<ModalNewsComponent, NewsModalResult>>(MatDialogRef);\r\n\r\n readonly labels = computed<Required<NewsModalLabels>>(() => ({ ...DEFAULT_LABELS, ...this.data.labels }));\r\n readonly index = signal(this.data.startIndex ?? 0);\r\n readonly total = computed(() => this.data.items.length);\r\n readonly isMulti = computed(() => this.data.items.length > 1);\r\n readonly item = computed<NewsModalItem | null>(() => this.data.items[this.index()] ?? null);\r\n readonly slides = computed<NewsModalSlide[]>(() => {\r\n const item = this.item();\r\n if (!item) {\r\n return [];\r\n }\r\n return item.slides?.length ? item.slides : [item];\r\n });\r\n readonly slideIndex = signal(0);\r\n readonly slide = computed<NewsModalSlide | null>(() => this.slides()[this.slideIndex()] ?? null);\r\n readonly isMultiSlide = computed(() => this.slides().length > 1);\r\n\r\n private touchStartX = 0;\r\n\r\n readonly titleId = 'lib-modal-news-title';\r\n\r\n next(): void {\r\n this.advance(1);\r\n }\r\n\r\n prev(): void {\r\n this.advance(-1);\r\n }\r\n\r\n nextSlide(): void {\r\n this.moveSlide(1);\r\n }\r\n\r\n prevSlide(): void {\r\n this.moveSlide(-1);\r\n }\r\n\r\n goTo(i: number): void {\r\n this.move(i - this.index());\r\n }\r\n\r\n /** Close button and article links both end the same way: the item counts as read. */\r\n dismiss(): void {\r\n const item = this.item();\r\n if (!item) {\r\n this.dialogRef.close();\r\n return;\r\n }\r\n this.dialogRef.close({ action: 'dismiss', index: this.index(), item, url: item.actionUrl });\r\n }\r\n\r\n onLinkClick(): void {\r\n if (this.item()?.actionUrl) {\r\n this.dismiss();\r\n }\r\n }\r\n\r\n onTouchStart(event: TouchEvent): void {\r\n this.touchStartX = event.changedTouches[0]?.clientX ?? 0;\r\n }\r\n\r\n onTouchEnd(event: TouchEvent): void {\r\n const endX = event.changedTouches[0]?.clientX ?? 0;\r\n const dx = endX - this.touchStartX;\r\n this.touchStartX = 0;\r\n if (Math.abs(dx) < SWIPE_THRESHOLD) {\r\n return;\r\n }\r\n this.advance(dx < 0 ? 1 : -1);\r\n }\r\n\r\n @HostListener('keydown', ['$event'])\r\n onKeydown(event: KeyboardEvent): void {\r\n if (event.key === 'ArrowRight') {\r\n event.preventDefault();\r\n this.advance(1);\r\n } else if (event.key === 'ArrowLeft') {\r\n event.preventDefault();\r\n this.advance(-1);\r\n }\r\n }\r\n\r\n private advance(steps: number): void {\r\n const target = this.slideIndex() + steps;\r\n if (this.isMultiSlide() && target >= 0 && target < this.slides().length) {\r\n this.slideIndex.set(target);\r\n return;\r\n }\r\n this.move(steps);\r\n }\r\n\r\n private moveSlide(steps: number): void {\r\n const target = this.slideIndex() + steps;\r\n if (target < 0 || target >= this.slides().length) {\r\n return;\r\n }\r\n this.slideIndex.set(target);\r\n }\r\n\r\n private move(steps: number): void {\r\n const target = this.index() + steps;\r\n if (target < 0 || target >= this.total() || target === this.index()) {\r\n return;\r\n }\r\n this.index.set(target);\r\n this.slideIndex.set(0);\r\n }\r\n}\r\n","<div class=\"news-card\" (touchstart)=\"onTouchStart($event)\" (touchend)=\"onTouchEnd($event)\">\r\n @if (item(); as news) {\r\n <div class=\"news-header\">\r\n <i class=\"fa-regular fa-newspaper news-header-icon\" aria-hidden=\"true\"></i>\r\n <h2 class=\"news-header-title\">{{ labels().headerTitle }}</h2>\r\n <button\r\n type=\"button\"\r\n class=\"btn-close news-close\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"dismiss()\"\r\n ></button>\r\n </div>\r\n\r\n <div class=\"news-hero\">\r\n @if (isMulti()) {\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-prev\"\r\n [disabled]=\"index() === 0 && slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prev\"\r\n (click)=\"prev()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"news-nav news-next\"\r\n [disabled]=\"index() === total() - 1 && slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"next()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (slide()?.image || news.image) {\r\n <a\r\n class=\"news-image-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <img\r\n class=\"news-image\"\r\n [src]=\"slide()?.image || news.image\"\r\n [alt]=\"slide()?.imageAlt || slide()?.title || news.imageAlt || news.title\"\r\n draggable=\"false\"\r\n brokenImageIconFailSafe\r\n (dragstart)=\"$event.preventDefault()\"\r\n (contextmenu)=\"$event.preventDefault()\"\r\n />\r\n </a>\r\n } @else {\r\n <div class=\"news-placeholder\" aria-hidden=\"true\">\r\n <i class=\"fa fa-image\"></i>\r\n </div>\r\n }\r\n\r\n @if (isMultiSlide()) {\r\n <div class=\"news-slide-nav\">\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === 0\"\r\n [attr.aria-label]=\"labels().prevImage\"\r\n (click)=\"prevSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\r\n </button>\r\n <span class=\"news-slide-count\" aria-hidden=\"true\">{{ slideIndex() + 1 }} / {{ slides().length }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"news-slide-btn\"\r\n [disabled]=\"slideIndex() === slides().length - 1\"\r\n [attr.aria-label]=\"labels().nextImage\"\r\n (click)=\"nextSlide()\"\r\n >\r\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (isMulti()) {\r\n <div class=\"news-indicator\">\r\n <div class=\"news-dots\">\r\n @for (dot of data.items; track dot.id; let i = $index) {\r\n <button\r\n type=\"button\"\r\n class=\"news-dot\"\r\n [class.active]=\"i === index()\"\r\n [attr.aria-label]=\"labels().goToNews + ' #' + (i + 1)\"\r\n [attr.aria-current]=\"i === index() ? 'true' : null\"\r\n (click)=\"goTo(i)\"\r\n ></button>\r\n }\r\n </div>\r\n <span class=\"news-count\">{{ index() + 1 }} / {{ total() }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"news-body\">\r\n <a\r\n class=\"news-link\"\r\n [attr.href]=\"news.actionUrl || null\"\r\n [attr.target]=\"news.actionUrl ? '_blank' : null\"\r\n [attr.rel]=\"news.actionUrl ? 'noopener noreferrer' : null\"\r\n (click)=\"onLinkClick()\"\r\n >\r\n <h5 class=\"news-title\" [id]=\"titleId\">{{ slide()?.title || news.title }}</h5>\r\n </a>\r\n <p class=\"news-text\" [innerHTML]=\"(slide()?.body || news.body) | newlines\"></p>\r\n </div>\r\n\r\n <p class=\"visually-hidden\" aria-live=\"polite\">\r\n {{ index() + 1 }} / {{ total() }}@if (isMultiSlide()) { · {{ slideIndex() + 1 }} / {{ slides().length }} } —\r\n {{ slide()?.title || news.title }}\r\n </p>\r\n }\r\n</div>\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { ModalNewsComponent } from './news-modal.component';\r\nimport { NewsModalData, NewsModalItem, NewsModalLabels, NewsModalResult } from './news-modal.types';\r\n\r\nexport interface NewsModalOpenOptions {\r\n startIndex?: number;\r\n labels?: NewsModalLabels;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NewsModalService {\r\n private readonly dialog = inject(MatDialog);\r\n\r\n open(\r\n items: NewsModalItem[],\r\n options?: NewsModalOpenOptions,\r\n ): MatDialogRef<ModalNewsComponent, NewsModalResult | undefined> {\r\n return this.dialog.open<ModalNewsComponent, NewsModalData, NewsModalResult | undefined>(ModalNewsComponent, {\r\n data: { items, startIndex: options?.startIndex ?? 0, labels: options?.labels },\r\n panelClass: 'news-modal-panel',\r\n backdropClass: 'news-modal-backdrop',\r\n width: '475px',\r\n maxWidth: '95vw',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n ariaLabel: options?.labels?.dialogLabel ?? 'New feature announcement',\r\n });\r\n }\r\n}\r\n","/**\r\n * Case-insensitive, per-segment prefix match between a router URL and a target route.\r\n * Query string and fragment are ignored. An empty target matches everything.\r\n */\r\nexport function matchesNewsTarget(currentUrl: string, target: string): boolean {\r\n const segments = (value: string): string[] =>\r\n value\r\n .split(/[?#]/, 1)[0]\r\n .toLowerCase()\r\n .split('/')\r\n .filter((part) => part.length > 0);\r\n\r\n const current = segments(currentUrl);\r\n const wanted = segments(target);\r\n if (!wanted.length) return true;\r\n if (wanted.length > current.length) return false;\r\n return wanted.every((segment, index) => current[index] === segment);\r\n}\r\n","import { Injectable, inject, signal } from '@angular/core';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\nimport { filter } from 'rxjs';\r\nimport { NewsModalItem, NewsModalLabels } from './news-modal.types';\r\nimport { NewsModalService } from './news-modal.service';\r\nimport { matchesNewsTarget } from './news-modal-route.util';\r\n\r\nexport interface NewsModalAutoOpenOptions {\r\n startIndex?: number;\r\n labels?: NewsModalLabels;\r\n onOpen?: (items: NewsModalItem[]) => void;\r\n}\r\n\r\n/**\r\n * Opens the news modal automatically when the current route matches the `targets` of any\r\n * supplied item. Persisting \"already seen\" state is deliberately NOT handled here — the host\r\n * owns that, and can pass a getter that returns only items the user has not seen yet.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class NewsModalRouterService {\r\n private readonly router = inject(Router);\r\n private readonly newsModal = inject(NewsModalService);\r\n private readonly dialogOpen = signal(false);\r\n\r\n /**\r\n * Evaluates the items against the current URL immediately and again on every navigation.\r\n * Returns a teardown function that stops watching; it does not close an open dialog.\r\n */\r\n autoOpen(\r\n source: NewsModalItem[] | (() => NewsModalItem[]),\r\n options?: NewsModalAutoOpenOptions,\r\n ): () => void {\r\n const resolve = (): NewsModalItem[] => (typeof source === 'function' ? source() : source);\r\n\r\n const evaluate = (): void => {\r\n if (this.dialogOpen()) return;\r\n const url = this.router.url;\r\n const matched = resolve().filter(\r\n (item) => !item.targets?.length || item.targets.some((target) => matchesNewsTarget(url, target)),\r\n );\r\n if (!matched.length) return;\r\n this.dialogOpen.set(true);\r\n options?.onOpen?.(matched);\r\n this.newsModal.open(matched, options).afterClosed().subscribe(() => this.dialogOpen.set(false));\r\n };\r\n\r\n evaluate();\r\n const subscription = this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(evaluate);\r\n\r\n return () => subscription.unsubscribe();\r\n }\r\n}\r\n"],"mappings":";;;;;;;AAOA,MAAM,iBAA4C;CAChD,aAAa;CACb,OAAO;CACP,MAAM;CACN,MAAM;CACN,WAAW;CACX,WAAW;CACX,OAAO;CACP,UAAU;CACV,aAAa;AACd;AAED,MAAM,kBAAkB;AAUxB,IAAa,qBAAb,MAAa,mBAAkB;CAR/B,cAAA;EASW,KAAA,OAAO,OAAsB,eAAe;EACpC,KAAA,YAAY,OAA0D,YAAY;EAE1F,KAAA,SAAS,gBAA2C;GAAE,GAAG;GAAgB,GAAG,KAAK,KAAK;EAAM,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;EAChG,KAAA,QAAQ,OAAO,KAAK,KAAK,cAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EACzC,KAAA,QAAQ,eAAe,KAAK,KAAK,MAAM,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAC9C,KAAA,UAAU,eAAe,KAAK,KAAK,MAAM,SAAS,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;EACpD,KAAA,OAAO,eAAqC,KAAK,KAAK,MAAM,KAAK,MAAK,MAAO,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAClF,KAAA,SAAS,eAAgC;GAChD,MAAM,OAAO,KAAK,KAAI;GACtB,IAAI,CAAC,MACH,OAAO,CAAA;GA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SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAtB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,YADT;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EADlC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dealpos-npm/ng-dealpos-library",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^22.2.0",
|
|
6
6
|
"@angular/core": "^22.2.0",
|
|
@@ -136,10 +136,6 @@
|
|
|
136
136
|
"types": "./types/dealpos-npm-ng-dealpos-library-components-radio-options.d.ts",
|
|
137
137
|
"default": "./fesm2022/dealpos-npm-ng-dealpos-library-components-radio-options.mjs"
|
|
138
138
|
},
|
|
139
|
-
"./components/search-option": {
|
|
140
|
-
"types": "./types/dealpos-npm-ng-dealpos-library-components-search-option.d.ts",
|
|
141
|
-
"default": "./fesm2022/dealpos-npm-ng-dealpos-library-components-search-option.mjs"
|
|
142
|
-
},
|
|
143
139
|
"./components/select-lazy-load": {
|
|
144
140
|
"types": "./types/dealpos-npm-ng-dealpos-library-components-select-lazy-load.d.ts",
|
|
145
141
|
"default": "./fesm2022/dealpos-npm-ng-dealpos-library-components-select-lazy-load.mjs"
|
|
@@ -86,10 +86,7 @@ export interface NewsModalOpenOptions {
|
|
|
86
86
|
}
|
|
87
87
|
export declare class NewsModalService {
|
|
88
88
|
private readonly dialog;
|
|
89
|
-
private readonly document;
|
|
90
89
|
open(items: NewsModalItem[], options?: NewsModalOpenOptions): MatDialogRef<ModalNewsComponent, NewsModalResult | undefined>;
|
|
91
|
-
/** Material's block strategy only locks a document-scrolled page, so lock the body as well. */
|
|
92
|
-
private lockPageScroll;
|
|
93
90
|
static ɵfac: i0.ɵɵFactoryDeclaration<NewsModalService, never>;
|
|
94
91
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
95
92
|
}
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import * as i1 from "@angular/common";
|
|
2
|
-
import { CommonModule } from "@angular/common";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import { ChangeDetectionStrategy, Component, ElementRef, HostListener, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
|
|
5
|
-
var SearchScope;
|
|
6
|
-
(function(SearchScope) {
|
|
7
|
-
SearchScope["Name"] = "name";
|
|
8
|
-
SearchScope["Code"] = "code";
|
|
9
|
-
})(SearchScope || (SearchScope = {}));
|
|
10
|
-
const DEFAULT_SEARCH_SCOPES = [{
|
|
11
|
-
value: SearchScope.Name,
|
|
12
|
-
label: "Name"
|
|
13
|
-
}, {
|
|
14
|
-
value: SearchScope.Code,
|
|
15
|
-
label: "Code"
|
|
16
|
-
}];
|
|
17
|
-
var SearchOptionComponent = class SearchOptionComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.scopes = input(DEFAULT_SEARCH_SCOPES, ...ngDevMode ? [{ debugName: "scopes" }] : /* istanbul ignore next */ []);
|
|
20
|
-
this.scope = input(SearchScope.Name, ...ngDevMode ? [{ debugName: "scope" }] : /* istanbul ignore next */ []);
|
|
21
|
-
this.searchText = input("", ...ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []);
|
|
22
|
-
this.extendedFiltersTemplate = input(null, ...ngDevMode ? [{ debugName: "extendedFiltersTemplate" }] : /* istanbul ignore next */ []);
|
|
23
|
-
this.data_cy = input("", ...ngDevMode ? [{ debugName: "data_cy" }] : /* istanbul ignore next */ []);
|
|
24
|
-
this.scopeChange = output();
|
|
25
|
-
this.onSearch = output();
|
|
26
|
-
this.panelOpen = signal(false, ...ngDevMode ? [{ debugName: "panelOpen" }] : /* istanbul ignore next */ []);
|
|
27
|
-
this.text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
28
|
-
this.inputRef = viewChild("searchInput", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
|
|
29
|
-
this.host = inject(ElementRef);
|
|
30
|
-
effect(() => {
|
|
31
|
-
const value = this.searchText();
|
|
32
|
-
untracked(() => this.text.set(value));
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
label(value) {
|
|
36
|
-
return this.scopes().find((item) => item.value === value)?.label ?? value;
|
|
37
|
-
}
|
|
38
|
-
placeholder() {
|
|
39
|
-
return `Search by ${this.label(this.scope())}`;
|
|
40
|
-
}
|
|
41
|
-
openPanel() {
|
|
42
|
-
this.panelOpen.set(true);
|
|
43
|
-
}
|
|
44
|
-
closePanel() {
|
|
45
|
-
this.panelOpen.set(false);
|
|
46
|
-
}
|
|
47
|
-
togglePanel() {
|
|
48
|
-
this.panelOpen.update((open) => !open);
|
|
49
|
-
this.inputRef()?.nativeElement.focus();
|
|
50
|
-
}
|
|
51
|
-
pick(scope) {
|
|
52
|
-
this.scopeChange.emit(scope);
|
|
53
|
-
this.panelOpen.set(false);
|
|
54
|
-
this.inputRef()?.nativeElement.focus();
|
|
55
|
-
}
|
|
56
|
-
onInput(event) {
|
|
57
|
-
this.text.set(event.target.value);
|
|
58
|
-
}
|
|
59
|
-
clear() {
|
|
60
|
-
this.text.set("");
|
|
61
|
-
this.inputRef()?.nativeElement.focus();
|
|
62
|
-
}
|
|
63
|
-
submit() {
|
|
64
|
-
this.onSearch.emit({
|
|
65
|
-
scope: this.scope(),
|
|
66
|
-
text: this.text()
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
onDocumentClick(event) {
|
|
70
|
-
if (!this.host.nativeElement.contains(event.target)) this.panelOpen.set(false);
|
|
71
|
-
}
|
|
72
|
-
static {
|
|
73
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
74
|
-
minVersion: "12.0.0",
|
|
75
|
-
version: "22.2.4",
|
|
76
|
-
ngImport: i0,
|
|
77
|
-
type: SearchOptionComponent,
|
|
78
|
-
deps: [],
|
|
79
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
static {
|
|
83
|
-
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
84
|
-
minVersion: "17.0.0",
|
|
85
|
-
version: "22.2.4",
|
|
86
|
-
type: SearchOptionComponent,
|
|
87
|
-
isStandalone: true,
|
|
88
|
-
selector: "POS-search-option",
|
|
89
|
-
inputs: {
|
|
90
|
-
scopes: {
|
|
91
|
-
classPropertyName: "scopes",
|
|
92
|
-
publicName: "scopes",
|
|
93
|
-
isSignal: true,
|
|
94
|
-
isRequired: false,
|
|
95
|
-
transformFunction: null
|
|
96
|
-
},
|
|
97
|
-
scope: {
|
|
98
|
-
classPropertyName: "scope",
|
|
99
|
-
publicName: "scope",
|
|
100
|
-
isSignal: true,
|
|
101
|
-
isRequired: false,
|
|
102
|
-
transformFunction: null
|
|
103
|
-
},
|
|
104
|
-
searchText: {
|
|
105
|
-
classPropertyName: "searchText",
|
|
106
|
-
publicName: "searchText",
|
|
107
|
-
isSignal: true,
|
|
108
|
-
isRequired: false,
|
|
109
|
-
transformFunction: null
|
|
110
|
-
},
|
|
111
|
-
extendedFiltersTemplate: {
|
|
112
|
-
classPropertyName: "extendedFiltersTemplate",
|
|
113
|
-
publicName: "extendedFiltersTemplate",
|
|
114
|
-
isSignal: true,
|
|
115
|
-
isRequired: false,
|
|
116
|
-
transformFunction: null
|
|
117
|
-
},
|
|
118
|
-
data_cy: {
|
|
119
|
-
classPropertyName: "data_cy",
|
|
120
|
-
publicName: "data_cy",
|
|
121
|
-
isSignal: true,
|
|
122
|
-
isRequired: false,
|
|
123
|
-
transformFunction: null
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
outputs: {
|
|
127
|
-
scopeChange: "scopeChange",
|
|
128
|
-
onSearch: "onSearch"
|
|
129
|
-
},
|
|
130
|
-
host: { listeners: { "document:click": "onDocumentClick($event)" } },
|
|
131
|
-
viewQueries: [{
|
|
132
|
-
propertyName: "inputRef",
|
|
133
|
-
first: true,
|
|
134
|
-
predicate: ["searchInput"],
|
|
135
|
-
descendants: true,
|
|
136
|
-
isSignal: true
|
|
137
|
-
}],
|
|
138
|
-
ngImport: i0,
|
|
139
|
-
template: "<div class=\"search-option\">\r\n <div class=\"search-option__bar\" [class.is-focused]=\"panelOpen()\">\r\n <svg class=\"search-option__glass\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\r\n <circle cx=\"7\" cy=\"7\" r=\"4.6\"></circle>\r\n <line x1=\"10.4\" y1=\"10.4\" x2=\"14\" y2=\"14\"></line>\r\n </svg>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"search-option__toggle\"\r\n aria-label=\"Change search scope\"\r\n [attr.aria-expanded]=\"panelOpen()\"\r\n [attr.data-cy]=\"data_cy() + '-toggle'\"\r\n (click)=\"togglePanel()\"\r\n >\r\n <svg viewBox=\"0 0 10 6\" aria-hidden=\"true\">\r\n <path d=\"M1 1l4 4 4-4\"></path>\r\n </svg>\r\n </button>\r\n\r\n <input\r\n #searchInput\r\n type=\"text\"\r\n class=\"search-option__input\"\r\n [value]=\"text()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"placeholder()\"\r\n [attr.data-cy]=\"data_cy() + '-input'\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"openPanel()\"\r\n (keydown.enter)=\"submit()\"\r\n (keydown.escape)=\"closePanel()\"\r\n />\r\n\r\n @if (text()) {\r\n <button\r\n type=\"button\"\r\n class=\"search-option__clear\"\r\n aria-label=\"Clear search\"\r\n (click)=\"clear()\"\r\n >\r\n ✕\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (panelOpen()) {\r\n <div class=\"search-option__panel\" role=\"menu\">\r\n @for (item of scopes(); track item.value) {\r\n <button\r\n type=\"button\"\r\n role=\"menuitemradio\"\r\n class=\"search-option__row\"\r\n [class.is-active]=\"item.value === scope()\"\r\n [attr.aria-checked]=\"item.value === scope()\"\r\n [attr.data-cy]=\"data_cy() + '-scope-' + item.value\"\r\n (click)=\"pick(item.value)\"\r\n >\r\n <span class=\"search-option__name\">{{ item.label }}</span>\r\n <span class=\"search-option__desc\">{{ item.description }}</span>\r\n @if (item.value === scope()) {\r\n <span class=\"search-option__tick\" aria-hidden=\"true\">✓</span>\r\n }\r\n </button>\r\n }\r\n\r\n @if (extendedFiltersTemplate()) {\r\n <div class=\"search-option__divider\"></div>\r\n <div class=\"search-option__slot\">\r\n <ng-container *ngTemplateOutlet=\"extendedFiltersTemplate()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n",
|
|
140
|
-
styles: [".search-option{position:relative;width:100%;font-size:14px;color:#343434}.search-option__bar{display:flex;align-items:center;gap:8px;height:38px;padding:0 10px;background:#fff;border:1px solid #c8d3df;border-radius:4px;color:#9da2a6}.search-option__bar.is-focused{border-color:#1a73e8;box-shadow:0 0 0 2px #1a73e826}.search-option__glass{flex:none;width:15px;height:15px}.search-option__glass circle,.search-option__glass line{fill:none;stroke:currentColor;stroke-width:1.8}.search-option__toggle{display:flex;align-items:center;padding:0 8px 0 0;height:100%;background:none;border:0;border-right:1px solid #e5eaf0;color:inherit}.search-option__toggle:hover{color:#343434}.search-option__toggle svg{width:10px;height:6px}.search-option__toggle svg path{fill:none;stroke:currentColor;stroke-width:1.6}.search-option__input{flex:1;min-width:0;height:100%;background:none;border:0;outline:none;color:#343434}.search-option__input::placeholder{color:#9da2a6;opacity:1}.search-option__clear{background:none;border:0;padding:0 2px;color:#9da2a6;font-size:12px}.search-option__clear:hover{color:#343434}.search-option__panel{position:absolute;z-index:20;top:calc(100% + 6px);left:0;right:0;max-height:320px;overflow-y:auto;background:#fff;border:1px solid #c8d3df;border-radius:4px;box-shadow:0 6px 16px #3434341f}.search-option__row{display:flex;align-items:center;width:100%;height:38px;padding:0 14px;background:none;border:0;text-align:left;font-size:14px;color:#343434}.search-option__row:hover{background:#f4f7fb}.search-option__row.is-active{background:#eaf2fd;color:#1a73e8;font-weight:500}.search-option__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-option__desc{margin-left:auto;flex:none;font-size:12px;color:#9da2a6}.search-option__tick{margin-left:8px;flex:none}.search-option__divider{height:1px;background:#eef1f4}.search-option__slot{padding:12px 14px 14px;background:#fff}\n"],
|
|
141
|
-
dependencies: [{
|
|
142
|
-
kind: "ngmodule",
|
|
143
|
-
type: CommonModule
|
|
144
|
-
}, {
|
|
145
|
-
kind: "directive",
|
|
146
|
-
type: i1.NgTemplateOutlet,
|
|
147
|
-
selector: "[ngTemplateOutlet]",
|
|
148
|
-
inputs: [
|
|
149
|
-
"ngTemplateOutletContext",
|
|
150
|
-
"ngTemplateOutlet",
|
|
151
|
-
"ngTemplateOutletInjector"
|
|
152
|
-
]
|
|
153
|
-
}],
|
|
154
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
159
|
-
minVersion: "12.0.0",
|
|
160
|
-
version: "22.2.4",
|
|
161
|
-
ngImport: i0,
|
|
162
|
-
type: SearchOptionComponent,
|
|
163
|
-
decorators: [{
|
|
164
|
-
type: Component,
|
|
165
|
-
args: [{
|
|
166
|
-
selector: "POS-search-option",
|
|
167
|
-
standalone: true,
|
|
168
|
-
imports: [CommonModule],
|
|
169
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
170
|
-
template: "<div class=\"search-option\">\r\n <div class=\"search-option__bar\" [class.is-focused]=\"panelOpen()\">\r\n <svg class=\"search-option__glass\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\r\n <circle cx=\"7\" cy=\"7\" r=\"4.6\"></circle>\r\n <line x1=\"10.4\" y1=\"10.4\" x2=\"14\" y2=\"14\"></line>\r\n </svg>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"search-option__toggle\"\r\n aria-label=\"Change search scope\"\r\n [attr.aria-expanded]=\"panelOpen()\"\r\n [attr.data-cy]=\"data_cy() + '-toggle'\"\r\n (click)=\"togglePanel()\"\r\n >\r\n <svg viewBox=\"0 0 10 6\" aria-hidden=\"true\">\r\n <path d=\"M1 1l4 4 4-4\"></path>\r\n </svg>\r\n </button>\r\n\r\n <input\r\n #searchInput\r\n type=\"text\"\r\n class=\"search-option__input\"\r\n [value]=\"text()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"placeholder()\"\r\n [attr.data-cy]=\"data_cy() + '-input'\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"openPanel()\"\r\n (keydown.enter)=\"submit()\"\r\n (keydown.escape)=\"closePanel()\"\r\n />\r\n\r\n @if (text()) {\r\n <button\r\n type=\"button\"\r\n class=\"search-option__clear\"\r\n aria-label=\"Clear search\"\r\n (click)=\"clear()\"\r\n >\r\n ✕\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (panelOpen()) {\r\n <div class=\"search-option__panel\" role=\"menu\">\r\n @for (item of scopes(); track item.value) {\r\n <button\r\n type=\"button\"\r\n role=\"menuitemradio\"\r\n class=\"search-option__row\"\r\n [class.is-active]=\"item.value === scope()\"\r\n [attr.aria-checked]=\"item.value === scope()\"\r\n [attr.data-cy]=\"data_cy() + '-scope-' + item.value\"\r\n (click)=\"pick(item.value)\"\r\n >\r\n <span class=\"search-option__name\">{{ item.label }}</span>\r\n <span class=\"search-option__desc\">{{ item.description }}</span>\r\n @if (item.value === scope()) {\r\n <span class=\"search-option__tick\" aria-hidden=\"true\">✓</span>\r\n }\r\n </button>\r\n }\r\n\r\n @if (extendedFiltersTemplate()) {\r\n <div class=\"search-option__divider\"></div>\r\n <div class=\"search-option__slot\">\r\n <ng-container *ngTemplateOutlet=\"extendedFiltersTemplate()\" />\r\n </div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n",
|
|
171
|
-
styles: [".search-option{position:relative;width:100%;font-size:14px;color:#343434}.search-option__bar{display:flex;align-items:center;gap:8px;height:38px;padding:0 10px;background:#fff;border:1px solid #c8d3df;border-radius:4px;color:#9da2a6}.search-option__bar.is-focused{border-color:#1a73e8;box-shadow:0 0 0 2px #1a73e826}.search-option__glass{flex:none;width:15px;height:15px}.search-option__glass circle,.search-option__glass line{fill:none;stroke:currentColor;stroke-width:1.8}.search-option__toggle{display:flex;align-items:center;padding:0 8px 0 0;height:100%;background:none;border:0;border-right:1px solid #e5eaf0;color:inherit}.search-option__toggle:hover{color:#343434}.search-option__toggle svg{width:10px;height:6px}.search-option__toggle svg path{fill:none;stroke:currentColor;stroke-width:1.6}.search-option__input{flex:1;min-width:0;height:100%;background:none;border:0;outline:none;color:#343434}.search-option__input::placeholder{color:#9da2a6;opacity:1}.search-option__clear{background:none;border:0;padding:0 2px;color:#9da2a6;font-size:12px}.search-option__clear:hover{color:#343434}.search-option__panel{position:absolute;z-index:20;top:calc(100% + 6px);left:0;right:0;max-height:320px;overflow-y:auto;background:#fff;border:1px solid #c8d3df;border-radius:4px;box-shadow:0 6px 16px #3434341f}.search-option__row{display:flex;align-items:center;width:100%;height:38px;padding:0 14px;background:none;border:0;text-align:left;font-size:14px;color:#343434}.search-option__row:hover{background:#f4f7fb}.search-option__row.is-active{background:#eaf2fd;color:#1a73e8;font-weight:500}.search-option__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-option__desc{margin-left:auto;flex:none;font-size:12px;color:#9da2a6}.search-option__tick{margin-left:8px;flex:none}.search-option__divider{height:1px;background:#eef1f4}.search-option__slot{padding:12px 14px 14px;background:#fff}\n"]
|
|
172
|
-
}]
|
|
173
|
-
}],
|
|
174
|
-
ctorParameters: () => [],
|
|
175
|
-
propDecorators: {
|
|
176
|
-
scopes: [{
|
|
177
|
-
type: i0.Input,
|
|
178
|
-
args: [{
|
|
179
|
-
isSignal: true,
|
|
180
|
-
alias: "scopes",
|
|
181
|
-
required: false
|
|
182
|
-
}]
|
|
183
|
-
}],
|
|
184
|
-
scope: [{
|
|
185
|
-
type: i0.Input,
|
|
186
|
-
args: [{
|
|
187
|
-
isSignal: true,
|
|
188
|
-
alias: "scope",
|
|
189
|
-
required: false
|
|
190
|
-
}]
|
|
191
|
-
}],
|
|
192
|
-
searchText: [{
|
|
193
|
-
type: i0.Input,
|
|
194
|
-
args: [{
|
|
195
|
-
isSignal: true,
|
|
196
|
-
alias: "searchText",
|
|
197
|
-
required: false
|
|
198
|
-
}]
|
|
199
|
-
}],
|
|
200
|
-
extendedFiltersTemplate: [{
|
|
201
|
-
type: i0.Input,
|
|
202
|
-
args: [{
|
|
203
|
-
isSignal: true,
|
|
204
|
-
alias: "extendedFiltersTemplate",
|
|
205
|
-
required: false
|
|
206
|
-
}]
|
|
207
|
-
}],
|
|
208
|
-
data_cy: [{
|
|
209
|
-
type: i0.Input,
|
|
210
|
-
args: [{
|
|
211
|
-
isSignal: true,
|
|
212
|
-
alias: "data_cy",
|
|
213
|
-
required: false
|
|
214
|
-
}]
|
|
215
|
-
}],
|
|
216
|
-
scopeChange: [{
|
|
217
|
-
type: i0.Output,
|
|
218
|
-
args: ["scopeChange"]
|
|
219
|
-
}],
|
|
220
|
-
onSearch: [{
|
|
221
|
-
type: i0.Output,
|
|
222
|
-
args: ["onSearch"]
|
|
223
|
-
}],
|
|
224
|
-
inputRef: [{
|
|
225
|
-
type: i0.ViewChild,
|
|
226
|
-
args: ["searchInput", { isSignal: true }]
|
|
227
|
-
}],
|
|
228
|
-
onDocumentClick: [{
|
|
229
|
-
type: HostListener,
|
|
230
|
-
args: ["document:click", ["$event"]]
|
|
231
|
-
}]
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
export { DEFAULT_SEARCH_SCOPES, SearchOptionComponent, SearchScope };
|
|
235
|
-
|
|
236
|
-
//# sourceMappingURL=dealpos-npm-ng-dealpos-library-components-search-option.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dealpos-npm-ng-dealpos-library-components-search-option.mjs","names":[],"sources":["../../../projects/dealpos-npm/ng-dealpos-library/components/search-option/src/search-option.component.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/search-option/src/search-option.component.html"],"sourcesContent":["import { CommonModule } from \"@angular/common\";\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n TemplateRef,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n untracked,\r\n viewChild,\r\n} from \"@angular/core\";\r\n\r\n/** One entry of the scope picker. Consumers may pass their own list. */\r\nexport interface SearchScopeOption {\r\n value: string;\r\n label: string;\r\n /** Optional hint rendered on the right of the row. */\r\n description?: string;\r\n}\r\n\r\n/** Default scopes: search the item by name or by code. */\r\nexport enum SearchScope {\r\n Name = \"name\",\r\n Code = \"code\",\r\n}\r\n\r\nexport const DEFAULT_SEARCH_SCOPES: SearchScopeOption[] = [\r\n { value: SearchScope.Name, label: \"Name\" },\r\n { value: SearchScope.Code, label: \"Code\" },\r\n];\r\n\r\n@Component({\r\n selector: \"POS-search-option\",\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: \"./search-option.component.html\",\r\n styleUrls: [\"./search-option.component.scss\"],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SearchOptionComponent {\r\n /** Scopes offered in the picker. Defaults to name and code. */\r\n scopes = input<SearchScopeOption[]>(DEFAULT_SEARCH_SCOPES);\r\n /** Currently selected scope value. */\r\n scope = input<string>(SearchScope.Name);\r\n /** Seeds the query text; later host changes overwrite what the user typed. */\r\n searchText = input<string>(\"\");\r\n /** Optional advanced-filter fields rendered under the scope list. */\r\n extendedFiltersTemplate = input<TemplateRef<unknown> | null>(null);\r\n /** for e2e testing */\r\n data_cy = input<string>(\"\");\r\n\r\n /** Fires when the user picks a different scope. */\r\n scopeChange = output<string>();\r\n /** Fires on Enter with the current scope and query. */\r\n onSearch = output<{ scope: string; text: string }>();\r\n\r\n readonly panelOpen = signal(false);\r\n readonly text = signal(\"\");\r\n\r\n private readonly inputRef = viewChild<ElementRef<HTMLInputElement>>(\"searchInput\");\r\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n constructor() {\r\n effect(() => {\r\n const value = this.searchText();\r\n untracked(() => this.text.set(value));\r\n });\r\n }\r\n\r\n private label(value: string): string {\r\n return this.scopes().find((item) => item.value === value)?.label ?? value;\r\n }\r\n\r\n placeholder(): string {\r\n return `Search by ${this.label(this.scope())}`;\r\n }\r\n\r\n openPanel(): void {\r\n this.panelOpen.set(true);\r\n }\r\n\r\n closePanel(): void {\r\n this.panelOpen.set(false);\r\n }\r\n\r\n togglePanel(): void {\r\n this.panelOpen.update((open) => !open);\r\n this.inputRef()?.nativeElement.focus();\r\n }\r\n\r\n pick(scope: string): void {\r\n this.scopeChange.emit(scope);\r\n this.panelOpen.set(false);\r\n this.inputRef()?.nativeElement.focus();\r\n }\r\n\r\n onInput(event: Event): void {\r\n this.text.set((event.target as HTMLInputElement).value);\r\n }\r\n\r\n clear(): void {\r\n this.text.set(\"\");\r\n this.inputRef()?.nativeElement.focus();\r\n }\r\n\r\n submit(): void {\r\n this.onSearch.emit({ scope: this.scope(), text: this.text() });\r\n }\r\n\r\n @HostListener(\"document:click\", [\"$event\"])\r\n onDocumentClick(event: MouseEvent): void {\r\n if (!this.host.nativeElement.contains(event.target as Node)) {\r\n this.panelOpen.set(false);\r\n }\r\n }\r\n}\r\n","<div class=\"search-option\">\r\n <div class=\"search-option__bar\" [class.is-focused]=\"panelOpen()\">\r\n <svg class=\"search-option__glass\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\r\n <circle cx=\"7\" cy=\"7\" r=\"4.6\"></circle>\r\n <line x1=\"10.4\" y1=\"10.4\" x2=\"14\" y2=\"14\"></line>\r\n </svg>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"search-option__toggle\"\r\n aria-label=\"Change search scope\"\r\n [attr.aria-expanded]=\"panelOpen()\"\r\n [attr.data-cy]=\"data_cy() + '-toggle'\"\r\n (click)=\"togglePanel()\"\r\n >\r\n <svg viewBox=\"0 0 10 6\" aria-hidden=\"true\">\r\n <path d=\"M1 1l4 4 4-4\"></path>\r\n </svg>\r\n </button>\r\n\r\n <input\r\n #searchInput\r\n type=\"text\"\r\n class=\"search-option__input\"\r\n [value]=\"text()\"\r\n [attr.placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"placeholder()\"\r\n [attr.data-cy]=\"data_cy() + '-input'\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"openPanel()\"\r\n (keydown.enter)=\"submit()\"\r\n (keydown.escape)=\"closePanel()\"\r\n />\r\n\r\n @if (text()) {\r\n <button\r\n type=\"button\"\r\n class=\"search-option__clear\"\r\n aria-label=\"Clear search\"\r\n (click)=\"clear()\"\r\n >\r\n ✕\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (panelOpen()) {\r\n <div class=\"search-option__panel\" role=\"menu\">\r\n @for (item of scopes(); track item.value) {\r\n <button\r\n type=\"button\"\r\n role=\"menuitemradio\"\r\n class=\"search-option__row\"\r\n [class.is-active]=\"item.value === scope()\"\r\n [attr.aria-checked]=\"item.value === scope()\"\r\n [attr.data-cy]=\"data_cy() + '-scope-' + item.value\"\r\n (click)=\"pick(item.value)\"\r\n >\r\n <span class=\"search-option__name\">{{ item.label }}</span>\r\n <span class=\"search-option__desc\">{{ item.description }}</span>\r\n @if (item.value === scope()) {\r\n <span class=\"search-option__tick\" aria-hidden=\"true\">✓</span>\r\n }\r\n </button>\r\n }\r\n\r\n @if (extendedFiltersTemplate()) {\r\n <div class=\"search-option__divider\"></div>\r\n <div class=\"search-option__slot\">\r\n <ng-container *ngTemplateOutlet=\"extendedFiltersTemplate()\" />\r\n </div>\r\n }\r\n </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AAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,yBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAa,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,iBAAA,CAAA;GAkDhF,MAAA;GAAa,MAAA,CAAA,kBAAkB,CAAC,QAAQ,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import { TemplateRef } from "@angular/core";
|
|
3
|
-
/** One entry of the scope picker. Consumers may pass their own list. */
|
|
4
|
-
export interface SearchScopeOption {
|
|
5
|
-
value: string;
|
|
6
|
-
label: string;
|
|
7
|
-
/** Optional hint rendered on the right of the row. */
|
|
8
|
-
description?: string;
|
|
9
|
-
}
|
|
10
|
-
/** Default scopes: search the item by name or by code. */
|
|
11
|
-
export declare enum SearchScope {
|
|
12
|
-
Name = "name",
|
|
13
|
-
Code = "code"
|
|
14
|
-
}
|
|
15
|
-
export declare const DEFAULT_SEARCH_SCOPES: SearchScopeOption[];
|
|
16
|
-
export declare class SearchOptionComponent {
|
|
17
|
-
/** Scopes offered in the picker. Defaults to name and code. */
|
|
18
|
-
scopes: import("@angular/core").InputSignal<SearchScopeOption[]>;
|
|
19
|
-
/** Currently selected scope value. */
|
|
20
|
-
scope: import("@angular/core").InputSignal<string>;
|
|
21
|
-
/** Seeds the query text; later host changes overwrite what the user typed. */
|
|
22
|
-
searchText: import("@angular/core").InputSignal<string>;
|
|
23
|
-
/** Optional advanced-filter fields rendered under the scope list. */
|
|
24
|
-
extendedFiltersTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null>;
|
|
25
|
-
/** for e2e testing */
|
|
26
|
-
data_cy: import("@angular/core").InputSignal<string>;
|
|
27
|
-
/** Fires when the user picks a different scope. */
|
|
28
|
-
scopeChange: import("@angular/core").OutputEmitterRef<string>;
|
|
29
|
-
/** Fires on Enter with the current scope and query. */
|
|
30
|
-
onSearch: import("@angular/core").OutputEmitterRef<{
|
|
31
|
-
scope: string;
|
|
32
|
-
text: string;
|
|
33
|
-
}>;
|
|
34
|
-
readonly panelOpen: import("@angular/core").WritableSignal<boolean>;
|
|
35
|
-
readonly text: import("@angular/core").WritableSignal<string>;
|
|
36
|
-
private readonly inputRef;
|
|
37
|
-
private readonly host;
|
|
38
|
-
constructor();
|
|
39
|
-
private label;
|
|
40
|
-
placeholder(): string;
|
|
41
|
-
openPanel(): void;
|
|
42
|
-
closePanel(): void;
|
|
43
|
-
togglePanel(): void;
|
|
44
|
-
pick(scope: string): void;
|
|
45
|
-
onInput(event: Event): void;
|
|
46
|
-
clear(): void;
|
|
47
|
-
submit(): void;
|
|
48
|
-
onDocumentClick(event: MouseEvent): void;
|
|
49
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SearchOptionComponent, never>;
|
|
50
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SearchOptionComponent, "POS-search-option", never, {
|
|
51
|
-
"scopes": {
|
|
52
|
-
"alias": "scopes";
|
|
53
|
-
"required": false;
|
|
54
|
-
"isSignal": true;
|
|
55
|
-
};
|
|
56
|
-
"scope": {
|
|
57
|
-
"alias": "scope";
|
|
58
|
-
"required": false;
|
|
59
|
-
"isSignal": true;
|
|
60
|
-
};
|
|
61
|
-
"searchText": {
|
|
62
|
-
"alias": "searchText";
|
|
63
|
-
"required": false;
|
|
64
|
-
"isSignal": true;
|
|
65
|
-
};
|
|
66
|
-
"extendedFiltersTemplate": {
|
|
67
|
-
"alias": "extendedFiltersTemplate";
|
|
68
|
-
"required": false;
|
|
69
|
-
"isSignal": true;
|
|
70
|
-
};
|
|
71
|
-
"data_cy": {
|
|
72
|
-
"alias": "data_cy";
|
|
73
|
-
"required": false;
|
|
74
|
-
"isSignal": true;
|
|
75
|
-
};
|
|
76
|
-
}, {
|
|
77
|
-
"scopeChange": "scopeChange";
|
|
78
|
-
"onSearch": "onSearch";
|
|
79
|
-
}, never, never, true, never>;
|
|
80
|
-
}
|