@teipublisher/pb-components 1.44.0 → 1.44.1
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/.github/workflows/main.yml +3 -2
- package/CHANGELOG.md +7 -0
- package/dist/demo/pb-facsimile.html +1 -1
- package/dist/demo/redirect.html +4 -3
- package/dist/pb-components-bundle.js +20 -20
- package/dist/pb-elements.json +18 -2
- package/gh-pages.js +5 -1
- package/package.json +1 -1
- package/pb-elements.json +18 -2
- package/src/pb-facsimile.js +10 -2
- package/src/pb-split-list.js +38 -0
- package/src/pb-timeline.js +31 -1
package/dist/pb-elements.json
CHANGED
|
@@ -4015,6 +4015,11 @@
|
|
|
4015
4015
|
"path": "./src/pb-facsimile.js",
|
|
4016
4016
|
"description": "View zoomable images using a IIIF server.",
|
|
4017
4017
|
"attributes": [
|
|
4018
|
+
{
|
|
4019
|
+
"name": "show-sequence-control",
|
|
4020
|
+
"description": "If true then the 'previous\" and 'next' button is displayed switch between images.",
|
|
4021
|
+
"type": "boolean"
|
|
4022
|
+
},
|
|
4018
4023
|
{
|
|
4019
4024
|
"name": "facsimiles",
|
|
4020
4025
|
"description": "Array of facsimiles",
|
|
@@ -4139,6 +4144,12 @@
|
|
|
4139
4144
|
}
|
|
4140
4145
|
],
|
|
4141
4146
|
"properties": [
|
|
4147
|
+
{
|
|
4148
|
+
"name": "showSequenceMode",
|
|
4149
|
+
"attribute": "show-sequence-control",
|
|
4150
|
+
"description": "If true then the 'previous\" and 'next' button is displayed switch between images.",
|
|
4151
|
+
"type": "boolean"
|
|
4152
|
+
},
|
|
4142
4153
|
{
|
|
4143
4154
|
"name": "facsimiles",
|
|
4144
4155
|
"attribute": "facsimiles",
|
|
@@ -4172,6 +4183,11 @@
|
|
|
4172
4183
|
"type": "number",
|
|
4173
4184
|
"default": "0"
|
|
4174
4185
|
},
|
|
4186
|
+
{
|
|
4187
|
+
"name": "sequenceMode",
|
|
4188
|
+
"type": "boolean",
|
|
4189
|
+
"default": "false"
|
|
4190
|
+
},
|
|
4175
4191
|
{
|
|
4176
4192
|
"name": "showHomeControl",
|
|
4177
4193
|
"attribute": "show-home-control",
|
|
@@ -9899,7 +9915,7 @@
|
|
|
9899
9915
|
{
|
|
9900
9916
|
"name": "pb-split-list",
|
|
9901
9917
|
"path": "./src/pb-split-list.js",
|
|
9902
|
-
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n be an object with two properties: `category` - containing the name of the category\n and `count` - containing a count of items available under this category.\n+ `items`: an array with the items to be shown for the currently selected\n category. Those may contain HTML markup.",
|
|
9918
|
+
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n be an object with two properties: `category` - containing the name of the category\n and `count` - containing a count of items available under this category.\n+ `items`: an array with the items to be shown for the currently selected\n category. Those may contain HTML markup.\n\nSample JSON object for pb-split-list\n```javascript\n{\n \"items\": [\n \"<span><a href='Abegg-Arter Carl?category=A&view=correspondents&search='>Abegg-Arter, Carl</a><span class='dates'> (1836–1912)</span></span>\",\n \"<span><a href='Abegg Hans Heinrich?category=A&view=correspondents&search='>Abegg, Hans Heinrich</a><span class='dates'> (1805–1874)</span></span>\",\n \"<span><a href='Abegg Jakob?category=A&view=correspondents&search='>Abegg, Jakob</a><span class='dates'> (1801–1871)</span></span>\",\n \"<span><a href='Abys Raget?category=A&view=correspondents&search='>Abys, Raget</a><span class='dates'> (1790–1861)</span></span>\",\n \"<span><a href='Aebli Johann Peter?category=A&view=correspondents&search='>Aebli, Johann Peter</a><span class='dates'> (1804–1879)</span></span>\",\n \"<span><a href='Aepli Arnold Otto?category=A&view=correspondents&search='>Aepli, Arnold Otto</a><span class='dates'> (1816–1897)</span></span>\",\n ...\n ],\n \"categories\": [\n {\n \"category\": \"A\",\n \"count\": 22\n },\n {\n \"category\": \"B\",\n \"count\": 77\n },\n {\n \"category\": \"C\",\n \"count\": 19\n },\n ...\n ]\n}\n```\n\nSample Usage \n```xml\n<pb-split-list url=\"api/people\" subforms=\"#options\" selected=\"A\" emit=\"transcription\" subscribe=\"transcription\"></pb-split-list>\n```\nSee https://www.briefedition.alfred-escher.ch/kontexte/personen/?category=A&search=&view=correspondents for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/index.html](https://github.com/stazh/briefedition-escher/blob/master/templates/index.html#L223) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1098) - `/api/people` endpoint delivering required JSON object",
|
|
9903
9919
|
"attributes": [
|
|
9904
9920
|
{
|
|
9905
9921
|
"name": "url",
|
|
@@ -10446,7 +10462,7 @@
|
|
|
10446
10462
|
{
|
|
10447
10463
|
"name": "pb-timeline",
|
|
10448
10464
|
"path": "./src/pb-timeline.js",
|
|
10449
|
-
"description": "A timeline component to display time series data in a bar chart like view.\n\nTime series data can be displayed in one of 6 different scales:\n\n- by decade (10Y)\n- by 5 years (5Y)\n- by years (Y)\n- by month (M)\n- by week (W)\n- by day (D)\n\nThe endpoint is expected to return a JSON object. Each property should either be a date or the special\nmarker `?`, which indicates undated resources.\nThe value associated with each entry\nshould either correspond to a count of resources or an object with properties `count` and `info`. \n`info` should be an array, containing HTML to be shown in a list within the tooltips.",
|
|
10465
|
+
"description": "A timeline component to display time series data in a bar chart like view.\n\nTime series data can be displayed in one of 6 different scales:\n\n- by decade (10Y)\n- by 5 years (5Y)\n- by years (Y)\n- by month (M)\n- by week (W)\n- by day (D)\n\nThe endpoint is expected to return a JSON object. Each property should either be a date or the special\nmarker `?`, which indicates undated resources.\nThe value associated with each entry\nshould either correspond to a count of resources or an object with properties `count` and `info`. \n`info` should be an array, containing HTML to be shown in a list within the tooltips.\nExpected JSON: \n```javascript\n{\n \"1852-01-14\": {\n \"count\": 1,\n \"info\": [\n \"<a href='/briefe/B0977' part='tooltip-link'>Alfred Escher an Joseph Wolfgang von Deschwanden, Belvoir (Enge, Zürich), Mittwoch, 14. Januar 1852</a>\"\n ]\n },\n\"1874-01-25\": {\n \"count\": 3,\n \"info\": [\n \"<a href='/briefe/B8140' part='tooltip-link'>Alfred Escher an Gustav von Mevissen, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8139' part='tooltip-link'>Alfred Escher an Theodor Weishaupt, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8143' part='tooltip-link'>Alfred Escher an Ludwig August Parcus, Zürich, Sonntag, 25. Januar 1874</a>\"\n ]\n }\n}\n```\nSample Usage:\n```xml\n<pb-timeline url=\"api/timeline\" scopes=\"['D', 'M', 'Y', '5Y', '10Y']\"\n resettable=\"\"\n subscribe=\"docs\" emit=\"timeline\">\n <span slot=\"label\">Angezeigter Zeitraum: </span>\n</pb-timeline>\n```\nSee https://www.briefedition.alfred-escher.ch/briefe/ for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/people.html](https://github.com/stazh/briefedition-escher/blob/master/templates/people.html#L91) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1080) - `/api/timeline` endpoint delivering required JSON object",
|
|
10450
10466
|
"attributes": [
|
|
10451
10467
|
{
|
|
10452
10468
|
"name": "start-date",
|
package/gh-pages.js
CHANGED
|
@@ -18,6 +18,10 @@ copy('lib', path.join(dir, 'lib'));
|
|
|
18
18
|
copy('css', path.join(dir, 'css'));
|
|
19
19
|
copy('src', path.join(dir, 'src'));
|
|
20
20
|
|
|
21
|
+
const redirect = fs.readFileSync(path.join('demo', 'redirect.js'), 'utf-8');
|
|
22
|
+
fs.writeFileSync(path.join('docs', 'redirect.js'), redirect, { encoding: 'utf-8' });
|
|
23
|
+
|
|
21
24
|
const index = fs.readFileSync(path.join('demo', 'redirect.html'), 'utf-8');
|
|
22
25
|
const updated = index.toString().replace(/\$version/, versionTag);
|
|
23
|
-
fs.writeFileSync(path.join('docs', 'index.html'), updated, { encoding: 'utf-8' });
|
|
26
|
+
fs.writeFileSync(path.join('docs', 'index.html'), updated, { encoding: 'utf-8' });
|
|
27
|
+
fs.writeFileSync(path.join('docs', 'api.html'), updated, { encoding: 'utf-8' });
|
package/package.json
CHANGED
package/pb-elements.json
CHANGED
|
@@ -4015,6 +4015,11 @@
|
|
|
4015
4015
|
"path": "./src/pb-facsimile.js",
|
|
4016
4016
|
"description": "View zoomable images using a IIIF server.",
|
|
4017
4017
|
"attributes": [
|
|
4018
|
+
{
|
|
4019
|
+
"name": "show-sequence-control",
|
|
4020
|
+
"description": "If true then the 'previous\" and 'next' button is displayed switch between images.",
|
|
4021
|
+
"type": "boolean"
|
|
4022
|
+
},
|
|
4018
4023
|
{
|
|
4019
4024
|
"name": "facsimiles",
|
|
4020
4025
|
"description": "Array of facsimiles",
|
|
@@ -4139,6 +4144,12 @@
|
|
|
4139
4144
|
}
|
|
4140
4145
|
],
|
|
4141
4146
|
"properties": [
|
|
4147
|
+
{
|
|
4148
|
+
"name": "showSequenceMode",
|
|
4149
|
+
"attribute": "show-sequence-control",
|
|
4150
|
+
"description": "If true then the 'previous\" and 'next' button is displayed switch between images.",
|
|
4151
|
+
"type": "boolean"
|
|
4152
|
+
},
|
|
4142
4153
|
{
|
|
4143
4154
|
"name": "facsimiles",
|
|
4144
4155
|
"attribute": "facsimiles",
|
|
@@ -4172,6 +4183,11 @@
|
|
|
4172
4183
|
"type": "number",
|
|
4173
4184
|
"default": "0"
|
|
4174
4185
|
},
|
|
4186
|
+
{
|
|
4187
|
+
"name": "sequenceMode",
|
|
4188
|
+
"type": "boolean",
|
|
4189
|
+
"default": "false"
|
|
4190
|
+
},
|
|
4175
4191
|
{
|
|
4176
4192
|
"name": "showHomeControl",
|
|
4177
4193
|
"attribute": "show-home-control",
|
|
@@ -9899,7 +9915,7 @@
|
|
|
9899
9915
|
{
|
|
9900
9916
|
"name": "pb-split-list",
|
|
9901
9917
|
"path": "./src/pb-split-list.js",
|
|
9902
|
-
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n be an object with two properties: `category` - containing the name of the category\n and `count` - containing a count of items available under this category.\n+ `items`: an array with the items to be shown for the currently selected\n category. Those may contain HTML markup.",
|
|
9918
|
+
"description": "Implements a list which is split into different categories \n(e.g. letters of the alphabet, countries ...).\nOnly one category is shown at a time unless the server reports\nno categories (e.g. if the number of items to display goes below\na defined threshold).\n\nThe server-side API endpoint should return a JSON object with two\nproperties:\n\n+ `categories`: an array of category descriptions: each item should \n be an object with two properties: `category` - containing the name of the category\n and `count` - containing a count of items available under this category.\n+ `items`: an array with the items to be shown for the currently selected\n category. Those may contain HTML markup.\n\nSample JSON object for pb-split-list\n```javascript\n{\n \"items\": [\n \"<span><a href='Abegg-Arter Carl?category=A&view=correspondents&search='>Abegg-Arter, Carl</a><span class='dates'> (1836–1912)</span></span>\",\n \"<span><a href='Abegg Hans Heinrich?category=A&view=correspondents&search='>Abegg, Hans Heinrich</a><span class='dates'> (1805–1874)</span></span>\",\n \"<span><a href='Abegg Jakob?category=A&view=correspondents&search='>Abegg, Jakob</a><span class='dates'> (1801–1871)</span></span>\",\n \"<span><a href='Abys Raget?category=A&view=correspondents&search='>Abys, Raget</a><span class='dates'> (1790–1861)</span></span>\",\n \"<span><a href='Aebli Johann Peter?category=A&view=correspondents&search='>Aebli, Johann Peter</a><span class='dates'> (1804–1879)</span></span>\",\n \"<span><a href='Aepli Arnold Otto?category=A&view=correspondents&search='>Aepli, Arnold Otto</a><span class='dates'> (1816–1897)</span></span>\",\n ...\n ],\n \"categories\": [\n {\n \"category\": \"A\",\n \"count\": 22\n },\n {\n \"category\": \"B\",\n \"count\": 77\n },\n {\n \"category\": \"C\",\n \"count\": 19\n },\n ...\n ]\n}\n```\n\nSample Usage \n```xml\n<pb-split-list url=\"api/people\" subforms=\"#options\" selected=\"A\" emit=\"transcription\" subscribe=\"transcription\"></pb-split-list>\n```\nSee https://www.briefedition.alfred-escher.ch/kontexte/personen/?category=A&search=&view=correspondents for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/index.html](https://github.com/stazh/briefedition-escher/blob/master/templates/index.html#L223) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1098) - `/api/people` endpoint delivering required JSON object",
|
|
9903
9919
|
"attributes": [
|
|
9904
9920
|
{
|
|
9905
9921
|
"name": "url",
|
|
@@ -10446,7 +10462,7 @@
|
|
|
10446
10462
|
{
|
|
10447
10463
|
"name": "pb-timeline",
|
|
10448
10464
|
"path": "./src/pb-timeline.js",
|
|
10449
|
-
"description": "A timeline component to display time series data in a bar chart like view.\n\nTime series data can be displayed in one of 6 different scales:\n\n- by decade (10Y)\n- by 5 years (5Y)\n- by years (Y)\n- by month (M)\n- by week (W)\n- by day (D)\n\nThe endpoint is expected to return a JSON object. Each property should either be a date or the special\nmarker `?`, which indicates undated resources.\nThe value associated with each entry\nshould either correspond to a count of resources or an object with properties `count` and `info`. \n`info` should be an array, containing HTML to be shown in a list within the tooltips.",
|
|
10465
|
+
"description": "A timeline component to display time series data in a bar chart like view.\n\nTime series data can be displayed in one of 6 different scales:\n\n- by decade (10Y)\n- by 5 years (5Y)\n- by years (Y)\n- by month (M)\n- by week (W)\n- by day (D)\n\nThe endpoint is expected to return a JSON object. Each property should either be a date or the special\nmarker `?`, which indicates undated resources.\nThe value associated with each entry\nshould either correspond to a count of resources or an object with properties `count` and `info`. \n`info` should be an array, containing HTML to be shown in a list within the tooltips.\nExpected JSON: \n```javascript\n{\n \"1852-01-14\": {\n \"count\": 1,\n \"info\": [\n \"<a href='/briefe/B0977' part='tooltip-link'>Alfred Escher an Joseph Wolfgang von Deschwanden, Belvoir (Enge, Zürich), Mittwoch, 14. Januar 1852</a>\"\n ]\n },\n\"1874-01-25\": {\n \"count\": 3,\n \"info\": [\n \"<a href='/briefe/B8140' part='tooltip-link'>Alfred Escher an Gustav von Mevissen, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8139' part='tooltip-link'>Alfred Escher an Theodor Weishaupt, Zürich, Sonntag, 25. Januar 1874</a>\",\n \"<a href='/briefe/B8143' part='tooltip-link'>Alfred Escher an Ludwig August Parcus, Zürich, Sonntag, 25. Januar 1874</a>\"\n ]\n }\n}\n```\nSample Usage:\n```xml\n<pb-timeline url=\"api/timeline\" scopes=\"['D', 'M', 'Y', '5Y', '10Y']\"\n resettable=\"\"\n subscribe=\"docs\" emit=\"timeline\">\n <span slot=\"label\">Angezeigter Zeitraum: </span>\n</pb-timeline>\n```\nSee https://www.briefedition.alfred-escher.ch/briefe/ for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are: \n- [templates/people.html](https://github.com/stazh/briefedition-escher/blob/master/templates/people.html#L91) - usage of pb-timeline\n- [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1080) - `/api/timeline` endpoint delivering required JSON object",
|
|
10450
10466
|
"attributes": [
|
|
10451
10467
|
{
|
|
10452
10468
|
"name": "start-date",
|
package/src/pb-facsimile.js
CHANGED
|
@@ -42,6 +42,13 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
42
42
|
type: Boolean,
|
|
43
43
|
attribute: 'show-navigator'
|
|
44
44
|
},
|
|
45
|
+
|
|
46
|
+
/** If true then the 'previous" and 'next' button is displayed switch between images. */
|
|
47
|
+
showSequenceMode: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
attribute: 'show-sequence-control'
|
|
50
|
+
},
|
|
51
|
+
|
|
45
52
|
/** If true then the 'Go home' button is displayed to go back to the original zoom and pan. */
|
|
46
53
|
showHomeControl: {
|
|
47
54
|
type: Boolean,
|
|
@@ -143,6 +150,7 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
143
150
|
this.type = 'iiif';
|
|
144
151
|
this.visibilityRatio = 1;
|
|
145
152
|
this.defaultZoomLevel = 0;
|
|
153
|
+
this.sequenceMode = false;
|
|
146
154
|
this.showHomeControl = false;
|
|
147
155
|
this.showNavigator = false;
|
|
148
156
|
this.showNavigationControl = false;
|
|
@@ -217,9 +225,9 @@ export class PbFacsimile extends pbMixin(LitElement) {
|
|
|
217
225
|
const options = {
|
|
218
226
|
element: this.shadowRoot.getElementById('viewer'),
|
|
219
227
|
prefixUrl,
|
|
220
|
-
preserveViewport: true,
|
|
221
|
-
sequenceMode: true,
|
|
228
|
+
preserveViewport: true,
|
|
222
229
|
showZoomControl: true,
|
|
230
|
+
sequenceMode: this.showSequenceMode,
|
|
223
231
|
showHomeControl: this.showHomeControl,
|
|
224
232
|
showFullPageControl: this.showFullPageControl,
|
|
225
233
|
showNavigator: this.showNavigator,
|
package/src/pb-split-list.js
CHANGED
|
@@ -19,6 +19,44 @@ import { themableMixin } from "./theming.js";
|
|
|
19
19
|
* + `items`: an array with the items to be shown for the currently selected
|
|
20
20
|
* category. Those may contain HTML markup.
|
|
21
21
|
*
|
|
22
|
+
* Sample JSON object for pb-split-list
|
|
23
|
+
* ```javascript
|
|
24
|
+
* {
|
|
25
|
+
* "items": [
|
|
26
|
+
* "<span><a href='Abegg-Arter Carl?category=A&view=correspondents&search='>Abegg-Arter, Carl</a><span class='dates'> (1836–1912)</span></span>",
|
|
27
|
+
* "<span><a href='Abegg Hans Heinrich?category=A&view=correspondents&search='>Abegg, Hans Heinrich</a><span class='dates'> (1805–1874)</span></span>",
|
|
28
|
+
* "<span><a href='Abegg Jakob?category=A&view=correspondents&search='>Abegg, Jakob</a><span class='dates'> (1801–1871)</span></span>",
|
|
29
|
+
* "<span><a href='Abys Raget?category=A&view=correspondents&search='>Abys, Raget</a><span class='dates'> (1790–1861)</span></span>",
|
|
30
|
+
* "<span><a href='Aebli Johann Peter?category=A&view=correspondents&search='>Aebli, Johann Peter</a><span class='dates'> (1804–1879)</span></span>",
|
|
31
|
+
* "<span><a href='Aepli Arnold Otto?category=A&view=correspondents&search='>Aepli, Arnold Otto</a><span class='dates'> (1816–1897)</span></span>",
|
|
32
|
+
* ...
|
|
33
|
+
* ],
|
|
34
|
+
* "categories": [
|
|
35
|
+
* {
|
|
36
|
+
* "category": "A",
|
|
37
|
+
* "count": 22
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* "category": "B",
|
|
41
|
+
* "count": 77
|
|
42
|
+
* },
|
|
43
|
+
* {
|
|
44
|
+
* "category": "C",
|
|
45
|
+
* "count": 19
|
|
46
|
+
* },
|
|
47
|
+
* ...
|
|
48
|
+
* ]
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Sample Usage
|
|
53
|
+
* ```xml
|
|
54
|
+
* <pb-split-list url="api/people" subforms="#options" selected="A" emit="transcription" subscribe="transcription"></pb-split-list>
|
|
55
|
+
* ```
|
|
56
|
+
* See https://www.briefedition.alfred-escher.ch/kontexte/personen/?category=A&search=&view=correspondents for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are:
|
|
57
|
+
* - [templates/index.html](https://github.com/stazh/briefedition-escher/blob/master/templates/index.html#L223) - usage of pb-timeline
|
|
58
|
+
* - [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1098) - `/api/people` endpoint delivering required JSON object
|
|
59
|
+
*
|
|
22
60
|
* @cssprop --pb-categorized-list-columns - the number of columns to display (default: 2)
|
|
23
61
|
* @fires pb-submit - when received, submit a request to the server and refresh
|
|
24
62
|
* @fires pb-start-update - sent before the element sends the request to the server
|
package/src/pb-timeline.js
CHANGED
|
@@ -25,7 +25,37 @@ import { translate } from "./pb-i18n.js";
|
|
|
25
25
|
* The value associated with each entry
|
|
26
26
|
* should either correspond to a count of resources or an object with properties `count` and `info`.
|
|
27
27
|
* `info` should be an array, containing HTML to be shown in a list within the tooltips.
|
|
28
|
-
*
|
|
28
|
+
* Expected JSON:
|
|
29
|
+
* ```javascript
|
|
30
|
+
* {
|
|
31
|
+
* "1852-01-14": {
|
|
32
|
+
* "count": 1,
|
|
33
|
+
* "info": [
|
|
34
|
+
* "<a href='/briefe/B0977' part='tooltip-link'>Alfred Escher an Joseph Wolfgang von Deschwanden, Belvoir (Enge, Zürich), Mittwoch, 14. Januar 1852</a>"
|
|
35
|
+
* ]
|
|
36
|
+
* },
|
|
37
|
+
* "1874-01-25": {
|
|
38
|
+
* "count": 3,
|
|
39
|
+
* "info": [
|
|
40
|
+
* "<a href='/briefe/B8140' part='tooltip-link'>Alfred Escher an Gustav von Mevissen, Zürich, Sonntag, 25. Januar 1874</a>",
|
|
41
|
+
* "<a href='/briefe/B8139' part='tooltip-link'>Alfred Escher an Theodor Weishaupt, Zürich, Sonntag, 25. Januar 1874</a>",
|
|
42
|
+
* "<a href='/briefe/B8143' part='tooltip-link'>Alfred Escher an Ludwig August Parcus, Zürich, Sonntag, 25. Januar 1874</a>"
|
|
43
|
+
* ]
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
* Sample Usage:
|
|
48
|
+
* ```xml
|
|
49
|
+
* <pb-timeline url="api/timeline" scopes="['D', 'M', 'Y', '5Y', '10Y']"
|
|
50
|
+
* resettable=""
|
|
51
|
+
* subscribe="docs" emit="timeline">
|
|
52
|
+
* <span slot="label">Angezeigter Zeitraum: </span>
|
|
53
|
+
* </pb-timeline>
|
|
54
|
+
* ```
|
|
55
|
+
* See https://www.briefedition.alfred-escher.ch/briefe/ for a running sample. The source code of the webpage is here: https://github.com/stazh/briefedition-escher. Relevant files are:
|
|
56
|
+
* - [templates/people.html](https://github.com/stazh/briefedition-escher/blob/master/templates/people.html#L91) - usage of pb-timeline
|
|
57
|
+
* - [modules/custom-api.json](https://github.com/stazh/briefedition-escher/blob/master/modules/custom-api.json#L1080) - `/api/timeline` endpoint delivering required JSON object
|
|
58
|
+
*
|
|
29
59
|
* @slot label - Inserted before the label showing the currently displayed time range
|
|
30
60
|
*
|
|
31
61
|
* @fires pb-timeline-date-changed - Triggered when user clicks on a single entry
|