@teipublisher/pb-components 2.6.0 → 2.7.0
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/CHANGELOG.md +26 -0
- package/dist/demo/pb-svg.html +2 -5
- package/dist/pb-components-bundle.js +197 -197
- package/dist/pb-elements.json +57 -20
- package/package.json +2 -1
- package/pb-elements.json +57 -20
- package/src/pb-browse-docs.js +2 -0
- package/src/pb-custom-form.js +17 -1
- package/src/pb-load.js +5 -0
- package/src/pb-page.js +28 -1
- package/src/pb-popover.js +398 -390
- package/src/pb-svg.js +27 -21
- package/src/pb-tabs.js +10 -0
- package/src/urls.js +81 -15
package/dist/pb-elements.json
CHANGED
|
@@ -8160,6 +8160,16 @@
|
|
|
8160
8160
|
"type": "string",
|
|
8161
8161
|
"default": "\".\""
|
|
8162
8162
|
},
|
|
8163
|
+
{
|
|
8164
|
+
"name": "url-template",
|
|
8165
|
+
"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.",
|
|
8166
|
+
"type": "string"
|
|
8167
|
+
},
|
|
8168
|
+
{
|
|
8169
|
+
"name": "url-ignore",
|
|
8170
|
+
"description": "A comma-separated list of parameter names which should not be reflected on the browser URL.\nUse this to exclude e.g. the default `odd` parameter of a pb-view to be shown in the\nbrowser URL.",
|
|
8171
|
+
"type": "string"
|
|
8172
|
+
},
|
|
8163
8173
|
{
|
|
8164
8174
|
"name": "url-path",
|
|
8165
8175
|
"description": "Is the resource path part of the URL or should it be\nencoded as a parameter? TEI Publisher uses the\nURL path, but the webcomponent demos need to encode the resource path\nin a query parameter.",
|
|
@@ -8279,6 +8289,18 @@
|
|
|
8279
8289
|
"type": "string",
|
|
8280
8290
|
"default": "\".\""
|
|
8281
8291
|
},
|
|
8292
|
+
{
|
|
8293
|
+
"name": "urlTemplate",
|
|
8294
|
+
"attribute": "url-template",
|
|
8295
|
+
"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.",
|
|
8296
|
+
"type": "string"
|
|
8297
|
+
},
|
|
8298
|
+
{
|
|
8299
|
+
"name": "urlIgnore",
|
|
8300
|
+
"attribute": "url-ignore",
|
|
8301
|
+
"description": "A comma-separated list of parameter names which should not be reflected on the browser URL.\nUse this to exclude e.g. the default `odd` parameter of a pb-view to be shown in the\nbrowser URL.",
|
|
8302
|
+
"type": "string"
|
|
8303
|
+
},
|
|
8282
8304
|
{
|
|
8283
8305
|
"name": "urlPath",
|
|
8284
8306
|
"attribute": "url-path",
|
|
@@ -8734,27 +8756,27 @@
|
|
|
8734
8756
|
{
|
|
8735
8757
|
"name": "pb-popover",
|
|
8736
8758
|
"path": "./src/pb-popover.js",
|
|
8737
|
-
"description": "Show a popover. It may either \
|
|
8759
|
+
"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.",
|
|
8738
8760
|
"attributes": [
|
|
8739
8761
|
{
|
|
8740
8762
|
"name": "remote",
|
|
8741
|
-
"description": "An optional URL to asynchronously load the popover's content from. Content will\
|
|
8763
|
+
"description": "An optional URL to asynchronously load the popover's content from. Content will\nbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
|
|
8742
8764
|
"type": "String"
|
|
8743
8765
|
},
|
|
8744
8766
|
{
|
|
8745
8767
|
"name": "persistent",
|
|
8746
|
-
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\
|
|
8768
|
+
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\nunless defined otherwise; clicking anywhere on the page will close the popup.",
|
|
8747
8769
|
"type": "Boolean",
|
|
8748
8770
|
"default": "false"
|
|
8749
8771
|
},
|
|
8750
8772
|
{
|
|
8751
8773
|
"name": "trigger",
|
|
8752
|
-
"description": "Defines one or more actions (space separated) which should cause\
|
|
8774
|
+
"description": "Defines one or more actions (space separated) which should cause\nthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
|
|
8753
8775
|
"type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
|
|
8754
8776
|
},
|
|
8755
8777
|
{
|
|
8756
8778
|
"name": "for",
|
|
8757
|
-
"description": "The id of a trigger element (e.g. a link) to which the popover will\
|
|
8779
|
+
"description": "The id of a trigger element (e.g. a link) to which the popover will\nbe attached. If not set, the trigger is the pb-popover itself.",
|
|
8758
8780
|
"type": "String"
|
|
8759
8781
|
},
|
|
8760
8782
|
{
|
|
@@ -8764,22 +8786,26 @@
|
|
|
8764
8786
|
},
|
|
8765
8787
|
{
|
|
8766
8788
|
"name": "placement",
|
|
8767
|
-
"description": "Preferred placement of the popup.\
|
|
8789
|
+
"description": "Preferred placement of the popup.\nDefault is 'auto'.",
|
|
8768
8790
|
"type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
|
|
8769
8791
|
},
|
|
8792
|
+
{
|
|
8793
|
+
"name": "touch",
|
|
8794
|
+
"type": "string"
|
|
8795
|
+
},
|
|
8770
8796
|
{
|
|
8771
8797
|
"name": "fallback-placement",
|
|
8772
|
-
"description": "Fallback placement if there is more space on another side.\
|
|
8798
|
+
"description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
|
|
8773
8799
|
"type": "String"
|
|
8774
8800
|
},
|
|
8775
8801
|
{
|
|
8776
8802
|
"name": "popup-class",
|
|
8777
|
-
"description": "Additional class names which will be added to the popup element.\
|
|
8803
|
+
"description": "Additional class names which will be added to the popup element.\nUse this to apply a specific style to certain popovers, but not others.",
|
|
8778
8804
|
"type": "String"
|
|
8779
8805
|
},
|
|
8780
8806
|
{
|
|
8781
8807
|
"name": "stop-propagation",
|
|
8782
|
-
"description": "If you have nested pb-popover, set this property to\
|
|
8808
|
+
"description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
|
|
8783
8809
|
"type": "Boolean",
|
|
8784
8810
|
"default": "false"
|
|
8785
8811
|
},
|
|
@@ -8819,30 +8845,30 @@
|
|
|
8819
8845
|
{
|
|
8820
8846
|
"name": "remote",
|
|
8821
8847
|
"attribute": "remote",
|
|
8822
|
-
"description": "An optional URL to asynchronously load the popover's content from. Content will\
|
|
8848
|
+
"description": "An optional URL to asynchronously load the popover's content from. Content will\nbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
|
|
8823
8849
|
"type": "String"
|
|
8824
8850
|
},
|
|
8825
8851
|
{
|
|
8826
8852
|
"name": "alternate",
|
|
8827
|
-
"description": "Returns the root element of the alternate content currently shown in the popover.\
|
|
8853
|
+
"description": "Returns the root element of the alternate content currently shown in the popover.\nThis will be initialized from either the default slot or the slot with name 'alternate' (if present).\nThe returned element is always a `div` and can be modified."
|
|
8828
8854
|
},
|
|
8829
8855
|
{
|
|
8830
8856
|
"name": "persistent",
|
|
8831
8857
|
"attribute": "persistent",
|
|
8832
|
-
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\
|
|
8858
|
+
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\nunless defined otherwise; clicking anywhere on the page will close the popup.",
|
|
8833
8859
|
"type": "Boolean",
|
|
8834
8860
|
"default": "false"
|
|
8835
8861
|
},
|
|
8836
8862
|
{
|
|
8837
8863
|
"name": "trigger",
|
|
8838
8864
|
"attribute": "trigger",
|
|
8839
|
-
"description": "Defines one or more actions (space separated) which should cause\
|
|
8865
|
+
"description": "Defines one or more actions (space separated) which should cause\nthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
|
|
8840
8866
|
"type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
|
|
8841
8867
|
},
|
|
8842
8868
|
{
|
|
8843
8869
|
"name": "for",
|
|
8844
8870
|
"attribute": "for",
|
|
8845
|
-
"description": "The id of a trigger element (e.g. a link) to which the popover will\
|
|
8871
|
+
"description": "The id of a trigger element (e.g. a link) to which the popover will\nbe attached. If not set, the trigger is the pb-popover itself.",
|
|
8846
8872
|
"type": "String"
|
|
8847
8873
|
},
|
|
8848
8874
|
{
|
|
@@ -8854,25 +8880,30 @@
|
|
|
8854
8880
|
{
|
|
8855
8881
|
"name": "placement",
|
|
8856
8882
|
"attribute": "placement",
|
|
8857
|
-
"description": "Preferred placement of the popup.\
|
|
8883
|
+
"description": "Preferred placement of the popup.\nDefault is 'auto'.",
|
|
8858
8884
|
"type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
|
|
8859
8885
|
},
|
|
8886
|
+
{
|
|
8887
|
+
"name": "touch",
|
|
8888
|
+
"attribute": "touch",
|
|
8889
|
+
"type": "string"
|
|
8890
|
+
},
|
|
8860
8891
|
{
|
|
8861
8892
|
"name": "fallbackPlacement",
|
|
8862
8893
|
"attribute": "fallback-placement",
|
|
8863
|
-
"description": "Fallback placement if there is more space on another side.\
|
|
8894
|
+
"description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
|
|
8864
8895
|
"type": "String"
|
|
8865
8896
|
},
|
|
8866
8897
|
{
|
|
8867
8898
|
"name": "popupClass",
|
|
8868
8899
|
"attribute": "popup-class",
|
|
8869
|
-
"description": "Additional class names which will be added to the popup element.\
|
|
8900
|
+
"description": "Additional class names which will be added to the popup element.\nUse this to apply a specific style to certain popovers, but not others.",
|
|
8870
8901
|
"type": "String"
|
|
8871
8902
|
},
|
|
8872
8903
|
{
|
|
8873
8904
|
"name": "stopPropagation",
|
|
8874
8905
|
"attribute": "stop-propagation",
|
|
8875
|
-
"description": "If you have nested pb-popover, set this property to\
|
|
8906
|
+
"description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
|
|
8876
8907
|
"type": "Boolean",
|
|
8877
8908
|
"default": "false"
|
|
8878
8909
|
},
|
|
@@ -10309,7 +10340,7 @@
|
|
|
10309
10340
|
{
|
|
10310
10341
|
"name": "pb-svg",
|
|
10311
10342
|
"path": "./src/pb-svg.js",
|
|
10312
|
-
"description": "Show an SVG image with zoom and pan functionality. The image URL may\neither be specified via the `url` property or an `pb-show-annotation` event\nsent to this component.",
|
|
10343
|
+
"description": "Show an SVG image with zoom and pan functionality. The image URL may\neither be specified via the `url` property or an `pb-show-annotation` event\nsent to this component. A relative URL will be resolved against the current API context.",
|
|
10313
10344
|
"attributes": [
|
|
10314
10345
|
{
|
|
10315
10346
|
"name": "url",
|
|
@@ -10396,7 +10427,7 @@
|
|
|
10396
10427
|
"events": [
|
|
10397
10428
|
{
|
|
10398
10429
|
"name": "pb-show-annotation",
|
|
10399
|
-
"description": "When received, loads the image from the URL passed
|
|
10430
|
+
"description": "When received, loads the image from the URL passed in property `file`\nwithin the event"
|
|
10400
10431
|
}
|
|
10401
10432
|
],
|
|
10402
10433
|
"cssProperties": [
|
|
@@ -10706,6 +10737,12 @@
|
|
|
10706
10737
|
"default": "false"
|
|
10707
10738
|
}
|
|
10708
10739
|
],
|
|
10740
|
+
"events": [
|
|
10741
|
+
{
|
|
10742
|
+
"name": "pb-tab",
|
|
10743
|
+
"description": "fired if selected tab changes. Details contain number of \nselected tab in propery `selected`."
|
|
10744
|
+
}
|
|
10745
|
+
],
|
|
10709
10746
|
"slots": [
|
|
10710
10747
|
{
|
|
10711
10748
|
"name": "tab",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teipublisher/pb-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
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",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"lit-html": "^1.3.0",
|
|
84
84
|
"marked": "^1.2.0",
|
|
85
85
|
"pagedjs": "^0.4.0",
|
|
86
|
+
"path-to-regexp": "^6.2.1",
|
|
86
87
|
"prismjs": "^1.21.0",
|
|
87
88
|
"tippy.js": "^6.2.7",
|
|
88
89
|
"tom-select": "^2.0.2",
|
package/pb-elements.json
CHANGED
|
@@ -8160,6 +8160,16 @@
|
|
|
8160
8160
|
"type": "string",
|
|
8161
8161
|
"default": "\".\""
|
|
8162
8162
|
},
|
|
8163
|
+
{
|
|
8164
|
+
"name": "url-template",
|
|
8165
|
+
"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.",
|
|
8166
|
+
"type": "string"
|
|
8167
|
+
},
|
|
8168
|
+
{
|
|
8169
|
+
"name": "url-ignore",
|
|
8170
|
+
"description": "A comma-separated list of parameter names which should not be reflected on the browser URL.\nUse this to exclude e.g. the default `odd` parameter of a pb-view to be shown in the\nbrowser URL.",
|
|
8171
|
+
"type": "string"
|
|
8172
|
+
},
|
|
8163
8173
|
{
|
|
8164
8174
|
"name": "url-path",
|
|
8165
8175
|
"description": "Is the resource path part of the URL or should it be\nencoded as a parameter? TEI Publisher uses the\nURL path, but the webcomponent demos need to encode the resource path\nin a query parameter.",
|
|
@@ -8279,6 +8289,18 @@
|
|
|
8279
8289
|
"type": "string",
|
|
8280
8290
|
"default": "\".\""
|
|
8281
8291
|
},
|
|
8292
|
+
{
|
|
8293
|
+
"name": "urlTemplate",
|
|
8294
|
+
"attribute": "url-template",
|
|
8295
|
+
"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.",
|
|
8296
|
+
"type": "string"
|
|
8297
|
+
},
|
|
8298
|
+
{
|
|
8299
|
+
"name": "urlIgnore",
|
|
8300
|
+
"attribute": "url-ignore",
|
|
8301
|
+
"description": "A comma-separated list of parameter names which should not be reflected on the browser URL.\nUse this to exclude e.g. the default `odd` parameter of a pb-view to be shown in the\nbrowser URL.",
|
|
8302
|
+
"type": "string"
|
|
8303
|
+
},
|
|
8282
8304
|
{
|
|
8283
8305
|
"name": "urlPath",
|
|
8284
8306
|
"attribute": "url-path",
|
|
@@ -8734,27 +8756,27 @@
|
|
|
8734
8756
|
{
|
|
8735
8757
|
"name": "pb-popover",
|
|
8736
8758
|
"path": "./src/pb-popover.js",
|
|
8737
|
-
"description": "Show a popover. It may either \
|
|
8759
|
+
"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.",
|
|
8738
8760
|
"attributes": [
|
|
8739
8761
|
{
|
|
8740
8762
|
"name": "remote",
|
|
8741
|
-
"description": "An optional URL to asynchronously load the popover's content from. Content will\
|
|
8763
|
+
"description": "An optional URL to asynchronously load the popover's content from. Content will\nbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
|
|
8742
8764
|
"type": "String"
|
|
8743
8765
|
},
|
|
8744
8766
|
{
|
|
8745
8767
|
"name": "persistent",
|
|
8746
|
-
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\
|
|
8768
|
+
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\nunless defined otherwise; clicking anywhere on the page will close the popup.",
|
|
8747
8769
|
"type": "Boolean",
|
|
8748
8770
|
"default": "false"
|
|
8749
8771
|
},
|
|
8750
8772
|
{
|
|
8751
8773
|
"name": "trigger",
|
|
8752
|
-
"description": "Defines one or more actions (space separated) which should cause\
|
|
8774
|
+
"description": "Defines one or more actions (space separated) which should cause\nthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
|
|
8753
8775
|
"type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
|
|
8754
8776
|
},
|
|
8755
8777
|
{
|
|
8756
8778
|
"name": "for",
|
|
8757
|
-
"description": "The id of a trigger element (e.g. a link) to which the popover will\
|
|
8779
|
+
"description": "The id of a trigger element (e.g. a link) to which the popover will\nbe attached. If not set, the trigger is the pb-popover itself.",
|
|
8758
8780
|
"type": "String"
|
|
8759
8781
|
},
|
|
8760
8782
|
{
|
|
@@ -8764,22 +8786,26 @@
|
|
|
8764
8786
|
},
|
|
8765
8787
|
{
|
|
8766
8788
|
"name": "placement",
|
|
8767
|
-
"description": "Preferred placement of the popup.\
|
|
8789
|
+
"description": "Preferred placement of the popup.\nDefault is 'auto'.",
|
|
8768
8790
|
"type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
|
|
8769
8791
|
},
|
|
8792
|
+
{
|
|
8793
|
+
"name": "touch",
|
|
8794
|
+
"type": "string"
|
|
8795
|
+
},
|
|
8770
8796
|
{
|
|
8771
8797
|
"name": "fallback-placement",
|
|
8772
|
-
"description": "Fallback placement if there is more space on another side.\
|
|
8798
|
+
"description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
|
|
8773
8799
|
"type": "String"
|
|
8774
8800
|
},
|
|
8775
8801
|
{
|
|
8776
8802
|
"name": "popup-class",
|
|
8777
|
-
"description": "Additional class names which will be added to the popup element.\
|
|
8803
|
+
"description": "Additional class names which will be added to the popup element.\nUse this to apply a specific style to certain popovers, but not others.",
|
|
8778
8804
|
"type": "String"
|
|
8779
8805
|
},
|
|
8780
8806
|
{
|
|
8781
8807
|
"name": "stop-propagation",
|
|
8782
|
-
"description": "If you have nested pb-popover, set this property to\
|
|
8808
|
+
"description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
|
|
8783
8809
|
"type": "Boolean",
|
|
8784
8810
|
"default": "false"
|
|
8785
8811
|
},
|
|
@@ -8819,30 +8845,30 @@
|
|
|
8819
8845
|
{
|
|
8820
8846
|
"name": "remote",
|
|
8821
8847
|
"attribute": "remote",
|
|
8822
|
-
"description": "An optional URL to asynchronously load the popover's content from. Content will\
|
|
8848
|
+
"description": "An optional URL to asynchronously load the popover's content from. Content will\nbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
|
|
8823
8849
|
"type": "String"
|
|
8824
8850
|
},
|
|
8825
8851
|
{
|
|
8826
8852
|
"name": "alternate",
|
|
8827
|
-
"description": "Returns the root element of the alternate content currently shown in the popover.\
|
|
8853
|
+
"description": "Returns the root element of the alternate content currently shown in the popover.\nThis will be initialized from either the default slot or the slot with name 'alternate' (if present).\nThe returned element is always a `div` and can be modified."
|
|
8828
8854
|
},
|
|
8829
8855
|
{
|
|
8830
8856
|
"name": "persistent",
|
|
8831
8857
|
"attribute": "persistent",
|
|
8832
|
-
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\
|
|
8858
|
+
"description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\nunless defined otherwise; clicking anywhere on the page will close the popup.",
|
|
8833
8859
|
"type": "Boolean",
|
|
8834
8860
|
"default": "false"
|
|
8835
8861
|
},
|
|
8836
8862
|
{
|
|
8837
8863
|
"name": "trigger",
|
|
8838
8864
|
"attribute": "trigger",
|
|
8839
|
-
"description": "Defines one or more actions (space separated) which should cause\
|
|
8865
|
+
"description": "Defines one or more actions (space separated) which should cause\nthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
|
|
8840
8866
|
"type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
|
|
8841
8867
|
},
|
|
8842
8868
|
{
|
|
8843
8869
|
"name": "for",
|
|
8844
8870
|
"attribute": "for",
|
|
8845
|
-
"description": "The id of a trigger element (e.g. a link) to which the popover will\
|
|
8871
|
+
"description": "The id of a trigger element (e.g. a link) to which the popover will\nbe attached. If not set, the trigger is the pb-popover itself.",
|
|
8846
8872
|
"type": "String"
|
|
8847
8873
|
},
|
|
8848
8874
|
{
|
|
@@ -8854,25 +8880,30 @@
|
|
|
8854
8880
|
{
|
|
8855
8881
|
"name": "placement",
|
|
8856
8882
|
"attribute": "placement",
|
|
8857
|
-
"description": "Preferred placement of the popup.\
|
|
8883
|
+
"description": "Preferred placement of the popup.\nDefault is 'auto'.",
|
|
8858
8884
|
"type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
|
|
8859
8885
|
},
|
|
8886
|
+
{
|
|
8887
|
+
"name": "touch",
|
|
8888
|
+
"attribute": "touch",
|
|
8889
|
+
"type": "string"
|
|
8890
|
+
},
|
|
8860
8891
|
{
|
|
8861
8892
|
"name": "fallbackPlacement",
|
|
8862
8893
|
"attribute": "fallback-placement",
|
|
8863
|
-
"description": "Fallback placement if there is more space on another side.\
|
|
8894
|
+
"description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
|
|
8864
8895
|
"type": "String"
|
|
8865
8896
|
},
|
|
8866
8897
|
{
|
|
8867
8898
|
"name": "popupClass",
|
|
8868
8899
|
"attribute": "popup-class",
|
|
8869
|
-
"description": "Additional class names which will be added to the popup element.\
|
|
8900
|
+
"description": "Additional class names which will be added to the popup element.\nUse this to apply a specific style to certain popovers, but not others.",
|
|
8870
8901
|
"type": "String"
|
|
8871
8902
|
},
|
|
8872
8903
|
{
|
|
8873
8904
|
"name": "stopPropagation",
|
|
8874
8905
|
"attribute": "stop-propagation",
|
|
8875
|
-
"description": "If you have nested pb-popover, set this property to\
|
|
8906
|
+
"description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
|
|
8876
8907
|
"type": "Boolean",
|
|
8877
8908
|
"default": "false"
|
|
8878
8909
|
},
|
|
@@ -10309,7 +10340,7 @@
|
|
|
10309
10340
|
{
|
|
10310
10341
|
"name": "pb-svg",
|
|
10311
10342
|
"path": "./src/pb-svg.js",
|
|
10312
|
-
"description": "Show an SVG image with zoom and pan functionality. The image URL may\neither be specified via the `url` property or an `pb-show-annotation` event\nsent to this component.",
|
|
10343
|
+
"description": "Show an SVG image with zoom and pan functionality. The image URL may\neither be specified via the `url` property or an `pb-show-annotation` event\nsent to this component. A relative URL will be resolved against the current API context.",
|
|
10313
10344
|
"attributes": [
|
|
10314
10345
|
{
|
|
10315
10346
|
"name": "url",
|
|
@@ -10396,7 +10427,7 @@
|
|
|
10396
10427
|
"events": [
|
|
10397
10428
|
{
|
|
10398
10429
|
"name": "pb-show-annotation",
|
|
10399
|
-
"description": "When received, loads the image from the URL passed
|
|
10430
|
+
"description": "When received, loads the image from the URL passed in property `file`\nwithin the event"
|
|
10400
10431
|
}
|
|
10401
10432
|
],
|
|
10402
10433
|
"cssProperties": [
|
|
@@ -10706,6 +10737,12 @@
|
|
|
10706
10737
|
"default": "false"
|
|
10707
10738
|
}
|
|
10708
10739
|
],
|
|
10740
|
+
"events": [
|
|
10741
|
+
{
|
|
10742
|
+
"name": "pb-tab",
|
|
10743
|
+
"description": "fired if selected tab changes. Details contain number of \nselected tab in propery `selected`."
|
|
10744
|
+
}
|
|
10745
|
+
],
|
|
10709
10746
|
"slots": [
|
|
10710
10747
|
{
|
|
10711
10748
|
"name": "tab",
|
package/src/pb-browse-docs.js
CHANGED
|
@@ -156,6 +156,8 @@ export class PbBrowseDocs extends themableMixin(PbLoad) {
|
|
|
156
156
|
const param = registry.state[key];
|
|
157
157
|
if (this.facets[key]) {
|
|
158
158
|
this.facets[key].push(param);
|
|
159
|
+
} else if (Array.isArray(param)) {
|
|
160
|
+
this.facets[key] = param;
|
|
159
161
|
} else {
|
|
160
162
|
this.facets[key] = [param];
|
|
161
163
|
}
|
package/src/pb-custom-form.js
CHANGED
|
@@ -93,8 +93,24 @@ export class PbCustomForm extends PbLoad {
|
|
|
93
93
|
this.shadowRoot.getElementById('ironform').reset();
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* serialize custom form to object with name value pairs
|
|
98
|
+
* empty, unselected and undifined inputs will be returned
|
|
99
|
+
* as null while disabled elements will still be omitted
|
|
100
|
+
* this allows url parameters to be reset in the URL
|
|
101
|
+
* as IronForm.serializeform will omit names without a value
|
|
102
|
+
* @returns {Object} name value pairs
|
|
103
|
+
*/
|
|
96
104
|
serializeForm() {
|
|
97
|
-
|
|
105
|
+
const elements = this.shadowRoot.getElementById('ironform')._getSubmittableElements()
|
|
106
|
+
const initial = {}
|
|
107
|
+
for (const element of elements) {
|
|
108
|
+
initial[element.name] = null;
|
|
109
|
+
}
|
|
110
|
+
return Object.assign(
|
|
111
|
+
initial,
|
|
112
|
+
this.shadowRoot.getElementById('ironform').serializeForm()
|
|
113
|
+
);
|
|
98
114
|
}
|
|
99
115
|
|
|
100
116
|
_parseHeaders(xhr) {
|
package/src/pb-load.js
CHANGED
|
@@ -315,6 +315,11 @@ export class PbLoad extends pbMixin(LitElement) {
|
|
|
315
315
|
|
|
316
316
|
params = this.prepareParameters(params);
|
|
317
317
|
|
|
318
|
+
// filter null values
|
|
319
|
+
for (const [k,v] of Object.entries(params)) {
|
|
320
|
+
if (v === null) { delete params[k] }
|
|
321
|
+
}
|
|
322
|
+
|
|
318
323
|
const url = this.getURL(params);
|
|
319
324
|
|
|
320
325
|
console.log("<pb-load> Loading %s with parameters %o", url, params);
|
package/src/pb-page.js
CHANGED
|
@@ -39,6 +39,31 @@ export class PbPage extends pbMixin(LitElement) {
|
|
|
39
39
|
type: String,
|
|
40
40
|
attribute: 'app-root'
|
|
41
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Can be used to define parameters which should be serialized in the
|
|
44
|
+
* URL path rather than as query parameters. Expects a url pattern
|
|
45
|
+
* relative to the application root
|
|
46
|
+
* (supported patterns are documented in the
|
|
47
|
+
* [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) library documentation).
|
|
48
|
+
*
|
|
49
|
+
* For example, a pattern `:lang/texts/:path/:id?` would support URLs like
|
|
50
|
+
* `en/texts/text1/chapter1`. Whenever components change state – e.g. due to a navigation
|
|
51
|
+
* event – the standard parameters `path`, `lang` and `id` would be serialized into the
|
|
52
|
+
* URL path pattern rather than query parameters.
|
|
53
|
+
*/
|
|
54
|
+
urlTemplate: {
|
|
55
|
+
type: String,
|
|
56
|
+
attribute: 'url-template'
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* A comma-separated list of parameter names which should not be reflected on the browser URL.
|
|
60
|
+
* Use this to exclude e.g. the default `odd` parameter of a pb-view to be shown in the
|
|
61
|
+
* browser URL.
|
|
62
|
+
*/
|
|
63
|
+
urlIgnore: {
|
|
64
|
+
type: String,
|
|
65
|
+
attribute: 'url-ignore'
|
|
66
|
+
},
|
|
42
67
|
/**
|
|
43
68
|
* Is the resource path part of the URL or should it be
|
|
44
69
|
* encoded as a parameter? TEI Publisher uses the
|
|
@@ -180,6 +205,8 @@ export class PbPage extends pbMixin(LitElement) {
|
|
|
180
205
|
super();
|
|
181
206
|
this.unresolved = true;
|
|
182
207
|
this.endpoint = ".";
|
|
208
|
+
this.urlTemplate = null;
|
|
209
|
+
this.urlIgnore = null;
|
|
183
210
|
this.urlPath = 'path';
|
|
184
211
|
this.idHash = false;
|
|
185
212
|
this.apiVersion = undefined;
|
|
@@ -221,7 +248,7 @@ export class PbPage extends pbMixin(LitElement) {
|
|
|
221
248
|
return;
|
|
222
249
|
}
|
|
223
250
|
|
|
224
|
-
registry.configure(this.urlPath === 'path', this.idHash, this.appRoot);
|
|
251
|
+
registry.configure(this.urlPath === 'path', this.idHash, this.appRoot, this.urlTemplate, this.urlIgnore);
|
|
225
252
|
|
|
226
253
|
this.endpoint = this.endpoint.replace(/\/+$/, '');
|
|
227
254
|
|