@teipublisher/pb-components 2.26.0-next-3.12 → 2.26.0-next-3.14
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 -3
- package/.github/workflows/node.js.yml +3 -3
- package/.github/workflows/release.js.yml +3 -3
- package/CHANGELOG.md +43 -0
- package/Dockerfile +78 -70
- package/css/components.css +5 -5
- package/dist/demo/pb-drawer2.html +1 -1
- package/dist/demo/pb-grid.html +19 -6
- package/dist/demo/pb-leaflet-map.html +1 -1
- package/dist/demo/pb-progress.html +2 -2
- package/dist/demo/pb-repeat.html +1 -3
- package/dist/demo/pb-view3.html +1 -1
- package/dist/{iron-form-277f9d42.js → iron-form-78b43d38.js} +1 -1
- package/dist/{paper-checkbox-4f410b1f.js → paper-checkbox-d16f23be.js} +44 -44
- package/dist/{paper-icon-button-0fb125c4.js → paper-icon-button-2cd9e0b4.js} +3 -3
- package/dist/{paper-listbox-c2468542.js → paper-listbox-2ad5c882.js} +7 -7
- package/dist/pb-code-editor.js +25 -20
- package/dist/pb-component-docs.js +58 -54
- package/dist/pb-components-bundle.js +2057 -2351
- package/dist/pb-edit-app.js +167 -107
- package/dist/pb-elements.json +45 -45
- package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
- package/dist/pb-leaflet-map.js +23 -23
- package/dist/pb-mei.js +56 -41
- package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
- package/dist/pb-odd-editor.js +923 -756
- package/dist/pb-tify.js +2 -2
- package/dist/{vaadin-element-mixin-49ab4037.js → vaadin-element-mixin-c200b196.js} +179 -164
- package/gh-pages.js +5 -3
- package/i18n/common/pl.json +2 -2
- package/lib/openseadragon.min.js +1 -1
- package/package.json +2 -2
- package/pb-elements.json +45 -45
- package/src/assets/components.css +5 -5
- package/src/authority/airtable.js +20 -21
- package/src/authority/anton.js +129 -129
- package/src/authority/custom.js +23 -21
- package/src/authority/geonames.js +38 -32
- package/src/authority/gnd.js +47 -42
- package/src/authority/kbga.js +137 -134
- package/src/authority/metagrid.js +44 -46
- package/src/authority/reconciliation.js +66 -67
- package/src/authority/registry.js +4 -4
- package/src/docs/pb-component-docs.js +2 -2
- package/src/docs/pb-component-view.js +5 -5
- package/src/docs/pb-components-list.js +2 -2
- package/src/docs/pb-demo-snippet.js +2 -2
- package/src/dts-client.js +299 -297
- package/src/dts-select-endpoint.js +90 -82
- package/src/parse-date-service.js +184 -135
- package/src/pb-ajax.js +150 -146
- package/src/pb-authority-lookup.js +183 -146
- package/src/pb-autocomplete.js +292 -280
- package/src/pb-blacklab-highlight.js +264 -259
- package/src/pb-blacklab-results.js +236 -221
- package/src/pb-browse-docs.js +540 -475
- package/src/pb-browse.js +68 -65
- package/src/pb-clipboard.js +79 -76
- package/src/pb-code-editor.js +110 -102
- package/src/pb-code-highlight.js +209 -204
- package/src/pb-codepen.js +79 -72
- package/src/pb-collapse.js +212 -207
- package/src/pb-combo-box.js +190 -190
- package/src/pb-components-bundle.js +1 -1
- package/src/pb-custom-form.js +151 -149
- package/src/pb-dialog.js +94 -85
- package/src/pb-document.js +89 -90
- package/src/pb-download.js +210 -198
- package/src/pb-drawer.js +145 -148
- package/src/pb-edit-app.js +301 -229
- package/src/pb-edit-xml.js +98 -96
- package/src/pb-events.js +114 -107
- package/src/pb-facs-link.js +104 -102
- package/src/pb-facsimile.js +419 -414
- package/src/pb-formula.js +151 -153
- package/src/pb-geolocation.js +129 -131
- package/src/pb-grid-action.js +53 -56
- package/src/pb-grid.js +231 -228
- package/src/pb-highlight.js +140 -140
- package/src/pb-hotkeys.js +40 -42
- package/src/pb-i18n.js +101 -104
- package/src/pb-image-strip.js +84 -78
- package/src/pb-lang.js +132 -128
- package/src/pb-leaflet-map.js +488 -485
- package/src/pb-link.js +126 -124
- package/src/pb-load.js +431 -426
- package/src/pb-login.js +291 -248
- package/src/pb-manage-odds.js +364 -318
- package/src/pb-map-icon.js +89 -89
- package/src/pb-map-layer.js +85 -85
- package/src/pb-markdown.js +90 -99
- package/src/pb-media-query.js +74 -72
- package/src/pb-mei.js +306 -295
- package/src/pb-message.js +144 -144
- package/src/pb-mixin.js +269 -264
- package/src/pb-navigation.js +80 -82
- package/src/pb-observable.js +38 -38
- package/src/pb-odd-editor.js +1053 -955
- package/src/pb-odd-elementspec-editor.js +348 -297
- package/src/pb-odd-model-editor.js +1061 -901
- package/src/pb-odd-parameter-editor.js +200 -178
- package/src/pb-odd-rendition-editor.js +136 -124
- package/src/pb-page.js +431 -421
- package/src/pb-paginate.js +202 -190
- package/src/pb-panel.js +198 -182
- package/src/pb-popover-themes.js +7 -5
- package/src/pb-popover.js +296 -287
- package/src/pb-print-preview.js +127 -127
- package/src/pb-progress.js +51 -51
- package/src/pb-repeat.js +105 -104
- package/src/pb-restricted.js +84 -77
- package/src/pb-search.js +252 -241
- package/src/pb-select-feature.js +127 -120
- package/src/pb-select-odd.js +132 -124
- package/src/pb-select-template.js +89 -78
- package/src/pb-select.js +251 -227
- package/src/pb-split-list.js +179 -174
- package/src/pb-svg.js +80 -79
- package/src/pb-table-column.js +54 -54
- package/src/pb-table-grid.js +221 -203
- package/src/pb-tabs.js +61 -63
- package/src/pb-tify.js +154 -154
- package/src/pb-timeline.js +271 -229
- package/src/pb-toggle-feature.js +182 -175
- package/src/pb-upload.js +184 -174
- package/src/pb-version.js +30 -30
- package/src/pb-view-annotate.js +132 -98
- package/src/pb-view.js +1290 -1270
- package/src/pb-zoom.js +75 -59
- package/src/polymer-hack.js +1 -1
- package/src/search-result-service.js +256 -223
- package/src/seed-element.js +13 -20
- package/src/settings.js +4 -4
- package/src/theming.js +96 -96
- package/src/urls.js +289 -289
- package/src/utils.js +53 -51
package/pb-elements.json
CHANGED
|
@@ -792,11 +792,11 @@
|
|
|
792
792
|
},
|
|
793
793
|
{
|
|
794
794
|
"name": "pb-authority-new-entity",
|
|
795
|
-
"description": "
|
|
795
|
+
"description": "Fired when user clicks the add new entity button"
|
|
796
796
|
},
|
|
797
797
|
{
|
|
798
798
|
"name": "pb-authority-lookup",
|
|
799
|
-
"description": "When received, starts a lookup using the passed in query string and
|
|
799
|
+
"description": "When received, starts a lookup using the passed in query string and\nauthority type"
|
|
800
800
|
}
|
|
801
801
|
]
|
|
802
802
|
},
|
|
@@ -1007,7 +1007,7 @@
|
|
|
1007
1007
|
{
|
|
1008
1008
|
"name": "pb-blacklab-highlight",
|
|
1009
1009
|
"path": "./src/pb-blacklab-highlight.js",
|
|
1010
|
-
"description": "This component queries the blacklab API of TEI-Publisher for a list of text matches\nin a given document. The query is given as a CQL querystring (see pattern property).\n\n**Note**: There's no demo for this component yet as it would need a blacklab instance
|
|
1010
|
+
"description": "This component queries the blacklab API of TEI-Publisher for a list of text matches\nin a given document. The query is given as a CQL querystring (see pattern property).\n\n**Note**: There's no demo for this component yet as it would need a blacklab instance.\n\nThe component displays 2 navigation buttons to jump to previous / next match and\na display of the current index and total number of matches.\n\nWhen navigating and the requested match is not on the current page a pb-refresh is dispatched\nto load the correct page. Once the page has dispatch pb-update this component will refresh and trigger\nloading of matches from the API.\n\nHighlighting is accomplished by marking the matched text with the following CSS classes:\n- kwic-start - for the start of the match\n- kwic-end - for the end of the match (might be on the same node as 'kwic-start'\n- kwic-current - to set a different highlight color for the current match\n\nWhen navigating the browser URL will be updated to allow bookmarks for a certain match.\n\nNote: this component does no caching of query results yet. In case of heavier use the data can be taken\nfrom localStorage ('pb-kwic-results') as usually pb-kwic-results has been visited by the user before. For\nstability reasons this was not done in this version.\n\n\nWhen data are present highlights are processed.",
|
|
1011
1011
|
"attributes": [
|
|
1012
1012
|
{
|
|
1013
1013
|
"name": "current",
|
|
@@ -1475,7 +1475,7 @@
|
|
|
1475
1475
|
},
|
|
1476
1476
|
{
|
|
1477
1477
|
"name": "use-language",
|
|
1478
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
1478
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
1479
1479
|
"type": "boolean"
|
|
1480
1480
|
},
|
|
1481
1481
|
{
|
|
@@ -1678,7 +1678,7 @@
|
|
|
1678
1678
|
{
|
|
1679
1679
|
"name": "useLanguage",
|
|
1680
1680
|
"attribute": "use-language",
|
|
1681
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
1681
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
1682
1682
|
"type": "boolean"
|
|
1683
1683
|
},
|
|
1684
1684
|
{
|
|
@@ -1873,7 +1873,7 @@
|
|
|
1873
1873
|
{
|
|
1874
1874
|
"name": "pb-browse",
|
|
1875
1875
|
"path": "./src/pb-browse.js",
|
|
1876
|
-
"description": "Extends PbLoad to support browsing collections.\n\nThis is a reduced version of `pb-browse-docs`, which differs\nfrom a plain `pb-load` only in that it scans the returned\ncollection listing for links to subcollections and keeps\ntrack of the current collection
|
|
1876
|
+
"description": "Extends PbLoad to support browsing collections.\n\nThis is a reduced version of `pb-browse-docs`, which differs\nfrom a plain `pb-load` only in that it scans the returned\ncollection listing for links to subcollections and keeps\ntrack of the current collection.\n\nAll UI elements present in `pb-browse-docs` have been removed.",
|
|
1877
1877
|
"attributes": [
|
|
1878
1878
|
{
|
|
1879
1879
|
"name": "collection",
|
|
@@ -1918,7 +1918,7 @@
|
|
|
1918
1918
|
},
|
|
1919
1919
|
{
|
|
1920
1920
|
"name": "use-language",
|
|
1921
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
1921
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
1922
1922
|
"type": "boolean"
|
|
1923
1923
|
},
|
|
1924
1924
|
{
|
|
@@ -2052,7 +2052,7 @@
|
|
|
2052
2052
|
{
|
|
2053
2053
|
"name": "useLanguage",
|
|
2054
2054
|
"attribute": "use-language",
|
|
2055
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
2055
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
2056
2056
|
"type": "boolean"
|
|
2057
2057
|
},
|
|
2058
2058
|
{
|
|
@@ -2183,7 +2183,7 @@
|
|
|
2183
2183
|
{
|
|
2184
2184
|
"name": "pb-clipboard",
|
|
2185
2185
|
"path": "./src/pb-clipboard.js",
|
|
2186
|
-
"description": "A component with a button which copies the contained content to the clipboard.\
|
|
2186
|
+
"description": "A component with a button which copies the contained content to the clipboard.\nUse for the typical 'quote this content as' hints on a webpage.",
|
|
2187
2187
|
"attributes": [
|
|
2188
2188
|
{
|
|
2189
2189
|
"name": "label",
|
|
@@ -2432,16 +2432,16 @@
|
|
|
2432
2432
|
}
|
|
2433
2433
|
],
|
|
2434
2434
|
"deprecated": true,
|
|
2435
|
-
"deprecatedMessage": "directly use `jinn-codemirror`/`jinn-xml-editor`/`jinn-epidoc-editor` instead, which are
|
|
2435
|
+
"deprecatedMessage": "directly use `jinn-codemirror`/`jinn-xml-editor`/`jinn-epidoc-editor` instead, which are\nincluded in the `pb-code-editor` bundle."
|
|
2436
2436
|
},
|
|
2437
2437
|
{
|
|
2438
2438
|
"name": "pb-code-highlight",
|
|
2439
2439
|
"path": "./src/pb-code-highlight.js",
|
|
2440
|
-
"description": "Highlight a code snippet. The snippet may either be passed in a template child\
|
|
2440
|
+
"description": "Highlight a code snippet. The snippet may either be passed in a template child\nelement, which could contain HTML or text. If no template child is present, the\ncomponent will take any text content contained in it and highlight it. One can also\npass the code to be highlighted in the `code` property.",
|
|
2441
2441
|
"attributes": [
|
|
2442
2442
|
{
|
|
2443
2443
|
"name": "code",
|
|
2444
|
-
"description": "The code to be highlighted as a string. If not set,\
|
|
2444
|
+
"description": "The code to be highlighted as a string. If not set,\nthis will be populated from either a template child element\nor the element's text content.\nThe value of the property can be changed programmatically from JavaScript.",
|
|
2445
2445
|
"type": "string"
|
|
2446
2446
|
},
|
|
2447
2447
|
{
|
|
@@ -2452,7 +2452,7 @@
|
|
|
2452
2452
|
},
|
|
2453
2453
|
{
|
|
2454
2454
|
"name": "theme",
|
|
2455
|
-
"description": "Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',\
|
|
2455
|
+
"description": "Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',\n'tomorrow', 'twilight' or 'default'.",
|
|
2456
2456
|
"type": "string",
|
|
2457
2457
|
"default": "\"default\""
|
|
2458
2458
|
},
|
|
@@ -2466,7 +2466,7 @@
|
|
|
2466
2466
|
{
|
|
2467
2467
|
"name": "code",
|
|
2468
2468
|
"attribute": "code",
|
|
2469
|
-
"description": "The code to be highlighted as a string. If not set,\
|
|
2469
|
+
"description": "The code to be highlighted as a string. If not set,\nthis will be populated from either a template child element\nor the element's text content.\nThe value of the property can be changed programmatically from JavaScript.",
|
|
2470
2470
|
"type": "string"
|
|
2471
2471
|
},
|
|
2472
2472
|
{
|
|
@@ -2479,7 +2479,7 @@
|
|
|
2479
2479
|
{
|
|
2480
2480
|
"name": "theme",
|
|
2481
2481
|
"attribute": "theme",
|
|
2482
|
-
"description": "Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',\
|
|
2482
|
+
"description": "Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',\n'tomorrow', 'twilight' or 'default'.",
|
|
2483
2483
|
"type": "string",
|
|
2484
2484
|
"default": "\"default\""
|
|
2485
2485
|
},
|
|
@@ -2753,7 +2753,7 @@
|
|
|
2753
2753
|
{
|
|
2754
2754
|
"name": "pb-combo-box",
|
|
2755
2755
|
"path": "./src/pb-combo-box.js",
|
|
2756
|
-
"description": "Provides a combo box, i.e. a combination of an input with a dropdown.\nItems to select from may be obtained from a remote data source.\n\nThe form control to be used (either a select or input) should be passed
|
|
2756
|
+
"description": "Provides a combo box, i.e. a combination of an input with a dropdown.\nItems to select from may be obtained from a remote data source.\n\nThe form control to be used (either a select or input) should be passed\nin the content of the element. If no control is provided, a simple `<input>`\nwill be created.",
|
|
2757
2757
|
"attributes": [
|
|
2758
2758
|
{
|
|
2759
2759
|
"name": "source",
|
|
@@ -2964,7 +2964,7 @@
|
|
|
2964
2964
|
},
|
|
2965
2965
|
{
|
|
2966
2966
|
"name": "use-language",
|
|
2967
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
2967
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
2968
2968
|
"type": "boolean"
|
|
2969
2969
|
},
|
|
2970
2970
|
{
|
|
@@ -3091,7 +3091,7 @@
|
|
|
3091
3091
|
{
|
|
3092
3092
|
"name": "useLanguage",
|
|
3093
3093
|
"attribute": "use-language",
|
|
3094
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
3094
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
3095
3095
|
"type": "boolean"
|
|
3096
3096
|
},
|
|
3097
3097
|
{
|
|
@@ -3234,7 +3234,7 @@
|
|
|
3234
3234
|
{
|
|
3235
3235
|
"name": "pb-dialog",
|
|
3236
3236
|
"path": "./src/pb-dialog.js",
|
|
3237
|
-
"description": "A simple dialog component using the HTML5 <dialog> element",
|
|
3237
|
+
"description": "A simple dialog component using the HTML5 <dialog> element.\n\nAny button with the attribute `rel=\"prev\"` will close the dialog when clicked.",
|
|
3238
3238
|
"attributes": [
|
|
3239
3239
|
{
|
|
3240
3240
|
"name": "open",
|
|
@@ -3524,7 +3524,7 @@
|
|
|
3524
3524
|
"attributes": [
|
|
3525
3525
|
{
|
|
3526
3526
|
"name": "src",
|
|
3527
|
-
"description": "optional id reference to a pb-document. If `url` is not specified
|
|
3527
|
+
"description": "optional id reference to a pb-document. If `url` is not specified,\na correct download URL is constructed using the given document path and parameters.\nOtherwise `url` will be used as main URL.",
|
|
3528
3528
|
"type": "string"
|
|
3529
3529
|
},
|
|
3530
3530
|
{
|
|
@@ -3600,7 +3600,7 @@
|
|
|
3600
3600
|
{
|
|
3601
3601
|
"name": "src",
|
|
3602
3602
|
"attribute": "src",
|
|
3603
|
-
"description": "optional id reference to a pb-document. If `url` is not specified
|
|
3603
|
+
"description": "optional id reference to a pb-document. If `url` is not specified,\na correct download URL is constructed using the given document path and parameters.\nOtherwise `url` will be used as main URL.",
|
|
3604
3604
|
"type": "string"
|
|
3605
3605
|
},
|
|
3606
3606
|
{
|
|
@@ -4133,7 +4133,7 @@
|
|
|
4133
4133
|
},
|
|
4134
4134
|
{
|
|
4135
4135
|
"name": "trigger",
|
|
4136
|
-
"description": "Type of event which should trigger the facsimile to display
|
|
4136
|
+
"description": "Type of event which should trigger the facsimile to display.\nEither 'click' or 'mouseover' (default).",
|
|
4137
4137
|
"type": "string",
|
|
4138
4138
|
"default": "\"mouseover\""
|
|
4139
4139
|
},
|
|
@@ -4202,7 +4202,7 @@
|
|
|
4202
4202
|
{
|
|
4203
4203
|
"name": "trigger",
|
|
4204
4204
|
"attribute": "trigger",
|
|
4205
|
-
"description": "Type of event which should trigger the facsimile to display
|
|
4205
|
+
"description": "Type of event which should trigger the facsimile to display.\nEither 'click' or 'mouseover' (default).",
|
|
4206
4206
|
"type": "string",
|
|
4207
4207
|
"default": "\"mouseover\""
|
|
4208
4208
|
},
|
|
@@ -4689,7 +4689,7 @@
|
|
|
4689
4689
|
{
|
|
4690
4690
|
"name": "pb-geolocation",
|
|
4691
4691
|
"path": "./src/pb-geolocation.js",
|
|
4692
|
-
"description": "Represents a geo location. Extends `pb-highlight`, but sends an additional `pb-geolocation` event\non mouseover.\n\nFor `pb-leaflet-map` to show markers for `pb-geolocation` elements, make sure that map subscribes to the channel\ninto which `pb-geolocation`s emit and that map is loaded before the emitting component, e.g. `pb-view`, by specifying
|
|
4692
|
+
"description": "Represents a geo location. Extends `pb-highlight`, but sends an additional `pb-geolocation` event\non mouseover.\n\nFor `pb-leaflet-map` to show markers for `pb-geolocation` elements, make sure that map subscribes to the channel\ninto which `pb-geolocation`s emit and that map is loaded before the emitting component, e.g. `pb-view`, by specifying\n`wait-for` property.",
|
|
4693
4693
|
"attributes": [
|
|
4694
4694
|
{
|
|
4695
4695
|
"name": "longitude",
|
|
@@ -5695,7 +5695,7 @@
|
|
|
5695
5695
|
},
|
|
5696
5696
|
{
|
|
5697
5697
|
"name": "geo-coding",
|
|
5698
|
-
"description": "Enables geocoding: an additional control will allow users to search for a place.\nReverse geocoding is also possible: clicking on the map while pressing ctrl or cmd
|
|
5698
|
+
"description": "Enables geocoding: an additional control will allow users to search for a place.\nReverse geocoding is also possible: clicking on the map while pressing ctrl or cmd\nwill request information about the current location.\n\nIn both cases, a `pb-geocode` event will be emitted containing additional information\nabout the place in the event details (see demo).\n\nFor lookups the free OSM/Nominatim service is used.",
|
|
5699
5699
|
"type": "boolean",
|
|
5700
5700
|
"default": "false"
|
|
5701
5701
|
},
|
|
@@ -5815,7 +5815,7 @@
|
|
|
5815
5815
|
{
|
|
5816
5816
|
"name": "geoCoding",
|
|
5817
5817
|
"attribute": "geo-coding",
|
|
5818
|
-
"description": "Enables geocoding: an additional control will allow users to search for a place.\nReverse geocoding is also possible: clicking on the map while pressing ctrl or cmd
|
|
5818
|
+
"description": "Enables geocoding: an additional control will allow users to search for a place.\nReverse geocoding is also possible: clicking on the map while pressing ctrl or cmd\nwill request information about the current location.\n\nIn both cases, a `pb-geocode` event will be emitted containing additional information\nabout the place in the event details (see demo).\n\nFor lookups the free OSM/Nominatim service is used.",
|
|
5819
5819
|
"type": "boolean",
|
|
5820
5820
|
"default": "false"
|
|
5821
5821
|
},
|
|
@@ -5889,7 +5889,7 @@
|
|
|
5889
5889
|
{
|
|
5890
5890
|
"name": "pb-link",
|
|
5891
5891
|
"path": "./src/pb-link.js",
|
|
5892
|
-
"description": "Create an internal link: clicking it will emit a `pb-refresh`event
|
|
5892
|
+
"description": "Create an internal link: clicking it will emit a `pb-refresh`event,\ncausing connected views to update and load the corresponding document fragment defined by the\nproperties.",
|
|
5893
5893
|
"attributes": [
|
|
5894
5894
|
{
|
|
5895
5895
|
"name": "xml-id",
|
|
@@ -6106,7 +6106,7 @@
|
|
|
6106
6106
|
},
|
|
6107
6107
|
{
|
|
6108
6108
|
"name": "use-language",
|
|
6109
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
6109
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
6110
6110
|
"type": "boolean"
|
|
6111
6111
|
},
|
|
6112
6112
|
{
|
|
@@ -6227,7 +6227,7 @@
|
|
|
6227
6227
|
{
|
|
6228
6228
|
"name": "useLanguage",
|
|
6229
6229
|
"attribute": "use-language",
|
|
6230
|
-
"description": "If set, a parameter \"language\" will be added to the parameter list
|
|
6230
|
+
"description": "If set, a parameter \"language\" will be added to the parameter list.\nAlso, a refresh will be triggered if a `pb-i18n-update` event is received,\ne.g. due to the user selecting a different interface language.\n\nAlso requires `requireLanguage` to be set on the surrounding `pb-page`.\nSee there for more information.",
|
|
6231
6231
|
"type": "boolean"
|
|
6232
6232
|
},
|
|
6233
6233
|
{
|
|
@@ -6698,7 +6698,7 @@
|
|
|
6698
6698
|
{
|
|
6699
6699
|
"name": "pb-map-icon",
|
|
6700
6700
|
"path": "./src/pb-map-icon.js",
|
|
6701
|
-
"description": "Configure a map icon type to be used for markers
|
|
6701
|
+
"description": "Configure a map icon type to be used for markers.\nShould be nested inside `pb-leaflet-map`.",
|
|
6702
6702
|
"attributes": [
|
|
6703
6703
|
{
|
|
6704
6704
|
"name": "icon-size",
|
|
@@ -7091,7 +7091,7 @@
|
|
|
7091
7091
|
{
|
|
7092
7092
|
"name": "pb-mei",
|
|
7093
7093
|
"path": "./src/pb-mei.js",
|
|
7094
|
-
"description": "A viewer and player for MEI musical notation based on [Verovio](https://www.verovio.org/).\nSupports optional MIDI playback using [web-midi-player](https://midi.yvesgurcan.com/).\nBoth libraries are loaded dynamically when the component is used the first time.\n\nViewing options to be selected by the user can be defined via nested `pb-option` elements:\n\n```html\n<pb-mei id=\"viewer\" player url=\"http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei\"
|
|
7094
|
+
"description": "A viewer and player for MEI musical notation based on [Verovio](https://www.verovio.org/).\nSupports optional MIDI playback using [web-midi-player](https://midi.yvesgurcan.com/).\nBoth libraries are loaded dynamically when the component is used the first time.\n\nViewing options to be selected by the user can be defined via nested `pb-option` elements:\n\n```html\n<pb-mei id=\"viewer\" player url=\"http://www.marenzio.org/mei/M-06-5/M_06_5_01_S_io_parto_i_moro_e_pur_partir_conviene.mei\"\n footer=\"none\">\n <pb-option name=\"appXPath\" on=\"./rdg[contains(@label, 'original')]\" off=\"\">Original Clefs</pb-option>\n</pb-mei>\n```\n\nThe MEI document to display can either be given directly in the `data` property or loaded from an URL\nspecified in `url`.",
|
|
7095
7095
|
"attributes": [
|
|
7096
7096
|
{
|
|
7097
7097
|
"name": "data",
|
|
@@ -7100,7 +7100,7 @@
|
|
|
7100
7100
|
},
|
|
7101
7101
|
{
|
|
7102
7102
|
"name": "url",
|
|
7103
|
-
"description": "URL of the MEI file to load. Will be used if no `data` property is present
|
|
7103
|
+
"description": "URL of the MEI file to load. Will be used if no `data` property is present.\nA relative URL would be resolved relative to the TEI Publisher endpoint.",
|
|
7104
7104
|
"type": "string"
|
|
7105
7105
|
},
|
|
7106
7106
|
{
|
|
@@ -7188,7 +7188,7 @@
|
|
|
7188
7188
|
{
|
|
7189
7189
|
"name": "url",
|
|
7190
7190
|
"attribute": "url",
|
|
7191
|
-
"description": "URL of the MEI file to load. Will be used if no `data` property is present
|
|
7191
|
+
"description": "URL of the MEI file to load. Will be used if no `data` property is present.\nA relative URL would be resolved relative to the TEI Publisher endpoint.",
|
|
7192
7192
|
"type": "string"
|
|
7193
7193
|
},
|
|
7194
7194
|
{
|
|
@@ -8480,7 +8480,7 @@
|
|
|
8480
8480
|
},
|
|
8481
8481
|
{
|
|
8482
8482
|
"name": "locales",
|
|
8483
|
-
"description": "Optional URL pointing to a directory from which additional i18n
|
|
8483
|
+
"description": "Optional URL pointing to a directory from which additional i18n\nlanguage files will be loaded. The URL should contain placeholders\nfor the language (`lng`) and the namespace (`ns`), e.g.\n\n`resources/i18n/{{ns}}_{{lng}}.json`\n\nor\n\n`resources/i18n/{{ns}}/{{lng}}.json`\n\nThe latter assumes custom language files in a subdirectory, the first\nexpects the namespace to be specified at the start of the file name.\n\nThe default namespace for custom language files is assumed to be `app`,\nbut you can define additional namespaces via `localeFallbackNS`.",
|
|
8484
8484
|
"type": "string"
|
|
8485
8485
|
},
|
|
8486
8486
|
{
|
|
@@ -8507,7 +8507,7 @@
|
|
|
8507
8507
|
},
|
|
8508
8508
|
{
|
|
8509
8509
|
"name": "url-template",
|
|
8510
|
-
"description": "Can be used to define parameters which should be serialized in the\nURL path rather than as query parameters. Expects a url pattern\nrelative to the application root\n(supported patterns are documented in the
|
|
8510
|
+
"description": "Can be used to define parameters which should be serialized in the\nURL path rather than as query parameters. Expects a url pattern\nrelative to the application root\n(supported patterns are documented in the\n[path-to-regexp](https://www.npmjs.com/package/path-to-regexp) library documentation).\n\nFor example, a pattern `:lang/texts/:path/:id?` would support URLs like\n`en/texts/text1/chapter1`. Whenever components change state – e.g. due to a navigation\nevent – the standard parameters `path`, `lang` and `id` would be serialized into the\nURL path pattern rather than query parameters.",
|
|
8511
8511
|
"type": "string"
|
|
8512
8512
|
},
|
|
8513
8513
|
{
|
|
@@ -8534,7 +8534,7 @@
|
|
|
8534
8534
|
},
|
|
8535
8535
|
{
|
|
8536
8536
|
"name": "require-language",
|
|
8537
|
-
"description": "If set, the element will wait for a language being set by i18n before\nit sends a `pb-page-ready` event. Elements like `pb-view` will wait\nfor this event before displaying content.\n\nAlso, `pb-view` will pass the configured language to the server endpoint\nwhere it will be available to ODD processing models in variable
|
|
8537
|
+
"description": "If set, the element will wait for a language being set by i18n before\nit sends a `pb-page-ready` event. Elements like `pb-view` will wait\nfor this event before displaying content.\n\nAlso, `pb-view` will pass the configured language to the server endpoint\nwhere it will be available to ODD processing models in variable\n`$parameters?language` and can thus be used to change output depending on\nthe user interface language.\n\nIf you would like `pb-view` to refresh automatically whenever the language\nsetting changes, specify property `useLanguage` on the corresponding `pb-view`.",
|
|
8538
8538
|
"type": "boolean",
|
|
8539
8539
|
"default": "false"
|
|
8540
8540
|
},
|
|
@@ -8601,7 +8601,7 @@
|
|
|
8601
8601
|
{
|
|
8602
8602
|
"name": "locales",
|
|
8603
8603
|
"attribute": "locales",
|
|
8604
|
-
"description": "Optional URL pointing to a directory from which additional i18n
|
|
8604
|
+
"description": "Optional URL pointing to a directory from which additional i18n\nlanguage files will be loaded. The URL should contain placeholders\nfor the language (`lng`) and the namespace (`ns`), e.g.\n\n`resources/i18n/{{ns}}_{{lng}}.json`\n\nor\n\n`resources/i18n/{{ns}}/{{lng}}.json`\n\nThe latter assumes custom language files in a subdirectory, the first\nexpects the namespace to be specified at the start of the file name.\n\nThe default namespace for custom language files is assumed to be `app`,\nbut you can define additional namespaces via `localeFallbackNS`.",
|
|
8605
8605
|
"type": "string"
|
|
8606
8606
|
},
|
|
8607
8607
|
{
|
|
@@ -8637,7 +8637,7 @@
|
|
|
8637
8637
|
{
|
|
8638
8638
|
"name": "urlTemplate",
|
|
8639
8639
|
"attribute": "url-template",
|
|
8640
|
-
"description": "Can be used to define parameters which should be serialized in the\nURL path rather than as query parameters. Expects a url pattern\nrelative to the application root\n(supported patterns are documented in the
|
|
8640
|
+
"description": "Can be used to define parameters which should be serialized in the\nURL path rather than as query parameters. Expects a url pattern\nrelative to the application root\n(supported patterns are documented in the\n[path-to-regexp](https://www.npmjs.com/package/path-to-regexp) library documentation).\n\nFor example, a pattern `:lang/texts/:path/:id?` would support URLs like\n`en/texts/text1/chapter1`. Whenever components change state – e.g. due to a navigation\nevent – the standard parameters `path`, `lang` and `id` would be serialized into the\nURL path pattern rather than query parameters.",
|
|
8641
8641
|
"type": "string"
|
|
8642
8642
|
},
|
|
8643
8643
|
{
|
|
@@ -8669,7 +8669,7 @@
|
|
|
8669
8669
|
{
|
|
8670
8670
|
"name": "requireLanguage",
|
|
8671
8671
|
"attribute": "require-language",
|
|
8672
|
-
"description": "If set, the element will wait for a language being set by i18n before\nit sends a `pb-page-ready` event. Elements like `pb-view` will wait\nfor this event before displaying content.\n\nAlso, `pb-view` will pass the configured language to the server endpoint\nwhere it will be available to ODD processing models in variable
|
|
8672
|
+
"description": "If set, the element will wait for a language being set by i18n before\nit sends a `pb-page-ready` event. Elements like `pb-view` will wait\nfor this event before displaying content.\n\nAlso, `pb-view` will pass the configured language to the server endpoint\nwhere it will be available to ODD processing models in variable\n`$parameters?language` and can thus be used to change output depending on\nthe user interface language.\n\nIf you would like `pb-view` to refresh automatically whenever the language\nsetting changes, specify property `useLanguage` on the corresponding `pb-view`.",
|
|
8673
8673
|
"type": "boolean",
|
|
8674
8674
|
"default": "false"
|
|
8675
8675
|
},
|
|
@@ -9122,7 +9122,7 @@
|
|
|
9122
9122
|
{
|
|
9123
9123
|
"name": "pb-popover",
|
|
9124
9124
|
"path": "./src/pb-popover.js",
|
|
9125
|
-
"description": "Show a popover. It may either
|
|
9125
|
+
"description": "Show a popover. It may either\n\n1. be attached to another element on the page which serves as a trigger. For this the\n`for` property must be specified and should contain the ID of the trigger element.\nThe whole content of the `pb-popover` element will be shown in the popup.\n\n2. if no `for` property is specified, the `pb-popover` acts itself as the trigger. The trigger\ntext is either taken from a slot named `default` - or the default slot (i.e. the content of the element).\nThe content to show in the popup should be supplied in a slot named `alternate`. It is recommended to use an\nHTML `template` to specify the alternate, so it is ignored by the browser:\n\n```html\n<pb-popover theme=\"material\">\n <span slot=\"default\">ipsum dolor sit amet</span>\n <template slot=\"alternate\">\n <p>At vero eos et <strong>accusam</strong> et justo duo dolores<br>\n et ea rebum.</p>\n </template>\n</pb-popover>\n```\n\nIf you would like popovers to contain nested popovers, choose approach 1 above and use `for`.\n\nIf property `persistent` is true, the popover will be shown\non click. Otherwise display a tooltip on mouseover.\n\n`pb-popover` uses the tippy.js library for the popup.\n\n## Styling\n\nWhen showing the popup, the popup content will either be added to the parent shadow DOM - if the `pb-popover`\nis located inside the shadow DOM of another element like `pb-view`; or the document body. This has an\neffect on where CSS styles can be defined: within a `pb-view`, only the styles specified inside the\nCSS attached to the ODD are applied.",
|
|
9126
9126
|
"attributes": [
|
|
9127
9127
|
{
|
|
9128
9128
|
"name": "remote",
|
|
@@ -9506,7 +9506,7 @@
|
|
|
9506
9506
|
{
|
|
9507
9507
|
"name": "pb-progress",
|
|
9508
9508
|
"path": "./src/pb-progress.js",
|
|
9509
|
-
"description": "A progress bar which becomes active when signal `pb-start-update` is\nbeing sent and is deactivated on `pb-end-update
|
|
9509
|
+
"description": "A progress bar which becomes active when signal `pb-start-update` is\nbeing sent and is deactivated on `pb-end-update`.\n\nUses a native `<progress>` element.",
|
|
9510
9510
|
"attributes": [
|
|
9511
9511
|
{
|
|
9512
9512
|
"name": "subscribe",
|
|
@@ -10045,7 +10045,7 @@
|
|
|
10045
10045
|
{
|
|
10046
10046
|
"name": "pb-select-feature",
|
|
10047
10047
|
"path": "./src/pb-select-feature.js",
|
|
10048
|
-
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side
|
|
10048
|
+
"description": "Similar to `pb-toggle-feature` but allows you to choose from a list of defined states instead of a simple\non/off toggle. Like `pb-toggle-feature` it can change state server-side as well as client-side.\n\nThe list of states is passed as a JSON array to property `items`:\n\n# Server-side\n\nProperties to be passed to the server are specified as follows:\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"properties\": {\"mode\": \"diplomatic\", \"view\": \"page\"}},\n {\"name\": \"Normalized View\", \"properties\": {\"mode\": \"norm\", \"view\": \"single\"}}\n]\n```\n\nIf the `name` property references the path to a translated label, the translation will be used instead.\n# Client-side\n\n```javascript\n[\n {\"name\": \"Diplomatic View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": false},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Normalized View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true},{\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\"}]},\n {\"name\": \"Plain Reading View\", \"selectors\": [{\"selector\": \".choice,.choice-alternate,br\", \"state\": true}, {\"selector\": \".tei-foreign,pb-highlight,pb-popover\", \"command\": \"disable\", \"state\": true}]}\n]\n```\n\nEach item in the `selectors` property above defines either a state or a command. *state* will simply add\na css class `.toggle` to the target element when true. If *command* is set to 'disable', it will entirely disable\nthe functionality of selected elements - provided that they are\npublisher components implementing the corresponding `command` method of `pb-mixin`.\n\nClient-side you may also pass an optional property `\"global\": true` to toggle the state of elements which reside\nin the surrounding HTML context below `pb-page` (means: elements which are not inside a `pb-view` or `pb-load`).",
|
|
10049
10049
|
"attributes": [
|
|
10050
10050
|
{
|
|
10051
10051
|
"name": "name",
|
|
@@ -10578,7 +10578,7 @@
|
|
|
10578
10578
|
{
|
|
10579
10579
|
"name": "pb-split-list",
|
|
10580
10580
|
"path": "./src/pb-split-list.js",
|
|
10581
|
-
"description": "Implements a list which is split into different categories
|
|
10581
|
+
"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",
|
|
10582
10582
|
"attributes": [
|
|
10583
10583
|
{
|
|
10584
10584
|
"name": "url",
|
|
@@ -11117,7 +11117,7 @@
|
|
|
11117
11117
|
"events": [
|
|
11118
11118
|
{
|
|
11119
11119
|
"name": "pb-tab",
|
|
11120
|
-
"description": "fired if selected tab changes. Details contain number of
|
|
11120
|
+
"description": "fired if selected tab changes. Details contain number of\nselected tab in propery `selected`."
|
|
11121
11121
|
}
|
|
11122
11122
|
],
|
|
11123
11123
|
"slots": [
|
|
@@ -11243,7 +11243,7 @@
|
|
|
11243
11243
|
{
|
|
11244
11244
|
"name": "pb-timeline",
|
|
11245
11245
|
"path": "./src/pb-timeline.js",
|
|
11246
|
-
"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
|
|
11246
|
+
"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",
|
|
11247
11247
|
"attributes": [
|
|
11248
11248
|
{
|
|
11249
11249
|
"name": "start-date",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Global component theme stylesheet
|
|
3
|
-
*
|
|
4
|
-
* Styles defined here are injected into a components' shadow DOM.
|
|
5
|
-
*/
|
|
1
|
+
/*
|
|
2
|
+
* Global component theme stylesheet
|
|
3
|
+
*
|
|
4
|
+
* Styles defined here are injected into a components' shadow DOM.
|
|
5
|
+
*/
|
|
@@ -4,11 +4,11 @@ import { resolveURL } from '../utils.js';
|
|
|
4
4
|
|
|
5
5
|
function expandTemplate(template = '', options) {
|
|
6
6
|
return template.replace(/\${([^}]+)}/g, (match, p) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
let replacement;
|
|
8
|
+
if (options[p]) {
|
|
9
|
+
replacement = options[p];
|
|
10
|
+
}
|
|
11
|
+
return replacement || '';
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -23,7 +23,6 @@ function getTemplate(configElem, selector) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class Airtable extends Registry {
|
|
26
|
-
|
|
27
26
|
constructor(configElem) {
|
|
28
27
|
super(configElem);
|
|
29
28
|
this.apiKey = configElem.getAttribute('api-key');
|
|
@@ -45,7 +44,7 @@ export class Airtable extends Registry {
|
|
|
45
44
|
this.tokenize = [this.fields[0]];
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
this.tokenizeChars = configElem.getAttribute('tokenize-regex') ||
|
|
47
|
+
this.tokenizeChars = configElem.getAttribute('tokenize-regex') || '\\W';
|
|
49
48
|
|
|
50
49
|
this.infoExpr = getTemplate(configElem, '.info');
|
|
51
50
|
this.detailExpr = getTemplate(configElem, '.detail');
|
|
@@ -54,14 +53,12 @@ export class Airtable extends Registry {
|
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
_init() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{ once: true },
|
|
64
|
-
);
|
|
56
|
+
window.ESGlobalBridge.requestAvailability();
|
|
57
|
+
const path = resolveURL('../lib/airtable.browser.js');
|
|
58
|
+
window.ESGlobalBridge.instance.load('airtable', path);
|
|
59
|
+
window.addEventListener('es-bridge-airtable-loaded', this._initAirtable.bind(this), {
|
|
60
|
+
once: true,
|
|
61
|
+
});
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
_initAirtable() {
|
|
@@ -76,7 +73,7 @@ export class Airtable extends Registry {
|
|
|
76
73
|
const options = {
|
|
77
74
|
fields: this.fields,
|
|
78
75
|
// Selecting the first 3 records in Grid view:
|
|
79
|
-
maxRecords: 100
|
|
76
|
+
maxRecords: 100,
|
|
80
77
|
};
|
|
81
78
|
if (this.view) {
|
|
82
79
|
options.view = this.view;
|
|
@@ -95,13 +92,15 @@ export class Airtable extends Registry {
|
|
|
95
92
|
}
|
|
96
93
|
records.forEach(record => {
|
|
97
94
|
const data = {};
|
|
98
|
-
this.fields.forEach(
|
|
95
|
+
this.fields.forEach(field => {
|
|
96
|
+
data[field] = record.get(field);
|
|
97
|
+
});
|
|
99
98
|
const result = {
|
|
100
99
|
register: this._register,
|
|
101
100
|
id: record.id,
|
|
102
101
|
label: expandTemplate(this.labelExpr, data),
|
|
103
102
|
details: expandTemplate(this.detailExpr, data),
|
|
104
|
-
provider: 'airtable'
|
|
103
|
+
provider: 'airtable',
|
|
105
104
|
};
|
|
106
105
|
results.push(result);
|
|
107
106
|
});
|
|
@@ -133,7 +132,7 @@ export class Airtable extends Registry {
|
|
|
133
132
|
}
|
|
134
133
|
let strings = [];
|
|
135
134
|
const data = {};
|
|
136
|
-
this.fields.forEach(
|
|
135
|
+
this.fields.forEach(field => {
|
|
137
136
|
const value = record.get(field);
|
|
138
137
|
if (value) {
|
|
139
138
|
data[field] = value;
|
|
@@ -141,7 +140,7 @@ export class Airtable extends Registry {
|
|
|
141
140
|
}
|
|
142
141
|
});
|
|
143
142
|
const regex = new RegExp(this.tokenizeChars);
|
|
144
|
-
this.tokenize.forEach(
|
|
143
|
+
this.tokenize.forEach(key => {
|
|
145
144
|
if (data[key]) {
|
|
146
145
|
strings = strings.concat(data[key].split(regex));
|
|
147
146
|
}
|
|
@@ -152,7 +151,7 @@ export class Airtable extends Registry {
|
|
|
152
151
|
|
|
153
152
|
resolve({
|
|
154
153
|
id: record.id,
|
|
155
|
-
strings
|
|
154
|
+
strings,
|
|
156
155
|
});
|
|
157
156
|
});
|
|
158
157
|
});
|