@dso-toolkit/core 34.2.0 → 36.0.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/dist/cjs/dso-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +7 -3
- package/dist/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
- package/dist/cjs/dso-header.cjs.entry.js +16 -7
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-image-overlay.cjs.entry.js +62 -0
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-label.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-controls.cjs.entry.js +22 -19
- package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +289 -419
- package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +3 -3
- package/dist/cjs/dso-tooltip.cjs.entry.js +8 -4
- package/dist/cjs/dso-tree-view.cjs.entry.js +9 -9
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +6 -712
- package/dist/cjs/focus-trap.esm-a85643b0.js +746 -0
- package/dist/cjs/{index-5ea63531.js → index-dfb4ea62.js} +73 -64
- package/dist/cjs/index.esm-3520a2a6.js +427 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/alert/alert.template.js +1 -1
- package/dist/collection/components/anchor/anchor.template.js +1 -1
- package/dist/collection/components/autosuggest/autosuggest.css +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js +6 -2
- package/dist/collection/components/badge/badge.template.js +1 -1
- package/dist/collection/components/button/button.template.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +6 -6
- package/dist/collection/components/date-picker/date-picker.template.js +1 -1
- package/dist/collection/components/definition-list/definition-list.template.js +2 -2
- package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +1 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +38 -9
- package/dist/collection/components/header/header.template.js +4 -2
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +2 -2
- package/dist/collection/components/highlight-box/highlight-box.template.js +5 -2
- package/dist/collection/components/icon/icon.template.js +1 -1
- package/dist/collection/components/image-overlay/image-overlay.css +263 -0
- package/dist/collection/components/image-overlay/image-overlay.js +72 -0
- package/dist/collection/components/image-overlay/image-overlay.template.js +7 -0
- package/dist/collection/components/label/label.template.js +2 -2
- package/dist/collection/components/list/list.template.js +1 -1
- package/dist/collection/components/map-controls/map-controls.js +17 -19
- package/dist/collection/components/ozon-content/get-node-name.function.js +9 -0
- package/dist/collection/components/ozon-content/nodes/al.node.js +14 -0
- package/dist/collection/components/ozon-content/nodes/document.node.js +9 -0
- package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +15 -0
- package/dist/collection/components/ozon-content/nodes/fallback.node.js +11 -0
- package/dist/collection/components/ozon-content/nodes/illustratie.node.js +13 -0
- package/dist/collection/components/ozon-content/nodes/inhoud.node.js +14 -0
- package/dist/collection/components/ozon-content/nodes/inline.nodes.js +21 -0
- package/dist/collection/components/ozon-content/nodes/int-ref.node.js +26 -0
- package/dist/collection/components/ozon-content/nodes/noot.node.js +27 -0
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js +39 -0
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec.interface.js +2 -0
- package/dist/collection/components/ozon-content/nodes/table.node/index.js +1 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js +25 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js +4 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js +5 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +32 -0
- package/dist/collection/components/ozon-content/nodes/text.node.js +9 -0
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +80 -0
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-node.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content.css +84 -23
- package/dist/collection/components/ozon-content/ozon-content.js +21 -33
- package/dist/collection/components/progress-bar/progress-bar.template.js +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.template.js +1 -1
- package/dist/collection/components/selectable/selectable.css +7 -1
- package/dist/collection/components/selectable/selectable.template.js +1 -1
- package/dist/collection/components/toggletip/toggletip.template.js +2 -2
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.template.js +1 -1
- package/dist/collection/components/tree-view/tree-item.js +7 -7
- package/dist/collection/components/tree-view/tree-view.css +86 -15
- package/dist/collection/components/viewer-grid/viewer-grid.css +32 -4
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +1541 -1400
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-016ed5a8.entry.js +1 -0
- package/dist/dso-toolkit/p-0216f283.entry.js +1 -0
- package/dist/dso-toolkit/{p-348414bf.entry.js → p-09bcacd0.entry.js} +1 -1
- package/dist/dso-toolkit/{p-2b6a3dfa.entry.js → p-117a31fe.entry.js} +1 -1
- package/dist/dso-toolkit/p-131d54e3.js +5 -0
- package/dist/dso-toolkit/{p-50b63cf4.entry.js → p-1eeadd3e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-ad540748.entry.js → p-2279329b.entry.js} +1 -1
- package/dist/dso-toolkit/p-258e8371.entry.js +1 -0
- package/dist/dso-toolkit/{p-bc14cafd.entry.js → p-3ced438e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c54ecae1.entry.js → p-406b179d.entry.js} +1 -1
- package/dist/dso-toolkit/p-4b5f6b4c.entry.js +1 -0
- package/dist/dso-toolkit/{p-3b493a2c.entry.js → p-527a85b6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94dffa65.entry.js → p-52f159e7.entry.js} +1 -1
- package/dist/dso-toolkit/{p-dc86d830.entry.js → p-58f5e092.entry.js} +1 -1
- package/dist/dso-toolkit/p-5e5fbd41.js +5 -0
- package/dist/dso-toolkit/{p-f0b67246.entry.js → p-639228f6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-951f5872.entry.js → p-6a8452bd.entry.js} +1 -1
- package/dist/dso-toolkit/{p-4e573fc5.entry.js → p-98ef5f8c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94b79e43.entry.js → p-a1c9bb35.entry.js} +1 -1
- package/dist/dso-toolkit/{p-3c4dbd89.entry.js → p-a5008a4e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c95108fe.entry.js → p-a59dcbb0.entry.js} +1 -1
- package/dist/dso-toolkit/p-b06c275a.entry.js +1 -0
- package/dist/dso-toolkit/p-b4222d6e.entry.js +1 -0
- package/dist/dso-toolkit/{p-dad72605.js → p-b9eb3491.js} +1 -1
- package/dist/dso-toolkit/p-bec38cf5.entry.js +1 -0
- package/dist/dso-toolkit/{p-ad2210ad.entry.js → p-d0d3ca99.entry.js} +1 -1
- package/dist/dso-toolkit/{p-5037944e.entry.js → p-d72edd80.entry.js} +1 -1
- package/dist/dso-toolkit/{p-1fefbf8c.entry.js → p-e1934ab6.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +7 -3
- package/dist/esm/dso-badge.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +2 -2
- package/dist/esm/dso-dropdown-menu.entry.js +2 -2
- package/dist/esm/dso-header.entry.js +16 -7
- package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-image-overlay.entry.js +58 -0
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-label.entry.js +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +1 -1
- package/dist/esm/dso-map-controls.entry.js +22 -19
- package/dist/esm/dso-map-overlays.entry.js +1 -1
- package/dist/esm/dso-ozon-content.entry.js +289 -419
- package/dist/esm/dso-progress-bar.entry.js +1 -1
- package/dist/esm/dso-progress-indicator.entry.js +1 -1
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +3 -3
- package/dist/esm/dso-tooltip.entry.js +8 -4
- package/dist/esm/dso-tree-view.entry.js +9 -9
- package/dist/esm/dso-viewer-grid.entry.js +4 -710
- package/dist/esm/focus-trap.esm-a01ad6c9.js +744 -0
- package/dist/esm/{index-d54cae76.js → index-9ec8c07f.js} +73 -64
- package/dist/esm/index.esm-45465af7.js +422 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/autosuggest/autosuggest.d.ts +15 -1
- package/dist/types/components/header/header.d.ts +7 -1
- package/dist/types/components/header/header.template.d.ts +1 -1
- package/dist/types/components/image-overlay/image-overlay.d.ts +15 -0
- package/dist/types/components/image-overlay/image-overlay.template.d.ts +2 -0
- package/dist/types/components/ozon-content/get-node-name.function.d.ts +1 -0
- package/dist/types/components/ozon-content/nodes/al.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/document.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/ext-ref.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/fallback.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/illustratie.node.d.ts +5 -0
- package/dist/types/components/ozon-content/nodes/inhoud.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/inline.nodes.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/int-ref.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/noot.node.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec-mapper.d.ts +2 -0
- package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec.interface.d.ts +10 -0
- package/dist/types/components/ozon-content/nodes/table.node/index.d.ts +1 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-cell.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-colgroup.d.ts +5 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-rows.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/table.node.d.ts +7 -0
- package/dist/types/components/ozon-content/nodes/text.node.d.ts +5 -0
- package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +8 -0
- package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +11 -0
- package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +7 -0
- package/dist/types/components/ozon-content/ozon-content-node-state.interface.d.ts +3 -0
- package/dist/types/components/ozon-content/ozon-content-node.interface.d.ts +7 -0
- package/dist/types/components/ozon-content/ozon-content.d.ts +7 -10
- package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +2 -2
- package/dist/types/components.d.ts +22 -8
- package/dist/types/icon/dso-icon-sass-function.d.ts +1 -1
- package/package.json +29 -27
- package/dist/cjs/index.esm-2ac7081c.js +0 -267
- package/dist/collection/components/ozon-content/ozon-content.transformer.js +0 -105
- package/dist/dso-toolkit/p-20856f91.entry.js +0 -1
- package/dist/dso-toolkit/p-88bc5873.entry.js +0 -1
- package/dist/dso-toolkit/p-8b6e3abc.entry.js +0 -1
- package/dist/dso-toolkit/p-8bf3a60e.js +0 -5
- package/dist/dso-toolkit/p-a7306b7b.entry.js +0 -1
- package/dist/dso-toolkit/p-daa1e29d.entry.js +0 -1
- package/dist/dso-toolkit/p-de3ab027.entry.js +0 -5
- package/dist/esm/index.esm-a1362957.js +0 -262
- package/dist/types/components/ozon-content/ozon-content.transformer.d.ts +0 -15
|
@@ -1,488 +1,358 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent
|
|
1
|
+
import { h, F as Fragment, r as registerInstance, c as createEvent } from './index-9ec8c07f.js';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var isString = typeof input === 'string' || input instanceof String;
|
|
7
|
-
|
|
8
|
-
if (!isString) {
|
|
9
|
-
var invalidType = _typeof(input);
|
|
10
|
-
|
|
11
|
-
if (input === null) invalidType = 'null';else if (invalidType === 'object') invalidType = input.constructor.name;
|
|
12
|
-
throw new TypeError("Expected a string but received a ".concat(invalidType));
|
|
3
|
+
function getNodeName(node) {
|
|
4
|
+
if (node instanceof Element) {
|
|
5
|
+
return node.localName;
|
|
13
6
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function merge() {
|
|
17
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
-
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
|
-
|
|
20
|
-
for (var key in defaults) {
|
|
21
|
-
if (typeof obj[key] === 'undefined') {
|
|
22
|
-
obj[key] = defaults[key];
|
|
23
|
-
}
|
|
7
|
+
if (node.nodeName.includes(':')) {
|
|
8
|
+
return node.nodeName.substring(node.nodeName.indexOf(':') + 1);
|
|
24
9
|
}
|
|
25
|
-
|
|
26
|
-
return obj;
|
|
10
|
+
return node.nodeName;
|
|
27
11
|
}
|
|
28
12
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
allow_trailing_dot: false,
|
|
33
|
-
allow_numeric_tld: false,
|
|
34
|
-
allow_wildcard: false
|
|
35
|
-
};
|
|
36
|
-
function isFQDN(str, options) {
|
|
37
|
-
assertString(str);
|
|
38
|
-
options = merge(options, default_fqdn_options);
|
|
39
|
-
/* Remove the optional trailing dot before checking validity */
|
|
40
|
-
|
|
41
|
-
if (options.allow_trailing_dot && str[str.length - 1] === '.') {
|
|
42
|
-
str = str.substring(0, str.length - 1);
|
|
13
|
+
class OzonContentAlNode {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'Al';
|
|
43
16
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
17
|
+
render(node, { mapNodeToJsx, path }) {
|
|
18
|
+
const nestedAl = path.some(node => getNodeName(node) === 'Al');
|
|
19
|
+
const content = mapNodeToJsx(node.childNodes);
|
|
20
|
+
return nestedAl
|
|
21
|
+
? h("span", { role: "paragraph" }, content)
|
|
22
|
+
: h("p", null, content);
|
|
49
23
|
}
|
|
24
|
+
}
|
|
50
25
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
|
|
61
|
-
return false;
|
|
62
|
-
} // disallow spaces
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (/\s/.test(tld)) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
} // reject numeric TLDs
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
|
|
72
|
-
return false;
|
|
26
|
+
class OzonContentDocumentNode {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.name = '#document';
|
|
29
|
+
}
|
|
30
|
+
render(node, { mapNodeToJsx }) {
|
|
31
|
+
return h(Fragment, null, mapNodeToJsx(node.childNodes));
|
|
73
32
|
}
|
|
74
|
-
|
|
75
|
-
return parts.every(function (part) {
|
|
76
|
-
if (part.length > 63) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
|
|
81
|
-
return false;
|
|
82
|
-
} // disallow full-width chars
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (/[\uff01-\uff5e]/.test(part)) {
|
|
86
|
-
return false;
|
|
87
|
-
} // disallow parts starting or ending with hyphen
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (/^-|-$/.test(part)) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!options.allow_underscores && /_/.test(part)) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return true;
|
|
99
|
-
});
|
|
100
33
|
}
|
|
101
34
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
ff02::5678 (on the 5th link of the node)
|
|
109
|
-
ff08::9abc (on the 10th organization of the node)
|
|
110
|
-
|
|
111
|
-
would be represented as follows:
|
|
112
|
-
|
|
113
|
-
fe80::1234%1
|
|
114
|
-
ff02::5678%5
|
|
115
|
-
ff08::9abc%10
|
|
116
|
-
|
|
117
|
-
(Here we assume a natural translation from a zone index to the
|
|
118
|
-
<zone_id> part, where the Nth zone of any scope is translated into
|
|
119
|
-
"N".)
|
|
120
|
-
|
|
121
|
-
If we use interface names as <zone_id>, those addresses could also be
|
|
122
|
-
represented as follows:
|
|
123
|
-
|
|
124
|
-
fe80::1234%ne0
|
|
125
|
-
ff02::5678%pvc1.3
|
|
126
|
-
ff08::9abc%interface10
|
|
127
|
-
|
|
128
|
-
where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
|
|
129
|
-
to the 5th link, and "interface10" belongs to the 10th organization.
|
|
130
|
-
* * */
|
|
131
|
-
|
|
132
|
-
var IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
|
|
133
|
-
var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat);
|
|
134
|
-
var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$"));
|
|
135
|
-
var IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
|
|
136
|
-
var IPv6AddressRegExp = new RegExp('^(' + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ')(%[0-9a-zA-Z-.:]{1,})?$');
|
|
137
|
-
function isIP(str) {
|
|
138
|
-
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
139
|
-
assertString(str);
|
|
140
|
-
version = String(version);
|
|
141
|
-
|
|
142
|
-
if (!version) {
|
|
143
|
-
return isIP(str, 4) || isIP(str, 6);
|
|
35
|
+
class OzonContentExtRefNode {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.name = [
|
|
38
|
+
'ExtRef',
|
|
39
|
+
'ExtIoRef'
|
|
40
|
+
];
|
|
144
41
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var parts = str.split('.').sort(function (a, b) {
|
|
152
|
-
return a - b;
|
|
153
|
-
});
|
|
154
|
-
return parts[3] <= 255;
|
|
42
|
+
render(node, { mapNodeToJsx }) {
|
|
43
|
+
var _a;
|
|
44
|
+
return (h("a", { target: "_blank", rel: "noopener noreferrer", href: (_a = node.getAttribute('ref')) !== null && _a !== void 0 ? _a : undefined },
|
|
45
|
+
h("span", { class: "sr-only" }, "opent in nieuw venster"),
|
|
46
|
+
mapNodeToJsx(node.childNodes)));
|
|
155
47
|
}
|
|
48
|
+
}
|
|
156
49
|
|
|
157
|
-
|
|
158
|
-
|
|
50
|
+
class OzonContentIllustratieNode {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.name = [
|
|
53
|
+
'Illustratie',
|
|
54
|
+
'InlineTekstAfbeelding'
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
render(node) {
|
|
58
|
+
var _a, _b, _c, _d;
|
|
59
|
+
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 }));
|
|
159
60
|
}
|
|
160
|
-
|
|
161
|
-
return false;
|
|
162
61
|
}
|
|
163
62
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
options for isURL method
|
|
177
|
-
|
|
178
|
-
require_protocol - if set as true isURL will return false if protocol is not present in the URL
|
|
179
|
-
require_valid_protocol - isURL will check if the URL's protocol is present in the protocols option
|
|
180
|
-
protocols - valid protocols can be modified with this option
|
|
181
|
-
require_host - if set as false isURL will not check if host is present in the URL
|
|
182
|
-
require_port - if set as true isURL will check if port is present in the URL
|
|
183
|
-
allow_protocol_relative_urls - if set as true protocol relative URLs will be allowed
|
|
184
|
-
validate_length - if set as false isURL will skip string length validation (IE maximum is 2083)
|
|
185
|
-
|
|
186
|
-
*/
|
|
187
|
-
|
|
188
|
-
var default_url_options = {
|
|
189
|
-
protocols: ['http', 'https', 'ftp'],
|
|
190
|
-
require_tld: true,
|
|
191
|
-
require_protocol: false,
|
|
192
|
-
require_host: true,
|
|
193
|
-
require_port: false,
|
|
194
|
-
require_valid_protocol: true,
|
|
195
|
-
allow_underscores: false,
|
|
196
|
-
allow_trailing_dot: false,
|
|
197
|
-
allow_protocol_relative_urls: false,
|
|
198
|
-
allow_fragments: true,
|
|
199
|
-
allow_query_components: true,
|
|
200
|
-
validate_length: true
|
|
201
|
-
};
|
|
202
|
-
var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
|
|
203
|
-
|
|
204
|
-
function isRegExp(obj) {
|
|
205
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
63
|
+
class OzonContentInhoudNode {
|
|
64
|
+
constructor() {
|
|
65
|
+
this.name = [
|
|
66
|
+
'Inhoud',
|
|
67
|
+
'Opschrift',
|
|
68
|
+
'ContainerBlocksType',
|
|
69
|
+
'BlockMixedcontentMetMaximaleInlinesMarkersPopupsType'
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
render(node, { mapNodeToJsx }) {
|
|
73
|
+
return h("div", { class: "dso-rich-content" }, mapNodeToJsx(node.childNodes));
|
|
74
|
+
}
|
|
206
75
|
}
|
|
207
76
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
77
|
+
class OzonContentInlineNodes {
|
|
78
|
+
constructor() {
|
|
79
|
+
this.name = [
|
|
80
|
+
'sub',
|
|
81
|
+
'sup',
|
|
82
|
+
'strong',
|
|
83
|
+
'b',
|
|
84
|
+
'u',
|
|
85
|
+
'i',
|
|
86
|
+
'br'
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
render(node, { mapNodeToJsx }) {
|
|
90
|
+
if (node.localName === 'br') {
|
|
91
|
+
return h("br", null);
|
|
214
92
|
}
|
|
93
|
+
const Tag = node.localName;
|
|
94
|
+
return h(Tag, null, mapNodeToJsx(node.childNodes));
|
|
215
95
|
}
|
|
216
|
-
|
|
217
|
-
return false;
|
|
218
96
|
}
|
|
219
97
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (!url || /[\s<>]/.test(url)) {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (url.indexOf('mailto:') === 0) {
|
|
228
|
-
return false;
|
|
98
|
+
class OzonContentIntRefNode {
|
|
99
|
+
constructor() {
|
|
100
|
+
this.name = 'IntRef';
|
|
229
101
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
102
|
+
render(node, { mapNodeToJsx, emitAnchorClick }) {
|
|
103
|
+
const ref = node.getAttribute('ref');
|
|
104
|
+
if (!ref) {
|
|
105
|
+
return mapNodeToJsx(node.childNodes);
|
|
106
|
+
}
|
|
107
|
+
const intRefOnClick = (event) => {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
const target = event.currentTarget;
|
|
110
|
+
if (!(target instanceof HTMLAnchorElement)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const { href } = target;
|
|
114
|
+
emitAnchorClick({
|
|
115
|
+
href,
|
|
116
|
+
documentComponent: ref,
|
|
117
|
+
originalEvent: event
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
return (h("a", { href: `#${ref}`, onClick: intRefOnClick }, mapNodeToJsx(node.childNodes)));
|
|
235
121
|
}
|
|
122
|
+
}
|
|
236
123
|
|
|
237
|
-
|
|
238
|
-
|
|
124
|
+
class OzonContentNootNode {
|
|
125
|
+
constructor() {
|
|
126
|
+
this.name = 'Noot';
|
|
127
|
+
this.handles = ['NootNummer'];
|
|
239
128
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return false;
|
|
129
|
+
identify() {
|
|
130
|
+
return 'Noot';
|
|
243
131
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
split = url.split('://');
|
|
251
|
-
|
|
252
|
-
if (split.length > 1) {
|
|
253
|
-
protocol = split.shift().toLowerCase();
|
|
254
|
-
|
|
255
|
-
if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
} else if (options.require_protocol) {
|
|
259
|
-
return false;
|
|
260
|
-
} else if (url.substr(0, 2) === '//') {
|
|
261
|
-
if (!options.allow_protocol_relative_urls) {
|
|
262
|
-
return false;
|
|
132
|
+
render(node, { mapNodeToJsx, state: openNoteId, setState }) {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
const noteId = node.getAttribute('id');
|
|
135
|
+
if (!noteId) {
|
|
136
|
+
console.error('Noot node without id', node);
|
|
137
|
+
return h(Fragment, null);
|
|
263
138
|
}
|
|
264
|
-
|
|
265
|
-
|
|
139
|
+
const noteControlsId = `dso-ozon-note-${noteId}`;
|
|
140
|
+
const childNodes = Array.from(node.childNodes);
|
|
141
|
+
const nootNummer = (_b = (_a = childNodes.find(n => getNodeName(n) === 'NootNummer')) === null || _a === void 0 ? void 0 : _a.textContent) !== null && _b !== void 0 ? _b : noteId;
|
|
142
|
+
return (h(Fragment, null,
|
|
143
|
+
h("sup", null,
|
|
144
|
+
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)),
|
|
145
|
+
h("dso-tooltip", { active: openNoteId === noteId, for: noteControlsId, stateless: true },
|
|
146
|
+
h("span", { role: "section" }, mapNodeToJsx(Array.from(node.querySelectorAll(':scope > Al')))))));
|
|
266
147
|
}
|
|
148
|
+
}
|
|
267
149
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
150
|
+
function mapColspecs(count, nodeList) {
|
|
151
|
+
const elements = Array.from(nodeList);
|
|
152
|
+
const totalWidth = getTotalWidth(elements);
|
|
153
|
+
return {
|
|
154
|
+
totalWidth,
|
|
155
|
+
count,
|
|
156
|
+
columns: elements.map((element, index) => {
|
|
157
|
+
var _a;
|
|
158
|
+
const colNumber = element.getAttribute('colnum');
|
|
159
|
+
return {
|
|
160
|
+
name: (_a = element.getAttribute('colname')) !== null && _a !== void 0 ? _a : '',
|
|
161
|
+
number: colNumber ? parseInt(colNumber, 10) : index + 1,
|
|
162
|
+
width: getWidth(totalWidth, element)
|
|
163
|
+
};
|
|
164
|
+
})
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function getTotalWidth(elements) {
|
|
168
|
+
return elements.reduce((totalWidth, element) => {
|
|
169
|
+
var _a, _b;
|
|
170
|
+
const width = (_b = (_a = element.getAttribute('colwidth')) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/, '')) !== null && _b !== void 0 ? _b : '';
|
|
171
|
+
const colWidth = parseInt(width, 10);
|
|
172
|
+
return totalWidth + (isNaN(colWidth) ? 0 : colWidth);
|
|
173
|
+
}, 0);
|
|
174
|
+
}
|
|
175
|
+
function getWidth(totalWidth, element) {
|
|
176
|
+
const width = element.getAttribute('colwidth');
|
|
177
|
+
if (!width) {
|
|
178
|
+
return undefined;
|
|
272
179
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
url = split.shift();
|
|
276
|
-
|
|
277
|
-
if (url === '' && !options.require_host) {
|
|
278
|
-
return true;
|
|
180
|
+
if (width === '*') {
|
|
181
|
+
return '100%';
|
|
279
182
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
if (split.length > 1) {
|
|
284
|
-
if (options.disallow_auth) {
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
if (split[0] === '') {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
auth = split.shift();
|
|
293
|
-
|
|
294
|
-
if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
var _auth$split = auth.split(':'),
|
|
299
|
-
_auth$split2 = _slicedToArray(_auth$split, 2),
|
|
300
|
-
user = _auth$split2[0],
|
|
301
|
-
password = _auth$split2[1];
|
|
302
|
-
|
|
303
|
-
if (user === '' && password === '') {
|
|
304
|
-
return false;
|
|
305
|
-
}
|
|
183
|
+
if (width.includes('*') || width.match(/^[\d+]$/)) {
|
|
184
|
+
const colWidth = parseInt(width.replace(/[^0-9]/, ''), 10);
|
|
185
|
+
return `${Math.round(colWidth / totalWidth * 100)}%`;
|
|
306
186
|
}
|
|
187
|
+
return width;
|
|
188
|
+
}
|
|
307
189
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
var ipv6_match = hostname.match(wrapped_ipv6);
|
|
312
|
-
|
|
313
|
-
if (ipv6_match) {
|
|
314
|
-
host = '';
|
|
315
|
-
ipv6 = ipv6_match[1];
|
|
316
|
-
port_str = ipv6_match[2] || null;
|
|
317
|
-
} else {
|
|
318
|
-
split = hostname.split(':');
|
|
319
|
-
host = split.shift();
|
|
190
|
+
const Colgroup = ({ colspecs }) => (colspecs.columns.length > 0
|
|
191
|
+
? (h("colgroup", null, colspecs.columns.map(colspec => (h("col", { style: { width: colspec.width } })))))
|
|
192
|
+
: h(Fragment, null));
|
|
320
193
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
194
|
+
function getData(cell) {
|
|
195
|
+
return {
|
|
196
|
+
moreRows: cell.getAttribute('morerows'),
|
|
197
|
+
nameStart: cell.getAttribute('namest'),
|
|
198
|
+
nameEnd: cell.getAttribute('nameend')
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function getColspan({ columns }, nameStart, nameEnd) {
|
|
202
|
+
const colspecStart = columns.find(c => c.name === nameStart);
|
|
203
|
+
const colspecEnd = columns.find(c => c.name === nameEnd);
|
|
204
|
+
if (!colspecStart || !colspecEnd) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const colspan = colspecEnd.number - colspecStart.number + 1;
|
|
208
|
+
return colspan === 1 ? undefined : colspan;
|
|
209
|
+
}
|
|
210
|
+
const Cell = ({ context: { mapNodeToJsx }, colspecs, cell }) => {
|
|
211
|
+
const { moreRows, nameStart, nameEnd } = getData(cell);
|
|
212
|
+
const td = {
|
|
213
|
+
rowSpan: moreRows ? parseInt(moreRows, 10) + 1 : undefined,
|
|
214
|
+
colSpan: colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined
|
|
215
|
+
};
|
|
216
|
+
return (h("td", Object.assign({}, td), mapNodeToJsx(cell.childNodes)));
|
|
217
|
+
};
|
|
325
218
|
|
|
326
|
-
|
|
327
|
-
|
|
219
|
+
const Rows = ({ context, colspecs, rows }) => {
|
|
220
|
+
return (h(Fragment, null, rows.map(row => (h("tr", null, Array.from(row.children).map(cell => (h(Cell, { cell: cell, colspecs: colspecs, context: context }))))))));
|
|
221
|
+
};
|
|
328
222
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
223
|
+
function mapData(node) {
|
|
224
|
+
var _a, _b, _c;
|
|
225
|
+
const tgroup = node.querySelector(':scope > tgroup');
|
|
226
|
+
const colAttribute = (_a = tgroup === null || tgroup === void 0 ? void 0 : tgroup.getAttribute('cols')) !== null && _a !== void 0 ? _a : undefined;
|
|
227
|
+
const columnCount = colAttribute ? parseInt(colAttribute, 10) : undefined;
|
|
228
|
+
return {
|
|
229
|
+
caption: (_c = (_b = node.querySelector(':scope > title')) === null || _b === void 0 ? void 0 : _b.textContent) !== null && _c !== void 0 ? _c : undefined,
|
|
230
|
+
colspecs: tgroup && columnCount ? mapColspecs(columnCount, tgroup.querySelectorAll(':scope > colspec')) : undefined,
|
|
231
|
+
headRows: Array.from(node.querySelectorAll(':scope > tgroup > thead > row')),
|
|
232
|
+
bodyRows: Array.from(node.querySelectorAll(':scope > tgroup > tbody > row'))
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
class OzonContentTableNode {
|
|
236
|
+
constructor() {
|
|
237
|
+
this.name = 'table';
|
|
238
|
+
this.handles = ['title', 'tgroup', 'colspec', 'thead', 'tbody', 'row', 'cell'];
|
|
239
|
+
}
|
|
240
|
+
render(node, context) {
|
|
241
|
+
const { caption, colspecs, headRows, bodyRows } = mapData(node);
|
|
242
|
+
return (h("table", { class: "table" },
|
|
243
|
+
caption && (h("caption", null, caption)),
|
|
244
|
+
colspecs && (h(Colgroup, { colspecs: colspecs })),
|
|
245
|
+
headRows.length > 0 && (h("thead", null,
|
|
246
|
+
h(Rows, { rows: headRows, colspecs: colspecs, context: context }))),
|
|
247
|
+
bodyRows.length > 0 && (h("tbody", null,
|
|
248
|
+
h(Rows, { rows: bodyRows, colspecs: colspecs, context: context })))));
|
|
334
249
|
}
|
|
250
|
+
}
|
|
335
251
|
|
|
336
|
-
|
|
337
|
-
|
|
252
|
+
class OzonContentTextNode {
|
|
253
|
+
constructor() {
|
|
254
|
+
this.name = '#text';
|
|
338
255
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return false;
|
|
256
|
+
render(node) {
|
|
257
|
+
return h(Fragment, null, node.textContent);
|
|
342
258
|
}
|
|
259
|
+
}
|
|
343
260
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
261
|
+
class OzonContentFallbackNode {
|
|
262
|
+
constructor() {
|
|
263
|
+
// This name does not match any elements
|
|
264
|
+
this.name = ['<fallback>'];
|
|
265
|
+
}
|
|
266
|
+
render(node, { mapNodeToJsx }) {
|
|
267
|
+
return (h("span", { class: `fallback od-${getNodeName(node)}` }, mapNodeToJsx(node.childNodes)));
|
|
348
268
|
}
|
|
349
|
-
|
|
350
|
-
return true;
|
|
351
269
|
}
|
|
352
270
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
nootAnchorElement.replaceChildren(supElement);
|
|
375
|
-
const id = (index + 1).toString(10);
|
|
376
|
-
const [termId, contentId] = [`dso-ozon-term-${id}`, `dso-ozon-content-${id}`];
|
|
377
|
-
nootAnchorElement.setAttribute('href', `#${termId}`);
|
|
378
|
-
nootAnchorElement.setAttribute('id', termId);
|
|
379
|
-
nootAnchorElement.setAttribute('aria-controls', contentId);
|
|
380
|
-
nootAnchorElement.setAttribute('aria-expanded', 'false');
|
|
381
|
-
contentAlElement === null || contentAlElement === void 0 ? void 0 : contentAlElement.setAttribute('id', contentId);
|
|
382
|
-
});
|
|
383
|
-
return body;
|
|
384
|
-
}
|
|
385
|
-
function transformDocumentComponent(body) {
|
|
386
|
-
body.querySelectorAll('span[data-verwijst-naar-documentcomponent]').forEach(e => {
|
|
387
|
-
const a = document.createElement('a');
|
|
388
|
-
a.href = `#${e.getAttribute('data-verwijst-naar-documentcomponent')}`;
|
|
389
|
-
a.replaceChildren(...Array.from(e.childNodes));
|
|
390
|
-
e.replaceWith(a);
|
|
391
|
-
});
|
|
392
|
-
return body;
|
|
393
|
-
}
|
|
394
|
-
const transformers = [transformDescriptionNote, transformDocumentComponent];
|
|
395
|
-
class OzonContentTransformer {
|
|
396
|
-
constructor(anchorClick) {
|
|
397
|
-
this.anchorClick = anchorClick;
|
|
271
|
+
class Mapper {
|
|
272
|
+
constructor() {
|
|
273
|
+
this.mappers = [
|
|
274
|
+
new OzonContentTextNode(),
|
|
275
|
+
new OzonContentDocumentNode(),
|
|
276
|
+
new OzonContentInhoudNode(),
|
|
277
|
+
new OzonContentIntRefNode(),
|
|
278
|
+
new OzonContentExtRefNode(),
|
|
279
|
+
new OzonContentAlNode(),
|
|
280
|
+
new OzonContentInlineNodes(),
|
|
281
|
+
new OzonContentIllustratieNode(),
|
|
282
|
+
new OzonContentNootNode(),
|
|
283
|
+
new OzonContentTableNode()
|
|
284
|
+
];
|
|
285
|
+
this.skip = this.mappers.reduce((t, m) => {
|
|
286
|
+
if (m.handles) {
|
|
287
|
+
t.push(...m.handles);
|
|
288
|
+
}
|
|
289
|
+
return t;
|
|
290
|
+
}, []);
|
|
291
|
+
this.fallbackNode = new OzonContentFallbackNode();
|
|
398
292
|
this.domParser = new DOMParser();
|
|
399
|
-
this.eventHandlers = [this.handleValidUrls, this.handleDescriptionNoteClick, this.handleContentAnchor];
|
|
400
|
-
}
|
|
401
|
-
setContent(content) {
|
|
402
|
-
this.content = transformers.reduce((c, t) => t(c), this.domParser.parseFromString(content, 'text/html').body).children;
|
|
403
293
|
}
|
|
404
|
-
|
|
405
|
-
this.eventHandlers.some(h => h.bind(this)(event.composedPath(), event));
|
|
406
|
-
}
|
|
407
|
-
handleDescriptionNoteClick(composedPath, event) {
|
|
294
|
+
findMapper(name) {
|
|
408
295
|
var _a;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return false;
|
|
296
|
+
if (this.skip.includes(name)) {
|
|
297
|
+
return undefined;
|
|
412
298
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
299
|
+
return (_a = this.mappers.find(m => {
|
|
300
|
+
if (Array.isArray(m.name)) {
|
|
301
|
+
return m.name.includes(name);
|
|
302
|
+
}
|
|
303
|
+
return m.name === name;
|
|
304
|
+
})) !== null && _a !== void 0 ? _a : this.fallbackNode;
|
|
305
|
+
}
|
|
306
|
+
mapNodeToJsx(node, context, path) {
|
|
307
|
+
var _a;
|
|
308
|
+
if (node instanceof NodeList) {
|
|
309
|
+
return h(Fragment, null, Array.from(node).map(n => this.mapNodeToJsx(n, context, path)));
|
|
417
310
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (open) {
|
|
421
|
-
anchorElement.classList.remove('dso-open');
|
|
422
|
-
anchorElement.setAttribute('aria-expanded', 'false');
|
|
311
|
+
if (Array.isArray(node)) {
|
|
312
|
+
return h(Fragment, null, node.map(n => this.mapNodeToJsx(n, context, path)));
|
|
423
313
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
314
|
+
const nodeName = getNodeName(node);
|
|
315
|
+
const mapper = this.findMapper(nodeName);
|
|
316
|
+
if (!mapper) {
|
|
317
|
+
return h(Fragment, null);
|
|
427
318
|
}
|
|
428
|
-
|
|
319
|
+
const identity = (_a = mapper.identify) === null || _a === void 0 ? void 0 : _a.call(mapper, node);
|
|
320
|
+
const state = identity ? context.state[identity] : undefined;
|
|
321
|
+
const setState = identity ? (state) => context.setState(Object.assign(Object.assign({}, context.state), { [identity]: state })) : undefined;
|
|
322
|
+
return mapper.render(node, {
|
|
323
|
+
mapNodeToJsx: n => this.mapNodeToJsx(n, context, [...path, node]),
|
|
324
|
+
emitAnchorClick: context.emitAnchorClick,
|
|
325
|
+
setState,
|
|
326
|
+
state,
|
|
327
|
+
path
|
|
328
|
+
});
|
|
429
329
|
}
|
|
430
|
-
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
const anchor = composedPath.find((e) => e instanceof HTMLAnchorElement);
|
|
434
|
-
const href = anchor.href;
|
|
435
|
-
this.anchorClick.emit({
|
|
436
|
-
href,
|
|
437
|
-
documentComponent: href.substr(href.indexOf('#') + 1),
|
|
438
|
-
originalEvent: event
|
|
439
|
-
});
|
|
440
|
-
return true;
|
|
330
|
+
transform(xml, context) {
|
|
331
|
+
if (!this.cache || this.cache.xml !== xml) {
|
|
332
|
+
this.cache = { xml, document: this.domParser.parseFromString(xml, 'text/xml') };
|
|
441
333
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
handleValidUrls(composedPath) {
|
|
445
|
-
var _a;
|
|
446
|
-
const containerIndex = composedPath.findIndex(this.isHostElement);
|
|
447
|
-
if (containerIndex === -1) {
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
// require_tld: false is needed to allow http://localhost
|
|
451
|
-
return (_a = composedPath.slice(0, containerIndex)) === null || _a === void 0 ? void 0 : _a.some(e => { var _a; return e instanceof HTMLAnchorElement && isURL((_a = e.getAttribute('href')) !== null && _a !== void 0 ? _a : '', { require_tld: false, require_protocol: true }); });
|
|
452
|
-
}
|
|
453
|
-
isHostElement(value) {
|
|
454
|
-
return value instanceof HTMLElement && value.tagName === 'DSO-OZON-CONTENT';
|
|
334
|
+
const xmlDocument = this.cache.document;
|
|
335
|
+
return this.mapNodeToJsx(xmlDocument.getRootNode(), context, []);
|
|
455
336
|
}
|
|
456
337
|
}
|
|
457
338
|
|
|
458
|
-
const ozonContentCss = "dso-ozon-content{display:block}.
|
|
339
|
+
const ozonContentCss = ".sc-dso-ozon-content-h{display:block}button.toggle-note.sc-dso-ozon-content{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;border:0;color:#39870c;line-height:1;padding:0;background-color:transparent}button.toggle-note.sc-dso-ozon-content:focus,button.toggle-note.sc-dso-ozon-content:focus-visible{outline-offset:2px}button.toggle-note.sc-dso-ozon-content:active{outline:0}button.toggle-note.extern.sc-dso-ozon-content::after,button.toggle-note.download.sc-dso-ozon-content::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}button.toggle-note[disabled].sc-dso-ozon-content{color:#afcf9d}button.toggle-note.sc-dso-ozon-content:not([disabled]):hover{color:#676cb0;text-decoration:underline}button.toggle-note.sc-dso-ozon-content:not([disabled]):active{color:#676cb0}button.toggle-note.btn-align.sc-dso-ozon-content{line-height:calc(1.5em - 1px);padding:11px 0;position:relative}button.toggle-note.extern.sc-dso-ozon-content::after,button.toggle-note.download.sc-dso-ozon-content::after{position:relative;top:-2px}button.toggle-note.download.sc-dso-ozon-content::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}button.toggle-note.download[disabled].sc-dso-ozon-content::after{--dso-icon:var(--di-download-grasgroen-40)}button.toggle-note.download.sc-dso-ozon-content:not([disabled]):hover::after,button.toggle-note.download.sc-dso-ozon-content:not([disabled]):active::after{--dso-icon:var(--di-download-scampi)}button.toggle-note.extern.sc-dso-ozon-content::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}button.toggle-note.extern[disabled].sc-dso-ozon-content::after{--dso-icon:var(--di-external-link-grasgroen-40)}button.toggle-note.extern.sc-dso-ozon-content:not([disabled]):hover::after,button.toggle-note.extern.sc-dso-ozon-content:not([disabled]):active::after{--dso-icon:var(--di-external-link-scampi)}button.toggle-note.sc-dso-ozon-content dso-icon.sc-dso-ozon-content+span.sc-dso-ozon-content:not(.sr-only),button.toggle-note.sc-dso-ozon-content svg.di.sc-dso-ozon-content+span.sc-dso-ozon-content:not(.sr-only),button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content:not(.sr-only)+dso-icon.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content:not(.sr-only)+svg.di.sc-dso-ozon-content{margin-left:8px}button.toggle-note.sc-dso-ozon-content dso-icon.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content svg.di.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content{vertical-align:middle}span[role=section].sc-dso-ozon-content,span[role=paragraph].sc-dso-ozon-content{display:block}.fallback.sc-dso-ozon-content{display:block}.od-Term.sc-dso-ozon-content{font-weight:700}.od-Definitie.sc-dso-ozon-content,.od-Tussenkop.sc-dso-ozon-content{font-style:italic}.od-Inhoud.sc-dso-ozon-content,.od-Inhoud.sc-dso-ozon-content>.od-Lijst.sc-dso-ozon-content,.od-IntIoRef.sc-dso-ozon-content,.od-Lidnr.sc-dso-ozon-content,.od-LiNr.sc-dso-ozon-content,.od-Opschrift.sc-dso-ozon-content,.od-Tussenkop.sc-dso-ozon-content{display:inline}.od-Al.sc-dso-ozon-content,.od-Lijstaanhef.sc-dso-ozon-content{margin-bottom:0.75em}.od-IntIoRef.sc-dso-ozon-content{border-bottom:1px dotted}.od-LiNummer.sc-dso-ozon-content{float:left;min-width:0.7em;padding-right:0.3em;text-align:right}.od-Figuur.sc-dso-ozon-content img.sc-dso-ozon-content{margin-left:25px;max-width:100%;height:auto}.od-Figuur.sc-dso-ozon-content .od-Bijschrift.sc-dso-ozon-content{font-size:0.75rem;margin-left:25px;padding-bottom:2.5rem}.od-Tabel.sc-dso-ozon-content thead.sc-dso-ozon-content{font-weight:600}.od-Kadertekst.sc-dso-ozon-content{border:1px solid #e5e5e5;margin-bottom:1rem;padding:1rem}";
|
|
459
340
|
|
|
460
341
|
let OzonContent = class {
|
|
461
342
|
constructor(hostRef) {
|
|
462
343
|
registerInstance(this, hostRef);
|
|
463
344
|
this.anchorClick = createEvent(this, "anchorClick", 7);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
this.transformer.handleClickEvent(event);
|
|
467
|
-
}
|
|
468
|
-
componentWillLoad() {
|
|
469
|
-
this.transformer = new OzonContentTransformer(this.anchorClick);
|
|
470
|
-
}
|
|
471
|
-
componentWillRender() {
|
|
472
|
-
this.transformer.setContent(this.content);
|
|
345
|
+
this.state = {};
|
|
346
|
+
this.mapper = new Mapper();
|
|
473
347
|
}
|
|
474
348
|
render() {
|
|
475
|
-
return h("div", { class: "dso-rich-content", ref: el => this.container = el });
|
|
476
|
-
}
|
|
477
|
-
componentDidRender() {
|
|
478
349
|
var _a;
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
this.
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
350
|
+
const context = {
|
|
351
|
+
state: this.state,
|
|
352
|
+
setState: state => this.state = state,
|
|
353
|
+
emitAnchorClick: this.anchorClick.emit
|
|
354
|
+
};
|
|
355
|
+
return this.mapper.transform((_a = this.content) !== null && _a !== void 0 ? _a : '', context);
|
|
486
356
|
}
|
|
487
357
|
};
|
|
488
358
|
OzonContent.style = ozonContentCss;
|