@teipublisher/pb-components 2.6.1 → 2.8.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.
@@ -5624,7 +5624,7 @@
5624
5624
  {
5625
5625
  "name": "pb-link",
5626
5626
  "path": "./src/pb-link.js",
5627
- "description": "Create an internal link: clicking it will cause connected views to\nupdate and load the corresponding document fragment defined by the\nproperties.",
5627
+ "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.",
5628
5628
  "attributes": [
5629
5629
  {
5630
5630
  "name": "xml-id",
@@ -5657,10 +5657,15 @@
5657
5657
  },
5658
5658
  {
5659
5659
  "name": "history",
5660
- "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.\nOnly use this on one element on the page.",
5660
+ "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.",
5661
5661
  "type": "boolean",
5662
5662
  "default": "true"
5663
5663
  },
5664
+ {
5665
+ "name": "params",
5666
+ "description": "Additional parameters to be passed in the event details.\nShould be specified as a JSON object.",
5667
+ "type": "object"
5668
+ },
5664
5669
  {
5665
5670
  "name": "subscribe",
5666
5671
  "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
@@ -5732,10 +5737,16 @@
5732
5737
  {
5733
5738
  "name": "history",
5734
5739
  "attribute": "history",
5735
- "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.\nOnly use this on one element on the page.",
5740
+ "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.",
5736
5741
  "type": "boolean",
5737
5742
  "default": "true"
5738
5743
  },
5744
+ {
5745
+ "name": "params",
5746
+ "attribute": "params",
5747
+ "description": "Additional parameters to be passed in the event details.\nShould be specified as a JSON object.",
5748
+ "type": "object"
5749
+ },
5739
5750
  {
5740
5751
  "name": "subscribe",
5741
5752
  "attribute": "subscribe",
@@ -8160,6 +8171,16 @@
8160
8171
  "type": "string",
8161
8172
  "default": "\".\""
8162
8173
  },
8174
+ {
8175
+ "name": "url-template",
8176
+ "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.",
8177
+ "type": "string"
8178
+ },
8179
+ {
8180
+ "name": "url-ignore",
8181
+ "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.",
8182
+ "type": "string"
8183
+ },
8163
8184
  {
8164
8185
  "name": "url-path",
8165
8186
  "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 +8300,18 @@
8279
8300
  "type": "string",
8280
8301
  "default": "\".\""
8281
8302
  },
8303
+ {
8304
+ "name": "urlTemplate",
8305
+ "attribute": "url-template",
8306
+ "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.",
8307
+ "type": "string"
8308
+ },
8309
+ {
8310
+ "name": "urlIgnore",
8311
+ "attribute": "url-ignore",
8312
+ "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.",
8313
+ "type": "string"
8314
+ },
8282
8315
  {
8283
8316
  "name": "urlPath",
8284
8317
  "attribute": "url-path",
@@ -8734,27 +8767,27 @@
8734
8767
  {
8735
8768
  "name": "pb-popover",
8736
8769
  "path": "./src/pb-popover.js",
8737
- "description": "Show a popover. It may either \r\n\r\n1. be attached to another element on the page which serves as a trigger. For this the\r\n`for` property must be specified and should contain the ID of the trigger element. \r\nThe whole content of the `pb-popover` element will be shown in the popup.\r\n\r\n2. if no `for` property is specified, the `pb-popover` acts itself as the trigger. The trigger\r\ntext is either taken from a slot named `default` - or the default slot (i.e. the content of the element).\r\nThe content to show in the popup should be supplied in a slot named `alternate`. It is recommended to use an\r\nHTML `template` to specify the alternate, so it is ignored by the browser:\r\n\r\n```html\r\n<pb-popover theme=\"material\">\r\n <span slot=\"default\">ipsum dolor sit amet</span>\r\n <template slot=\"alternate\">\r\n <p>At vero eos et <strong>accusam</strong> et justo duo dolores<br>\r\n et ea rebum.</p>\r\n </template>\r\n</pb-popover>\r\n```\r\n\r\nIf you would like popovers to contain nested popovers, choose approach 1 above and use `for`.\r\n\r\nIf property `persistent` is true, the popover will be shown\r\non click. Otherwise display a tooltip on mouseover.\r\n\r\n`pb-popover` uses the tippy.js library for the popup.\r\n\r\n## Styling\r\n\r\nWhen showing the popup, the popup content will either be added to the parent shadow DOM - if the `pb-popover`\r\nis located inside the shadow DOM of another element like `pb-view`; or the document body. This has an\r\neffect on where CSS styles can be defined: within a `pb-view`, only the styles specified inside the\r\nCSS attached to the ODD are applied.",
8770
+ "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
8771
  "attributes": [
8739
8772
  {
8740
8773
  "name": "remote",
8741
- "description": "An optional URL to asynchronously load the popover's content from. Content will\rbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
8774
+ "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
8775
  "type": "String"
8743
8776
  },
8744
8777
  {
8745
8778
  "name": "persistent",
8746
- "description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\runless defined otherwise; clicking anywhere on the page will close the popup.",
8779
+ "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
8780
  "type": "Boolean",
8748
8781
  "default": "false"
8749
8782
  },
8750
8783
  {
8751
8784
  "name": "trigger",
8752
- "description": "Defines one or more actions (space separated) which should cause\rthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
8785
+ "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
8786
  "type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
8754
8787
  },
8755
8788
  {
8756
8789
  "name": "for",
8757
- "description": "The id of a trigger element (e.g. a link) to which the popover will\rbe attached. If not set, the trigger is the pb-popover itself.",
8790
+ "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
8791
  "type": "String"
8759
8792
  },
8760
8793
  {
@@ -8764,22 +8797,26 @@
8764
8797
  },
8765
8798
  {
8766
8799
  "name": "placement",
8767
- "description": "Preferred placement of the popup.\rDefault is 'auto'.",
8800
+ "description": "Preferred placement of the popup.\nDefault is 'auto'.",
8768
8801
  "type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
8769
8802
  },
8803
+ {
8804
+ "name": "touch",
8805
+ "type": "string"
8806
+ },
8770
8807
  {
8771
8808
  "name": "fallback-placement",
8772
- "description": "Fallback placement if there is more space on another side.\rAccepts same values as `placement`. Separate by space if more than one.",
8809
+ "description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
8773
8810
  "type": "String"
8774
8811
  },
8775
8812
  {
8776
8813
  "name": "popup-class",
8777
- "description": "Additional class names which will be added to the popup element.\rUse this to apply a specific style to certain popovers, but not others.",
8814
+ "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
8815
  "type": "String"
8779
8816
  },
8780
8817
  {
8781
8818
  "name": "stop-propagation",
8782
- "description": "If you have nested pb-popover, set this property to\ronly show the innermost popover when triggered",
8819
+ "description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
8783
8820
  "type": "Boolean",
8784
8821
  "default": "false"
8785
8822
  },
@@ -8819,30 +8856,30 @@
8819
8856
  {
8820
8857
  "name": "remote",
8821
8858
  "attribute": "remote",
8822
- "description": "An optional URL to asynchronously load the popover's content from. Content will\rbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
8859
+ "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
8860
  "type": "String"
8824
8861
  },
8825
8862
  {
8826
8863
  "name": "alternate",
8827
- "description": "Returns the root element of the alternate content currently shown in the popover.\r\nThis will be initialized from either the default slot or the slot with name 'alternate' (if present).\r\nThe returned element is always a `div` and can be modified."
8864
+ "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
8865
  },
8829
8866
  {
8830
8867
  "name": "persistent",
8831
8868
  "attribute": "persistent",
8832
- "description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\runless defined otherwise; clicking anywhere on the page will close the popup.",
8869
+ "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
8870
  "type": "Boolean",
8834
8871
  "default": "false"
8835
8872
  },
8836
8873
  {
8837
8874
  "name": "trigger",
8838
8875
  "attribute": "trigger",
8839
- "description": "Defines one or more actions (space separated) which should cause\rthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
8876
+ "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
8877
  "type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
8841
8878
  },
8842
8879
  {
8843
8880
  "name": "for",
8844
8881
  "attribute": "for",
8845
- "description": "The id of a trigger element (e.g. a link) to which the popover will\rbe attached. If not set, the trigger is the pb-popover itself.",
8882
+ "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
8883
  "type": "String"
8847
8884
  },
8848
8885
  {
@@ -8854,25 +8891,30 @@
8854
8891
  {
8855
8892
  "name": "placement",
8856
8893
  "attribute": "placement",
8857
- "description": "Preferred placement of the popup.\rDefault is 'auto'.",
8894
+ "description": "Preferred placement of the popup.\nDefault is 'auto'.",
8858
8895
  "type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
8859
8896
  },
8897
+ {
8898
+ "name": "touch",
8899
+ "attribute": "touch",
8900
+ "type": "string"
8901
+ },
8860
8902
  {
8861
8903
  "name": "fallbackPlacement",
8862
8904
  "attribute": "fallback-placement",
8863
- "description": "Fallback placement if there is more space on another side.\rAccepts same values as `placement`. Separate by space if more than one.",
8905
+ "description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
8864
8906
  "type": "String"
8865
8907
  },
8866
8908
  {
8867
8909
  "name": "popupClass",
8868
8910
  "attribute": "popup-class",
8869
- "description": "Additional class names which will be added to the popup element.\rUse this to apply a specific style to certain popovers, but not others.",
8911
+ "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
8912
  "type": "String"
8871
8913
  },
8872
8914
  {
8873
8915
  "name": "stopPropagation",
8874
8916
  "attribute": "stop-propagation",
8875
- "description": "If you have nested pb-popover, set this property to\ronly show the innermost popover when triggered",
8917
+ "description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
8876
8918
  "type": "Boolean",
8877
8919
  "default": "false"
8878
8920
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teipublisher/pb-components",
3
- "version": "2.6.1",
3
+ "version": "2.8.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
@@ -5624,7 +5624,7 @@
5624
5624
  {
5625
5625
  "name": "pb-link",
5626
5626
  "path": "./src/pb-link.js",
5627
- "description": "Create an internal link: clicking it will cause connected views to\nupdate and load the corresponding document fragment defined by the\nproperties.",
5627
+ "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.",
5628
5628
  "attributes": [
5629
5629
  {
5630
5630
  "name": "xml-id",
@@ -5657,10 +5657,15 @@
5657
5657
  },
5658
5658
  {
5659
5659
  "name": "history",
5660
- "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.\nOnly use this on one element on the page.",
5660
+ "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.",
5661
5661
  "type": "boolean",
5662
5662
  "default": "true"
5663
5663
  },
5664
+ {
5665
+ "name": "params",
5666
+ "description": "Additional parameters to be passed in the event details.\nShould be specified as a JSON object.",
5667
+ "type": "object"
5668
+ },
5664
5669
  {
5665
5670
  "name": "subscribe",
5666
5671
  "description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
@@ -5732,10 +5737,16 @@
5732
5737
  {
5733
5738
  "name": "history",
5734
5739
  "attribute": "history",
5735
- "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.\nOnly use this on one element on the page.",
5740
+ "description": "Modify browser history: if set, clicking this\nelement will generate a new history entry in the browser's history.",
5736
5741
  "type": "boolean",
5737
5742
  "default": "true"
5738
5743
  },
5744
+ {
5745
+ "name": "params",
5746
+ "attribute": "params",
5747
+ "description": "Additional parameters to be passed in the event details.\nShould be specified as a JSON object.",
5748
+ "type": "object"
5749
+ },
5739
5750
  {
5740
5751
  "name": "subscribe",
5741
5752
  "attribute": "subscribe",
@@ -8160,6 +8171,16 @@
8160
8171
  "type": "string",
8161
8172
  "default": "\".\""
8162
8173
  },
8174
+ {
8175
+ "name": "url-template",
8176
+ "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.",
8177
+ "type": "string"
8178
+ },
8179
+ {
8180
+ "name": "url-ignore",
8181
+ "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.",
8182
+ "type": "string"
8183
+ },
8163
8184
  {
8164
8185
  "name": "url-path",
8165
8186
  "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 +8300,18 @@
8279
8300
  "type": "string",
8280
8301
  "default": "\".\""
8281
8302
  },
8303
+ {
8304
+ "name": "urlTemplate",
8305
+ "attribute": "url-template",
8306
+ "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.",
8307
+ "type": "string"
8308
+ },
8309
+ {
8310
+ "name": "urlIgnore",
8311
+ "attribute": "url-ignore",
8312
+ "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.",
8313
+ "type": "string"
8314
+ },
8282
8315
  {
8283
8316
  "name": "urlPath",
8284
8317
  "attribute": "url-path",
@@ -8734,27 +8767,27 @@
8734
8767
  {
8735
8768
  "name": "pb-popover",
8736
8769
  "path": "./src/pb-popover.js",
8737
- "description": "Show a popover. It may either \r\n\r\n1. be attached to another element on the page which serves as a trigger. For this the\r\n`for` property must be specified and should contain the ID of the trigger element. \r\nThe whole content of the `pb-popover` element will be shown in the popup.\r\n\r\n2. if no `for` property is specified, the `pb-popover` acts itself as the trigger. The trigger\r\ntext is either taken from a slot named `default` - or the default slot (i.e. the content of the element).\r\nThe content to show in the popup should be supplied in a slot named `alternate`. It is recommended to use an\r\nHTML `template` to specify the alternate, so it is ignored by the browser:\r\n\r\n```html\r\n<pb-popover theme=\"material\">\r\n <span slot=\"default\">ipsum dolor sit amet</span>\r\n <template slot=\"alternate\">\r\n <p>At vero eos et <strong>accusam</strong> et justo duo dolores<br>\r\n et ea rebum.</p>\r\n </template>\r\n</pb-popover>\r\n```\r\n\r\nIf you would like popovers to contain nested popovers, choose approach 1 above and use `for`.\r\n\r\nIf property `persistent` is true, the popover will be shown\r\non click. Otherwise display a tooltip on mouseover.\r\n\r\n`pb-popover` uses the tippy.js library for the popup.\r\n\r\n## Styling\r\n\r\nWhen showing the popup, the popup content will either be added to the parent shadow DOM - if the `pb-popover`\r\nis located inside the shadow DOM of another element like `pb-view`; or the document body. This has an\r\neffect on where CSS styles can be defined: within a `pb-view`, only the styles specified inside the\r\nCSS attached to the ODD are applied.",
8770
+ "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
8771
  "attributes": [
8739
8772
  {
8740
8773
  "name": "remote",
8741
- "description": "An optional URL to asynchronously load the popover's content from. Content will\rbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
8774
+ "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
8775
  "type": "String"
8743
8776
  },
8744
8777
  {
8745
8778
  "name": "persistent",
8746
- "description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\runless defined otherwise; clicking anywhere on the page will close the popup.",
8779
+ "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
8780
  "type": "Boolean",
8748
8781
  "default": "false"
8749
8782
  },
8750
8783
  {
8751
8784
  "name": "trigger",
8752
- "description": "Defines one or more actions (space separated) which should cause\rthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
8785
+ "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
8786
  "type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
8754
8787
  },
8755
8788
  {
8756
8789
  "name": "for",
8757
- "description": "The id of a trigger element (e.g. a link) to which the popover will\rbe attached. If not set, the trigger is the pb-popover itself.",
8790
+ "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
8791
  "type": "String"
8759
8792
  },
8760
8793
  {
@@ -8764,22 +8797,26 @@
8764
8797
  },
8765
8798
  {
8766
8799
  "name": "placement",
8767
- "description": "Preferred placement of the popup.\rDefault is 'auto'.",
8800
+ "description": "Preferred placement of the popup.\nDefault is 'auto'.",
8768
8801
  "type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
8769
8802
  },
8803
+ {
8804
+ "name": "touch",
8805
+ "type": "string"
8806
+ },
8770
8807
  {
8771
8808
  "name": "fallback-placement",
8772
- "description": "Fallback placement if there is more space on another side.\rAccepts same values as `placement`. Separate by space if more than one.",
8809
+ "description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
8773
8810
  "type": "String"
8774
8811
  },
8775
8812
  {
8776
8813
  "name": "popup-class",
8777
- "description": "Additional class names which will be added to the popup element.\rUse this to apply a specific style to certain popovers, but not others.",
8814
+ "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
8815
  "type": "String"
8779
8816
  },
8780
8817
  {
8781
8818
  "name": "stop-propagation",
8782
- "description": "If you have nested pb-popover, set this property to\ronly show the innermost popover when triggered",
8819
+ "description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
8783
8820
  "type": "Boolean",
8784
8821
  "default": "false"
8785
8822
  },
@@ -8819,30 +8856,30 @@
8819
8856
  {
8820
8857
  "name": "remote",
8821
8858
  "attribute": "remote",
8822
- "description": "An optional URL to asynchronously load the popover's content from. Content will\rbe loaded after the popover is displayed. The downloaded HTML content will replace the text set via the alternate slot.",
8859
+ "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
8860
  "type": "String"
8824
8861
  },
8825
8862
  {
8826
8863
  "name": "alternate",
8827
- "description": "Returns the root element of the alternate content currently shown in the popover.\r\nThis will be initialized from either the default slot or the slot with name 'alternate' (if present).\r\nThe returned element is always a `div` and can be modified."
8864
+ "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
8865
  },
8829
8866
  {
8830
8867
  "name": "persistent",
8831
8868
  "attribute": "persistent",
8832
- "description": "If true, show the 'hand' cursor when hovering over the link; `trigger` will be set to 'click'\runless defined otherwise; clicking anywhere on the page will close the popup.",
8869
+ "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
8870
  "type": "Boolean",
8834
8871
  "default": "false"
8835
8872
  },
8836
8873
  {
8837
8874
  "name": "trigger",
8838
8875
  "attribute": "trigger",
8839
- "description": "Defines one or more actions (space separated) which should cause\rthe popover to show. If property `persistent` is set, `trigger` will by default be set to `click`.",
8876
+ "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
8877
  "type": "\"click\" | \"mouseenter\" | \"focus\" | \"focusin\""
8841
8878
  },
8842
8879
  {
8843
8880
  "name": "for",
8844
8881
  "attribute": "for",
8845
- "description": "The id of a trigger element (e.g. a link) to which the popover will\rbe attached. If not set, the trigger is the pb-popover itself.",
8882
+ "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
8883
  "type": "String"
8847
8884
  },
8848
8885
  {
@@ -8854,25 +8891,30 @@
8854
8891
  {
8855
8892
  "name": "placement",
8856
8893
  "attribute": "placement",
8857
- "description": "Preferred placement of the popup.\rDefault is 'auto'.",
8894
+ "description": "Preferred placement of the popup.\nDefault is 'auto'.",
8858
8895
  "type": "\"auto\" | \"top\" | \"bottom\" | \"left\" | \"right\""
8859
8896
  },
8897
+ {
8898
+ "name": "touch",
8899
+ "attribute": "touch",
8900
+ "type": "string"
8901
+ },
8860
8902
  {
8861
8903
  "name": "fallbackPlacement",
8862
8904
  "attribute": "fallback-placement",
8863
- "description": "Fallback placement if there is more space on another side.\rAccepts same values as `placement`. Separate by space if more than one.",
8905
+ "description": "Fallback placement if there is more space on another side.\nAccepts same values as `placement`. Separate by space if more than one.",
8864
8906
  "type": "String"
8865
8907
  },
8866
8908
  {
8867
8909
  "name": "popupClass",
8868
8910
  "attribute": "popup-class",
8869
- "description": "Additional class names which will be added to the popup element.\rUse this to apply a specific style to certain popovers, but not others.",
8911
+ "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
8912
  "type": "String"
8871
8913
  },
8872
8914
  {
8873
8915
  "name": "stopPropagation",
8874
8916
  "attribute": "stop-propagation",
8875
- "description": "If you have nested pb-popover, set this property to\ronly show the innermost popover when triggered",
8917
+ "description": "If you have nested pb-popover, set this property to\nonly show the innermost popover when triggered",
8876
8918
  "type": "Boolean",
8877
8919
  "default": "false"
8878
8920
  },
@@ -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
  }
@@ -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
- return this.shadowRoot.getElementById('ironform').serializeForm();
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-link.js CHANGED
@@ -4,8 +4,8 @@ import { pbMixin } from './pb-mixin.js';
4
4
  import { registry } from "./urls.js";
5
5
 
6
6
  /**
7
- * Create an internal link: clicking it will cause connected views to
8
- * update and load the corresponding document fragment defined by the
7
+ * Create an internal link: clicking it will emit a `pb-refresh`event,
8
+ * causing connected views to update and load the corresponding document fragment defined by the
9
9
  * properties.
10
10
  *
11
11
  * @fires pb-refresh - Fires when user clicks the link
@@ -41,10 +41,16 @@ export class PbLink extends pbMixin(LitElement) {
41
41
  view: {
42
42
  type: String
43
43
  },
44
+ /**
45
+ * Additional parameters to be passed in the event details.
46
+ * Should be specified as a JSON object.
47
+ */
48
+ params: {
49
+ type: Object
50
+ },
44
51
  /**
45
52
  * Modify browser history: if set, clicking this
46
53
  * element will generate a new history entry in the browser's history.
47
- * Only use this on one element on the page.
48
54
  */
49
55
  history: {
50
56
  type: Boolean
@@ -55,6 +61,7 @@ export class PbLink extends pbMixin(LitElement) {
55
61
  constructor() {
56
62
  super();
57
63
  this.history = true;
64
+ this.params = null;
58
65
  }
59
66
 
60
67
  connectedCallback() {
@@ -110,6 +117,9 @@ export class PbLink extends pbMixin(LitElement) {
110
117
  if (this.view) {
111
118
  params.view = this.view;
112
119
  }
120
+ if (this.params) {
121
+ Object.assign(params, this.params);
122
+ }
113
123
  if (this.history) {
114
124
  registry.commit(this, params);
115
125
  }
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