ng-prime-tools 1.1.9 → 1.1.10

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.
@@ -9785,6 +9785,12 @@ var PTNewsTickerType;
9785
9785
  PTNewsTickerType["DANGER"] = "DANGER";
9786
9786
  PTNewsTickerType["FLASH"] = "FLASH";
9787
9787
  })(PTNewsTickerType || (PTNewsTickerType = {}));
9788
+ var PTNewsTickerTrend;
9789
+ (function (PTNewsTickerTrend) {
9790
+ PTNewsTickerTrend["UP"] = "UP";
9791
+ PTNewsTickerTrend["DOWN"] = "DOWN";
9792
+ PTNewsTickerTrend["STABLE"] = "STABLE";
9793
+ })(PTNewsTickerTrend || (PTNewsTickerTrend = {}));
9788
9794
 
9789
9795
  class PTNewsTickerComponent {
9790
9796
  constructor(changeDetectorRef, zone) {
@@ -9806,6 +9812,9 @@ class PTNewsTickerComponent {
9806
9812
  this.showResetSpeedControl = true;
9807
9813
  this.showRemoveButton = true;
9808
9814
  this.showSpeedValue = false;
9815
+ this.showNewBadge = true;
9816
+ this.newBadgeText = 'Nouveau';
9817
+ this.newBadgeDuration = 20_000;
9809
9818
  this.height = '3.25rem';
9810
9819
  this.gap = '2rem';
9811
9820
  this.itemGap = '0.5rem';
@@ -9825,17 +9834,21 @@ class PTNewsTickerComponent {
9825
9834
  this.playStateChange = new EventEmitter();
9826
9835
  this.speedChange = new EventEmitter();
9827
9836
  this.PTNewsTickerType = PTNewsTickerType;
9837
+ this.PTNewsTickerTrend = PTNewsTickerTrend;
9828
9838
  this.internalNews = [];
9829
9839
  this.animationDurationSeconds = 20;
9830
9840
  this.playing = true;
9831
9841
  this.hovered = false;
9842
+ this.pendingNews = null;
9832
9843
  this.animationFrameId = null;
9833
9844
  this.viewInitialized = false;
9845
+ this.newBadgeTimeouts = new Map();
9846
+ this.expiredNewBadgeIds = new Set();
9834
9847
  }
9835
9848
  ngOnChanges(changes) {
9836
9849
  if (changes['news']) {
9837
- this.internalNews = this.normalizeNews(changes['news'].currentValue ?? []);
9838
- this.scheduleAnimationRefresh();
9850
+ const normalizedNews = this.normalizeNews(changes['news'].currentValue ?? []);
9851
+ this.queueOrApplyNews(normalizedNews);
9839
9852
  }
9840
9853
  if (changes['speed'] || changes['minSpeed'] || changes['maxSpeed']) {
9841
9854
  this.speed = this.normalizeSpeed(this.speed);
@@ -9844,6 +9857,9 @@ class PTNewsTickerComponent {
9844
9857
  if (changes['defaultSpeed']) {
9845
9858
  this.defaultSpeed = this.normalizeSpeed(this.defaultSpeed);
9846
9859
  }
9860
+ if (changes['newBadgeDuration']) {
9861
+ this.newBadgeDuration = this.normalizeNewBadgeDuration(this.newBadgeDuration);
9862
+ }
9847
9863
  if (changes['autoplay']) {
9848
9864
  this.playing = this.autoplay;
9849
9865
  this.emitPlayStateChange();
@@ -9869,52 +9885,57 @@ class PTNewsTickerComponent {
9869
9885
  cancelAnimationFrame(this.animationFrameId);
9870
9886
  this.animationFrameId = null;
9871
9887
  }
9888
+ this.clearNewBadgeTimeouts();
9889
+ this.pendingNews = null;
9872
9890
  }
9873
9891
  addNews(item) {
9874
9892
  if (!item || item.id === null || item.id === undefined) {
9875
9893
  return;
9876
9894
  }
9877
9895
  const normalizedItem = this.normalizeItem(item);
9878
- const existingIndex = this.internalNews.findIndex((newsItem) => newsItem.id === normalizedItem.id);
9879
- if (existingIndex >= 0) {
9880
- this.internalNews = this.internalNews.map((newsItem, index) => index === existingIndex ? normalizedItem : newsItem);
9881
- }
9882
- else {
9883
- this.internalNews = [...this.internalNews, normalizedItem];
9884
- }
9896
+ const sourceNews = this.pendingNews ?? this.internalNews;
9897
+ const existingIndex = sourceNews.findIndex((newsItem) => String(newsItem.id) === String(normalizedItem.id));
9898
+ const updatedNews = existingIndex >= 0
9899
+ ? sourceNews.map((newsItem, index) => index === existingIndex ? normalizedItem : newsItem)
9900
+ : [...sourceNews, normalizedItem];
9901
+ this.queueOrApplyNews(updatedNews);
9885
9902
  this.emitNewsChange({
9886
- news: [...this.internalNews],
9903
+ news: [...updatedNews],
9887
9904
  addedItem: normalizedItem,
9888
9905
  });
9889
- this.scheduleAnimationRefresh();
9890
9906
  }
9891
9907
  removeNews(itemOrId) {
9892
9908
  const id = typeof itemOrId === 'object' ? itemOrId?.id : itemOrId;
9893
- const removedItem = this.internalNews.find((item) => item.id === id);
9909
+ const sourceNews = this.pendingNews ?? this.internalNews;
9910
+ const removedItem = sourceNews.find((item) => String(item.id) === String(id));
9894
9911
  if (!removedItem) {
9895
9912
  return;
9896
9913
  }
9897
- this.internalNews = this.internalNews.filter((item) => item.id !== id);
9914
+ const updatedNews = sourceNews.filter((item) => String(item.id) !== String(id));
9915
+ this.clearNewBadgeTimeout(removedItem);
9916
+ this.queueOrApplyNews(updatedNews);
9898
9917
  this.newsRemove.emit(removedItem);
9899
9918
  this.emitNewsChange({
9900
- news: [...this.internalNews],
9919
+ news: [...updatedNews],
9901
9920
  removedItem,
9902
9921
  });
9903
- this.scheduleAnimationRefresh();
9904
9922
  }
9905
9923
  clearNews() {
9924
+ this.pendingNews = null;
9906
9925
  this.internalNews = [];
9926
+ this.clearNewBadgeTimeouts();
9927
+ this.expiredNewBadgeIds.clear();
9907
9928
  this.emitNewsChange({
9908
9929
  news: [],
9909
9930
  });
9910
9931
  this.scheduleAnimationRefresh();
9911
9932
  }
9912
9933
  replaceNews(news) {
9913
- this.internalNews = this.normalizeNews(news);
9934
+ const normalizedNews = this.normalizeNews(news);
9935
+ this.queueOrApplyNews(normalizedNews);
9914
9936
  this.emitNewsChange({
9915
- news: [...this.internalNews],
9937
+ news: [...normalizedNews],
9916
9938
  });
9917
- this.scheduleAnimationRefresh();
9918
9939
  }
9919
9940
  play() {
9920
9941
  if (this.playing) {
@@ -9929,10 +9950,14 @@ class PTNewsTickerComponent {
9929
9950
  }
9930
9951
  this.playing = false;
9931
9952
  this.emitPlayStateChange();
9953
+ this.applyPendingNewsImmediately();
9932
9954
  }
9933
9955
  togglePlayState() {
9934
9956
  this.playing = !this.playing;
9935
9957
  this.emitPlayStateChange();
9958
+ if (!this.playing) {
9959
+ this.applyPendingNewsImmediately();
9960
+ }
9936
9961
  }
9937
9962
  increaseSpeed() {
9938
9963
  this.setSpeed(this.speed + this.normalizeSpeedStep());
@@ -9966,6 +9991,12 @@ class PTNewsTickerComponent {
9966
9991
  onMouseLeave() {
9967
9992
  this.hovered = false;
9968
9993
  }
9994
+ onTrackAnimationIteration() {
9995
+ this.applyPendingNews();
9996
+ }
9997
+ onTrackAnimationEnd() {
9998
+ this.applyPendingNews();
9999
+ }
9969
10000
  onItemClick(event, item) {
9970
10001
  if (item.disabled) {
9971
10002
  event.preventDefault();
@@ -9985,9 +10016,6 @@ class PTNewsTickerComponent {
9985
10016
  }
9986
10017
  window.location.assign(link);
9987
10018
  }
9988
- hasItemLink(item) {
9989
- return !!item.link?.trim() && !item.disabled;
9990
- }
9991
10019
  onRemoveClick(event, item) {
9992
10020
  event.preventDefault();
9993
10021
  event.stopPropagation();
@@ -9996,12 +10024,60 @@ class PTNewsTickerComponent {
9996
10024
  }
9997
10025
  this.removeNews(item);
9998
10026
  }
10027
+ hasItemLink(item) {
10028
+ return !!item.link?.trim() && !item.disabled;
10029
+ }
10030
+ hasSegments(item) {
10031
+ return Array.isArray(item.segments) && item.segments.length > 0;
10032
+ }
9999
10033
  isItemRemovable(item) {
10000
10034
  return this.showRemoveButton && item.removable !== false && !item.disabled;
10001
10035
  }
10002
10036
  isItemFlash(item) {
10003
10037
  return item.flash === true || item.type === PTNewsTickerType.FLASH;
10004
10038
  }
10039
+ shouldShowNewBadge(item) {
10040
+ if (!this.showNewBadge || item.showNewBadge === false) {
10041
+ return false;
10042
+ }
10043
+ const key = this.getItemKey(item);
10044
+ if (this.expiredNewBadgeIds.has(key)) {
10045
+ return false;
10046
+ }
10047
+ const createdAt = this.resolveCreatedAt(item);
10048
+ if (createdAt === null) {
10049
+ return true;
10050
+ }
10051
+ return Date.now() - createdAt < this.getNewBadgeDuration(item);
10052
+ }
10053
+ getNewBadgeText(item) {
10054
+ return item.newBadgeText?.trim() || this.newBadgeText;
10055
+ }
10056
+ getSegmentSeparator(item) {
10057
+ return item.segmentSeparator?.trim() || '•';
10058
+ }
10059
+ getSegmentIcon(segment) {
10060
+ if (segment.icon?.trim()) {
10061
+ return segment.icon.trim();
10062
+ }
10063
+ switch (segment.trend) {
10064
+ case PTNewsTickerTrend.UP:
10065
+ return 'pi pi-arrow-up';
10066
+ case PTNewsTickerTrend.DOWN:
10067
+ return 'pi pi-arrow-down';
10068
+ case PTNewsTickerTrend.STABLE:
10069
+ return 'pi pi-minus';
10070
+ default:
10071
+ return null;
10072
+ }
10073
+ }
10074
+ getSegmentStyle(segment) {
10075
+ const trendColor = this.getSegmentTrendColor(segment.trend);
10076
+ return {
10077
+ '--pt-news-segment-color': segment.textColor ?? trendColor ?? 'currentColor',
10078
+ '--pt-news-segment-icon-color': segment.iconColor ?? segment.textColor ?? trendColor ?? 'currentColor',
10079
+ };
10080
+ }
10005
10081
  getTrackStyle() {
10006
10082
  return {
10007
10083
  '--pt-news-ticker-duration': `${this.animationDurationSeconds}s`,
@@ -10059,12 +10135,150 @@ class PTNewsTickerComponent {
10059
10135
  }
10060
10136
  return classes;
10061
10137
  }
10138
+ getDuplicateItemClasses(item) {
10139
+ const classes = {
10140
+ 'pt-news-ticker__item--flash': this.isItemFlash(item),
10141
+ 'pt-news-ticker__item--disabled': item.disabled === true,
10142
+ };
10143
+ if (item.styleClass?.trim()) {
10144
+ classes[item.styleClass.trim()] = true;
10145
+ }
10146
+ return classes;
10147
+ }
10062
10148
  getTrackById(index, item) {
10063
10149
  return `${item.id}-${index}`;
10064
10150
  }
10065
10151
  getDuplicateTrackById(index, item) {
10066
10152
  return `duplicate-${item.id}-${index}`;
10067
10153
  }
10154
+ getItemRole(item) {
10155
+ return this.hasItemLink(item) ? 'link' : null;
10156
+ }
10157
+ getItemTabIndex(item) {
10158
+ if (item.disabled) {
10159
+ return -1;
10160
+ }
10161
+ return this.hasItemLink(item) || this.newsClick.observers.length > 0
10162
+ ? 0
10163
+ : -1;
10164
+ }
10165
+ queueOrApplyNews(news) {
10166
+ this.scheduleNewBadges(news);
10167
+ if (this.shouldApplyNewsImmediately()) {
10168
+ this.pendingNews = null;
10169
+ this.internalNews = [...news];
10170
+ this.scheduleAnimationRefresh();
10171
+ return;
10172
+ }
10173
+ this.pendingNews = [...news];
10174
+ }
10175
+ shouldApplyNewsImmediately() {
10176
+ return (!this.viewInitialized ||
10177
+ !this.loop ||
10178
+ !this.playing ||
10179
+ this.internalNews.length === 0 ||
10180
+ this.prefersReducedMotion());
10181
+ }
10182
+ applyPendingNews() {
10183
+ if (!this.pendingNews) {
10184
+ return;
10185
+ }
10186
+ const nextNews = [...this.pendingNews];
10187
+ this.pendingNews = null;
10188
+ this.internalNews = nextNews;
10189
+ this.changeDetectorRef.detectChanges();
10190
+ this.scheduleAnimationRefresh();
10191
+ }
10192
+ applyPendingNewsImmediately() {
10193
+ if (!this.pendingNews) {
10194
+ return;
10195
+ }
10196
+ this.applyPendingNews();
10197
+ }
10198
+ scheduleNewBadges(news) {
10199
+ news.forEach((item) => {
10200
+ this.scheduleNewBadgeExpiration(item);
10201
+ });
10202
+ }
10203
+ scheduleNewBadgeExpiration(item) {
10204
+ if (!this.showNewBadge || item.showNewBadge === false) {
10205
+ return;
10206
+ }
10207
+ const key = this.getItemKey(item);
10208
+ if (this.expiredNewBadgeIds.has(key) || this.newBadgeTimeouts.has(key)) {
10209
+ return;
10210
+ }
10211
+ const duration = this.getNewBadgeDuration(item);
10212
+ const createdAt = this.resolveCreatedAt(item) ?? Date.now();
10213
+ const elapsed = Date.now() - createdAt;
10214
+ const remainingDuration = Math.max(0, duration - elapsed);
10215
+ if (remainingDuration === 0) {
10216
+ this.expiredNewBadgeIds.add(key);
10217
+ return;
10218
+ }
10219
+ const timeout = setTimeout(() => {
10220
+ this.newBadgeTimeouts.delete(key);
10221
+ this.expiredNewBadgeIds.add(key);
10222
+ this.changeDetectorRef.markForCheck();
10223
+ }, remainingDuration);
10224
+ this.newBadgeTimeouts.set(key, timeout);
10225
+ }
10226
+ getNewBadgeDuration(item) {
10227
+ return this.normalizeNewBadgeDuration(item.newBadgeDuration ?? this.newBadgeDuration);
10228
+ }
10229
+ normalizeNewBadgeDuration(duration) {
10230
+ const numericDuration = Number(duration);
10231
+ if (!Number.isFinite(numericDuration) || numericDuration <= 0) {
10232
+ return 20_000;
10233
+ }
10234
+ return Math.max(1_000, numericDuration);
10235
+ }
10236
+ clearNewBadgeTimeout(item) {
10237
+ const key = this.getItemKey(item);
10238
+ const timeout = this.newBadgeTimeouts.get(key);
10239
+ if (timeout) {
10240
+ clearTimeout(timeout);
10241
+ this.newBadgeTimeouts.delete(key);
10242
+ }
10243
+ this.expiredNewBadgeIds.delete(key);
10244
+ }
10245
+ clearNewBadgeTimeouts() {
10246
+ this.newBadgeTimeouts.forEach((timeout) => {
10247
+ clearTimeout(timeout);
10248
+ });
10249
+ this.newBadgeTimeouts.clear();
10250
+ }
10251
+ resolveCreatedAt(item) {
10252
+ if (!item.createdAt) {
10253
+ return null;
10254
+ }
10255
+ if (item.createdAt instanceof Date) {
10256
+ const timestamp = item.createdAt.getTime();
10257
+ return Number.isFinite(timestamp) ? timestamp : null;
10258
+ }
10259
+ const timestamp = new Date(item.createdAt).getTime();
10260
+ return Number.isFinite(timestamp) ? timestamp : null;
10261
+ }
10262
+ getItemKey(item) {
10263
+ return String(item.id);
10264
+ }
10265
+ getSegmentTrendColor(trend) {
10266
+ switch (trend) {
10267
+ case PTNewsTickerTrend.UP:
10268
+ return '#15803d';
10269
+ case PTNewsTickerTrend.DOWN:
10270
+ return '#dc2626';
10271
+ case PTNewsTickerTrend.STABLE:
10272
+ return '#64748b';
10273
+ default:
10274
+ return null;
10275
+ }
10276
+ }
10277
+ prefersReducedMotion() {
10278
+ return (typeof window !== 'undefined' &&
10279
+ typeof window.matchMedia === 'function' &&
10280
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches);
10281
+ }
10068
10282
  getAnimationPlayState() {
10069
10283
  if (!this.playing) {
10070
10284
  return 'paused';
@@ -10134,8 +10348,29 @@ class PTNewsTickerComponent {
10134
10348
  removable: item.removable ?? true,
10135
10349
  disabled: item.disabled ?? false,
10136
10350
  flashDuration: Math.max(100, Number(item.flashDuration ?? 700)),
10351
+ showNewBadge: item.showNewBadge ?? true,
10352
+ newBadgeDuration: this.normalizeNewBadgeDuration(item.newBadgeDuration ?? this.newBadgeDuration),
10353
+ newBadgeText: item.newBadgeText?.trim() || this.newBadgeText,
10354
+ segmentSeparator: item.segmentSeparator?.trim() || '•',
10355
+ segments: this.normalizeSegments(item.segments),
10137
10356
  };
10138
10357
  }
10358
+ normalizeSegments(segments) {
10359
+ if (!Array.isArray(segments)) {
10360
+ return [];
10361
+ }
10362
+ return segments
10363
+ .filter((segment) => !!segment &&
10364
+ (String(segment.label ?? '').trim().length > 0 ||
10365
+ String(segment.value ?? '').trim().length > 0))
10366
+ .map((segment) => ({
10367
+ ...segment,
10368
+ label: String(segment.label ?? '').trim(),
10369
+ value: segment.value === undefined || segment.value === null
10370
+ ? undefined
10371
+ : String(segment.value).trim(),
10372
+ }));
10373
+ }
10139
10374
  normalizeSpeed(speed) {
10140
10375
  const numericSpeed = Number(speed);
10141
10376
  const safeMinSpeed = Math.max(1, Number(this.minSpeed) || 1);
@@ -10201,23 +10436,12 @@ class PTNewsTickerComponent {
10201
10436
  };
10202
10437
  }
10203
10438
  }
10204
- getItemRole(item) {
10205
- return this.hasItemLink(item) ? 'link' : null;
10206
- }
10207
- getItemTabIndex(item) {
10208
- if (item.disabled) {
10209
- return -1;
10210
- }
10211
- return this.hasItemLink(item) || this.newsClick.observers.length > 0
10212
- ? 0
10213
- : -1;
10214
- }
10215
10439
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNewsTickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
10216
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNewsTickerComponent, isStandalone: false, selector: "pt-news-ticker", inputs: { news: "news", speed: "speed", defaultSpeed: "defaultSpeed", speedStep: "speedStep", minSpeed: "minSpeed", maxSpeed: "maxSpeed", direction: "direction", autoplay: "autoplay", loop: "loop", pauseOnHover: "pauseOnHover", showControls: "showControls", showPlayPauseControl: "showPlayPauseControl", showSpeedControls: "showSpeedControls", showResetSpeedControl: "showResetSpeedControl", showRemoveButton: "showRemoveButton", showSpeedValue: "showSpeedValue", height: "height", gap: "gap", itemGap: "itemGap", containerBackgroundColor: "containerBackgroundColor", containerTextColor: "containerTextColor", borderColor: "borderColor", borderWidth: "borderWidth", borderRadius: "borderRadius", controlsBackgroundColor: "controlsBackgroundColor", controlsBorderColor: "controlsBorderColor", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", ariaLabel: "ariaLabel" }, outputs: { newsClick: "newsClick", newsRemove: "newsRemove", newsChange: "newsChange", playStateChange: "playStateChange", speedChange: "speedChange" }, viewQueries: [{ propertyName: "tickerViewport", first: true, predicate: ["tickerViewport"], descendants: true }, { propertyName: "tickerGroup", first: true, predicate: ["tickerGroup"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <span class=\"pt-news-ticker__item-text\">\n {{ item.text }}\n </span>\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <span class=\"pt-news-ticker__item-text\">\n {{ item.text }}\n </span>\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:36rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable{cursor:pointer}.pt-news-ticker__item--clickable:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:22rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:17rem}.pt-news-ticker__item-text{font-size:.78rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i13.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] }); }
10440
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNewsTickerComponent, isStandalone: false, selector: "pt-news-ticker", inputs: { news: "news", speed: "speed", defaultSpeed: "defaultSpeed", speedStep: "speedStep", minSpeed: "minSpeed", maxSpeed: "maxSpeed", direction: "direction", autoplay: "autoplay", loop: "loop", pauseOnHover: "pauseOnHover", showControls: "showControls", showPlayPauseControl: "showPlayPauseControl", showSpeedControls: "showSpeedControls", showResetSpeedControl: "showResetSpeedControl", showRemoveButton: "showRemoveButton", showSpeedValue: "showSpeedValue", showNewBadge: "showNewBadge", newBadgeText: "newBadgeText", newBadgeDuration: "newBadgeDuration", height: "height", gap: "gap", itemGap: "itemGap", containerBackgroundColor: "containerBackgroundColor", containerTextColor: "containerTextColor", borderColor: "borderColor", borderWidth: "borderWidth", borderRadius: "borderRadius", controlsBackgroundColor: "controlsBackgroundColor", controlsBorderColor: "controlsBorderColor", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", ariaLabel: "ariaLabel" }, outputs: { newsClick: "newsClick", newsRemove: "newsRemove", newsChange: "newsChange", playStateChange: "playStateChange", speedChange: "speedChange" }, viewQueries: [{ propertyName: "tickerViewport", first: true, predicate: ["tickerViewport"], descendants: true }, { propertyName: "tickerGroup", first: true, predicate: ["tickerGroup"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration()\"\n (animationend)=\"onTrackAnimationEnd()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i13.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] }); }
10217
10441
  }
10218
10442
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNewsTickerComponent, decorators: [{
10219
10443
  type: Component,
10220
- args: [{ selector: 'pt-news-ticker', standalone: false, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <span class=\"pt-news-ticker__item-text\">\n {{ item.text }}\n </span>\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <span class=\"pt-news-ticker__item-text\">\n {{ item.text }}\n </span>\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:36rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable{cursor:pointer}.pt-news-ticker__item--clickable:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:22rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:17rem}.pt-news-ticker__item-text{font-size:.78rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"] }]
10444
+ args: [{ selector: 'pt-news-ticker', standalone: false, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration()\"\n (animationend)=\"onTrackAnimationEnd()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"] }]
10221
10445
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { news: [{
10222
10446
  type: Input
10223
10447
  }], speed: [{
@@ -10250,6 +10474,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
10250
10474
  type: Input
10251
10475
  }], showSpeedValue: [{
10252
10476
  type: Input
10477
+ }], showNewBadge: [{
10478
+ type: Input
10479
+ }], newBadgeText: [{
10480
+ type: Input
10481
+ }], newBadgeDuration: [{
10482
+ type: Input
10253
10483
  }], height: [{
10254
10484
  type: Input
10255
10485
  }], gap: [{
@@ -10716,5 +10946,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
10716
10946
  * Generated bundle index. Do not edit.
10717
10947
  */
10718
10948
 
10719
- export { AlignEnum, BadgeType, BadgeTypeStyles, ButtonColorEnum, DateUtilityService, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgPrimeToolsModule, PTAccordionComponent, PTAccordionModule, PTAccordionPanelDirective, PTAdvancedPrimeTableComponent, PTAdvancedPrimeTableModule, PTBreadCrumbComponent, PTBreadCrumbModule, PTButtonComponent, PTButtonModule, PTCardComponent, PTCardModule, PTChangePasswordPageComponent, PTChangePasswordPageModule, PTChartComparisonComponent, PTChartComparisonModule, PTChartComponent, PTChartModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTConfirmDialogComponent, PTConfirmDialogModule, PTDateInputComponent, PTDateInputModule, PTDialogComponent, PTDialogModule, PTDropdownComponent, PTDropdownModule, PTFooterComponent, PTFooterModule, PTFormBuilderComponent, PTFormBuilderModule, PTGroupComponent, PTGroupModule, PTLineChartComponent, PTLineChartModule, PTLoginPageComponent, PTLoginPageModule, PTMenuComponent, PTMenuFancyComponent, PTMenuFancyModule, PTMenuModule, PTMetricCardComponent, PTMetricCardGroupComponent, PTMetricCardGroupModule, PTMetricCardModule, PTMetricPanelComponent, PTMetricPanelModule, PTMultiSelectComponent, PTMultiSelectModule, PTNavbarMenuComponent, PTNavbarMenuModule, PTNewsTickerComponent, PTNewsTickerDirection, PTNewsTickerModule, PTNewsTickerType, PTNumberInputComponent, PTNumberInputModule, PTOtpInputComponent, PTOtpInputModule, PTOtpPageComponent, PTOtpPageModule, PTPageSkeletonComponent, PTPageSkeletonModule, PTPasswordInputComponent, PTPasswordInputModule, PTSideBarMenuComponent, PTSideBarMenuModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, PTToastNotifierComponent, PTToastNotifierModule, SearchCriteriaTypeEnum, SeverityEnum, TableTypeEnum };
10949
+ export { AlignEnum, BadgeType, BadgeTypeStyles, ButtonColorEnum, DateUtilityService, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgPrimeToolsModule, PTAccordionComponent, PTAccordionModule, PTAccordionPanelDirective, PTAdvancedPrimeTableComponent, PTAdvancedPrimeTableModule, PTBreadCrumbComponent, PTBreadCrumbModule, PTButtonComponent, PTButtonModule, PTCardComponent, PTCardModule, PTChangePasswordPageComponent, PTChangePasswordPageModule, PTChartComparisonComponent, PTChartComparisonModule, PTChartComponent, PTChartModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTConfirmDialogComponent, PTConfirmDialogModule, PTDateInputComponent, PTDateInputModule, PTDialogComponent, PTDialogModule, PTDropdownComponent, PTDropdownModule, PTFooterComponent, PTFooterModule, PTFormBuilderComponent, PTFormBuilderModule, PTGroupComponent, PTGroupModule, PTLineChartComponent, PTLineChartModule, PTLoginPageComponent, PTLoginPageModule, PTMenuComponent, PTMenuFancyComponent, PTMenuFancyModule, PTMenuModule, PTMetricCardComponent, PTMetricCardGroupComponent, PTMetricCardGroupModule, PTMetricCardModule, PTMetricPanelComponent, PTMetricPanelModule, PTMultiSelectComponent, PTMultiSelectModule, PTNavbarMenuComponent, PTNavbarMenuModule, PTNewsTickerComponent, PTNewsTickerDirection, PTNewsTickerModule, PTNewsTickerTrend, PTNewsTickerType, PTNumberInputComponent, PTNumberInputModule, PTOtpInputComponent, PTOtpInputModule, PTOtpPageComponent, PTOtpPageModule, PTPageSkeletonComponent, PTPageSkeletonModule, PTPasswordInputComponent, PTPasswordInputModule, PTSideBarMenuComponent, PTSideBarMenuModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, PTToastNotifierComponent, PTToastNotifierModule, SearchCriteriaTypeEnum, SeverityEnum, TableTypeEnum };
10720
10950
  //# sourceMappingURL=ng-prime-tools.mjs.map