@dso-toolkit/core 34.2.1 → 36.1.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.
Files changed (194) hide show
  1. package/dist/cjs/dso-alert.cjs.entry.js +1 -1
  2. package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
  3. package/dist/cjs/dso-autosuggest.cjs.entry.js +7 -3
  4. package/dist/cjs/dso-badge.cjs.entry.js +1 -1
  5. package/dist/cjs/dso-banner.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-date-picker.cjs.entry.js +2 -2
  7. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
  8. package/dist/cjs/dso-header.cjs.entry.js +16 -7
  9. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
  11. package/dist/cjs/dso-icon.cjs.entry.js +1 -1
  12. package/dist/cjs/dso-image-overlay.cjs.entry.js +62 -0
  13. package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
  14. package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
  15. package/dist/cjs/dso-label.cjs.entry.js +1 -1
  16. package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
  17. package/dist/cjs/dso-map-controls.cjs.entry.js +22 -19
  18. package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
  19. package/dist/cjs/dso-ozon-content.cjs.entry.js +289 -419
  20. package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
  21. package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
  22. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
  23. package/dist/cjs/dso-toolkit.cjs.js +3 -3
  24. package/dist/cjs/dso-tooltip.cjs.entry.js +8 -4
  25. package/dist/cjs/dso-tree-view.cjs.entry.js +9 -9
  26. package/dist/cjs/dso-viewer-grid.cjs.entry.js +6 -712
  27. package/dist/cjs/focus-trap.esm-a85643b0.js +746 -0
  28. package/dist/cjs/{index-5ea63531.js → index-dfb4ea62.js} +73 -64
  29. package/dist/cjs/index.esm-3520a2a6.js +427 -0
  30. package/dist/cjs/loader.cjs.js +3 -3
  31. package/dist/collection/collection-manifest.json +3 -2
  32. package/dist/collection/components/alert/alert.template.js +1 -1
  33. package/dist/collection/components/anchor/anchor.template.js +1 -1
  34. package/dist/collection/components/autosuggest/autosuggest.css +1 -1
  35. package/dist/collection/components/autosuggest/autosuggest.js +6 -2
  36. package/dist/collection/components/badge/badge.template.js +1 -1
  37. package/dist/collection/components/button/button.template.js +1 -1
  38. package/dist/collection/components/date-picker/date-picker.css +6 -6
  39. package/dist/collection/components/date-picker/date-picker.template.js +1 -1
  40. package/dist/collection/components/definition-list/definition-list.template.js +2 -2
  41. package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +1 -1
  42. package/dist/collection/components/header/header.css +1 -1
  43. package/dist/collection/components/header/header.js +38 -9
  44. package/dist/collection/components/header/header.template.js +4 -2
  45. package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +2 -2
  46. package/dist/collection/components/highlight-box/highlight-box.template.js +5 -2
  47. package/dist/collection/components/icon/icon.template.js +1 -1
  48. package/dist/collection/components/image-overlay/image-overlay.css +263 -0
  49. package/dist/collection/components/image-overlay/image-overlay.js +72 -0
  50. package/dist/collection/components/image-overlay/image-overlay.template.js +7 -0
  51. package/dist/collection/components/label/label.template.js +2 -2
  52. package/dist/collection/components/list/list.template.js +1 -1
  53. package/dist/collection/components/map-controls/map-controls.js +17 -19
  54. package/dist/collection/components/ozon-content/get-node-name.function.js +9 -0
  55. package/dist/collection/components/ozon-content/nodes/al.node.js +14 -0
  56. package/dist/collection/components/ozon-content/nodes/document.node.js +9 -0
  57. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +15 -0
  58. package/dist/collection/components/ozon-content/nodes/fallback.node.js +11 -0
  59. package/dist/collection/components/ozon-content/nodes/illustratie.node.js +13 -0
  60. package/dist/collection/components/ozon-content/nodes/inhoud.node.js +14 -0
  61. package/dist/collection/components/ozon-content/nodes/inline.nodes.js +21 -0
  62. package/dist/collection/components/ozon-content/nodes/int-ref.node.js +26 -0
  63. package/dist/collection/components/ozon-content/nodes/noot.node.js +27 -0
  64. package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js +39 -0
  65. package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec.interface.js +2 -0
  66. package/dist/collection/components/ozon-content/nodes/table.node/index.js +1 -0
  67. package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js +25 -0
  68. package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js +4 -0
  69. package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js +5 -0
  70. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +32 -0
  71. package/dist/collection/components/ozon-content/nodes/text.node.js +9 -0
  72. package/dist/collection/components/ozon-content/ozon-content-context.interface.js +1 -0
  73. package/dist/collection/components/ozon-content/ozon-content-mapper.js +80 -0
  74. package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js +1 -0
  75. package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js +1 -0
  76. package/dist/collection/components/ozon-content/ozon-content-node.interface.js +1 -0
  77. package/dist/collection/components/ozon-content/ozon-content.css +84 -23
  78. package/dist/collection/components/ozon-content/ozon-content.js +21 -33
  79. package/dist/collection/components/progress-bar/progress-bar.template.js +1 -1
  80. package/dist/collection/components/progress-indicator/progress-indicator.template.js +1 -1
  81. package/dist/collection/components/selectable/selectable.css +7 -1
  82. package/dist/collection/components/selectable/selectable.template.js +1 -1
  83. package/dist/collection/components/toggletip/toggletip.template.js +2 -2
  84. package/dist/collection/components/tooltip/tooltip.css +1 -1
  85. package/dist/collection/components/tooltip/tooltip.template.js +1 -1
  86. package/dist/collection/components/tree-view/tree-item.js +7 -7
  87. package/dist/collection/components/tree-view/tree-view.css +86 -15
  88. package/dist/collection/components/viewer-grid/viewer-grid.css +32 -4
  89. package/dist/custom-elements/index.d.ts +6 -0
  90. package/dist/custom-elements/index.js +1541 -1400
  91. package/dist/dso-toolkit/dso-toolkit.css +1 -1
  92. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  93. package/dist/dso-toolkit/p-016ed5a8.entry.js +1 -0
  94. package/dist/dso-toolkit/p-0216f283.entry.js +1 -0
  95. package/dist/dso-toolkit/{p-348414bf.entry.js → p-09bcacd0.entry.js} +1 -1
  96. package/dist/dso-toolkit/{p-2b6a3dfa.entry.js → p-117a31fe.entry.js} +1 -1
  97. package/dist/dso-toolkit/p-131d54e3.js +5 -0
  98. package/dist/dso-toolkit/{p-50b63cf4.entry.js → p-1eeadd3e.entry.js} +1 -1
  99. package/dist/dso-toolkit/{p-ad540748.entry.js → p-2279329b.entry.js} +1 -1
  100. package/dist/dso-toolkit/p-258e8371.entry.js +1 -0
  101. package/dist/dso-toolkit/{p-bc14cafd.entry.js → p-3ced438e.entry.js} +1 -1
  102. package/dist/dso-toolkit/{p-c54ecae1.entry.js → p-406b179d.entry.js} +1 -1
  103. package/dist/dso-toolkit/p-4b5f6b4c.entry.js +1 -0
  104. package/dist/dso-toolkit/{p-3b493a2c.entry.js → p-527a85b6.entry.js} +1 -1
  105. package/dist/dso-toolkit/{p-94dffa65.entry.js → p-52f159e7.entry.js} +1 -1
  106. package/dist/dso-toolkit/{p-dc86d830.entry.js → p-58f5e092.entry.js} +1 -1
  107. package/dist/dso-toolkit/p-5e5fbd41.js +5 -0
  108. package/dist/dso-toolkit/{p-f0b67246.entry.js → p-639228f6.entry.js} +1 -1
  109. package/dist/dso-toolkit/{p-951f5872.entry.js → p-6a8452bd.entry.js} +1 -1
  110. package/dist/dso-toolkit/{p-4e573fc5.entry.js → p-98ef5f8c.entry.js} +1 -1
  111. package/dist/dso-toolkit/{p-94b79e43.entry.js → p-a1c9bb35.entry.js} +1 -1
  112. package/dist/dso-toolkit/{p-3c4dbd89.entry.js → p-a5008a4e.entry.js} +1 -1
  113. package/dist/dso-toolkit/{p-c95108fe.entry.js → p-a59dcbb0.entry.js} +1 -1
  114. package/dist/dso-toolkit/p-b06c275a.entry.js +1 -0
  115. package/dist/dso-toolkit/p-b4222d6e.entry.js +1 -0
  116. package/dist/dso-toolkit/{p-dad72605.js → p-b9eb3491.js} +1 -1
  117. package/dist/dso-toolkit/p-bec38cf5.entry.js +1 -0
  118. package/dist/dso-toolkit/{p-ad2210ad.entry.js → p-d0d3ca99.entry.js} +1 -1
  119. package/dist/dso-toolkit/{p-5037944e.entry.js → p-d72edd80.entry.js} +1 -1
  120. package/dist/dso-toolkit/{p-1fefbf8c.entry.js → p-e1934ab6.entry.js} +1 -1
  121. package/dist/esm/dso-alert.entry.js +1 -1
  122. package/dist/esm/dso-attachments-counter.entry.js +1 -1
  123. package/dist/esm/dso-autosuggest.entry.js +7 -3
  124. package/dist/esm/dso-badge.entry.js +1 -1
  125. package/dist/esm/dso-banner.entry.js +1 -1
  126. package/dist/esm/dso-date-picker.entry.js +2 -2
  127. package/dist/esm/dso-dropdown-menu.entry.js +2 -2
  128. package/dist/esm/dso-header.entry.js +16 -7
  129. package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
  130. package/dist/esm/dso-highlight-box.entry.js +1 -1
  131. package/dist/esm/dso-icon.entry.js +1 -1
  132. package/dist/esm/dso-image-overlay.entry.js +58 -0
  133. package/dist/esm/dso-info-button.entry.js +1 -1
  134. package/dist/esm/dso-info_2.entry.js +2 -2
  135. package/dist/esm/dso-label.entry.js +1 -1
  136. package/dist/esm/dso-map-base-layers.entry.js +1 -1
  137. package/dist/esm/dso-map-controls.entry.js +22 -19
  138. package/dist/esm/dso-map-overlays.entry.js +1 -1
  139. package/dist/esm/dso-ozon-content.entry.js +289 -419
  140. package/dist/esm/dso-progress-bar.entry.js +1 -1
  141. package/dist/esm/dso-progress-indicator.entry.js +1 -1
  142. package/dist/esm/dso-toggletip.entry.js +1 -1
  143. package/dist/esm/dso-toolkit.js +3 -3
  144. package/dist/esm/dso-tooltip.entry.js +8 -4
  145. package/dist/esm/dso-tree-view.entry.js +9 -9
  146. package/dist/esm/dso-viewer-grid.entry.js +4 -710
  147. package/dist/esm/focus-trap.esm-a01ad6c9.js +744 -0
  148. package/dist/esm/{index-d54cae76.js → index-9ec8c07f.js} +73 -64
  149. package/dist/esm/index.esm-45465af7.js +422 -0
  150. package/dist/esm/loader.js +3 -3
  151. package/dist/types/components/autosuggest/autosuggest.d.ts +15 -1
  152. package/dist/types/components/header/header.d.ts +7 -1
  153. package/dist/types/components/header/header.template.d.ts +1 -1
  154. package/dist/types/components/image-overlay/image-overlay.d.ts +15 -0
  155. package/dist/types/components/image-overlay/image-overlay.template.d.ts +2 -0
  156. package/dist/types/components/ozon-content/get-node-name.function.d.ts +1 -0
  157. package/dist/types/components/ozon-content/nodes/al.node.d.ts +6 -0
  158. package/dist/types/components/ozon-content/nodes/document.node.d.ts +6 -0
  159. package/dist/types/components/ozon-content/nodes/ext-ref.node.d.ts +6 -0
  160. package/dist/types/components/ozon-content/nodes/fallback.node.d.ts +6 -0
  161. package/dist/types/components/ozon-content/nodes/illustratie.node.d.ts +5 -0
  162. package/dist/types/components/ozon-content/nodes/inhoud.node.d.ts +6 -0
  163. package/dist/types/components/ozon-content/nodes/inline.nodes.d.ts +6 -0
  164. package/dist/types/components/ozon-content/nodes/int-ref.node.d.ts +6 -0
  165. package/dist/types/components/ozon-content/nodes/noot.node.d.ts +8 -0
  166. package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec-mapper.d.ts +2 -0
  167. package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec.interface.d.ts +10 -0
  168. package/dist/types/components/ozon-content/nodes/table.node/index.d.ts +1 -0
  169. package/dist/types/components/ozon-content/nodes/table.node/table-cell.d.ts +8 -0
  170. package/dist/types/components/ozon-content/nodes/table.node/table-colgroup.d.ts +5 -0
  171. package/dist/types/components/ozon-content/nodes/table.node/table-rows.d.ts +8 -0
  172. package/dist/types/components/ozon-content/nodes/table.node/table.node.d.ts +7 -0
  173. package/dist/types/components/ozon-content/nodes/text.node.d.ts +5 -0
  174. package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +8 -0
  175. package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +11 -0
  176. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +7 -0
  177. package/dist/types/components/ozon-content/ozon-content-node-state.interface.d.ts +3 -0
  178. package/dist/types/components/ozon-content/ozon-content-node.interface.d.ts +7 -0
  179. package/dist/types/components/ozon-content/ozon-content.d.ts +7 -10
  180. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +2 -2
  181. package/dist/types/components.d.ts +22 -8
  182. package/dist/types/icon/dso-icon-sass-function.d.ts +1 -1
  183. package/package.json +31 -27
  184. package/dist/cjs/index.esm-2ac7081c.js +0 -267
  185. package/dist/collection/components/ozon-content/ozon-content.transformer.js +0 -105
  186. package/dist/dso-toolkit/p-20856f91.entry.js +0 -1
  187. package/dist/dso-toolkit/p-88bc5873.entry.js +0 -1
  188. package/dist/dso-toolkit/p-8b6e3abc.entry.js +0 -1
  189. package/dist/dso-toolkit/p-8bf3a60e.js +0 -5
  190. package/dist/dso-toolkit/p-a7306b7b.entry.js +0 -1
  191. package/dist/dso-toolkit/p-daa1e29d.entry.js +0 -1
  192. package/dist/dso-toolkit/p-de3ab027.entry.js +0 -5
  193. package/dist/esm/index.esm-a1362957.js +0 -262
  194. package/dist/types/components/ozon-content/ozon-content.transformer.d.ts +0 -15
@@ -1,6 +1,6 @@
1
1
  import { html, nothing } from 'lit-html';
2
- import { ifDefined } from 'lit-html/directives/if-defined';
3
- import { unsafeHTML } from 'lit-html/directives/unsafe-html';
2
+ import { ifDefined } from 'lit-html/directives/if-defined.js';
3
+ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
4
4
  export function labelTemplate({ status, label, button, compact, symbol }) {
5
5
  return html `
6
6
  <dso-label
@@ -1,7 +1,7 @@
1
1
  // Keep in sync with packages\css\src\components\list\list.template.ts (https://github.com/dso-toolkit/dso-toolkit/issues/1438)
2
2
  import { Type } from '@dso-toolkit/sources';
3
3
  import { html } from 'lit-html';
4
- import { classMap } from 'lit-html/directives/class-map';
4
+ import { classMap } from 'lit-html/directives/class-map.js';
5
5
  function ul(children, modifier) {
6
6
  return html `
7
7
  <ul class="${classMap({
@@ -1,41 +1,39 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
2
- if (!privateMap.has(receiver)) {
3
- throw new TypeError("attempted to get private field on non-instance");
4
- }
5
- return privateMap.get(receiver);
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
5
  };
7
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
8
- if (!privateMap.has(receiver)) {
9
- throw new TypeError("attempted to set private field on non-instance");
10
- }
11
- privateMap.set(receiver, value);
12
- return value;
6
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
+ if (kind === "m") throw new TypeError("Private method is not writable");
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
13
11
  };
14
- var _closeButtonElement, _toggleButtonElement;
12
+ var _MapControls_closeButtonElement, _MapControls_toggleButtonElement;
15
13
  import { Component, h, Host, Prop, Event, State, Watch } from '@stencil/core';
16
14
  const transitionDuration = 300; // Sync with $transition-duration in ./map-controls.scss
17
15
  export class MapControls {
18
16
  constructor() {
19
17
  this.open = false;
20
18
  this.hideContent = !this.open;
21
- _closeButtonElement.set(this, void 0);
22
- _toggleButtonElement.set(this, void 0);
19
+ _MapControls_closeButtonElement.set(this, void 0);
20
+ _MapControls_toggleButtonElement.set(this, void 0);
23
21
  }
24
22
  watchOpen(open) {
25
23
  if (open) {
26
24
  this.hideContent = false;
27
- setTimeout(() => __classPrivateFieldGet(this, _closeButtonElement).focus(), transitionDuration);
25
+ setTimeout(() => __classPrivateFieldGet(this, _MapControls_closeButtonElement, "f").focus(), transitionDuration);
28
26
  }
29
27
  else {
30
28
  setTimeout(() => {
31
29
  this.hideContent = true;
32
- __classPrivateFieldGet(this, _toggleButtonElement).focus();
30
+ __classPrivateFieldGet(this, _MapControls_toggleButtonElement, "f").focus();
33
31
  }, transitionDuration);
34
32
  }
35
33
  }
36
34
  render() {
37
35
  return (h(Host, null,
38
- h("button", { type: "button", id: "toggle-visibility-button", onClick: () => this.open = !this.open, ref: element => __classPrivateFieldSet(this, _toggleButtonElement, element) },
36
+ h("button", { type: "button", id: "toggle-visibility-button", onClick: () => this.open = !this.open, ref: element => __classPrivateFieldSet(this, _MapControls_toggleButtonElement, element, "f") },
39
37
  h("dso-icon", { icon: "layers" }),
40
38
  h("span", null, "Kaartlagen")),
41
39
  h("div", { id: "zoom-buttons" },
@@ -48,7 +46,7 @@ export class MapControls {
48
46
  h("section", { hidden: this.hideContent },
49
47
  h("header", null,
50
48
  h("h2", null, "Kaartlagen"),
51
- h("button", { type: "button", id: "close-button", onClick: () => this.open = false, ref: element => __classPrivateFieldSet(this, _closeButtonElement, element) },
49
+ h("button", { type: "button", id: "close-button", onClick: () => this.open = false, ref: element => __classPrivateFieldSet(this, _MapControls_closeButtonElement, element, "f") },
52
50
  h("span", null, "Sluit dialoog"),
53
51
  h("dso-icon", { icon: "times" }))),
54
52
  h("div", { class: "content" },
@@ -146,4 +144,4 @@ export class MapControls {
146
144
  "methodName": "watchOpen"
147
145
  }]; }
148
146
  }
149
- _closeButtonElement = new WeakMap(), _toggleButtonElement = new WeakMap();
147
+ _MapControls_closeButtonElement = new WeakMap(), _MapControls_toggleButtonElement = new WeakMap();
@@ -0,0 +1,9 @@
1
+ export function getNodeName(node) {
2
+ if (node instanceof Element) {
3
+ return node.localName;
4
+ }
5
+ if (node.nodeName.includes(':')) {
6
+ return node.nodeName.substring(node.nodeName.indexOf(':') + 1);
7
+ }
8
+ return node.nodeName;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ import { getNodeName } from '../get-node-name.function';
3
+ export class OzonContentAlNode {
4
+ constructor() {
5
+ this.name = 'Al';
6
+ }
7
+ render(node, { mapNodeToJsx, path }) {
8
+ const nestedAl = path.some(node => getNodeName(node) === 'Al');
9
+ const content = mapNodeToJsx(node.childNodes);
10
+ return nestedAl
11
+ ? h("span", { role: "paragraph" }, content)
12
+ : h("p", null, content);
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ export class OzonContentDocumentNode {
3
+ constructor() {
4
+ this.name = '#document';
5
+ }
6
+ render(node, { mapNodeToJsx }) {
7
+ return h(Fragment, null, mapNodeToJsx(node.childNodes));
8
+ }
9
+ }
@@ -0,0 +1,15 @@
1
+ import { h } from '@stencil/core';
2
+ export class OzonContentExtRefNode {
3
+ constructor() {
4
+ this.name = [
5
+ 'ExtRef',
6
+ 'ExtIoRef'
7
+ ];
8
+ }
9
+ render(node, { mapNodeToJsx }) {
10
+ var _a;
11
+ return (h("a", { target: "_blank", rel: "noopener noreferrer", href: (_a = node.getAttribute('ref')) !== null && _a !== void 0 ? _a : undefined },
12
+ h("span", { class: "sr-only" }, "opent in nieuw venster"),
13
+ mapNodeToJsx(node.childNodes)));
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ import { h } from '@stencil/core';
2
+ import { getNodeName } from '../get-node-name.function';
3
+ export class OzonContentFallbackNode {
4
+ constructor() {
5
+ // This name does not match any elements
6
+ this.name = ['<fallback>'];
7
+ }
8
+ render(node, { mapNodeToJsx }) {
9
+ return (h("span", { class: `fallback od-${getNodeName(node)}` }, mapNodeToJsx(node.childNodes)));
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ import { h } from '@stencil/core';
2
+ export class OzonContentIllustratieNode {
3
+ constructor() {
4
+ this.name = [
5
+ 'Illustratie',
6
+ 'InlineTekstAfbeelding'
7
+ ];
8
+ }
9
+ render(node) {
10
+ var _a, _b, _c, _d;
11
+ return (h("img", { src: (_a = node.getAttribute('naam')) !== null && _a !== void 0 ? _a : undefined, alt: (_b = node.getAttribute('naam')) !== null && _b !== void 0 ? _b : undefined, height: (_c = node.getAttribute('hoogte')) !== null && _c !== void 0 ? _c : undefined, width: (_d = node.getAttribute('breedte')) !== null && _d !== void 0 ? _d : undefined }));
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ export class OzonContentInhoudNode {
3
+ constructor() {
4
+ this.name = [
5
+ 'Inhoud',
6
+ 'Opschrift',
7
+ 'ContainerBlocksType',
8
+ 'BlockMixedcontentMetMaximaleInlinesMarkersPopupsType'
9
+ ];
10
+ }
11
+ render(node, { mapNodeToJsx }) {
12
+ return h("div", { class: "dso-rich-content" }, mapNodeToJsx(node.childNodes));
13
+ }
14
+ }
@@ -0,0 +1,21 @@
1
+ import { h } from '@stencil/core';
2
+ export class OzonContentInlineNodes {
3
+ constructor() {
4
+ this.name = [
5
+ 'sub',
6
+ 'sup',
7
+ 'strong',
8
+ 'b',
9
+ 'u',
10
+ 'i',
11
+ 'br'
12
+ ];
13
+ }
14
+ render(node, { mapNodeToJsx }) {
15
+ if (node.localName === 'br') {
16
+ return h("br", null);
17
+ }
18
+ const Tag = node.localName;
19
+ return h(Tag, null, mapNodeToJsx(node.childNodes));
20
+ }
21
+ }
@@ -0,0 +1,26 @@
1
+ import { h } from '@stencil/core';
2
+ export class OzonContentIntRefNode {
3
+ constructor() {
4
+ this.name = 'IntRef';
5
+ }
6
+ render(node, { mapNodeToJsx, emitAnchorClick }) {
7
+ const ref = node.getAttribute('ref');
8
+ if (!ref) {
9
+ return mapNodeToJsx(node.childNodes);
10
+ }
11
+ const intRefOnClick = (event) => {
12
+ event.preventDefault();
13
+ const target = event.currentTarget;
14
+ if (!(target instanceof HTMLAnchorElement)) {
15
+ return;
16
+ }
17
+ const { href } = target;
18
+ emitAnchorClick({
19
+ href,
20
+ documentComponent: ref,
21
+ originalEvent: event
22
+ });
23
+ };
24
+ return (h("a", { href: `#${ref}`, onClick: intRefOnClick }, mapNodeToJsx(node.childNodes)));
25
+ }
26
+ }
@@ -0,0 +1,27 @@
1
+ import { h, Fragment } from '@stencil/core';
2
+ import { getNodeName } from '../get-node-name.function';
3
+ export class OzonContentNootNode {
4
+ constructor() {
5
+ this.name = 'Noot';
6
+ this.handles = ['NootNummer'];
7
+ }
8
+ identify() {
9
+ return 'Noot';
10
+ }
11
+ render(node, { mapNodeToJsx, state: openNoteId, setState }) {
12
+ var _a, _b;
13
+ const noteId = node.getAttribute('id');
14
+ if (!noteId) {
15
+ console.error('Noot node without id', node);
16
+ return h(Fragment, null);
17
+ }
18
+ const noteControlsId = `dso-ozon-note-${noteId}`;
19
+ const childNodes = Array.from(node.childNodes);
20
+ const nootNummer = (_b = (_a = childNodes.find(n => getNodeName(n) === 'NootNummer')) === null || _a === void 0 ? void 0 : _a.textContent) !== null && _b !== void 0 ? _b : noteId;
21
+ return (h(Fragment, null,
22
+ h("sup", null,
23
+ h("button", { type: "button", class: "toggle-note", id: noteControlsId, onClick: () => setState === null || setState === void 0 ? void 0 : setState(openNoteId === noteId ? undefined : noteId), onBlur: () => setState === null || setState === void 0 ? void 0 : setState(undefined), "aria-expanded": openNoteId === noteId ? 'true' : 'false' }, nootNummer)),
24
+ h("dso-tooltip", { active: openNoteId === noteId, for: noteControlsId, stateless: true },
25
+ h("span", { role: "section" }, mapNodeToJsx(Array.from(node.querySelectorAll(':scope > Al')))))));
26
+ }
27
+ }
@@ -0,0 +1,39 @@
1
+ export function mapColspecs(count, nodeList) {
2
+ const elements = Array.from(nodeList);
3
+ const totalWidth = getTotalWidth(elements);
4
+ return {
5
+ totalWidth,
6
+ count,
7
+ columns: elements.map((element, index) => {
8
+ var _a;
9
+ const colNumber = element.getAttribute('colnum');
10
+ return {
11
+ name: (_a = element.getAttribute('colname')) !== null && _a !== void 0 ? _a : '',
12
+ number: colNumber ? parseInt(colNumber, 10) : index + 1,
13
+ width: getWidth(totalWidth, element)
14
+ };
15
+ })
16
+ };
17
+ }
18
+ function getTotalWidth(elements) {
19
+ return elements.reduce((totalWidth, element) => {
20
+ var _a, _b;
21
+ const width = (_b = (_a = element.getAttribute('colwidth')) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/, '')) !== null && _b !== void 0 ? _b : '';
22
+ const colWidth = parseInt(width, 10);
23
+ return totalWidth + (isNaN(colWidth) ? 0 : colWidth);
24
+ }, 0);
25
+ }
26
+ function getWidth(totalWidth, element) {
27
+ const width = element.getAttribute('colwidth');
28
+ if (!width) {
29
+ return undefined;
30
+ }
31
+ if (width === '*') {
32
+ return '100%';
33
+ }
34
+ if (width.includes('*') || width.match(/^[\d+]$/)) {
35
+ const colWidth = parseInt(width.replace(/[^0-9]/, ''), 10);
36
+ return `${Math.round(colWidth / totalWidth * 100)}%`;
37
+ }
38
+ return width;
39
+ }
@@ -0,0 +1 @@
1
+ export { OzonContentTableNode } from './table.node';
@@ -0,0 +1,25 @@
1
+ import { h } from '@stencil/core/internal';
2
+ function getData(cell) {
3
+ return {
4
+ moreRows: cell.getAttribute('morerows'),
5
+ nameStart: cell.getAttribute('namest'),
6
+ nameEnd: cell.getAttribute('nameend')
7
+ };
8
+ }
9
+ function getColspan({ columns }, nameStart, nameEnd) {
10
+ const colspecStart = columns.find(c => c.name === nameStart);
11
+ const colspecEnd = columns.find(c => c.name === nameEnd);
12
+ if (!colspecStart || !colspecEnd) {
13
+ return undefined;
14
+ }
15
+ const colspan = colspecEnd.number - colspecStart.number + 1;
16
+ return colspan === 1 ? undefined : colspan;
17
+ }
18
+ export const Cell = ({ context: { mapNodeToJsx }, colspecs, cell }) => {
19
+ const { moreRows, nameStart, nameEnd } = getData(cell);
20
+ const td = {
21
+ rowSpan: moreRows ? parseInt(moreRows, 10) + 1 : undefined,
22
+ colSpan: colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined
23
+ };
24
+ return (h("td", Object.assign({}, td), mapNodeToJsx(cell.childNodes)));
25
+ };
@@ -0,0 +1,4 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ export const Colgroup = ({ colspecs }) => (colspecs.columns.length > 0
3
+ ? (h("colgroup", null, colspecs.columns.map(colspec => (h("col", { style: { width: colspec.width } })))))
4
+ : h(Fragment, null));
@@ -0,0 +1,5 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ import { Cell } from './table-cell';
3
+ export const Rows = ({ context, colspecs, rows }) => {
4
+ return (h(Fragment, null, rows.map(row => (h("tr", null, Array.from(row.children).map(cell => (h(Cell, { cell: cell, colspecs: colspecs, context: context }))))))));
5
+ };
@@ -0,0 +1,32 @@
1
+ import { h } from '@stencil/core';
2
+ import { mapColspecs } from './colspec/colspec-mapper';
3
+ import { Colgroup } from './table-colgroup';
4
+ import { Rows } from './table-rows';
5
+ function mapData(node) {
6
+ var _a, _b, _c;
7
+ const tgroup = node.querySelector(':scope > tgroup');
8
+ const colAttribute = (_a = tgroup === null || tgroup === void 0 ? void 0 : tgroup.getAttribute('cols')) !== null && _a !== void 0 ? _a : undefined;
9
+ const columnCount = colAttribute ? parseInt(colAttribute, 10) : undefined;
10
+ return {
11
+ caption: (_c = (_b = node.querySelector(':scope > title')) === null || _b === void 0 ? void 0 : _b.textContent) !== null && _c !== void 0 ? _c : undefined,
12
+ colspecs: tgroup && columnCount ? mapColspecs(columnCount, tgroup.querySelectorAll(':scope > colspec')) : undefined,
13
+ headRows: Array.from(node.querySelectorAll(':scope > tgroup > thead > row')),
14
+ bodyRows: Array.from(node.querySelectorAll(':scope > tgroup > tbody > row'))
15
+ };
16
+ }
17
+ export class OzonContentTableNode {
18
+ constructor() {
19
+ this.name = 'table';
20
+ this.handles = ['title', 'tgroup', 'colspec', 'thead', 'tbody', 'row', 'cell'];
21
+ }
22
+ render(node, context) {
23
+ const { caption, colspecs, headRows, bodyRows } = mapData(node);
24
+ return (h("table", { class: "table" },
25
+ caption && (h("caption", null, caption)),
26
+ colspecs && (h(Colgroup, { colspecs: colspecs })),
27
+ headRows.length > 0 && (h("thead", null,
28
+ h(Rows, { rows: headRows, colspecs: colspecs, context: context }))),
29
+ bodyRows.length > 0 && (h("tbody", null,
30
+ h(Rows, { rows: bodyRows, colspecs: colspecs, context: context })))));
31
+ }
32
+ }
@@ -0,0 +1,9 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ export class OzonContentTextNode {
3
+ constructor() {
4
+ this.name = '#text';
5
+ }
6
+ render(node) {
7
+ return h(Fragment, null, node.textContent);
8
+ }
9
+ }
@@ -0,0 +1,80 @@
1
+ import { Fragment, h } from '@stencil/core';
2
+ import { OzonContentAlNode } from './nodes/al.node';
3
+ import { OzonContentDocumentNode } from './nodes/document.node';
4
+ import { OzonContentExtRefNode } from './nodes/ext-ref.node';
5
+ import { OzonContentIllustratieNode } from './nodes/illustratie.node';
6
+ import { OzonContentInhoudNode } from './nodes/inhoud.node';
7
+ import { OzonContentInlineNodes } from './nodes/inline.nodes';
8
+ import { OzonContentIntRefNode } from './nodes/int-ref.node';
9
+ import { OzonContentNootNode } from './nodes/noot.node';
10
+ import { OzonContentTableNode } from './nodes/table.node';
11
+ import { OzonContentTextNode } from './nodes/text.node';
12
+ import { getNodeName } from './get-node-name.function';
13
+ import { OzonContentFallbackNode } from './nodes/fallback.node';
14
+ export class Mapper {
15
+ constructor() {
16
+ this.mappers = [
17
+ new OzonContentTextNode(),
18
+ new OzonContentDocumentNode(),
19
+ new OzonContentInhoudNode(),
20
+ new OzonContentIntRefNode(),
21
+ new OzonContentExtRefNode(),
22
+ new OzonContentAlNode(),
23
+ new OzonContentInlineNodes(),
24
+ new OzonContentIllustratieNode(),
25
+ new OzonContentNootNode(),
26
+ new OzonContentTableNode()
27
+ ];
28
+ this.skip = this.mappers.reduce((t, m) => {
29
+ if (m.handles) {
30
+ t.push(...m.handles);
31
+ }
32
+ return t;
33
+ }, []);
34
+ this.fallbackNode = new OzonContentFallbackNode();
35
+ this.domParser = new DOMParser();
36
+ }
37
+ findMapper(name) {
38
+ var _a;
39
+ if (this.skip.includes(name)) {
40
+ return undefined;
41
+ }
42
+ return (_a = this.mappers.find(m => {
43
+ if (Array.isArray(m.name)) {
44
+ return m.name.includes(name);
45
+ }
46
+ return m.name === name;
47
+ })) !== null && _a !== void 0 ? _a : this.fallbackNode;
48
+ }
49
+ mapNodeToJsx(node, context, path) {
50
+ var _a;
51
+ if (node instanceof NodeList) {
52
+ return h(Fragment, null, Array.from(node).map(n => this.mapNodeToJsx(n, context, path)));
53
+ }
54
+ if (Array.isArray(node)) {
55
+ return h(Fragment, null, node.map(n => this.mapNodeToJsx(n, context, path)));
56
+ }
57
+ const nodeName = getNodeName(node);
58
+ const mapper = this.findMapper(nodeName);
59
+ if (!mapper) {
60
+ return h(Fragment, null);
61
+ }
62
+ const identity = (_a = mapper.identify) === null || _a === void 0 ? void 0 : _a.call(mapper, node);
63
+ const state = identity ? context.state[identity] : undefined;
64
+ const setState = identity ? (state) => context.setState(Object.assign(Object.assign({}, context.state), { [identity]: state })) : undefined;
65
+ return mapper.render(node, {
66
+ mapNodeToJsx: n => this.mapNodeToJsx(n, context, [...path, node]),
67
+ emitAnchorClick: context.emitAnchorClick,
68
+ setState,
69
+ state,
70
+ path
71
+ });
72
+ }
73
+ transform(xml, context) {
74
+ if (!this.cache || this.cache.xml !== xml) {
75
+ this.cache = { xml, document: this.domParser.parseFromString(xml, 'text/xml') };
76
+ }
77
+ const xmlDocument = this.cache.document;
78
+ return this.mapNodeToJsx(xmlDocument.getRootNode(), context, []);
79
+ }
80
+ }
@@ -1,42 +1,103 @@
1
- dso-ozon-content {
1
+ :host {
2
2
  display: block;
3
3
  }
4
4
 
5
- .noot {
5
+ button.toggle-note {
6
+ display: inline-block;
7
+ font-size: 1em;
8
+ font-weight: 500;
9
+ margin-bottom: 0;
6
10
  text-decoration: none;
11
+ touch-action: manipulation;
12
+ text-align: left;
13
+ user-select: none;
14
+ vertical-align: middle;
15
+ border: 0;
16
+ color: #39870c;
17
+ line-height: 1;
18
+ padding: 0;
19
+ background-color: transparent;
20
+ }
21
+ button.toggle-note:focus, button.toggle-note:focus-visible {
22
+ outline-offset: 2px;
23
+ }
24
+ button.toggle-note:active {
25
+ outline: 0;
26
+ }
27
+ button.toggle-note.extern::after, button.toggle-note.download::after {
28
+ content: "";
29
+ display: inline-block;
30
+ height: 1.5em;
31
+ margin-left: 8px;
32
+ vertical-align: top;
33
+ width: 1.5em;
7
34
  }
8
- .noot:not(.dso-open) + .od-Al {
9
- display: none;
35
+ button.toggle-note[disabled] {
36
+ color: #afcf9d;
10
37
  }
11
- .noot.dso-open + .od-Al {
12
- display: block;
38
+ button.toggle-note:not([disabled]):hover {
39
+ color: #676cb0;
40
+ text-decoration: underline;
41
+ }
42
+ button.toggle-note:not([disabled]):active {
43
+ color: #676cb0;
13
44
  }
14
- .noot + .od-Al {
15
- margin: 4px 0;
16
- padding: 8px 32px 8px 8px;
45
+ button.toggle-note.btn-align {
46
+ line-height: calc(1.5em - 1px);
47
+ padding: 11px 0;
17
48
  position: relative;
18
49
  }
19
- .noot + .od-Al > a {
20
- display: block;
21
- height: 24px;
22
- position: absolute;
23
- right: 0;
24
- text-align: center;
25
- top: 0;
26
- width: 24px;
27
- }
28
- .noot + .od-Al > a::before {
29
- background: var(--dso-icon, var(--di-times-zwart)) no-repeat;
50
+ button.toggle-note.extern::after, button.toggle-note.download::after {
51
+ position: relative;
52
+ top: -2px;
53
+ }
54
+ button.toggle-note.download::after {
55
+ background: var(--dso-icon, var(--di-download)) no-repeat;
30
56
  background-position: center;
31
57
  background-size: cover;
32
58
  height: 1.5em;
33
59
  vertical-align: top;
34
60
  width: 1.5em;
35
- content: "";
61
+ }
62
+ button.toggle-note.download[disabled]::after {
63
+ --dso-icon: var(--di-download-grasgroen-40);
64
+ }
65
+ button.toggle-note.download:not([disabled]):hover::after, button.toggle-note.download:not([disabled]):active::after {
66
+ --dso-icon: var(--di-download-scampi);
67
+ }
68
+ button.toggle-note.extern::after {
69
+ background: var(--dso-icon, var(--di-external-link)) no-repeat;
70
+ background-position: center;
71
+ background-size: cover;
72
+ height: 1.5em;
73
+ vertical-align: top;
74
+ width: 1.5em;
75
+ }
76
+ button.toggle-note.extern[disabled]::after {
77
+ --dso-icon: var(--di-external-link-grasgroen-40);
78
+ }
79
+ button.toggle-note.extern:not([disabled]):hover::after, button.toggle-note.extern:not([disabled]):active::after {
80
+ --dso-icon: var(--di-external-link-scampi);
81
+ }
82
+ button.toggle-note dso-icon + span:not(.sr-only),
83
+ button.toggle-note svg.di + span:not(.sr-only),
84
+ button.toggle-note span:not(.sr-only) + dso-icon,
85
+ button.toggle-note span:not(.sr-only) + svg.di {
86
+ margin-left: 8px;
87
+ }
88
+ button.toggle-note dso-icon,
89
+ button.toggle-note svg.di,
90
+ button.toggle-note span {
91
+ vertical-align: middle;
92
+ }
93
+
94
+ span[role=section],
95
+ span[role=paragraph] {
36
96
  display: block;
37
97
  }
38
- .noot + .od-Al {
39
- background-color: #ebf3e6;
98
+
99
+ .fallback {
100
+ display: block;
40
101
  }
41
102
 
42
103
  .od-Term {