@teipublisher/pb-components 1.36.2 → 1.36.3

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.
@@ -9576,6 +9576,11 @@
9576
9576
  "type": "array",
9577
9577
  "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9578
9578
  },
9579
+ {
9580
+ "name": "max-interval",
9581
+ "type": "number",
9582
+ "default": "60"
9583
+ },
9579
9584
  {
9580
9585
  "name": "url",
9581
9586
  "description": "Endpoint to load timeline data from. Expects response to be an\nobject with key value pairs for (date, hits).\n\nWill be reloaded whenever 'start-date' or 'end-date' attributes change.",
@@ -9672,6 +9677,12 @@
9672
9677
  "type": "array",
9673
9678
  "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9674
9679
  },
9680
+ {
9681
+ "name": "maxInterval",
9682
+ "attribute": "max-interval",
9683
+ "type": "number",
9684
+ "default": "60"
9685
+ },
9675
9686
  {
9676
9687
  "name": "url",
9677
9688
  "attribute": "url",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teipublisher/pb-components",
3
- "version": "1.36.2",
3
+ "version": "1.36.3",
4
4
  "description": "Collection of webcomponents underlying TEI Publisher",
5
5
  "repository": "https://github.com/eeditiones/tei-publisher-components.git",
6
6
  "main": "index.html",
package/pb-elements.json CHANGED
@@ -9576,6 +9576,11 @@
9576
9576
  "type": "array",
9577
9577
  "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9578
9578
  },
9579
+ {
9580
+ "name": "max-interval",
9581
+ "type": "number",
9582
+ "default": "60"
9583
+ },
9579
9584
  {
9580
9585
  "name": "url",
9581
9586
  "description": "Endpoint to load timeline data from. Expects response to be an\nobject with key value pairs for (date, hits).\n\nWill be reloaded whenever 'start-date' or 'end-date' attributes change.",
@@ -9672,6 +9677,12 @@
9672
9677
  "type": "array",
9673
9678
  "default": "[\"D\",\"W\",\"M\",\"Y\",\"5Y\",\"10Y\"]"
9674
9679
  },
9680
+ {
9681
+ "name": "maxInterval",
9682
+ "attribute": "max-interval",
9683
+ "type": "number",
9684
+ "default": "60"
9685
+ },
9675
9686
  {
9676
9687
  "name": "url",
9677
9688
  "attribute": "url",
@@ -282,6 +282,10 @@ export class PbTimeline extends pbMixin(LitElement) {
282
282
  scopes: {
283
283
  type: Array
284
284
  },
285
+ maxInterval: {
286
+ type: Number,
287
+ attribute: 'max-interval'
288
+ },
285
289
  /**
286
290
  * Endpoint to load timeline data from. Expects response to be an
287
291
  * object with key value pairs for (date, hits).
@@ -315,6 +319,7 @@ export class PbTimeline extends pbMixin(LitElement) {
315
319
  this.endDate = '';
316
320
  this.scope = '';
317
321
  this.scopes = ["D", "W", "M", "Y", "5Y", "10Y"];
322
+ this.maxInterval = 60;
318
323
  this.url = '';
319
324
  this.auto = false;
320
325
  this.resettable = false;
@@ -516,10 +521,18 @@ export class PbTimeline extends pbMixin(LitElement) {
516
521
  endDateStr: this.searchResult.getEndOfRangeDate(this.dataObj.scope, endDateStr),
517
522
  scope: this.dataObj.scope,
518
523
  categories,
519
- count: itemCount
524
+ count: itemCount,
525
+ label: this.label
520
526
  });
521
527
  } else {
522
- this.emitTo('pb-timeline-date-changed', { startDateStr, endDateStr: null, scope: this.dataObj.scope, categories, count: itemCount });
528
+ this.emitTo('pb-timeline-date-changed', {
529
+ startDateStr,
530
+ endDateStr: null,
531
+ scope: this.dataObj.scope,
532
+ categories,
533
+ count: itemCount,
534
+ label: this.label
535
+ });
523
536
  }
524
537
  } else {
525
538
  this.emitTo('pb-timeline-daterange-changed', {
@@ -527,7 +540,8 @@ export class PbTimeline extends pbMixin(LitElement) {
527
540
  endDateStr,
528
541
  categories,
529
542
  scope: this.dataObj.scope,
530
- count: itemCount
543
+ count: itemCount,
544
+ label: this.label
531
545
  });
532
546
  }
533
547
  }
@@ -732,15 +746,12 @@ export class PbTimeline extends pbMixin(LitElement) {
732
746
  } else {
733
747
  newJsonData = data;
734
748
  }
735
- this.searchResult = new SearchResultService(newJsonData, 60, this.scopes);
749
+ this.searchResult = new SearchResultService(newJsonData, this.maxInterval, this.scopes);
736
750
  this.setData(this.searchResult.export(this.scope));
737
- this.dispatchEvent(new CustomEvent('pb-timeline-loaded', {
738
- detail: {
739
- value: true
740
- },
741
- composed: true,
742
- bubbles: true
743
- }));
751
+ this.emitTo('pb-timeline-loaded', {
752
+ value: true,
753
+ label: this.label
754
+ });
744
755
  }
745
756
 
746
757
  }