@dso-toolkit/core 62.2.1 → 62.3.0-ghi-2431.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/create-identifier-5900c27b.js +19 -0
- package/dist/cjs/create-identifier-5900c27b.js.map +1 -0
- package/dist/cjs/dso-accordion-section.cjs.entry.js +15 -0
- package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
- package/dist/cjs/{dso-alert_5.cjs.entry.js → dso-alert_7.cjs.entry.js} +201 -5
- package/dist/cjs/dso-alert_7.cjs.entry.js.map +1 -0
- package/dist/cjs/dso-annotation-output_3.cjs.entry.js +3 -1
- package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-date-picker-legacy.cjs.entry.js +704 -0
- package/dist/cjs/dso-date-picker-legacy.cjs.entry.js.map +1 -0
- package/dist/cjs/dso-expandable.cjs.entry.js +1 -1
- package/dist/cjs/dso-expandable.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +4 -17
- package/dist/cjs/dso-info_2.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-list-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-list-button.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/accordion/components/accordion-section.js +15 -0
- package/dist/collection/components/accordion/components/accordion-section.js.map +1 -1
- package/dist/collection/components/annotation-button/annotation-button.js +1 -1
- package/dist/collection/components/annotation-output/annotation-output.js +1 -1
- package/dist/collection/components/date-picker-legacy/date-localization.js +30 -0
- package/dist/collection/components/date-picker-legacy/date-localization.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/date-picker-day.js +20 -0
- package/dist/collection/components/date-picker-legacy/date-picker-day.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.css +487 -0
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.interfaces.js +2 -0
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.interfaces.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.js +849 -0
- package/dist/collection/components/date-picker-legacy/date-picker-legacy.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/date-picker-month.js +26 -0
- package/dist/collection/components/date-picker-legacy/date-picker-month.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/date-utils.js +155 -0
- package/dist/collection/components/date-picker-legacy/date-utils.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/utils/month-range.js +28 -0
- package/dist/collection/components/date-picker-legacy/utils/month-range.js.map +1 -0
- package/dist/collection/components/date-picker-legacy/utils/range.js +8 -0
- package/dist/collection/components/date-picker-legacy/utils/range.js.map +1 -0
- package/dist/collection/components/document-component/document-component.js +44 -1
- package/dist/collection/components/document-component/document-component.js.map +1 -1
- package/dist/collection/components/document-component/document-component.models.js.map +1 -1
- package/dist/collection/components/expandable/expandable.css +0 -12
- package/dist/collection/components/expandable/expandable.js +2 -2
- package/dist/collection/components/highlight-box/highlight-box.css +2 -0
- package/dist/collection/components/list-button/list-button.css +0 -13
- package/dist/collection/components/ozon-content/nodes/text.node.js +11 -2
- package/dist/collection/components/ozon-content/nodes/text.node.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +2 -0
- package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.css +9 -0
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.js +53 -1
- package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
- package/dist/collection/components/selectable/selectable.css +1 -24
- package/dist/collection/components/selectable/selectable.js +6 -1
- package/dist/collection/components/selectable/selectable.js.map +1 -1
- package/dist/components/create-identifier.js +17 -0
- package/dist/components/create-identifier.js.map +1 -0
- package/dist/components/document-component.js +29 -14
- package/dist/components/document-component.js.map +1 -1
- package/dist/components/dso-accordion-section.js +15 -0
- package/dist/components/dso-accordion-section.js.map +1 -1
- package/dist/components/dso-date-picker-legacy.d.ts +11 -0
- package/dist/components/dso-date-picker-legacy.js +743 -0
- package/dist/components/dso-date-picker-legacy.js.map +1 -0
- package/dist/components/dso-highlight-box.js +1 -1
- package/dist/components/dso-highlight-box.js.map +1 -1
- package/dist/components/dso-image-overlay.js +1 -122
- package/dist/components/dso-image-overlay.js.map +1 -1
- package/dist/components/dso-list-button.js +1 -1
- package/dist/components/dso-list-button.js.map +1 -1
- package/dist/components/dso-table.js +1 -109
- package/dist/components/dso-table.js.map +1 -1
- package/dist/components/dsot-document-component-demo.js +34 -22
- package/dist/components/dsot-document-component-demo.js.map +1 -1
- package/dist/components/expandable.js +1 -1
- package/dist/components/expandable.js.map +1 -1
- package/dist/{esm/dso-image-overlay.entry.js → components/image-overlay.js} +35 -12
- package/dist/components/image-overlay.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/ozon-content.js +48 -5
- package/dist/components/ozon-content.js.map +1 -1
- package/dist/components/selectable.js +3 -16
- package/dist/components/selectable.js.map +1 -1
- package/dist/{esm/dso-table.entry.js → components/table.js} +38 -13
- package/dist/{cjs/dso-table.cjs.entry.js.map → components/table.js.map} +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
- package/dist/dso-toolkit/{p-4239e3d6.entry.js → p-0c156f79.entry.js} +2 -2
- package/dist/dso-toolkit/{p-4239e3d6.entry.js.map → p-0c156f79.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-0fbddb1a.entry.js +2 -0
- package/dist/dso-toolkit/p-0fbddb1a.entry.js.map +1 -0
- package/dist/dso-toolkit/p-1db9f4a4.entry.js +2 -0
- package/dist/dso-toolkit/p-1db9f4a4.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-000f7731.entry.js → p-23ec080b.entry.js} +2 -2
- package/dist/dso-toolkit/p-23ec080b.entry.js.map +1 -0
- package/dist/dso-toolkit/p-4423c2b5.entry.js +2 -0
- package/dist/dso-toolkit/p-4423c2b5.entry.js.map +1 -0
- package/dist/dso-toolkit/p-5a47a86e.entry.js +2 -0
- package/dist/dso-toolkit/{p-caf4d880.entry.js.map → p-5a47a86e.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-47e77e24.entry.js → p-76c0fc1b.entry.js} +2 -2
- package/dist/dso-toolkit/p-76c0fc1b.entry.js.map +1 -0
- package/dist/dso-toolkit/p-a377846a.entry.js +2 -0
- package/dist/dso-toolkit/p-a377846a.entry.js.map +1 -0
- package/dist/dso-toolkit/p-c19cfe3f.js +2 -0
- package/dist/dso-toolkit/p-c19cfe3f.js.map +1 -0
- package/dist/esm/create-identifier-479a4699.js +17 -0
- package/dist/esm/create-identifier-479a4699.js.map +1 -0
- package/dist/esm/dso-accordion-section.entry.js +15 -0
- package/dist/esm/dso-accordion-section.entry.js.map +1 -1
- package/dist/esm/{dso-alert_5.entry.js → dso-alert_7.entry.js} +201 -7
- package/dist/esm/dso-alert_7.entry.js.map +1 -0
- package/dist/esm/dso-annotation-output_3.entry.js +3 -1
- package/dist/esm/dso-annotation-output_3.entry.js.map +1 -1
- package/dist/esm/dso-date-picker-legacy.entry.js +700 -0
- package/dist/esm/dso-date-picker-legacy.entry.js.map +1 -0
- package/dist/esm/dso-expandable.entry.js +1 -1
- package/dist/esm/dso-expandable.entry.js.map +1 -1
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js.map +1 -1
- package/dist/esm/dso-info_2.entry.js +3 -16
- package/dist/esm/dso-info_2.entry.js.map +1 -1
- package/dist/esm/dso-list-button.entry.js +1 -1
- package/dist/esm/dso-list-button.entry.js.map +1 -1
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/date-picker-legacy/date-localization.d.ts +19 -0
- package/dist/types/components/date-picker-legacy/date-picker-day.d.ts +11 -0
- package/dist/types/components/date-picker-legacy/date-picker-legacy.d.ts +172 -0
- package/dist/types/components/date-picker-legacy/date-picker-legacy.interfaces.d.ts +14 -0
- package/dist/types/components/date-picker-legacy/date-picker-month.d.ts +20 -0
- package/dist/types/components/date-picker-legacy/date-utils.d.ts +46 -0
- package/dist/types/components/date-picker-legacy/utils/month-range.d.ts +2 -0
- package/dist/types/components/date-picker-legacy/utils/range.d.ts +1 -0
- package/dist/types/components/document-component/document-component.d.ts +9 -1
- package/dist/types/components/document-component/document-component.models.d.ts +8 -1
- package/dist/types/components/ozon-content/nodes/text.node.d.ts +2 -1
- package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +3 -1
- package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +3 -1
- package/dist/types/components/ozon-content/ozon-content.d.ts +10 -1
- package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +10 -0
- package/dist/types/components/selectable/selectable.d.ts +5 -0
- package/dist/types/components.d.ts +175 -4
- package/package.json +2 -2
- package/dist/cjs/dso-alert_5.cjs.entry.js.map +0 -1
- package/dist/cjs/dso-image-overlay.cjs.entry.js +0 -107
- package/dist/cjs/dso-image-overlay.cjs.entry.js.map +0 -1
- package/dist/cjs/dso-table.cjs.entry.js +0 -92
- package/dist/dso-toolkit/p-000f7731.entry.js.map +0 -1
- package/dist/dso-toolkit/p-18152675.entry.js +0 -2
- package/dist/dso-toolkit/p-18152675.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2719a53a.entry.js +0 -2
- package/dist/dso-toolkit/p-2719a53a.entry.js.map +0 -1
- package/dist/dso-toolkit/p-47e77e24.entry.js.map +0 -1
- package/dist/dso-toolkit/p-a91673a9.entry.js +0 -2
- package/dist/dso-toolkit/p-a91673a9.entry.js.map +0 -1
- package/dist/dso-toolkit/p-ab1f0511.entry.js +0 -2
- package/dist/dso-toolkit/p-ab1f0511.entry.js.map +0 -1
- package/dist/dso-toolkit/p-caf4d880.entry.js +0 -2
- package/dist/dso-toolkit/p-cbeb00cc.entry.js +0 -2
- package/dist/dso-toolkit/p-cbeb00cc.entry.js.map +0 -1
- package/dist/esm/dso-alert_5.entry.js.map +0 -1
- package/dist/esm/dso-image-overlay.entry.js.map +0 -1
- package/dist/esm/dso-table.entry.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
|
@@ -222,14 +222,6 @@
|
|
|
222
222
|
display: var(--dso-selectable-display, block);
|
|
223
223
|
padding: 0 0 0 32px;
|
|
224
224
|
}
|
|
225
|
-
.dso-selectable .dso-selectable-options {
|
|
226
|
-
list-style: none;
|
|
227
|
-
margin-top: 8px;
|
|
228
|
-
padding-left: 0;
|
|
229
|
-
}
|
|
230
|
-
.dso-selectable .dso-selectable-options li + li {
|
|
231
|
-
margin-top: 8px;
|
|
232
|
-
}
|
|
233
225
|
.dso-selectable label {
|
|
234
226
|
font-weight: 400;
|
|
235
227
|
line-height: 24px;
|
|
@@ -352,11 +344,6 @@
|
|
|
352
344
|
background-color: var(--dso-selectable-color, #39870c);
|
|
353
345
|
opacity: 1;
|
|
354
346
|
}
|
|
355
|
-
.dso-selectable > dso-info {
|
|
356
|
-
float: none;
|
|
357
|
-
margin: 8px 16px 0 0;
|
|
358
|
-
width: 100%;
|
|
359
|
-
}
|
|
360
347
|
.dso-selectable label {
|
|
361
348
|
font-weight: 700;
|
|
362
349
|
}
|
|
@@ -3,8 +3,17 @@ export class OzonContentTextNode {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.name = "#text";
|
|
5
5
|
}
|
|
6
|
-
render(
|
|
7
|
-
|
|
6
|
+
render({ textContent }, { mark, emitMarkItemHighlight }) {
|
|
7
|
+
if (!mark || !textContent) {
|
|
8
|
+
return h(Fragment, null, textContent);
|
|
9
|
+
}
|
|
10
|
+
const result = mark(textContent);
|
|
11
|
+
return !result || result.length === 0 ? (h(Fragment, null, textContent)) : (h(Fragment, null, result.map((value) => {
|
|
12
|
+
if (typeof value === "string") {
|
|
13
|
+
return h(Fragment, null, value);
|
|
14
|
+
}
|
|
15
|
+
return (h("mark", { class: value.highlight ? "dso-highlight" : undefined, ref: (ref) => value.highlight && ref && emitMarkItemHighlight(value.text, ref) }, value.text));
|
|
16
|
+
})));
|
|
8
17
|
}
|
|
9
18
|
}
|
|
10
19
|
//# sourceMappingURL=text.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/text.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"text.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/text.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,mBAAmB;EAAhC;IACE,SAAI,GAAG,OAAO,CAAC;EA8BjB,CAAC;EA5BC,MAAM,CAAC,EAAE,WAAW,EAAQ,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAA0B;IACnF,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE;MACzB,OAAO,kBAAG,WAAW,CAAI,CAAC;KAC3B;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACtC,kBAAG,WAAW,CAAI,CACnB,CAAC,CAAC,CAAC,CACF,kBACG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;MACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,kBAAG,KAAK,CAAI,CAAC;OACrB;MAED,OAAO,CACL,YACE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EACpD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAE7E,KAAK,CAAC,IAAI,CACN,CACR,CAAC;IACJ,CAAC,CAAC,CACD,CACJ,CAAC;EACJ,CAAC;CACF","sourcesContent":["import { Fragment, h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\n\r\nexport class OzonContentTextNode implements OzonContentNode {\r\n name = \"#text\";\r\n\r\n render({ textContent }: Node, { mark, emitMarkItemHighlight }: OzonContentNodeContext) {\r\n if (!mark || !textContent) {\r\n return <>{textContent}</>;\r\n }\r\n\r\n const result = mark(textContent);\r\n\r\n return !result || result.length === 0 ? (\r\n <>{textContent}</>\r\n ) : (\r\n <>\r\n {result.map((value) => {\r\n if (typeof value === \"string\") {\r\n return <>{value}</>;\r\n }\r\n\r\n return (\r\n <mark\r\n class={value.highlight ? \"dso-highlight\" : undefined}\r\n ref={(ref) => value.highlight && ref && emitMarkItemHighlight(value.text, ref)}\r\n >\r\n {value.text}\r\n </mark>\r\n );\r\n })}\r\n </>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-context.interface.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { EventEmitter } from \"@stencil/core\";\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\n\r\nimport { OzonContentAnchorClickEvent } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n inline: boolean;\r\n setState(state: OzonContentNodeState): void;\r\n emitAnchorClick: EventEmitter<OzonContentAnchorClickEvent>[\"emit\"];\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ozon-content-context.interface.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { EventEmitter } from \"@stencil/core\";\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\n\r\nimport { OzonContentAnchorClickEvent, OzonContentMarkFunction } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n inline: boolean;\r\n mark: OzonContentMarkFunction | undefined;\r\n setState(state: OzonContentNodeState): void;\r\n emitAnchorClick: EventEmitter<OzonContentAnchorClickEvent>[\"emit\"];\r\n emitMarkItemHighlight(text: string, ref: HTMLElement): void;\r\n}\r\n"]}
|
|
@@ -77,9 +77,11 @@ export class Mapper {
|
|
|
77
77
|
const setState = identity ? (s) => context.setState(Object.assign(Object.assign({}, context.state), { [identity]: s })) : undefined;
|
|
78
78
|
return mapper.render(node, {
|
|
79
79
|
inline: context.inline,
|
|
80
|
+
mark: context.mark,
|
|
80
81
|
mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),
|
|
81
82
|
emitAnchorClick: context.emitAnchorClick,
|
|
82
83
|
setState,
|
|
84
|
+
emitMarkItemHighlight: context.emitMarkItemHighlight,
|
|
83
85
|
state,
|
|
84
86
|
path,
|
|
85
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-mapper.js","sourceRoot":"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C,EAAE;MACzC,OAAO,CAAC,KAAK,CAAC;QACZ,OAAO,EAAE,wDAAwD;QACjE,OAAO;QACP,KAAK;QACL,QAAQ;OACT,CAAC,CAAC;MAEH,OAAO,EAAC,QAAQ,OAAG,CAAC;KACrB;IAED,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;EAChE,CAAC;EAEO,kBAAkB,CAAC,KAA2B;;IACpD,IAAI,KAAK,YAAY,WAAW,EAAE;MAChC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;MAC7B,MAAA,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,SAAS,EAAE,EAAC;MAEnC,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;KAC1D;IAED,OAAO,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAC5D,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\r\nimport { OzonContentAlNode } from \"./nodes/al.node\";\r\nimport { OzonContentBronNode } from \"./nodes/bron.node\";\r\nimport { OzonContentDocumentNode } from \"./nodes/document.node\";\r\nimport { OzonContentExtRefNode } from \"./nodes/ext-ref.node\";\r\nimport { OzonContentFallbackNode } from \"./nodes/fallback.node\";\r\nimport { OzonContentFiguurNode } from \"./nodes/figuur.node\";\r\nimport { OzonContentInhoudNode } from \"./nodes/inhoud.node\";\r\nimport { OzonContentInlineTekstAfbeeldingNode } from \"./nodes/inline-tekst-afbeelding.node\";\r\nimport { OzonContentInlineNodes } from \"./nodes/inline.nodes\";\r\nimport { OzonContentIntIoRefNode } from \"./nodes/int-io-ref.node\";\r\nimport { OzonContentIntRefNode } from \"./nodes/int-ref.node\";\r\nimport { OzonContentLijstNode } from \"./nodes/lijst.node\";\r\nimport { OzonContentNieuweTekstNode } from \"./nodes/nieuwe-tekst.node\";\r\nimport { OzonContentNootNode } from \"./nodes/noot.node\";\r\nimport { OzonContentOpschriftNode } from \"./nodes/opschrift.node\";\r\nimport { OzonContentTableNode } from \"./nodes/table.node\";\r\nimport { OzonContentTextNode } from \"./nodes/text.node\";\r\nimport { OzonContentVerwijderdeTekstNode } from \"./nodes/verwijderde-tekst.node\";\r\nimport { OzonContentContext } from \"./ozon-content-context.interface\";\r\nimport { OzonContentNode } from \"./ozon-content-node.interface\";\r\nimport { OzonContentInputType } from \"./ozon-content.interfaces\";\r\n\r\nexport class Mapper {\r\n private mappers: OzonContentNode[] = [\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentOpschriftNode(),\r\n new OzonContentIntRefNode(),\r\n new OzonContentExtRefNode(),\r\n new OzonContentAlNode(),\r\n new OzonContentInlineNodes(),\r\n new OzonContentInlineTekstAfbeeldingNode(),\r\n new OzonContentNootNode(),\r\n new OzonContentTableNode(),\r\n new OzonContentIntIoRefNode(),\r\n new OzonContentFiguurNode(),\r\n new OzonContentLijstNode(),\r\n new OzonContentBronNode(),\r\n new OzonContentNieuweTekstNode(),\r\n new OzonContentVerwijderdeTekstNode(),\r\n ];\r\n\r\n private skip = this.mappers.reduce<string[]>((t, m) => {\r\n if (m.handles) {\r\n t.push(...m.handles);\r\n }\r\n\r\n return t;\r\n }, []);\r\n\r\n private fallbackNode = new OzonContentFallbackNode();\r\n\r\n private domParser?: DOMParser;\r\n\r\n private findMapper(name: string): OzonContentNode | undefined {\r\n if (this.skip.includes(name)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n this.mappers.find((m) => {\r\n if (Array.isArray(m.name)) {\r\n return m.name.includes(name);\r\n }\r\n\r\n return m.name === name;\r\n }) ?? this.fallbackNode\r\n );\r\n }\r\n\r\n mapNodeToJsx(node: Node | Node[] | NodeList, context: OzonContentContext, path: Node[]): JSX.Element {\r\n if (node instanceof NodeList) {\r\n return <Fragment>{Array.from(node).map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n if (Array.isArray(node)) {\r\n return <Fragment>{node.map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n const nodeName = getNodeName(node);\r\n const mapper = this.findMapper(nodeName);\r\n if (!mapper) {\r\n return <Fragment />;\r\n }\r\n\r\n const identity = mapper.identify?.(node);\r\n\r\n const state = identity ? context.state[identity] : undefined;\r\n const setState = identity ? (s: unknown) => context.setState({ ...context.state, [identity]: s }) : undefined;\r\n\r\n return mapper.render(node, {\r\n inline: context.inline,\r\n mark: context.mark,\r\n mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),\r\n emitAnchorClick: context.emitAnchorClick,\r\n setState,\r\n emitMarkItemHighlight: context.emitMarkItemHighlight,\r\n state,\r\n path,\r\n });\r\n }\r\n\r\n transform(input: OzonContentInputType | undefined, context: OzonContentContext): JSX.Element {\r\n if (!input) {\r\n return <Fragment />;\r\n }\r\n\r\n const document = this.inputToXmlDocument(input);\r\n if (document.querySelector(\"parsererror\")) {\r\n console.error({\r\n message: \"[DSO Toolkit: Ozon Content Mapper] Unable to parse XML\",\r\n context,\r\n input,\r\n document,\r\n });\r\n\r\n return <Fragment />;\r\n }\r\n\r\n return this.mapNodeToJsx(document.getRootNode(), context, []);\r\n }\r\n\r\n private inputToXmlDocument(input: OzonContentInputType): XMLDocument {\r\n if (input instanceof XMLDocument) {\r\n return input;\r\n }\r\n\r\n if (typeof input === \"string\") {\r\n this.domParser ??= new DOMParser();\r\n\r\n return this.domParser.parseFromString(input, \"text/xml\");\r\n }\r\n\r\n return document.implementation.createDocument(null, null);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-node-context.interface.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content-node-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { JSX } from \"@stencil/core\";\r\n\r\nimport { OzonContentAnchorClickEvent } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentNodeContext<T = unknown> {\r\n inline: boolean;\r\n path: Node[];\r\n mapNodeToJsx(node: Node | Node[] | NodeList): JSX.Element;\r\n emitAnchorClick(event: OzonContentAnchorClickEvent): void;\r\n state?: T;\r\n setState?(state: T): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ozon-content-node-context.interface.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content-node-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { JSX } from \"@stencil/core\";\r\n\r\nimport { OzonContentAnchorClickEvent, OzonContentMarkFunction } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentNodeContext<T = unknown> {\r\n inline: boolean;\r\n path: Node[];\r\n mark: OzonContentMarkFunction | undefined;\r\n mapNodeToJsx(node: Node | Node[] | NodeList): JSX.Element;\r\n emitAnchorClick(event: OzonContentAnchorClickEvent): void;\r\n state?: T;\r\n setState?(state: T): void;\r\n emitMarkItemHighlight(text: string, elementRef: HTMLElement): void;\r\n}\r\n"]}
|
|
@@ -666,6 +666,15 @@ a.dso-tertiary, a.dso-tertiary:visited {
|
|
|
666
666
|
margin-left: 16px;
|
|
667
667
|
}
|
|
668
668
|
|
|
669
|
+
mark {
|
|
670
|
+
background-color: #f8f5ce;
|
|
671
|
+
color: #000;
|
|
672
|
+
padding-block: 0.2rem;
|
|
673
|
+
}
|
|
674
|
+
mark.dso-highlight {
|
|
675
|
+
background-color: #dbd136;
|
|
676
|
+
}
|
|
677
|
+
|
|
669
678
|
sup {
|
|
670
679
|
font-size: 0.65em;
|
|
671
680
|
line-height: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content.interfaces.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content.interfaces.ts"],"names":[],"mappings":"AAAA,iCAAiC","sourcesContent":["// Sync interfaces with readme.md\r\n\r\nexport interface OzonContentAnchorClickEvent {\r\n /** Node type, eg: `IntRef` or `IntIoRef` */\r\n node: string;\r\n href: string;\r\n documentComponent: string;\r\n originalEvent: MouseEvent;\r\n}\r\n\r\nexport type OzonContentInputType = XMLDocument | string;\r\n"]}
|
|
1
|
+
{"version":3,"file":"ozon-content.interfaces.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content.interfaces.ts"],"names":[],"mappings":"AAAA,iCAAiC","sourcesContent":["// Sync interfaces with readme.md\r\n\r\nexport interface OzonContentAnchorClickEvent {\r\n /** Node type, eg: `IntRef` or `IntIoRef` */\r\n node: string;\r\n href: string;\r\n documentComponent: string;\r\n originalEvent: MouseEvent;\r\n}\r\n\r\nexport type OzonContentInputType = XMLDocument | string;\r\n\r\nexport type OzonContentMarkFunction = (text: string) => OzonContentText[] | undefined;\r\n\r\nexport type OzonContentText = OzonContentMarkItem | string;\r\n\r\nexport interface OzonContentMarkItem {\r\n text: string;\r\n highlight?: boolean;\r\n}\r\n\r\nexport interface OzonContentMarkItemHighlightEvent {\r\n text: string;\r\n elementRef: HTMLElement;\r\n}\r\n"]}
|
|
@@ -3,8 +3,12 @@ import { Mapper } from "./ozon-content-mapper";
|
|
|
3
3
|
const mapper = new Mapper();
|
|
4
4
|
export class OzonContent {
|
|
5
5
|
constructor() {
|
|
6
|
+
this.handleMarkItemHighlight = (text, elementRef) => {
|
|
7
|
+
this.dsoOzonContentMarkItemHighlight.emit({ text, elementRef });
|
|
8
|
+
};
|
|
6
9
|
this.content = undefined;
|
|
7
10
|
this.inline = false;
|
|
11
|
+
this.mark = undefined;
|
|
8
12
|
this.state = {};
|
|
9
13
|
}
|
|
10
14
|
contentWatcher() {
|
|
@@ -14,7 +18,9 @@ export class OzonContent {
|
|
|
14
18
|
const context = {
|
|
15
19
|
state: this.state,
|
|
16
20
|
inline: this.inline,
|
|
21
|
+
mark: this.mark,
|
|
17
22
|
setState: (state) => (this.state = state),
|
|
23
|
+
emitMarkItemHighlight: this.handleMarkItemHighlight,
|
|
18
24
|
emitAnchorClick: this.dsoAnchorClick.emit,
|
|
19
25
|
};
|
|
20
26
|
const transformed = mapper.transform(this.content, context);
|
|
@@ -74,6 +80,27 @@ export class OzonContent {
|
|
|
74
80
|
"attribute": "inline",
|
|
75
81
|
"reflect": true,
|
|
76
82
|
"defaultValue": "false"
|
|
83
|
+
},
|
|
84
|
+
"mark": {
|
|
85
|
+
"type": "unknown",
|
|
86
|
+
"mutable": false,
|
|
87
|
+
"complexType": {
|
|
88
|
+
"original": "OzonContentMarkFunction",
|
|
89
|
+
"resolved": "((text: string) => OzonContentText[] | undefined) | undefined",
|
|
90
|
+
"references": {
|
|
91
|
+
"OzonContentMarkFunction": {
|
|
92
|
+
"location": "import",
|
|
93
|
+
"path": "./ozon-content.interfaces",
|
|
94
|
+
"id": "src/components/ozon-content/ozon-content.interfaces.ts::OzonContentMarkFunction"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": true,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": "To mark text."
|
|
103
|
+
}
|
|
77
104
|
}
|
|
78
105
|
};
|
|
79
106
|
}
|
|
@@ -86,7 +113,7 @@ export class OzonContent {
|
|
|
86
113
|
return [{
|
|
87
114
|
"method": "dsoAnchorClick",
|
|
88
115
|
"name": "dsoAnchorClick",
|
|
89
|
-
"bubbles":
|
|
116
|
+
"bubbles": false,
|
|
90
117
|
"cancelable": true,
|
|
91
118
|
"composed": true,
|
|
92
119
|
"docs": {
|
|
@@ -104,6 +131,27 @@ export class OzonContent {
|
|
|
104
131
|
}
|
|
105
132
|
}
|
|
106
133
|
}
|
|
134
|
+
}, {
|
|
135
|
+
"method": "dsoOzonContentMarkItemHighlight",
|
|
136
|
+
"name": "dsoOzonContentMarkItemHighlight",
|
|
137
|
+
"bubbles": false,
|
|
138
|
+
"cancelable": true,
|
|
139
|
+
"composed": true,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "Emitted when a marked item is highlighted."
|
|
143
|
+
},
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "OzonContentMarkItemHighlightEvent",
|
|
146
|
+
"resolved": "OzonContentMarkItemHighlightEvent",
|
|
147
|
+
"references": {
|
|
148
|
+
"OzonContentMarkItemHighlightEvent": {
|
|
149
|
+
"location": "import",
|
|
150
|
+
"path": "./ozon-content.interfaces",
|
|
151
|
+
"id": "src/components/ozon-content/ozon-content.interfaces.ts::OzonContentMarkItemHighlightEvent"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
107
155
|
}];
|
|
108
156
|
}
|
|
109
157
|
static get watchers() {
|
|
@@ -113,4 +161,8 @@ export class OzonContent {
|
|
|
113
161
|
}];
|
|
114
162
|
}
|
|
115
163
|
}
|
|
164
|
+
const dependencies = () => {
|
|
165
|
+
dependencies();
|
|
166
|
+
return (h(Fragment, null, h("dso-icon", null), h("dso-image-overlay", null), h("dso-tooltip", null), h("dso-table", null)));
|
|
167
|
+
};
|
|
116
168
|
//# sourceMappingURL=ozon-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,CAAC,EACD,SAAS,EAET,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,QAAQ,EAER,KAAK,GACN,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ozon-content.js","sourceRoot":"","sources":["../../../src/components/ozon-content/ozon-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,CAAC,EACD,SAAS,EAET,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,QAAQ,EAER,KAAK,GACN,MAAM,eAA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component,\r\n ComponentInterface,\r\n Event,\r\n EventEmitter,\r\n Prop,\r\n State,\r\n Fragment,\r\n JSX,\r\n Watch,\r\n} from \"@stencil/core\";\r\n\r\nimport { Mapper } from \"./ozon-content-mapper\";\r\nimport { OzonContentContext } from \"./ozon-content-context.interface\";\r\nimport {\r\n OzonContentAnchorClickEvent,\r\n OzonContentInputType,\r\n OzonContentMarkFunction,\r\n OzonContentMarkItemHighlightEvent,\r\n} from \"./ozon-content.interfaces\";\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\n\r\nconst mapper = new Mapper();\r\n\r\n@Component({\r\n tag: \"dso-ozon-content\",\r\n styleUrl: \"ozon-content.scss\",\r\n shadow: true,\r\n})\r\nexport class OzonContent implements ComponentInterface {\r\n /**\r\n * The XML to be rendered.\r\n */\r\n @Prop()\r\n content?: OzonContentInputType;\r\n\r\n /**\r\n * Setting this property creates dso-ozon-content as inline element instead of a block element.\r\n */\r\n @Prop({ reflect: true })\r\n inline = false;\r\n\r\n /**\r\n * To mark text.\r\n */\r\n @Prop()\r\n mark?: OzonContentMarkFunction;\r\n\r\n /**\r\n * Emitted when `<a>` is clicked.\r\n */\r\n @Event({ bubbles: false })\r\n dsoAnchorClick!: EventEmitter<OzonContentAnchorClickEvent>;\r\n\r\n /**\r\n * Emitted when a marked item is highlighted.\r\n */\r\n @Event({ bubbles: false })\r\n dsoOzonContentMarkItemHighlight!: EventEmitter<OzonContentMarkItemHighlightEvent>;\r\n\r\n @Watch(\"content\")\r\n contentWatcher() {\r\n this.state = {};\r\n }\r\n\r\n @State()\r\n state: OzonContentNodeState = {};\r\n\r\n private handleMarkItemHighlight = (text: string, elementRef: HTMLElement) => {\r\n this.dsoOzonContentMarkItemHighlight.emit({ text, elementRef });\r\n };\r\n\r\n render(): JSX.Element {\r\n const context: OzonContentContext = {\r\n state: this.state,\r\n inline: this.inline,\r\n mark: this.mark,\r\n setState: (state) => (this.state = state),\r\n emitMarkItemHighlight: this.handleMarkItemHighlight,\r\n emitAnchorClick: this.dsoAnchorClick.emit,\r\n };\r\n\r\n const transformed = mapper.transform(this.content, context);\r\n\r\n return <Fragment>{transformed}</Fragment>;\r\n }\r\n}\r\n\r\nconst dependencies = () => {\r\n dependencies();\r\n\r\n return (\r\n <>\r\n <dso-icon />\r\n <dso-image-overlay />\r\n <dso-tooltip />\r\n <dso-table />\r\n </>\r\n );\r\n};\r\n"]}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
position: relative;
|
|
3
3
|
display: var(--dso-selectable-display, block);
|
|
4
|
-
|
|
5
|
-
:host .dso-selectable-options {
|
|
6
|
-
list-style: none;
|
|
7
|
-
margin-top: 8px;
|
|
8
|
-
padding-left: 0;
|
|
9
|
-
}
|
|
10
|
-
:host .dso-selectable-options li + li {
|
|
11
|
-
margin-top: 8px;
|
|
4
|
+
padding-inline-start: 32px;
|
|
12
5
|
}
|
|
13
6
|
:host label {
|
|
14
7
|
font-weight: 400;
|
|
@@ -132,11 +125,6 @@
|
|
|
132
125
|
background-color: var(--dso-selectable-color, #39870c);
|
|
133
126
|
opacity: 1;
|
|
134
127
|
}
|
|
135
|
-
:host > dso-info {
|
|
136
|
-
float: none;
|
|
137
|
-
margin: 8px 16px 0 0;
|
|
138
|
-
width: 100%;
|
|
139
|
-
}
|
|
140
128
|
:host[invalid]:not([invalid=false]) {
|
|
141
129
|
--dso-selectable-color: #ce3f51;
|
|
142
130
|
}
|
|
@@ -153,11 +141,6 @@
|
|
|
153
141
|
|
|
154
142
|
.dso-selectable-container {
|
|
155
143
|
display: inline-block;
|
|
156
|
-
position: relative;
|
|
157
|
-
padding-inline-start: 32px;
|
|
158
|
-
}
|
|
159
|
-
.dso-selectable-container.has-info-button {
|
|
160
|
-
padding-inline-end: 32px;
|
|
161
144
|
}
|
|
162
145
|
.dso-selectable-container .dso-selectable-input-wrapper {
|
|
163
146
|
display: inline-block;
|
|
@@ -175,10 +158,4 @@
|
|
|
175
158
|
left: 2px;
|
|
176
159
|
top: 2px;
|
|
177
160
|
width: 20px;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
dso-info-button {
|
|
181
|
-
position: absolute;
|
|
182
|
-
right: 0;
|
|
183
|
-
top: 0;
|
|
184
161
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { h, Fragment, forceUpdate, } from "@stencil/core";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { createIdentifier } from "../../utils/create-identifier";
|
|
4
|
+
/**
|
|
5
|
+
* @slot - The label for this control
|
|
6
|
+
* @slot info - Rich Content to be slotted in Info.
|
|
7
|
+
* @slot options - for further nested selectable options: `<ul class="dso-selectable-options" slot="options">` and wrap each Selectable in a `<li>`.
|
|
8
|
+
*/
|
|
4
9
|
export class Selectable {
|
|
5
10
|
constructor() {
|
|
6
11
|
this.fallbackIdentifier = createIdentifier("DsoSelectable");
|
|
@@ -57,7 +62,7 @@ export class Selectable {
|
|
|
57
62
|
render() {
|
|
58
63
|
var _a;
|
|
59
64
|
const hasInfo = !!this.host.querySelector('[slot="info"]');
|
|
60
|
-
return (h(Fragment, null, h("div", { class:
|
|
65
|
+
return (h(Fragment, null, h("div", { class: "dso-selectable-container" }, h("div", { class: clsx("dso-selectable-input-wrapper", { "dso-keyboard-focus": this.keyboardFocus }) }, h("input", { type: this.type, id: this.getIdentifier(), value: this.value, name: this.name, "aria-invalid": (_a = this.invalid) === null || _a === void 0 ? void 0 : _a.toString(), "aria-describedby": hasInfo && this.infoFixed ? this.describedById : undefined, "aria-labelledBy": this.labelledById, disabled: this.disabled, required: this.required, checked: this.checked, onChange: this.handleOnChange, onBlur: () => (this.keyboardFocus = false), onKeyUp: () => (this.keyboardFocus = true), ref: (el) => (this.input = el) }), !this.labelledById ? (h("label", { htmlFor: this.getIdentifier() }, h("slot", null))) : (h("label", null, h("slot", null)))), hasInfo && !this.infoFixed && (h("dso-info-button", { active: this.infoActive, onDsoToggle: (e) => (this.infoActive = e.detail.active) }))), hasInfo && (h("dso-info", { id: hasInfo && this.infoFixed ? this.describedById : undefined, fixed: this.infoFixed, active: this.infoActive, onDsoClose: () => (this.infoActive = false) }, h("div", null, h("slot", { name: "info" })))), h("slot", { name: "options" })));
|
|
61
66
|
}
|
|
62
67
|
getIdentifier() {
|
|
63
68
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectable.js","sourceRoot":"","sources":["../../../src/components/selectable/selectable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,CAAC,EACD,SAAS,EACT,IAAI,EACJ,KAAK,EAEL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"selectable.js","sourceRoot":"","sources":["../../../src/components/selectable/selectable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,CAAC,EACD,SAAS,EACT,IAAI,EACJ,KAAK,EAEL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE;;;;GAIG;AAMH,MAAM,OAAO,UAAU;;IA0Gb,uBAAkB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAIvD,mBAAc,GAAG,CAAC,CAAQ,EAAE,EAAE;MACpC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;MAErB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAClB,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,YAAY,gBAAgB,IAAI,MAAM,CAAC,OAAO;OAC9D,CAAC,CAAC;IACL,CAAC,CAAC;;;;;;;;;;;;;sB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EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAE3C;UACE,YAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACG,CACZ;MACD,YAAM,IAAI,EAAC,SAAS,GAAG,CACd,CACZ,CAAC;EACJ,CAAC;EAEO,aAAa;;IACnB,OAAO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,kBAAkB,CAAC;EACpD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\r\n h,\r\n Component,\r\n Prop,\r\n Event,\r\n EventEmitter,\r\n Fragment,\r\n Element,\r\n State,\r\n forceUpdate,\r\n Watch,\r\n Method,\r\n} from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport { createIdentifier } from \"../../utils/create-identifier\";\r\nimport { SelectableChangeEvent } from \"./selectable.interfaces\";\r\n\r\n/**\r\n * @slot - The label for this control\r\n * @slot info - Rich Content to be slotted in Info.\r\n * @slot options - for further nested selectable options: `<ul class=\"dso-selectable-options\" slot=\"options\">` and wrap each Selectable in a `<li>`.\r\n */\r\n@Component({\r\n tag: \"dso-selectable\",\r\n styleUrl: \"selectable.scss\",\r\n scoped: true,\r\n})\r\nexport class Selectable {\r\n /**\r\n * Type of Selectable.\r\n *\r\n * `checkbox`: Multiple options\r\n * `radio`: Single option.\r\n */\r\n @Prop()\r\n type!: \"checkbox\" | \"radio\";\r\n\r\n /**\r\n * To set `<input id>` attribute for external references.\r\n */\r\n @Prop()\r\n identifier?: string;\r\n\r\n /**\r\n * Name of the Selectable. Can be used to group Selectables.\r\n */\r\n @Prop()\r\n name?: string;\r\n\r\n /**\r\n * The value of the Selectable.\r\n */\r\n @Prop()\r\n value!: string;\r\n\r\n /**\r\n * Set to true of the current value is not valid.\r\n */\r\n @Prop()\r\n invalid?: boolean;\r\n\r\n /**\r\n * To link this control to an element that describes it.\r\n */\r\n @Prop()\r\n describedById?: string;\r\n\r\n /**\r\n * To link this control to an element that labels it.\r\n */\r\n @Prop()\r\n labelledById?: string;\r\n\r\n /**\r\n * To disable the Selectable.\r\n */\r\n @Prop()\r\n disabled?: boolean;\r\n\r\n /**\r\n * To mark the Selectable as required.\r\n */\r\n @Prop()\r\n required?: boolean;\r\n\r\n /**\r\n * Mark the Selectable as checked\r\n */\r\n @Prop()\r\n checked?: boolean;\r\n\r\n /**\r\n * An indeterminate state is neither true or false. It means the answer is somewhere in between.\r\n *\r\n * Can be used to indicate child Selectables that are a mix of checked and unchecked.\r\n */\r\n @Prop()\r\n indeterminate?: boolean;\r\n\r\n /**\r\n * Set to true if the Info should not be toggled and always visible.\r\n */\r\n @Prop()\r\n infoFixed?: boolean;\r\n\r\n /**\r\n * Emitted when the user checks or unchecks the Selectable.\r\n */\r\n @Event()\r\n dsoChange!: EventEmitter<SelectableChangeEvent>;\r\n\r\n @Element()\r\n host!: HTMLDsoSelectableElement;\r\n\r\n @State()\r\n infoActive = false;\r\n\r\n @State()\r\n keyboardFocus = false;\r\n\r\n /**\r\n * Method to toggle the Info. Is set to `active` when passed.\r\n *\r\n * If `active` is not passed, Info is toggled to opposite value.\r\n * @param active\r\n */\r\n @Method()\r\n async toggleInfo(active?: boolean) {\r\n this.infoActive = active ?? !this.infoActive;\r\n }\r\n\r\n private mutationObserver?: MutationObserver;\r\n\r\n private fallbackIdentifier = createIdentifier(\"DsoSelectable\");\r\n\r\n private input: HTMLInputElement | undefined;\r\n\r\n private handleOnChange = (e: Event) => {\r\n const { target } = e;\r\n\r\n this.dsoChange.emit({\r\n originalEvent: e,\r\n checked: target instanceof HTMLInputElement && target.checked,\r\n });\r\n };\r\n\r\n componentDidLoad() {\r\n this.mutationObserver?.disconnect();\r\n\r\n this.mutationObserver = new MutationObserver(() => forceUpdate(this.host));\r\n this.mutationObserver.observe(this.host, {\r\n childList: true,\r\n });\r\n\r\n this.setIndeterminate();\r\n }\r\n\r\n disconnectedCallback() {\r\n this.mutationObserver?.disconnect();\r\n }\r\n\r\n @Watch(\"indeterminate\")\r\n setIndeterminate() {\r\n if (!(this.input instanceof HTMLInputElement) || this.type !== \"checkbox\") {\r\n return;\r\n }\r\n\r\n this.input.indeterminate = !!this.indeterminate;\r\n }\r\n\r\n render() {\r\n const hasInfo = !!this.host.querySelector('[slot=\"info\"]');\r\n\r\n return (\r\n <Fragment>\r\n <div class=\"dso-selectable-container\">\r\n <div class={clsx(\"dso-selectable-input-wrapper\", { \"dso-keyboard-focus\": this.keyboardFocus })}>\r\n <input\r\n type={this.type}\r\n id={this.getIdentifier()}\r\n value={this.value}\r\n name={this.name}\r\n aria-invalid={this.invalid?.toString()}\r\n aria-describedby={hasInfo && this.infoFixed ? this.describedById : undefined}\r\n aria-labelledBy={this.labelledById}\r\n disabled={this.disabled}\r\n required={this.required}\r\n checked={this.checked}\r\n onChange={this.handleOnChange}\r\n onBlur={() => (this.keyboardFocus = false)}\r\n onKeyUp={() => (this.keyboardFocus = true)}\r\n ref={(el) => (this.input = el)}\r\n />\r\n {!this.labelledById ? (\r\n <label htmlFor={this.getIdentifier()}>\r\n <slot />\r\n </label>\r\n ) : (\r\n <label>\r\n <slot />\r\n </label>\r\n )}\r\n </div>\r\n {hasInfo && !this.infoFixed && (\r\n <dso-info-button\r\n active={this.infoActive}\r\n onDsoToggle={(e) => (this.infoActive = e.detail.active)}\r\n ></dso-info-button>\r\n )}\r\n </div>\r\n {hasInfo && (\r\n <dso-info\r\n id={hasInfo && this.infoFixed ? this.describedById : undefined}\r\n fixed={this.infoFixed}\r\n active={this.infoActive}\r\n onDsoClose={() => (this.infoActive = false)}\r\n >\r\n <div>\r\n <slot name=\"info\"></slot>\r\n </div>\r\n </dso-info>\r\n )}\r\n <slot name=\"options\" />\r\n </Fragment>\r\n );\r\n }\r\n\r\n private getIdentifier(): string {\r\n return this.identifier ?? this.fallbackIdentifier;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form random hash
|
|
3
|
+
*/
|
|
4
|
+
function chr4() {
|
|
5
|
+
return Math.random().toString(16).slice(-4);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create random identifier with a prefix
|
|
9
|
+
* @param prefix
|
|
10
|
+
*/
|
|
11
|
+
function createIdentifier(prefix) {
|
|
12
|
+
return `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { createIdentifier as c };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=create-identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"create-identifier.js","mappings":"AAAA;;;SAGgB,IAAI;EAClB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED;;;;SAIgB,gBAAgB,CAAC,MAAc;EAC7C,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC;AAClG;;;;","names":[],"sources":["src/utils/create-identifier.ts"],"sourcesContent":["/**\r\n * Form random hash\r\n */\r\nexport function chr4() {\r\n return Math.random().toString(16).slice(-4);\r\n}\r\n\r\n/**\r\n * Create random identifier with a prefix\r\n * @param prefix\r\n */\r\nexport function createIdentifier(prefix: string): string {\r\n return `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\r\n}\r\n"],"version":3}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$
|
|
3
|
-
import { d as defineCustomElement$
|
|
4
|
-
import { d as defineCustomElement$
|
|
5
|
-
import { d as defineCustomElement$
|
|
6
|
-
import { d as defineCustomElement$
|
|
7
|
-
import { d as defineCustomElement$
|
|
2
|
+
import { d as defineCustomElement$9 } from './alert.js';
|
|
3
|
+
import { d as defineCustomElement$8 } from './annotation-button.js';
|
|
4
|
+
import { d as defineCustomElement$7 } from './badge.js';
|
|
5
|
+
import { d as defineCustomElement$6 } from './icon.js';
|
|
6
|
+
import { d as defineCustomElement$5 } from './image-overlay.js';
|
|
7
|
+
import { d as defineCustomElement$4 } from './label.js';
|
|
8
|
+
import { d as defineCustomElement$3 } from './ozon-content.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './table.js';
|
|
8
10
|
import { d as defineCustomElement$1 } from './tooltip.js';
|
|
9
11
|
|
|
10
12
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
@@ -51,6 +53,7 @@ const DocumentComponent = /*@__PURE__*/ proxyCustomElement(class DocumentCompone
|
|
|
51
53
|
this.dsoOpenToggle = createEvent(this, "dsoOpenToggle", 3);
|
|
52
54
|
this.dsoOzonContentAnchorClick = createEvent(this, "dsoOzonContentAnchorClick", 3);
|
|
53
55
|
this.dsoAnnotationToggle = createEvent(this, "dsoAnnotationToggle", 3);
|
|
56
|
+
this.dsoMarkItemHighlight = createEvent(this, "dsoMarkItemHighlight", 3);
|
|
54
57
|
this.handleHeadingClick = (e) => {
|
|
55
58
|
if (this.type !== "LID") {
|
|
56
59
|
this.dsoOpenToggle.emit({ originalEvent: e, open: !this.open });
|
|
@@ -76,6 +79,7 @@ const DocumentComponent = /*@__PURE__*/ proxyCustomElement(class DocumentCompone
|
|
|
76
79
|
this.alternativeTitle = undefined;
|
|
77
80
|
this.type = undefined;
|
|
78
81
|
this.wijzigactie = undefined;
|
|
82
|
+
this.mark = undefined;
|
|
79
83
|
}
|
|
80
84
|
get wijzigactieLabel() {
|
|
81
85
|
return this.wijzigactie && wijzigActieLabels[this.wijzigactie];
|
|
@@ -91,7 +95,7 @@ const DocumentComponent = /*@__PURE__*/ proxyCustomElement(class DocumentCompone
|
|
|
91
95
|
}
|
|
92
96
|
render() {
|
|
93
97
|
const suffix = this.suffix();
|
|
94
|
-
return (h(Fragment, null, h("div", { class: "heading-container" }, this.wijzigactie && h("span", { class: "wijzigactie-label" }, this.wijzigactieLabel, ":"), h("div", { class: "heading" }, h(Heading, { heading: this.heading, class: "heading-element", onClick: this.handleHeadingClick }, this.type !== "LID" && (h("button", { type: "button", class: "toggle-button" }, h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }))), h("div", { class: "title" }, this.notApplicable && h("span", { class: "not-applicable" }, "Niet van toepassing:"), this.label || this.nummer || this.opschrift ? (h(Fragment, null, this.label && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.label, onDsoAnchorClick: this.handleOzonContentAnchorClick, inline: true }))), this.nummer && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.nummer, onDsoAnchorClick: this.handleOzonContentAnchorClick, inline: true }))), this.opschrift && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.opschrift, onDsoAnchorClick: this.handleOzonContentAnchorClick, inline: true }))))) : (this.alternativeTitle), suffix && h("span", null, " - [", suffix, "]"))), this.genesteOntwerpInformatie && !this.open && !this.bevatOntwerpInformatie && (h(Fragment, null, h("dso-badge", { status: "warning", "aria-describedby": "nested-draft-description" }, "!"), h("dso-tooltip", { id: "nested-draft-description" }, "Er is een ontwerp beschikbaar."))), (this.bevatOntwerpInformatie || this.annotated) && (h("div", { class: "addons" }, this.bevatOntwerpInformatie && (h("dso-label", { status: "warning", compact: true }, "Ontwerp")), this.annotated && (h("dso-annotation-button", { identifier: "expandable", open: this.openAnnotation, onDsoClick: (e) => this.dsoAnnotationToggle.emit({ originalEvent: e }) })))))), h("slot", { name: "annotation" }), this.open && (this.inhoud || this.gereserveerd || this.vervallen) && (h("div", { class: "content" }, this.gereserveerd && (h("dso-alert", { status: "info" }, "Dit onderdeel is gereserveerd voor toekomstige toevoeging.")), this.vervallen && h("dso-alert", { status: "info" }, "Dit onderdeel is vervallen."), this.inhoud && (h("dso-ozon-content", { content: this.inhoud, onDsoAnchorClick: this.handleOzonContentAnchorClick })))), h("slot", null)));
|
|
98
|
+
return (h(Fragment, null, h("div", { class: "heading-container" }, this.wijzigactie && h("span", { class: "wijzigactie-label" }, this.wijzigactieLabel, ":"), h("div", { class: "heading" }, h(Heading, { heading: this.heading, class: "heading-element", onClick: this.handleHeadingClick }, this.type !== "LID" && (h("button", { type: "button", class: "toggle-button" }, h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }))), h("div", { class: "title" }, this.notApplicable && h("span", { class: "not-applicable" }, "Niet van toepassing:"), this.label || this.nummer || this.opschrift ? (h(Fragment, null, this.label && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.label, onDsoAnchorClick: this.handleOzonContentAnchorClick, mark: this.mark && ((text) => { var _a; return (_a = this.mark) === null || _a === void 0 ? void 0 : _a.call(this, text, "label"); }), onDsoOzonContentMarkItemHighlight: (e) => this.dsoMarkItemHighlight.emit(Object.assign(Object.assign({}, e.detail), { source: "label" })), inline: true }))), this.nummer && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.nummer, onDsoAnchorClick: this.handleOzonContentAnchorClick, mark: this.mark && ((text) => { var _a; return (_a = this.mark) === null || _a === void 0 ? void 0 : _a.call(this, text, "nummer"); }), onDsoOzonContentMarkItemHighlight: (e) => this.dsoMarkItemHighlight.emit(Object.assign(Object.assign({}, e.detail), { source: "nummer" })), inline: true }))), this.opschrift && (h(Fragment, null, " ", h("dso-ozon-content", { content: this.opschrift, onDsoAnchorClick: this.handleOzonContentAnchorClick, mark: this.mark && ((text) => { var _a; return (_a = this.mark) === null || _a === void 0 ? void 0 : _a.call(this, text, "opschrift"); }), onDsoOzonContentMarkItemHighlight: (e) => this.dsoMarkItemHighlight.emit(Object.assign(Object.assign({}, e.detail), { source: "opschrift" })), inline: true }))))) : (this.alternativeTitle), suffix && h("span", null, " - [", suffix, "]"))), this.genesteOntwerpInformatie && !this.open && !this.bevatOntwerpInformatie && (h(Fragment, null, h("dso-badge", { status: "warning", "aria-describedby": "nested-draft-description" }, "!"), h("dso-tooltip", { id: "nested-draft-description" }, "Er is een ontwerp beschikbaar."))), (this.bevatOntwerpInformatie || this.annotated) && (h("div", { class: "addons" }, this.bevatOntwerpInformatie && (h("dso-label", { status: "warning", compact: true }, "Ontwerp")), this.annotated && (h("dso-annotation-button", { identifier: "expandable", open: this.openAnnotation, onDsoClick: (e) => this.dsoAnnotationToggle.emit({ originalEvent: e }) })))))), h("slot", { name: "annotation" }), this.open && (this.inhoud || this.gereserveerd || this.vervallen) && (h("div", { class: "content" }, this.gereserveerd && (h("dso-alert", { status: "info" }, "Dit onderdeel is gereserveerd voor toekomstige toevoeging.")), this.vervallen && h("dso-alert", { status: "info" }, "Dit onderdeel is vervallen."), this.inhoud && (h("dso-ozon-content", { content: this.inhoud, onDsoAnchorClick: this.handleOzonContentAnchorClick, mark: this.mark && ((text) => { var _a; return (_a = this.mark) === null || _a === void 0 ? void 0 : _a.call(this, text, "inhoud"); }), onDsoOzonContentMarkItemHighlight: (e) => this.dsoMarkItemHighlight.emit(Object.assign(Object.assign({}, e.detail), { source: "inhoud" })) })))), h("slot", null)));
|
|
95
99
|
}
|
|
96
100
|
static get style() { return documentComponentCss; }
|
|
97
101
|
}, [1, "dso-document-component", {
|
|
@@ -111,13 +115,14 @@ const DocumentComponent = /*@__PURE__*/ proxyCustomElement(class DocumentCompone
|
|
|
111
115
|
"openAnnotation": [4, "open-annotation"],
|
|
112
116
|
"alternativeTitle": [1, "alternative-title"],
|
|
113
117
|
"type": [513],
|
|
114
|
-
"wijzigactie": [513]
|
|
118
|
+
"wijzigactie": [513],
|
|
119
|
+
"mark": [16]
|
|
115
120
|
}]);
|
|
116
121
|
function defineCustomElement() {
|
|
117
122
|
if (typeof customElements === "undefined") {
|
|
118
123
|
return;
|
|
119
124
|
}
|
|
120
|
-
const components = ["dso-document-component", "dso-alert", "dso-annotation-button", "dso-badge", "dso-icon", "dso-label", "dso-ozon-content", "dso-tooltip"];
|
|
125
|
+
const components = ["dso-document-component", "dso-alert", "dso-annotation-button", "dso-badge", "dso-icon", "dso-image-overlay", "dso-label", "dso-ozon-content", "dso-table", "dso-tooltip"];
|
|
121
126
|
components.forEach(tagName => { switch (tagName) {
|
|
122
127
|
case "dso-document-component":
|
|
123
128
|
if (!customElements.get(tagName)) {
|
|
@@ -126,30 +131,40 @@ function defineCustomElement() {
|
|
|
126
131
|
break;
|
|
127
132
|
case "dso-alert":
|
|
128
133
|
if (!customElements.get(tagName)) {
|
|
129
|
-
defineCustomElement$
|
|
134
|
+
defineCustomElement$9();
|
|
130
135
|
}
|
|
131
136
|
break;
|
|
132
137
|
case "dso-annotation-button":
|
|
133
138
|
if (!customElements.get(tagName)) {
|
|
134
|
-
defineCustomElement$
|
|
139
|
+
defineCustomElement$8();
|
|
135
140
|
}
|
|
136
141
|
break;
|
|
137
142
|
case "dso-badge":
|
|
138
143
|
if (!customElements.get(tagName)) {
|
|
139
|
-
defineCustomElement$
|
|
144
|
+
defineCustomElement$7();
|
|
140
145
|
}
|
|
141
146
|
break;
|
|
142
147
|
case "dso-icon":
|
|
143
148
|
if (!customElements.get(tagName)) {
|
|
144
|
-
defineCustomElement$
|
|
149
|
+
defineCustomElement$6();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "dso-image-overlay":
|
|
153
|
+
if (!customElements.get(tagName)) {
|
|
154
|
+
defineCustomElement$5();
|
|
145
155
|
}
|
|
146
156
|
break;
|
|
147
157
|
case "dso-label":
|
|
148
158
|
if (!customElements.get(tagName)) {
|
|
149
|
-
defineCustomElement$
|
|
159
|
+
defineCustomElement$4();
|
|
150
160
|
}
|
|
151
161
|
break;
|
|
152
162
|
case "dso-ozon-content":
|
|
163
|
+
if (!customElements.get(tagName)) {
|
|
164
|
+
defineCustomElement$3();
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
case "dso-table":
|
|
153
168
|
if (!customElements.get(tagName)) {
|
|
154
169
|
defineCustomElement$2();
|
|
155
170
|
}
|