@dso-toolkit/core 70.1.0 → 72.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.
Files changed (126) hide show
  1. package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.cjs.js.map +1 -1
  2. package/dist/cjs/dso-alert_6.cjs.entry.js +54 -34
  3. package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
  4. package/dist/cjs/dso-annotation-locatie.dso-document-component.entry.cjs.js.map +1 -1
  5. package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +3 -2
  6. package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-autosuggest.cjs.entry.js +19 -2
  8. package/dist/cjs/dso-autosuggest.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dso-autosuggest.entry.cjs.js.map +1 -1
  10. package/dist/cjs/dso-header.cjs.entry.js +3 -0
  11. package/dist/cjs/dso-header.cjs.entry.js.map +1 -1
  12. package/dist/cjs/dso-header.entry.cjs.js.map +1 -1
  13. package/dist/cjs/dso-logo.cjs.entry.js +1 -1
  14. package/dist/cjs/dso-logo.cjs.entry.js.map +1 -1
  15. package/dist/cjs/dso-logo.entry.cjs.js.map +1 -1
  16. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  17. package/dist/cjs/dso-viewer-grid.cjs.entry.js +1 -1
  18. package/dist/cjs/dso-viewer-grid.cjs.entry.js.map +1 -1
  19. package/dist/cjs/dso-viewer-grid.entry.cjs.js.map +1 -1
  20. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +6 -6
  21. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -1
  22. package/dist/cjs/dsot-document-component-demo.entry.cjs.js.map +1 -1
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/collection/components/autosuggest/autosuggest.js +19 -2
  25. package/dist/collection/components/autosuggest/autosuggest.js.map +1 -1
  26. package/dist/collection/components/document-component/document-component.js +26 -2
  27. package/dist/collection/components/document-component/document-component.js.map +1 -1
  28. package/dist/collection/components/document-component-demo/document-component.demo.js +29 -6
  29. package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -1
  30. package/dist/collection/components/header/header.js +3 -0
  31. package/dist/collection/components/header/header.js.map +1 -1
  32. package/dist/collection/components/logo/logo.css +3 -8
  33. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +4 -2
  34. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +1 -1
  35. package/dist/collection/components/ozon-content/nodes/figuur.node.js +34 -10
  36. package/dist/collection/components/ozon-content/nodes/figuur.node.js.map +1 -1
  37. package/dist/collection/components/ozon-content/nodes/inline-tekst-afbeelding.node.js +6 -3
  38. package/dist/collection/components/ozon-content/nodes/inline-tekst-afbeelding.node.js.map +1 -1
  39. package/dist/collection/components/ozon-content/nodes/kop.node.js +1 -1
  40. package/dist/collection/components/ozon-content/nodes/kop.node.js.map +1 -1
  41. package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
  42. package/dist/collection/components/ozon-content/ozon-content-mapper.js +3 -6
  43. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  44. package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
  45. package/dist/collection/components/ozon-content/ozon-content.css +11 -0
  46. package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
  47. package/dist/collection/components/ozon-content/ozon-content.js +22 -23
  48. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  49. package/dist/collection/components/viewer-grid/viewer-grid.css +1 -1
  50. package/dist/components/document-component.js +4 -2
  51. package/dist/components/document-component.js.map +1 -1
  52. package/dist/components/dso-autosuggest.js +19 -2
  53. package/dist/components/dso-autosuggest.js.map +1 -1
  54. package/dist/components/dso-header.js +3 -0
  55. package/dist/components/dso-header.js.map +1 -1
  56. package/dist/components/dso-logo.js +1 -1
  57. package/dist/components/dso-logo.js.map +1 -1
  58. package/dist/components/dso-viewer-grid.js +1 -1
  59. package/dist/components/dso-viewer-grid.js.map +1 -1
  60. package/dist/components/dsot-document-component-demo.js +7 -6
  61. package/dist/components/dsot-document-component-demo.js.map +1 -1
  62. package/dist/components/ozon-content.js +55 -35
  63. package/dist/components/ozon-content.js.map +1 -1
  64. package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.esm.js.map +1 -1
  65. package/dist/dso-toolkit/dso-annotation-locatie.dso-document-component.entry.esm.js.map +1 -1
  66. package/dist/dso-toolkit/dso-autosuggest.entry.esm.js.map +1 -1
  67. package/dist/dso-toolkit/dso-header.entry.esm.js.map +1 -1
  68. package/dist/dso-toolkit/dso-logo.entry.esm.js.map +1 -1
  69. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  70. package/dist/dso-toolkit/dso-viewer-grid.entry.esm.js.map +1 -1
  71. package/dist/dso-toolkit/dsot-document-component-demo.entry.esm.js.map +1 -1
  72. package/dist/dso-toolkit/p-159753d7.entry.js +2 -0
  73. package/dist/dso-toolkit/p-159753d7.entry.js.map +1 -0
  74. package/dist/dso-toolkit/{p-1d4589b3.entry.js → p-26d6681e.entry.js} +2 -2
  75. package/dist/dso-toolkit/p-26d6681e.entry.js.map +1 -0
  76. package/dist/dso-toolkit/p-3cb4ac7e.entry.js +2 -0
  77. package/dist/dso-toolkit/p-3cb4ac7e.entry.js.map +1 -0
  78. package/dist/dso-toolkit/{p-fcbb6aac.entry.js → p-43b5e74b.entry.js} +2 -2
  79. package/dist/dso-toolkit/p-43b5e74b.entry.js.map +1 -0
  80. package/dist/dso-toolkit/p-5509732c.entry.js +2 -0
  81. package/dist/dso-toolkit/p-5509732c.entry.js.map +1 -0
  82. package/dist/dso-toolkit/{p-95d77ea8.entry.js → p-5f01431d.entry.js} +2 -2
  83. package/dist/dso-toolkit/p-5f01431d.entry.js.map +1 -0
  84. package/dist/dso-toolkit/p-7918004d.entry.js +2 -0
  85. package/dist/dso-toolkit/p-7918004d.entry.js.map +1 -0
  86. package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-panel.dso-table.entry.js.map +1 -1
  87. package/dist/esm/dso-alert_6.entry.js +54 -34
  88. package/dist/esm/dso-alert_6.entry.js.map +1 -1
  89. package/dist/esm/dso-annotation-locatie.dso-document-component.entry.js.map +1 -1
  90. package/dist/esm/dso-annotation-locatie_2.entry.js +3 -2
  91. package/dist/esm/dso-annotation-locatie_2.entry.js.map +1 -1
  92. package/dist/esm/dso-autosuggest.entry.js +19 -2
  93. package/dist/esm/dso-autosuggest.entry.js.map +1 -1
  94. package/dist/esm/dso-header.entry.js +3 -0
  95. package/dist/esm/dso-header.entry.js.map +1 -1
  96. package/dist/esm/dso-logo.entry.js +1 -1
  97. package/dist/esm/dso-logo.entry.js.map +1 -1
  98. package/dist/esm/dso-toolkit.js +1 -1
  99. package/dist/esm/dso-viewer-grid.entry.js +1 -1
  100. package/dist/esm/dso-viewer-grid.entry.js.map +1 -1
  101. package/dist/esm/dsot-document-component-demo.entry.js +6 -6
  102. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -1
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/types/components/autosuggest/autosuggest.d.ts +2 -0
  105. package/dist/types/components/document-component/document-component.d.ts +5 -0
  106. package/dist/types/components/document-component-demo/document-component.demo.d.ts +8 -2
  107. package/dist/types/components/ozon-content/nodes/ext-ref.node.d.ts +1 -1
  108. package/dist/types/components/ozon-content/nodes/figuur.node.d.ts +3 -1
  109. package/dist/types/components/ozon-content/nodes/inline-tekst-afbeelding.node.d.ts +2 -1
  110. package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +2 -2
  111. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +2 -1
  112. package/dist/types/components/ozon-content/ozon-content.d.ts +5 -5
  113. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +4 -0
  114. package/dist/types/components.d.ts +28 -10
  115. package/package.json +3 -3
  116. package/dist/dso-toolkit/p-1d4589b3.entry.js.map +0 -1
  117. package/dist/dso-toolkit/p-95d77ea8.entry.js.map +0 -1
  118. package/dist/dso-toolkit/p-cc1ffecd.entry.js +0 -2
  119. package/dist/dso-toolkit/p-cc1ffecd.entry.js.map +0 -1
  120. package/dist/dso-toolkit/p-d39ac774.entry.js +0 -2
  121. package/dist/dso-toolkit/p-d39ac774.entry.js.map +0 -1
  122. package/dist/dso-toolkit/p-da12ccf9.entry.js +0 -2
  123. package/dist/dso-toolkit/p-da12ccf9.entry.js.map +0 -1
  124. package/dist/dso-toolkit/p-e67860a0.entry.js +0 -2
  125. package/dist/dso-toolkit/p-e67860a0.entry.js.map +0 -1
  126. package/dist/dso-toolkit/p-fcbb6aac.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"document-component.demo.js","sourceRoot":"","sources":["../../../../src/components/document-component-demo/document-component.demo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpH,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,MAAM,MAAM,eAAe,CAAC;AAsCnC,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QAEH,eAAU,GAAG,KAAK,CAAC;QAQnB;;WAEG;QAEH,gBAAW,GAAG,KAAK,CAAC;QAEpB;;WAEG;QAEH,SAAI,GAA0B,UAAU,CAAC;QAqBzC,iBAAY,GAAwB,EAAE,CAAC;QAGvC,qBAAgB,GAAwB,EAAE,CAAC;QAG3C,aAAQ,GAAwB,EAAE,CAAC;QAGnC,kBAAa,GAAwB,EAAE,CAAC;QAGxC,gCAA2B,GAAwB,EAAE,CAAC;QAiL9C,0BAAqB,GAAG,CAC9B,iBAAoC,EACpC,MAA6C,EAC7C,EAAE;YACF,MAAM,iBAAiB,GAA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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IAgBO,WAAW,CAAC,iBAAoC;QACtD,OAAO,CACL,iBAAiB,CAAC,IAAI,KAAK,SAAS;YACpC,iBAAiB,CAAC,IAAI,KAAK,cAAc;YACzC,iBAAiB,CAAC,IAAI,KAAK,SAAS;YACpC,iBAAiB,CAAC,IAAI,KAAK,KAAK,CACjC,CAAC;IACJ,CAAC;IAoED,MAAM;;QACJ,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAE/C,OAAO,CACL,+EAAwB,KAAK,EAAC,yBAAyB;YACrD,4DAAK,KAAK,EAAC,YAAY;gBACrB,2DAAI,KAAK,EAAC,qBAAqB,IAC5B,MAAA,MAAA,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,kBAAkB,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACjF,UAAI,KAAK,EAAE,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;oBACvD,EAAC,UAAU,IAAC,iBAAiB,EAAE,CAAC,GAAI,CACjC,CACN,CAAC,CACC,CACD;YACL,IAAI,CAAC,QAAQ,IAAI,EAAC,iBAAiB,qDAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAI,CACvC,CAC1B,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BF","sourcesContent":["import { h, Component, ComponentInterface, State, Prop, Watch, Event, EventEmitter, Fragment } from \"@stencil/core\";\r\nimport sampleSize from \"lodash.samplesize\";\r\nimport random from \"lodash.random\";\r\n\r\nimport {\r\n DocumentComponentMode,\r\n DocumentComponentOzonContentAnchorClickEvent,\r\n DocumentComponentRecursiveToggleEvent,\r\n DocumentComponentTableOfContentsClickEvent,\r\n DocumentComponentWijzigactie,\r\n} from \"../document-component/document-component.models\";\r\nimport { DsoDocumentComponentCustomEvent } from \"../../components\";\r\n\r\ninterface DocumentEmbedded {\r\n _embedded?: {\r\n ontwerpTekststructuurDocumentComponenten?: DocumentComponent[];\r\n tekststructuurDocumentComponenten?: DocumentComponent[];\r\n };\r\n}\r\n\r\ninterface DocumentComponent extends DocumentEmbedded {\r\n documentTechnischId: string;\r\n type?: string;\r\n labelXml?: string;\r\n nummerXml?: string;\r\n volgordeNummer: number;\r\n opschrift?: string;\r\n inhoud?: string;\r\n gereserveerd?: boolean;\r\n vervallen?: boolean;\r\n bevatOntwerpInformatie?: boolean;\r\n wijzigactie?: DocumentComponentWijzigactie;\r\n mode: DocumentComponentMode;\r\n}\r\n\r\n@Component({\r\n tag: \"dsot-document-component-demo\",\r\n scoped: true, // scoped because we are immitating the usage of <dso-document-component> in a page\r\n styleUrl: \"document-component.demo.scss\",\r\n})\r\nexport class DocumentComponentDemo implements ComponentInterface {\r\n /**\r\n * Show canvas to where Document Component extends.\r\n */\r\n @Prop({ reflect: true })\r\n showCanvas = false;\r\n\r\n /**\r\n * Name of the file to load.\r\n */\r\n @Prop()\r\n jsonFile?: string;\r\n\r\n /**\r\n * The default state for all Document Components.\r\n */\r\n @Prop()\r\n openDefault = false;\r\n\r\n /**\r\n * The mode of the Document Component. One of \"document\" or \"table-of-contents\". Defaults to \"document\"\r\n */\r\n @Prop({ reflect: true })\r\n mode: DocumentComponentMode = \"document\";\r\n\r\n /**\r\n * To demo user interacting with IntRef or IntIoRef elements.\r\n */\r\n @Event()\r\n dsotOzonContentAnchorClick!: EventEmitter<DocumentComponentOzonContentAnchorClickEvent>;\r\n\r\n /**\r\n * To demo user interacting the heading in mode=\"table-of-contents\".\r\n */\r\n @Event({ bubbles: false })\r\n dsotTableOfContentsClick!: EventEmitter<DocumentComponentTableOfContentsClickEvent>;\r\n\r\n @State()\r\n response?: DocumentEmbedded;\r\n\r\n @State()\r\n document?: DocumentComponent;\r\n\r\n @State()\r\n openOrClosed: DocumentComponent[] = [];\r\n\r\n @State()\r\n openedAnnotation: DocumentComponent[] = [];\r\n\r\n @State()\r\n filtered: DocumentComponent[] = [];\r\n\r\n @State()\r\n notApplicable: DocumentComponent[] = [];\r\n\r\n @State()\r\n activeAnnotationSelectables: DocumentComponent[] = [];\r\n\r\n @Watch(\"jsonFile\")\r\n async jsonFileWatcher() {\r\n this.openOrClosed = [];\r\n\r\n await this.loadData();\r\n }\r\n\r\n @Watch(\"openDefault\")\r\n async openDefaultWatcher() {\r\n this.openOrClosed = [];\r\n\r\n await this.loadData();\r\n }\r\n\r\n async componentDidLoad(): Promise<void> {\r\n await this.loadData();\r\n }\r\n\r\n private getEmbeddedDocumentComponents(documentEmbedded: DocumentEmbedded | undefined) {\r\n if (documentEmbedded?._embedded?.ontwerpTekststructuurDocumentComponenten) {\r\n return {\r\n documentComponents: documentEmbedded._embedded.ontwerpTekststructuurDocumentComponenten,\r\n ontwerp: true,\r\n };\r\n }\r\n\r\n if (documentEmbedded?._embedded?.tekststructuurDocumentComponenten) {\r\n return {\r\n documentComponents: documentEmbedded._embedded.tekststructuurDocumentComponenten,\r\n ontwerp: false,\r\n };\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private concatEmbeddedDocumentComponents(documentComponent: DocumentComponent): DocumentComponent[] {\r\n const embeddedDocuments = [...(this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents ?? [])];\r\n\r\n for (const d of embeddedDocuments) {\r\n embeddedDocuments.push(...this.concatEmbeddedDocumentComponents(d));\r\n }\r\n\r\n return embeddedDocuments;\r\n }\r\n\r\n private selectRandomDocumentComponents(\r\n documentComponent: DocumentComponent,\r\n exclude: DocumentComponent[] = [],\r\n ): DocumentComponent[] {\r\n const documentComponents = this.concatEmbeddedDocumentComponents(documentComponent).filter(\r\n (d) => !exclude.includes(d),\r\n );\r\n const size = random(0, Math.floor(documentComponents.length / 10));\r\n\r\n return sampleSize(documentComponents, size);\r\n }\r\n\r\n private async loadData() {\r\n if (!this.jsonFile) {\r\n this.response = undefined;\r\n this.document = undefined;\r\n\r\n return;\r\n }\r\n\r\n this.response = await fetch(this.jsonFile).then((r) => r.json());\r\n this.document = this.getEmbeddedDocumentComponents(this.response)?.documentComponents[0];\r\n\r\n if (this.document?.type === \"LICHAAM\") {\r\n this.notApplicable = this.selectRandomDocumentComponents(this.document);\r\n this.filtered = this.selectRandomDocumentComponents(this.document, this.notApplicable);\r\n } else {\r\n this.notApplicable = [];\r\n this.filtered = [];\r\n }\r\n }\r\n\r\n private handleOpenToggle(documentComponent: DocumentComponent, force?: boolean) {\r\n const isOpenOrClosed = typeof force === \"boolean\" ? force : this.openOrClosed.includes(documentComponent);\r\n\r\n if (isOpenOrClosed && this.openOrClosed.includes(documentComponent)) {\r\n this.openOrClosed = this.openOrClosed.filter((d) => d !== documentComponent);\r\n } else if (!isOpenOrClosed && !this.openOrClosed.includes(documentComponent)) {\r\n this.openOrClosed = [...this.openOrClosed, documentComponent];\r\n }\r\n }\r\n\r\n private handleAnnotationToggle(documentComponent: DocumentComponent) {\r\n this.openedAnnotation = this.isOpenedAnnotation(documentComponent)\r\n ? this.openedAnnotation.filter((d) => d !== documentComponent)\r\n : [...this.openedAnnotation, documentComponent];\r\n\r\n if (!this.isOpen(documentComponent)) {\r\n this.openOrClosed = [...this.openOrClosed, documentComponent];\r\n }\r\n }\r\n\r\n private handleSelectableChange(documentComponent: DocumentComponent) {\r\n this.activeAnnotationSelectables = this.isCheckedSlideToggle(documentComponent)\r\n ? this.activeAnnotationSelectables.filter((d) => d !== documentComponent)\r\n : [...this.activeAnnotationSelectables, documentComponent];\r\n }\r\n\r\n private handleOzonContentAnchorClick(\r\n e: DsoDocumentComponentCustomEvent<DocumentComponentOzonContentAnchorClickEvent>,\r\n ) {\r\n this.dsotOzonContentAnchorClick.emit(e.detail);\r\n }\r\n\r\n private handleTableOfContentsClick(e: DsoDocumentComponentCustomEvent<DocumentComponentTableOfContentsClickEvent>) {\r\n this.dsotTableOfContentsClick.emit(e.detail);\r\n }\r\n\r\n private isCheckedSlideToggle(documentComponent: DocumentComponent) {\r\n return this.activeAnnotationSelectables.includes(documentComponent);\r\n }\r\n\r\n private hasFilteredChildren(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.filtered.includes(documentComponent) ||\r\n (this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.some((d) =>\r\n this.hasFilteredChildren(d),\r\n ) ??\r\n false)\r\n );\r\n }\r\n\r\n private isOpen(documentComponent: DocumentComponent): boolean {\r\n return documentComponent.type === \"LID\" || this.openDefault\r\n ? !this.openOrClosed.includes(documentComponent)\r\n : this.openOrClosed.includes(documentComponent);\r\n }\r\n\r\n private isOpenedAnnotation(documentComponent: DocumentComponent): boolean {\r\n return this.openedAnnotation.includes(documentComponent);\r\n }\r\n\r\n private isFiltered(documentComponent: DocumentComponent): boolean {\r\n return this.filtered.includes(documentComponent);\r\n }\r\n\r\n private isNotApplicable(documentComponent: DocumentComponent): boolean {\r\n return this.notApplicable.includes(documentComponent);\r\n }\r\n\r\n private hasNestedDraft(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.some(\r\n (d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d),\r\n ) ?? false\r\n );\r\n }\r\n\r\n private showContent(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.isOpen(documentComponent) &&\r\n !!(this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.length || documentComponent.inhoud)\r\n );\r\n }\r\n\r\n private recursiveToggleState(documentComponent: DocumentComponent): undefined | boolean | \"indeterminate\" {\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n\r\n if (\r\n !embeddedDocuments ||\r\n embeddedDocuments.documentComponents.length <= 1 ||\r\n !embeddedDocuments.documentComponents.some((d) => d.type === \"ARTIKEL\")\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return embeddedDocuments.documentComponents.every((d) => this.isOpen(d));\r\n }\r\n\r\n private handleRecursiveToggle = (\r\n documentComponent: DocumentComponent,\r\n detail: DocumentComponentRecursiveToggleEvent,\r\n ) => {\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n if (!embeddedDocuments) {\r\n return;\r\n }\r\n\r\n for (const d of embeddedDocuments.documentComponents) {\r\n this.handleOpenToggle(d, detail.next);\r\n }\r\n };\r\n\r\n private isAnnotated(documentComponent: DocumentComponent): boolean {\r\n return (\r\n documentComponent.type === \"DIVISIE\" ||\r\n documentComponent.type === \"DIVISIETEKST\" ||\r\n documentComponent.type === \"ARTIKEL\" ||\r\n documentComponent.type === \"LID\"\r\n );\r\n }\r\n\r\n private DocumentComponent = ({ path }: DocumentComponentProps) => {\r\n const documentComponent = path.at(-1);\r\n if (!documentComponent || (this.mode === \"table-of-contents\" && documentComponent.type === \"LID\")) {\r\n return <Fragment />;\r\n }\r\n\r\n const { DocumentComponent } = this;\r\n\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n\r\n return (\r\n <dso-document-component\r\n annotated={this.isAnnotated(documentComponent)}\r\n bevatOntwerpInformatie={!!documentComponent.bevatOntwerpInformatie}\r\n filtered={\r\n this.isOpen(documentComponent)\r\n ? this.isFiltered(documentComponent)\r\n : this.hasFilteredChildren(documentComponent)\r\n }\r\n genesteOntwerpInformatie={this.hasNestedDraft(documentComponent)}\r\n gereserveerd={documentComponent.gereserveerd}\r\n heading=\"h2\"\r\n inhoud={documentComponent.inhoud}\r\n label={documentComponent.labelXml}\r\n openAnnotation={this.isOpenedAnnotation(documentComponent)}\r\n notApplicable={this.isNotApplicable(documentComponent) || path.some((p) => this.isNotApplicable(p))}\r\n nummer={documentComponent.nummerXml}\r\n onDsoAnnotationToggle={() => this.handleAnnotationToggle(documentComponent)}\r\n onDsoOpenToggle={() => this.handleOpenToggle(documentComponent)}\r\n onDsoOzonContentAnchorClick={(e) => this.handleOzonContentAnchorClick(e)}\r\n open={this.isOpen(documentComponent)}\r\n opschrift={documentComponent.opschrift}\r\n type={documentComponent.type}\r\n vervallen={documentComponent.vervallen}\r\n wijzigactie={documentComponent.wijzigactie}\r\n recursiveToggle={this.recursiveToggleState(documentComponent)}\r\n onDsoRecursiveToggle={(e) => this.handleRecursiveToggle(documentComponent, e.detail)}\r\n mode={this.mode}\r\n href={this.mode === \"table-of-contents\" ? \"/document/\" + documentComponent.documentTechnischId : undefined}\r\n onDsoTableOfContentsClick={(e) => this.handleTableOfContentsClick(e)}\r\n >\r\n {this.isOpenedAnnotation(documentComponent) && (\r\n <div slot=\"annotations\">\r\n <dso-annotation-locatie\r\n active={this.isCheckedSlideToggle(documentComponent)}\r\n gewijzigde-locatie\r\n locatieNoemer={\"Winkelgebied\"}\r\n onDsoActiveChange={() => this.handleSelectableChange(documentComponent)}\r\n >\r\n <span class=\"symboolcode\" slot=\"symbool\" data-symboolcode=\"vszt030\"></span>\r\n </dso-annotation-locatie>\r\n </div>\r\n )}\r\n {this.showContent(documentComponent) && embeddedDocuments?.documentComponents.length && (\r\n <ul class=\"dso-document-component-list\">\r\n {embeddedDocuments.documentComponents.map((d) => (\r\n <li key={d.documentTechnischId}>\r\n <DocumentComponent path={[...path, d]} />\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </dso-document-component>\r\n );\r\n };\r\n\r\n render() {\r\n const { DocumentComponent, MenuButton } = this;\r\n\r\n return (\r\n <dso-responsive-element class=\"dso-document-components\">\r\n <div class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-sub\">\r\n {this.getEmbeddedDocumentComponents(this.response)?.documentComponents?.map((d) => (\r\n <li class={this.document === d ? \"dso-active\" : undefined}>\r\n <MenuButton documentComponent={d} />\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n {this.document && <DocumentComponent path={[this.document]} />}\r\n </dso-responsive-element>\r\n );\r\n }\r\n\r\n private MenuButton = ({ documentComponent }: MenuItemProps) => {\r\n const { labelXml, nummerXml, type } = documentComponent;\r\n\r\n return (\r\n <button type=\"button\" onClick={() => (this.document = documentComponent)}>\r\n {!labelXml && !nummerXml ? (\r\n <span>\r\n <i>{type}</i>\r\n </span>\r\n ) : (\r\n <>\r\n {labelXml && (\r\n <>\r\n <dso-ozon-content content={labelXml} inline></dso-ozon-content>\r\n </>\r\n )}\r\n {nummerXml && (\r\n <>\r\n {\" \"}\r\n <dso-ozon-content content={nummerXml} inline></dso-ozon-content>\r\n </>\r\n )}\r\n </>\r\n )}\r\n </button>\r\n );\r\n };\r\n}\r\n\r\ninterface MenuItemProps {\r\n documentComponent: DocumentComponent;\r\n}\r\n\r\ninterface DocumentComponentProps {\r\n path: DocumentComponent[];\r\n}\r\n"]}
1
+ {"version":3,"file":"document-component.demo.js","sourceRoot":"","sources":["../../../../src/components/document-component-demo/document-component.demo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,SAAS,EAAsB,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpH,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,MAAM,MAAM,eAAe,CAAC;AAuCnC,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QAEH,eAAU,GAAG,KAAK,CAAC;QAQnB;;WAEG;QAEH,gBAAW,GAAG,KAAK,CAAC;QAEpB;;WAEG;QAEH,SAAI,GAA0B,UAAU,CAAC;QA2BzC,iBAAY,GAAwB,EAAE,CAAC;QAGvC,qBAAgB,GAAwB,EAAE,CAAC;QAG3C,aAAQ,GAAwB,EAAE,CAAC;QAGnC,kBAAa,GAAwB,EAAE,CAAC;QAGxC,gCAA2B,GAAwB,EAAE,CAAC;QAiL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, Component, ComponentInterface, State, Prop, Watch, Event, EventEmitter, Fragment } from \"@stencil/core\";\r\nimport sampleSize from \"lodash.samplesize\";\r\nimport random from \"lodash.random\";\r\n\r\nimport {\r\n DocumentComponentMode,\r\n DocumentComponentOzonContentAnchorClickEvent,\r\n DocumentComponentRecursiveToggleEvent,\r\n DocumentComponentTableOfContentsClickEvent,\r\n DocumentComponentWijzigactie,\r\n} from \"../document-component/document-component.models\";\r\nimport { DsoDocumentComponentCustomEvent, OzonContentUrlResolver } from \"../../components\";\r\n\r\ninterface DocumentEmbedded {\r\n _embedded?: {\r\n ontwerpDocumentComponenten?: DocumentComponent[];\r\n documentComponenten?: DocumentComponent[];\r\n };\r\n}\r\n\r\ninterface DocumentComponent extends DocumentEmbedded {\r\n documentTechnischId: string;\r\n type?: string;\r\n labelXml?: string;\r\n nummerXml?: string;\r\n volgordeNummer: number;\r\n opschrift?: string;\r\n inhoud?: string;\r\n kop?: string;\r\n gereserveerd?: boolean;\r\n vervallen?: boolean;\r\n bevatOntwerpInformatie?: boolean;\r\n wijzigactie?: DocumentComponentWijzigactie;\r\n mode: DocumentComponentMode;\r\n}\r\n\r\n@Component({\r\n tag: \"dsot-document-component-demo\",\r\n scoped: true, // scoped because we are immitating the usage of <dso-document-component> in a page\r\n styleUrl: \"document-component.demo.scss\",\r\n})\r\nexport class DocumentComponentDemo implements ComponentInterface {\r\n /**\r\n * Show canvas to where Document Component extends.\r\n */\r\n @Prop({ reflect: true })\r\n showCanvas = false;\r\n\r\n /**\r\n * Name of the file to load.\r\n */\r\n @Prop()\r\n jsonFile?: string;\r\n\r\n /**\r\n * The default state for all Document Components.\r\n */\r\n @Prop()\r\n openDefault = false;\r\n\r\n /**\r\n * The mode of the Document Component. One of \"document\" or \"table-of-contents\". Defaults to \"document\"\r\n */\r\n @Prop({ reflect: true })\r\n mode: DocumentComponentMode = \"document\";\r\n\r\n /**\r\n * A UrlResolver that will be called for all STOP elements that render to HTML5 elements with external references.\r\n */\r\n @Prop()\r\n ozonContentUrlResolver?: OzonContentUrlResolver;\r\n\r\n /**\r\n * To demo user interacting with IntRef or IntIoRef elements.\r\n */\r\n @Event()\r\n dsotOzonContentAnchorClick!: EventEmitter<DocumentComponentOzonContentAnchorClickEvent>;\r\n\r\n /**\r\n * To demo user interacting the heading in mode=\"table-of-contents\".\r\n */\r\n @Event({ bubbles: false })\r\n dsotTableOfContentsClick!: EventEmitter<DocumentComponentTableOfContentsClickEvent>;\r\n\r\n @State()\r\n response?: DocumentEmbedded;\r\n\r\n @State()\r\n document?: DocumentComponent;\r\n\r\n @State()\r\n openOrClosed: DocumentComponent[] = [];\r\n\r\n @State()\r\n openedAnnotation: DocumentComponent[] = [];\r\n\r\n @State()\r\n filtered: DocumentComponent[] = [];\r\n\r\n @State()\r\n notApplicable: DocumentComponent[] = [];\r\n\r\n @State()\r\n activeAnnotationSelectables: DocumentComponent[] = [];\r\n\r\n @Watch(\"jsonFile\")\r\n async jsonFileWatcher() {\r\n this.openOrClosed = [];\r\n\r\n await this.loadData();\r\n }\r\n\r\n @Watch(\"openDefault\")\r\n async openDefaultWatcher() {\r\n this.openOrClosed = [];\r\n\r\n await this.loadData();\r\n }\r\n\r\n async componentDidLoad(): Promise<void> {\r\n await this.loadData();\r\n }\r\n\r\n private getEmbeddedDocumentComponents(documentEmbedded: DocumentEmbedded | undefined) {\r\n if (documentEmbedded?._embedded?.ontwerpDocumentComponenten) {\r\n return {\r\n documentComponents: documentEmbedded._embedded.ontwerpDocumentComponenten,\r\n ontwerp: true,\r\n };\r\n }\r\n\r\n if (documentEmbedded?._embedded?.documentComponenten) {\r\n return {\r\n documentComponents: documentEmbedded._embedded.documentComponenten,\r\n ontwerp: false,\r\n };\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private concatEmbeddedDocumentComponents(documentComponent: DocumentComponent): DocumentComponent[] {\r\n const embeddedDocuments = [...(this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents ?? [])];\r\n\r\n for (const d of embeddedDocuments) {\r\n embeddedDocuments.push(...this.concatEmbeddedDocumentComponents(d));\r\n }\r\n\r\n return embeddedDocuments;\r\n }\r\n\r\n private selectRandomDocumentComponents(\r\n documentComponent: DocumentComponent,\r\n exclude: DocumentComponent[] = [],\r\n ): DocumentComponent[] {\r\n const documentComponents = this.concatEmbeddedDocumentComponents(documentComponent).filter(\r\n (d) => !exclude.includes(d),\r\n );\r\n const size = random(0, Math.floor(documentComponents.length / 10));\r\n\r\n return sampleSize(documentComponents, size);\r\n }\r\n\r\n private async loadData() {\r\n if (!this.jsonFile) {\r\n this.response = undefined;\r\n this.document = undefined;\r\n\r\n return;\r\n }\r\n\r\n this.response = await fetch(this.jsonFile).then((r) => r.json());\r\n this.document = this.getEmbeddedDocumentComponents(this.response)?.documentComponents[0];\r\n\r\n if (this.document?.type === \"LICHAAM\") {\r\n this.notApplicable = this.selectRandomDocumentComponents(this.document);\r\n this.filtered = this.selectRandomDocumentComponents(this.document, this.notApplicable);\r\n } else {\r\n this.notApplicable = [];\r\n this.filtered = [];\r\n }\r\n }\r\n\r\n private handleOpenToggle(documentComponent: DocumentComponent, force?: boolean) {\r\n const isOpenOrClosed = typeof force === \"boolean\" ? force : this.openOrClosed.includes(documentComponent);\r\n\r\n if (isOpenOrClosed && this.openOrClosed.includes(documentComponent)) {\r\n this.openOrClosed = this.openOrClosed.filter((d) => d !== documentComponent);\r\n } else if (!isOpenOrClosed && !this.openOrClosed.includes(documentComponent)) {\r\n this.openOrClosed = [...this.openOrClosed, documentComponent];\r\n }\r\n }\r\n\r\n private handleAnnotationToggle(documentComponent: DocumentComponent) {\r\n this.openedAnnotation = this.isOpenedAnnotation(documentComponent)\r\n ? this.openedAnnotation.filter((d) => d !== documentComponent)\r\n : [...this.openedAnnotation, documentComponent];\r\n\r\n if (!this.isOpen(documentComponent)) {\r\n this.openOrClosed = [...this.openOrClosed, documentComponent];\r\n }\r\n }\r\n\r\n private handleSelectableChange(documentComponent: DocumentComponent) {\r\n this.activeAnnotationSelectables = this.isCheckedSlideToggle(documentComponent)\r\n ? this.activeAnnotationSelectables.filter((d) => d !== documentComponent)\r\n : [...this.activeAnnotationSelectables, documentComponent];\r\n }\r\n\r\n private handleOzonContentAnchorClick(\r\n e: DsoDocumentComponentCustomEvent<DocumentComponentOzonContentAnchorClickEvent>,\r\n ) {\r\n this.dsotOzonContentAnchorClick.emit(e.detail);\r\n }\r\n\r\n private handleTableOfContentsClick(e: DsoDocumentComponentCustomEvent<DocumentComponentTableOfContentsClickEvent>) {\r\n this.dsotTableOfContentsClick.emit(e.detail);\r\n }\r\n\r\n private isCheckedSlideToggle(documentComponent: DocumentComponent) {\r\n return this.activeAnnotationSelectables.includes(documentComponent);\r\n }\r\n\r\n private hasFilteredChildren(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.filtered.includes(documentComponent) ||\r\n (this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.some((d) =>\r\n this.hasFilteredChildren(d),\r\n ) ??\r\n false)\r\n );\r\n }\r\n\r\n private isOpen(documentComponent: DocumentComponent): boolean {\r\n return documentComponent.type === \"LID\" || this.openDefault\r\n ? !this.openOrClosed.includes(documentComponent)\r\n : this.openOrClosed.includes(documentComponent);\r\n }\r\n\r\n private isOpenedAnnotation(documentComponent: DocumentComponent): boolean {\r\n return this.openedAnnotation.includes(documentComponent);\r\n }\r\n\r\n private isFiltered(documentComponent: DocumentComponent): boolean {\r\n return this.filtered.includes(documentComponent);\r\n }\r\n\r\n private isNotApplicable(documentComponent: DocumentComponent): boolean {\r\n return this.notApplicable.includes(documentComponent);\r\n }\r\n\r\n private hasNestedDraft(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.some(\r\n (d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d),\r\n ) ?? false\r\n );\r\n }\r\n\r\n private showContent(documentComponent: DocumentComponent): boolean {\r\n return (\r\n this.isOpen(documentComponent) &&\r\n !!(this.getEmbeddedDocumentComponents(documentComponent)?.documentComponents.length || documentComponent.inhoud)\r\n );\r\n }\r\n\r\n private recursiveToggleState(documentComponent: DocumentComponent): undefined | boolean | \"indeterminate\" {\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n\r\n if (\r\n !embeddedDocuments ||\r\n embeddedDocuments.documentComponents.length <= 1 ||\r\n !embeddedDocuments.documentComponents.some((d) => d.type === \"ARTIKEL\")\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return embeddedDocuments.documentComponents.every((d) => this.isOpen(d));\r\n }\r\n\r\n private handleRecursiveToggle = (\r\n documentComponent: DocumentComponent,\r\n detail: DocumentComponentRecursiveToggleEvent,\r\n ) => {\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n if (!embeddedDocuments) {\r\n return;\r\n }\r\n\r\n for (const d of embeddedDocuments.documentComponents) {\r\n this.handleOpenToggle(d, detail.next);\r\n }\r\n };\r\n\r\n private isAnnotated(documentComponent: DocumentComponent): boolean {\r\n return (\r\n documentComponent.type === \"DIVISIE\" ||\r\n documentComponent.type === \"DIVISIETEKST\" ||\r\n documentComponent.type === \"ARTIKEL\" ||\r\n documentComponent.type === \"LID\"\r\n );\r\n }\r\n\r\n private DocumentComponent = ({ path }: DocumentComponentProps) => {\r\n const documentComponent = path.at(-1);\r\n if (!documentComponent || (this.mode === \"table-of-contents\" && documentComponent.type === \"LID\")) {\r\n return <Fragment />;\r\n }\r\n\r\n const { DocumentComponent } = this;\r\n\r\n const embeddedDocuments = this.getEmbeddedDocumentComponents(documentComponent);\r\n\r\n return (\r\n <dso-document-component\r\n annotated={this.isAnnotated(documentComponent)}\r\n bevatOntwerpInformatie={!!documentComponent.bevatOntwerpInformatie}\r\n filtered={\r\n this.isOpen(documentComponent)\r\n ? this.isFiltered(documentComponent)\r\n : this.hasFilteredChildren(documentComponent)\r\n }\r\n genesteOntwerpInformatie={this.hasNestedDraft(documentComponent)}\r\n gereserveerd={documentComponent.gereserveerd}\r\n heading=\"h2\"\r\n kop={documentComponent.kop}\r\n inhoud={documentComponent.inhoud}\r\n openAnnotation={this.isOpenedAnnotation(documentComponent)}\r\n notApplicable={this.isNotApplicable(documentComponent) || path.some((p) => this.isNotApplicable(p))}\r\n onDsoAnnotationToggle={() => this.handleAnnotationToggle(documentComponent)}\r\n onDsoOpenToggle={() => this.handleOpenToggle(documentComponent)}\r\n onDsoOzonContentAnchorClick={(e) => this.handleOzonContentAnchorClick(e)}\r\n open={this.isOpen(documentComponent)}\r\n type={documentComponent.type}\r\n vervallen={documentComponent.vervallen}\r\n wijzigactie={documentComponent.wijzigactie}\r\n recursiveToggle={this.recursiveToggleState(documentComponent)}\r\n onDsoRecursiveToggle={(e) => this.handleRecursiveToggle(documentComponent, e.detail)}\r\n mode={this.mode}\r\n href={this.mode === \"table-of-contents\" ? \"/document/\" + documentComponent.documentTechnischId : undefined}\r\n onDsoTableOfContentsClick={(e) => this.handleTableOfContentsClick(e)}\r\n ozonContentUrlResolver={this.ozonContentUrlResolver}\r\n >\r\n {this.isOpenedAnnotation(documentComponent) && (\r\n <div slot=\"annotations\">\r\n <dso-annotation-locatie\r\n active={this.isCheckedSlideToggle(documentComponent)}\r\n gewijzigde-locatie\r\n locatieNoemer={\"Winkelgebied\"}\r\n onDsoActiveChange={() => this.handleSelectableChange(documentComponent)}\r\n >\r\n <span class=\"symboolcode\" slot=\"symbool\" data-symboolcode=\"vszt030\"></span>\r\n </dso-annotation-locatie>\r\n </div>\r\n )}\r\n {this.showContent(documentComponent) && embeddedDocuments?.documentComponents.length && (\r\n <ul class=\"dso-document-component-list\">\r\n {embeddedDocuments.documentComponents.map((d) => (\r\n <li key={d.documentTechnischId}>\r\n <DocumentComponent path={[...path, d]} />\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </dso-document-component>\r\n );\r\n };\r\n\r\n render() {\r\n const { DocumentComponent, MenuButton } = this;\r\n\r\n return (\r\n <dso-responsive-element class=\"dso-document-components\">\r\n <div class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-sub\">\r\n {this.getEmbeddedDocumentComponents(this.response)?.documentComponents?.map((d) => (\r\n <li class={this.document === d ? \"dso-active\" : undefined}>\r\n <MenuButton documentComponent={d} />\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n {this.document && <DocumentComponent path={[this.document]} />}\r\n </dso-responsive-element>\r\n );\r\n }\r\n\r\n private MenuButton = ({ documentComponent }: MenuItemProps) => {\r\n const { labelXml, nummerXml, type } = documentComponent;\r\n\r\n return (\r\n <button type=\"button\" onClick={() => (this.document = documentComponent)}>\r\n {!labelXml && !nummerXml ? (\r\n <span>\r\n <i>{type}</i>\r\n </span>\r\n ) : (\r\n <>\r\n {labelXml && (\r\n <>\r\n <dso-ozon-content content={labelXml} inline></dso-ozon-content>\r\n </>\r\n )}\r\n {nummerXml && (\r\n <>\r\n {\" \"}\r\n <dso-ozon-content content={nummerXml} inline></dso-ozon-content>\r\n </>\r\n )}\r\n </>\r\n )}\r\n </button>\r\n );\r\n };\r\n}\r\n\r\ninterface MenuItemProps {\r\n documentComponent: DocumentComponent;\r\n}\r\n\r\ninterface DocumentComponentProps {\r\n path: DocumentComponent[];\r\n}\r\n"]}
@@ -70,6 +70,9 @@ export class Header {
70
70
  this.overflowMenuItems++;
71
71
  }
72
72
  componentDidRender() {
73
+ if (!this.host.isConnected) {
74
+ return;
75
+ }
73
76
  if (this.showDropDown) {
74
77
  this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();
75
78
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../../src/components/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAA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AE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;oCAE3E,gBAAU,IAAI,EAAC,WAAW,GAAY;oCACrC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CACpB,CACD,CACN,CACE,CACD,CACP,CACA,CACJ,CACG,CACL,CACJ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Fragment, h, Prop, State, Watch } from \"@stencil/core\";\r\n\r\nimport clsx from \"clsx\";\r\nimport debounce from \"debounce\";\r\n\r\nimport { i18n } from \"../../utils/i18n\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\nimport { HeaderEvent, HeaderMenuItem, HeaderNavigationType } from \"./header.interfaces\";\r\nimport { translations } from \"./header.i18n\";\r\n\r\nconst minDesktopViewportWidth = 992;\r\n\r\n@Component({\r\n tag: \"dso-header\",\r\n styleUrl: \"header.scss\",\r\n shadow: true,\r\n})\r\nexport class Header {\r\n private clickHandler(\r\n e: MouseEvent,\r\n type: HeaderNavigationType,\r\n options?: { menuItem?: HeaderMenuItem; url?: string },\r\n ) {\r\n this.dsoHeaderClick.emit({\r\n originalEvent: e,\r\n isModifiedEvent: isModifiedEvent(e),\r\n type,\r\n menuItem: options?.menuItem,\r\n url: options?.url ?? options?.menuItem?.url,\r\n });\r\n }\r\n\r\n private dropdownElement?: HTMLElement;\r\n\r\n @Element()\r\n host!: HTMLDsoHeaderElement;\r\n\r\n /**\r\n * The main menu items.\r\n */\r\n @Prop()\r\n mainMenu?: HeaderMenuItem[] = [];\r\n\r\n /**\r\n * Either have the dropdown menu appear automatically or always.\r\n */\r\n @Prop()\r\n useDropDownMenu: \"always\" | \"auto\" = \"auto\";\r\n\r\n /**\r\n * Used to show the login/logout option. 'none' renders nothing.\r\n */\r\n @Prop()\r\n authStatus: \"none\" | \"loggedIn\" | \"loggedOut\" = \"none\";\r\n\r\n /**\r\n * When the `authStatus` is `loggedOut` a loginUrl can be provided.\r\n * The login button will then render as an anchor.\r\n */\r\n @Prop()\r\n loginUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"logout\".\r\n * If no URL is specified, a button element is used instead.\r\n */\r\n @Prop()\r\n logoutUrl?: string;\r\n\r\n /**\r\n * Show a help-button or link in the header\r\n */\r\n @Prop()\r\n showHelp? = false;\r\n\r\n /**\r\n * The URL to open when the user activates \"help\".\r\n * If no URL is specified, a button element is used instead.\r\n */\r\n @Prop()\r\n helpUrl?: string;\r\n\r\n /**\r\n * The name to show when the user is logged in.\r\n */\r\n @Prop()\r\n userProfileName?: string;\r\n\r\n /**\r\n * The URL to open when the user activates the profile url.\r\n */\r\n @Prop()\r\n userProfileUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeUrl?: string;\r\n\r\n /**\r\n * Set this to true when the user is at \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeActive?: boolean;\r\n\r\n @State()\r\n showDropDown?: boolean;\r\n\r\n @State()\r\n overflowMenuItems = 0;\r\n\r\n @State()\r\n dropdownOptionsOffset = 0;\r\n\r\n /**\r\n * Emitted when something in the header is selected.\r\n *\r\n * `event.detail.type` indicates the functionality the user pressed. eg. `'login'` or `'menuItem'`\r\n */\r\n @Event()\r\n dsoHeaderClick!: EventEmitter<HeaderEvent>;\r\n\r\n @Watch(\"useDropDownMenu\")\r\n setShowDropDown(value: \"always\" | \"auto\") {\r\n if (value === \"auto\") {\r\n this.setDropDownMenu();\r\n\r\n return;\r\n }\r\n\r\n this.showDropDown = value === \"always\";\r\n }\r\n\r\n private wrapper: HTMLDivElement | undefined;\r\n\r\n private nav: HTMLUListElement | undefined;\r\n\r\n private shrinkMenuToFit() {\r\n if (!this.wrapper || !this.nav) {\r\n return;\r\n }\r\n\r\n if (this.wrapper.clientWidth >= this.nav.clientWidth) {\r\n return;\r\n }\r\n\r\n if (this.mainMenu && this.overflowMenuItems >= this.mainMenu.length) {\r\n return;\r\n }\r\n\r\n this.overflowMenuItems++;\r\n }\r\n\r\n private text = i18n(() => this.host, translations);\r\n\r\n componentDidRender() {\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n\r\n return;\r\n }\r\n\r\n window.setTimeout(() => this.shrinkMenuToFit(), 0);\r\n }\r\n\r\n componentDidLoad() {\r\n this.setShowDropDown(this.useDropDownMenu);\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }\r\n\r\n private setOverflowMenu() {\r\n if (this.showDropDown) {\r\n return;\r\n }\r\n\r\n if (this.overflowMenuItems !== 0) {\r\n this.overflowMenuItems = 0;\r\n return;\r\n }\r\n\r\n this.shrinkMenuToFit();\r\n }\r\n\r\n private setDropDownMenu() {\r\n if (this.useDropDownMenu !== \"auto\") {\r\n return;\r\n }\r\n\r\n this.showDropDown = window.innerWidth < minDesktopViewportWidth;\r\n }\r\n\r\n private calculateDropdownOptionsOffset() {\r\n if (!this.dropdownElement) {\r\n return 0;\r\n }\r\n\r\n return (\r\n this.host.clientHeight -\r\n (this.dropdownElement?.getBoundingClientRect().bottom - this.host.getBoundingClientRect().top)\r\n );\r\n }\r\n\r\n private onWindowResize = debounce(() => {\r\n this.dropdownElement?.removeAttribute(\"open\");\r\n this.dropdownElement?.removeAttribute(\"tabindex\");\r\n\r\n this.setDropDownMenu();\r\n this.setOverflowMenu();\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }, 100);\r\n\r\n connectedCallback() {\r\n window.addEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n disconnectedCallback() {\r\n window.removeEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n private MenuItem = (item: HeaderMenuItem) => {\r\n return (\r\n <li class={item.active ? \"dso-active\" : undefined}>\r\n <a\r\n href={item.url}\r\n aria-current={item.active ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"menuItem\", { menuItem: item })}\r\n >\r\n {item.label}\r\n </a>\r\n </li>\r\n );\r\n };\r\n\r\n render() {\r\n // Prevent 'flickering' when useDropDownMenu = 'always'\r\n if (this.showDropDown === undefined) {\r\n return;\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n class={clsx(\"dso-header\", {\r\n [\"use-drop-down\"]: this.showDropDown,\r\n })}\r\n ref={(element) => (this.wrapper = element)}\r\n >\r\n <div class=\"logo-container\">\r\n <slot name=\"logo\" />\r\n </div>\r\n {this.showDropDown &&\r\n this.mainMenu &&\r\n (this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== \"none\") && (\r\n <div class=\"dropdown\">\r\n <dso-dropdown-menu\r\n dropdown-align=\"right\"\r\n strategy=\"absolute\"\r\n dropdownOptionsOffset={this.dropdownOptionsOffset}\r\n ref={(element) => (this.dropdownElement = element)}\r\n >\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>{this.text(\"menu\")}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu.map(this.MenuItem)}\r\n {this.userHomeUrl && (\r\n <li>\r\n <a\r\n href={this.userHomeUrl}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n {this.text(\"userHome\")}\r\n </a>\r\n </li>\r\n )}\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <li>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n <span class=\"profile-label\"> - Mijn profiel</span>\r\n </a>\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <li>\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n {this.text(\"login\")}\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n {this.text(\"login\")}\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <li>\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n {this.text(\"logout\")}\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n {this.text(\"logout\")}\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.showHelp && (\r\n <li>\r\n {this.helpUrl ? (\r\n <a\r\n href={this.helpUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"help\", { url: this.helpUrl })}\r\n >\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </a>\r\n ) : (\r\n <button type=\"button\" class=\"dso-tertiary\" onClick={(e) => this.clickHandler(e, \"help\")}>\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </div>\r\n )}\r\n {!this.showDropDown && (\r\n <>\r\n <div class=\"dso-header-session\">\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <div class=\"profile\">\r\n <a\r\n href={this.userProfileUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n </a>\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <div class=\"login\">\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n {this.text(\"login\")}\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n {this.text(\"login\")}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <div class=\"logout\">\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n {this.text(\"logout\")}\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n {this.text(\"logout\")}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.showHelp && (\r\n <div class=\"help\">\r\n {this.helpUrl ? (\r\n <a\r\n href={this.helpUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"help\", { url: this.helpUrl })}\r\n >\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"help\")}>\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n {((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (\r\n <nav class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-main\" ref={(element) => (this.nav = element)}>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)\r\n .map(this.MenuItem)}\r\n {this.overflowMenuItems > 0 && (\r\n <li>\r\n <dso-dropdown-menu placement=\"bottom\">\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>{this.text(\"overflowMenu\")}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter(\r\n (_, index) =>\r\n this.mainMenu && index >= this.mainMenu.length - this.overflowMenuItems,\r\n )\r\n .map(this.MenuItem)}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </li>\r\n )}\r\n {this.userHomeUrl && (\r\n <li class={clsx(\"menu-user-home\", { \"dso-active\": this.userHomeActive })}>\r\n <a\r\n href={this.userHomeUrl}\r\n aria-current={this.userHomeActive ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n <dso-icon icon=\"user-line\"></dso-icon>\r\n {this.text(\"userHome\")}\r\n </a>\r\n </li>\r\n )}\r\n </ul>\r\n </nav>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n </>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../../src/components/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,M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AAC,CAAC,CAAC,SAAS,EACtD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;oCAE3E,gBAAU,IAAI,EAAC,WAAW,GAAY;oCACrC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CACpB,CACD,CACN,CACE,CACD,CACP,CACA,CACJ,CACG,CACL,CACJ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Fragment, h, Prop, State, Watch } from \"@stencil/core\";\r\n\r\nimport clsx from \"clsx\";\r\nimport debounce from \"debounce\";\r\n\r\nimport { i18n } from \"../../utils/i18n\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\nimport { HeaderEvent, HeaderMenuItem, HeaderNavigationType } from \"./header.interfaces\";\r\nimport { translations } from \"./header.i18n\";\r\n\r\nconst minDesktopViewportWidth = 992;\r\n\r\n@Component({\r\n tag: \"dso-header\",\r\n styleUrl: \"header.scss\",\r\n shadow: true,\r\n})\r\nexport class Header {\r\n private clickHandler(\r\n e: MouseEvent,\r\n type: HeaderNavigationType,\r\n options?: { menuItem?: HeaderMenuItem; url?: string },\r\n ) {\r\n this.dsoHeaderClick.emit({\r\n originalEvent: e,\r\n isModifiedEvent: isModifiedEvent(e),\r\n type,\r\n menuItem: options?.menuItem,\r\n url: options?.url ?? options?.menuItem?.url,\r\n });\r\n }\r\n\r\n private dropdownElement?: HTMLElement;\r\n\r\n @Element()\r\n host!: HTMLDsoHeaderElement;\r\n\r\n /**\r\n * The main menu items.\r\n */\r\n @Prop()\r\n mainMenu?: HeaderMenuItem[] = [];\r\n\r\n /**\r\n * Either have the dropdown menu appear automatically or always.\r\n */\r\n @Prop()\r\n useDropDownMenu: \"always\" | \"auto\" = \"auto\";\r\n\r\n /**\r\n * Used to show the login/logout option. 'none' renders nothing.\r\n */\r\n @Prop()\r\n authStatus: \"none\" | \"loggedIn\" | \"loggedOut\" = \"none\";\r\n\r\n /**\r\n * When the `authStatus` is `loggedOut` a loginUrl can be provided.\r\n * The login button will then render as an anchor.\r\n */\r\n @Prop()\r\n loginUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"logout\".\r\n * If no URL is specified, a button element is used instead.\r\n */\r\n @Prop()\r\n logoutUrl?: string;\r\n\r\n /**\r\n * Show a help-button or link in the header\r\n */\r\n @Prop()\r\n showHelp? = false;\r\n\r\n /**\r\n * The URL to open when the user activates \"help\".\r\n * If no URL is specified, a button element is used instead.\r\n */\r\n @Prop()\r\n helpUrl?: string;\r\n\r\n /**\r\n * The name to show when the user is logged in.\r\n */\r\n @Prop()\r\n userProfileName?: string;\r\n\r\n /**\r\n * The URL to open when the user activates the profile url.\r\n */\r\n @Prop()\r\n userProfileUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeUrl?: string;\r\n\r\n /**\r\n * Set this to true when the user is at \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeActive?: boolean;\r\n\r\n @State()\r\n showDropDown?: boolean;\r\n\r\n @State()\r\n overflowMenuItems = 0;\r\n\r\n @State()\r\n dropdownOptionsOffset = 0;\r\n\r\n /**\r\n * Emitted when something in the header is selected.\r\n *\r\n * `event.detail.type` indicates the functionality the user pressed. eg. `'login'` or `'menuItem'`\r\n */\r\n @Event()\r\n dsoHeaderClick!: EventEmitter<HeaderEvent>;\r\n\r\n @Watch(\"useDropDownMenu\")\r\n setShowDropDown(value: \"always\" | \"auto\") {\r\n if (value === \"auto\") {\r\n this.setDropDownMenu();\r\n\r\n return;\r\n }\r\n\r\n this.showDropDown = value === \"always\";\r\n }\r\n\r\n private wrapper: HTMLDivElement | undefined;\r\n\r\n private nav: HTMLUListElement | undefined;\r\n\r\n private shrinkMenuToFit() {\r\n if (!this.wrapper || !this.nav) {\r\n return;\r\n }\r\n\r\n if (this.wrapper.clientWidth >= this.nav.clientWidth) {\r\n return;\r\n }\r\n\r\n if (this.mainMenu && this.overflowMenuItems >= this.mainMenu.length) {\r\n return;\r\n }\r\n\r\n this.overflowMenuItems++;\r\n }\r\n\r\n private text = i18n(() => this.host, translations);\r\n\r\n componentDidRender() {\r\n if (!this.host.isConnected) {\r\n return;\r\n }\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n\r\n return;\r\n }\r\n\r\n window.setTimeout(() => this.shrinkMenuToFit(), 0);\r\n }\r\n\r\n componentDidLoad() {\r\n this.setShowDropDown(this.useDropDownMenu);\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }\r\n\r\n private setOverflowMenu() {\r\n if (this.showDropDown) {\r\n return;\r\n }\r\n\r\n if (this.overflowMenuItems !== 0) {\r\n this.overflowMenuItems = 0;\r\n return;\r\n }\r\n\r\n this.shrinkMenuToFit();\r\n }\r\n\r\n private setDropDownMenu() {\r\n if (this.useDropDownMenu !== \"auto\") {\r\n return;\r\n }\r\n\r\n this.showDropDown = window.innerWidth < minDesktopViewportWidth;\r\n }\r\n\r\n private calculateDropdownOptionsOffset() {\r\n if (!this.dropdownElement) {\r\n return 0;\r\n }\r\n\r\n return (\r\n this.host.clientHeight -\r\n (this.dropdownElement?.getBoundingClientRect().bottom - this.host.getBoundingClientRect().top)\r\n );\r\n }\r\n\r\n private onWindowResize = debounce(() => {\r\n this.dropdownElement?.removeAttribute(\"open\");\r\n this.dropdownElement?.removeAttribute(\"tabindex\");\r\n\r\n this.setDropDownMenu();\r\n this.setOverflowMenu();\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }, 100);\r\n\r\n connectedCallback() {\r\n window.addEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n disconnectedCallback() {\r\n window.removeEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n private MenuItem = (item: HeaderMenuItem) => {\r\n return (\r\n <li class={item.active ? \"dso-active\" : undefined}>\r\n <a\r\n href={item.url}\r\n aria-current={item.active ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"menuItem\", { menuItem: item })}\r\n >\r\n {item.label}\r\n </a>\r\n </li>\r\n );\r\n };\r\n\r\n render() {\r\n // Prevent 'flickering' when useDropDownMenu = 'always'\r\n if (this.showDropDown === undefined) {\r\n return;\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n class={clsx(\"dso-header\", {\r\n [\"use-drop-down\"]: this.showDropDown,\r\n })}\r\n ref={(element) => (this.wrapper = element)}\r\n >\r\n <div class=\"logo-container\">\r\n <slot name=\"logo\" />\r\n </div>\r\n {this.showDropDown &&\r\n this.mainMenu &&\r\n (this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== \"none\") && (\r\n <div class=\"dropdown\">\r\n <dso-dropdown-menu\r\n dropdown-align=\"right\"\r\n strategy=\"absolute\"\r\n dropdownOptionsOffset={this.dropdownOptionsOffset}\r\n ref={(element) => (this.dropdownElement = element)}\r\n >\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>{this.text(\"menu\")}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu.map(this.MenuItem)}\r\n {this.userHomeUrl && (\r\n <li>\r\n <a\r\n href={this.userHomeUrl}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n {this.text(\"userHome\")}\r\n </a>\r\n </li>\r\n )}\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <li>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n <span class=\"profile-label\"> - Mijn profiel</span>\r\n </a>\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <li>\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n {this.text(\"login\")}\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n {this.text(\"login\")}\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <li>\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n {this.text(\"logout\")}\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n {this.text(\"logout\")}\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.showHelp && (\r\n <li>\r\n {this.helpUrl ? (\r\n <a\r\n href={this.helpUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"help\", { url: this.helpUrl })}\r\n >\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </a>\r\n ) : (\r\n <button type=\"button\" class=\"dso-tertiary\" onClick={(e) => this.clickHandler(e, \"help\")}>\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </div>\r\n )}\r\n {!this.showDropDown && (\r\n <>\r\n <div class=\"dso-header-session\">\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <div class=\"profile\">\r\n <a\r\n href={this.userProfileUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n </a>\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <div class=\"login\">\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n {this.text(\"login\")}\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n {this.text(\"login\")}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <div class=\"logout\">\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n {this.text(\"logout\")}\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n {this.text(\"logout\")}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.showHelp && (\r\n <div class=\"help\">\r\n {this.helpUrl ? (\r\n <a\r\n href={this.helpUrl}\r\n class=\"dso-tertiary\"\r\n onClick={(e) => this.clickHandler(e, \"help\", { url: this.helpUrl })}\r\n >\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"help\")}>\r\n <span>{this.text(\"help\")}</span>\r\n <dso-icon icon=\"help\"></dso-icon>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n {((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (\r\n <nav class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-main\" ref={(element) => (this.nav = element)}>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)\r\n .map(this.MenuItem)}\r\n {this.overflowMenuItems > 0 && (\r\n <li>\r\n <dso-dropdown-menu placement=\"bottom\">\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>{this.text(\"overflowMenu\")}</span>\r\n <dso-icon icon=\"chevron-down\"></dso-icon>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter(\r\n (_, index) =>\r\n this.mainMenu && index >= this.mainMenu.length - this.overflowMenuItems,\r\n )\r\n .map(this.MenuItem)}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </li>\r\n )}\r\n {this.userHomeUrl && (\r\n <li class={clsx(\"menu-user-home\", { \"dso-active\": this.userHomeActive })}>\r\n <a\r\n href={this.userHomeUrl}\r\n aria-current={this.userHomeActive ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n <dso-icon icon=\"user-line\"></dso-icon>\r\n {this.text(\"userHome\")}\r\n </a>\r\n </li>\r\n )}\r\n </ul>\r\n </nav>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n </>\r\n );\r\n }\r\n}\r\n"]}
@@ -33,16 +33,11 @@
33
33
  color: #275937;
34
34
  }
35
35
 
36
- :host([logo-url][ribbon]) {
36
+ :host([logo-url]:not([logo-url=""])[ribbon]:not([ribbon=""])) {
37
37
  grid-template-areas: "targetwordmark label";
38
38
  }
39
- :host([logo-url][ribbon]) .logo-url {
40
- grid-area: targetwordmark;
41
- }
42
- :host([logo-url][ribbon]) .logo-url + .logo-ribbon {
43
- grid-area: targetwordmark;
44
- }
45
- :host([logo-url][ribbon]) .logo-label-url + .logo-ribbon {
39
+ :host([logo-url]:not([logo-url=""])[ribbon]:not([ribbon=""])) .logo-url,
40
+ :host([logo-url]:not([logo-url=""])[ribbon]:not([ribbon=""])) .logo-ribbon {
46
41
  grid-area: targetwordmark;
47
42
  }
48
43
 
@@ -4,9 +4,11 @@ export class OzonContentExtRefNode {
4
4
  constructor() {
5
5
  this.name = ["ExtRef", "ExtIoRef"];
6
6
  }
7
- render(node, { mapNodeToJsx }) {
8
- const href = node.tagName === "ExtIoRef" ? node.getAttribute("href") : node.getAttribute("ref");
7
+ render(node, { mapNodeToJsx, urlResolver }) {
9
8
  const className = kebabCase(node.tagName);
9
+ const value = node.getAttribute("ref");
10
+ const name = node.tagName === "ExtRef" ? "ExtRef" : "ExtIoRef";
11
+ const href = urlResolver ? urlResolver(name, "ref", value, node) : value;
10
12
  return (h("a", { target: "_blank", rel: "noopener noreferrer", href: href !== null && href !== void 0 ? href : undefined, class: className, title: "Opent andere website in nieuw tabblad" }, h("span", null, mapNodeToJsx(node.childNodes)), h("dso-icon", { icon: "external-link" })));
11
13
  }
12
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ext-ref.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/ext-ref.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAKzC,MAAM,OAAO,qBAAqB;IAAlC;QACE,SAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAmBhC,CAAC;IAjBC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;QAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAChG,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1C,OAAO,CACL,SACE,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS,EACvB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAC,uCAAuC;YAE7C,gBAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAQ;YAC5C,gBAAU,IAAI,EAAC,eAAe,GAAY,CACxC,CACL,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\nimport kebabCase from \"lodash.kebabcase\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentExtRefNode implements OzonContentNode {\r\n name = [\"ExtRef\", \"ExtIoRef\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n const href = node.tagName === \"ExtIoRef\" ? node.getAttribute(\"href\") : node.getAttribute(\"ref\");\r\n const className = kebabCase(node.tagName);\r\n\r\n return (\r\n <a\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n href={href ?? undefined}\r\n class={className}\r\n title=\"Opent andere website in nieuw tabblad\"\r\n >\r\n <span>{mapNodeToJsx(node.childNodes)}</span>\r\n <dso-icon icon=\"external-link\"></dso-icon>\r\n </a>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ext-ref.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/ext-ref.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAKzC,MAAM,OAAO,qBAAqB;IAAlC;QACE,SAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAqBhC,CAAC;IAnBC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAAE,WAAW,EAA0B;QACzE,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,IAAI,GAA0B,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;QACtF,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEzE,OAAO,CACL,SACE,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS,EACvB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAC,uCAAuC;YAE7C,gBAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAQ;YAC5C,gBAAU,IAAI,EAAC,eAAe,GAAY,CACxC,CACL,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\nimport kebabCase from \"lodash.kebabcase\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentExtRefNode implements OzonContentNode {\r\n name = [\"ExtRef\", \"ExtIoRef\"];\r\n\r\n render(node: Element, { mapNodeToJsx, urlResolver }: OzonContentNodeContext) {\r\n const className = kebabCase(node.tagName);\r\n const value = node.getAttribute(\"ref\");\r\n const name: \"ExtRef\" | \"ExtIoRef\" = node.tagName === \"ExtRef\" ? \"ExtRef\" : \"ExtIoRef\";\r\n const href = urlResolver ? urlResolver(name, \"ref\", value, node) : value;\r\n\r\n return (\r\n <a\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n href={href ?? undefined}\r\n class={className}\r\n title=\"Opent andere website in nieuw tabblad\"\r\n >\r\n <span>{mapNodeToJsx(node.childNodes)}</span>\r\n <dso-icon icon=\"external-link\"></dso-icon>\r\n </a>\r\n );\r\n }\r\n}\r\n"]}
@@ -7,8 +7,37 @@ export class OzonContentFiguurNode {
7
7
  constructor() {
8
8
  this.name = ["Figuur"];
9
9
  }
10
- render(node, { mapNodeToJsx }) {
11
- var _a, _b, _c, _d, _e, _f;
10
+ getStyle(illustratie) {
11
+ const widthPixels = Number(illustratie.breedte);
12
+ const heightPixels = Number(illustratie.hoogte);
13
+ const style = {
14
+ "--_dso-ozon-content-illustratie-uitlijning": illustratie.uitlijning,
15
+ };
16
+ if (widthPixels && heightPixels) {
17
+ // This is the STOP formula to calculate the width in percentage
18
+ // see: https://koop.gitlab.io/stop/standaard/1.4.0-ic/regeltekst_afbeelding.html
19
+ // We maximise it to 100% in the case of missing dpi or a calculated percentage greater than 100%
20
+ const widthPercentage = Math.min(illustratie.dpi ? (16.4 * widthPixels) / Number(illustratie.dpi) : 100, 100);
21
+ Object.assign(style, {
22
+ "--_dso-ozon-content-illustratie-aspect-ratio": (widthPixels / heightPixels).toString(),
23
+ "--_dso-ozon-content-illustratie-width": `${widthPercentage}%`,
24
+ });
25
+ }
26
+ return style;
27
+ }
28
+ mapIllustratieNode(node) {
29
+ var _a, _b, _c;
30
+ return {
31
+ naam: (_a = node.getAttribute("naam")) !== null && _a !== void 0 ? _a : "",
32
+ breedte: Number(node.getAttribute("breedte")),
33
+ hoogte: Number(node.getAttribute("hoogte")),
34
+ dpi: Number(node.getAttribute("dpi")),
35
+ uitlijning: (_b = ["start", "center", "end"].find((u) => node.getAttribute("uitlijning") === u)) !== null && _b !== void 0 ? _b : "start",
36
+ alt: (_c = node.getAttribute("alt")) !== null && _c !== void 0 ? _c : undefined,
37
+ };
38
+ }
39
+ render(node, { mapNodeToJsx, urlResolver }) {
40
+ var _a, _b, _c, _d, _e;
12
41
  const childNodes = Array.from(node.childNodes);
13
42
  const titel = (_a = childNodes.find((n) => getNodeName(n) === "Titel")) === null || _a === void 0 ? void 0 : _a.textContent;
14
43
  const bron = childNodes.find((n) => getNodeName(n) === "Bron");
@@ -16,20 +45,15 @@ export class OzonContentFiguurNode {
16
45
  const bijschriftNode = childNodes.find((n) => getNodeName(n) === "Bijschrift");
17
46
  const wijzigactie = node.getAttribute("wijzigactie") || undefined;
18
47
  if (illustratieNode instanceof Element) {
19
- const illustratie = {
20
- naam: illustratieNode.getAttribute("naam"),
21
- breedte: illustratieNode.getAttribute("breedte"),
22
- hoogte: illustratieNode.getAttribute("hoogte"),
23
- uitlijning: illustratieNode.getAttribute("uitlijning"),
24
- alt: illustratieNode.getAttribute("alt"),
25
- };
48
+ const illustratie = this.mapIllustratieNode(illustratieNode);
26
49
  const bijschrift = bijschriftNode instanceof Element
27
50
  ? {
28
51
  inhoud: bijschriftNode.childNodes,
29
52
  locatie: (_b = bijschriftNode.getAttribute("locatie")) !== null && _b !== void 0 ? _b : "onder",
30
53
  }
31
54
  : undefined;
32
- return (h("div", { class: `dso-ozon-figuur ${bijschrift ? `bijschrift-${bijschrift.locatie}` : "onder"}` }, titel && h("span", { class: "figuur-titel" }, titel), (bijschrift === null || bijschrift === void 0 ? void 0 : bijschrift.locatie) === "boven" && (h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx })), h("dso-image-overlay", { wijzigactie: wijzigactie }, titel && (h("div", { slot: "titel" }, h("span", null, titel))), h("img", { src: (_c = illustratie.naam) !== null && _c !== void 0 ? _c : undefined, alt: (_f = (_e = (_d = illustratie.alt) !== null && _d !== void 0 ? _d : titel) !== null && _e !== void 0 ? _e : illustratie.naam) !== null && _f !== void 0 ? _f : undefined }), (bijschrift || bron) && (h("div", { slot: "bijschrift" }, h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx })))), ((bijschrift === null || bijschrift === void 0 ? void 0 : bijschrift.locatie) === "onder" || (!bijschrift && bron)) && (h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx }))));
55
+ const src = urlResolver ? urlResolver("Illustratie", "naam", illustratie.naam, node) : illustratie.naam;
56
+ return (h("div", { class: `dso-ozon-figuur ${bijschrift ? `bijschrift-${bijschrift.locatie}` : "onder"}`, style: this.getStyle(illustratie) }, titel && h("span", { class: "figuur-titel" }, titel), (bijschrift === null || bijschrift === void 0 ? void 0 : bijschrift.locatie) === "boven" && (h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx })), h("dso-image-overlay", { wijzigactie: wijzigactie }, titel && (h("div", { slot: "titel" }, h("span", null, titel))), h("img", { src: src !== null && src !== void 0 ? src : undefined, alt: (_e = (_d = (_c = illustratie.alt) !== null && _c !== void 0 ? _c : titel) !== null && _d !== void 0 ? _d : illustratie.naam) !== null && _e !== void 0 ? _e : undefined }), (bijschrift || bron) && (h("div", { slot: "bijschrift" }, h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx })))), ((bijschrift === null || bijschrift === void 0 ? void 0 : bijschrift.locatie) === "onder" || (!bijschrift && bron)) && (h(Bijschrift, { bijschrift: bijschrift, bron: bron, mapNodeToJsx: mapNodeToJsx }))));
33
57
  }
34
58
  }
35
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"figuur.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/figuur.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAO,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAexD,MAAM,UAAU,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAmB,EAAmB,EAAE;IAC1F,O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AE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,GAAI,CAC1E,CACP,CACiB;gBACnB,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,MAAK,OAAO,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,IAAI,CAC7D,EAAC,UAAU,IAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,GAAI,CAC/E,CACG,CACP,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\ntype BijschriftProps = {\r\n bijschrift?: IBijschrift;\r\n bron?: ChildNode;\r\n mapNodeToJsx: (node: Node | NodeList | Node[]) => JSX.Element;\r\n};\r\n\r\ninterface IBijschrift {\r\n inhoud: NodeListOf<ChildNode>;\r\n locatie: string;\r\n}\r\n\r\nconst Bijschrift = ({ bijschrift, bron, mapNodeToJsx }: BijschriftProps): HTMLSpanElement => {\r\n return (\r\n <span class=\"figuur-bijschrift\">\r\n {bijschrift && bijschrift.inhoud && mapNodeToJsx(bijschrift.inhoud)}\r\n {bron && (\r\n <Fragment>\r\n {`${bijschrift ? \" \" : \"\"}(bron: `}\r\n {mapNodeToJsx(bron)})\r\n </Fragment>\r\n )}\r\n </span>\r\n );\r\n};\r\n\r\nexport class OzonContentFiguurNode implements OzonContentNode {\r\n name = [\"Figuur\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n const childNodes = Array.from(node.childNodes);\r\n const titel = childNodes.find((n) => getNodeName(n) === \"Titel\")?.textContent;\r\n const bron = childNodes.find((n) => getNodeName(n) === \"Bron\");\r\n\r\n const illustratieNode = childNodes.find((n) => getNodeName(n) === \"Illustratie\");\r\n const bijschriftNode = childNodes.find((n) => getNodeName(n) === \"Bijschrift\");\r\n\r\n const wijzigactie = node.getAttribute(\"wijzigactie\") || undefined;\r\n\r\n if (illustratieNode instanceof Element) {\r\n const illustratie = {\r\n naam: illustratieNode.getAttribute(\"naam\"),\r\n breedte: illustratieNode.getAttribute(\"breedte\"),\r\n hoogte: illustratieNode.getAttribute(\"hoogte\"),\r\n uitlijning: illustratieNode.getAttribute(\"uitlijning\"),\r\n alt: illustratieNode.getAttribute(\"alt\"),\r\n };\r\n\r\n const bijschrift =\r\n bijschriftNode instanceof Element\r\n ? {\r\n inhoud: bijschriftNode.childNodes,\r\n locatie: bijschriftNode.getAttribute(\"locatie\") ?? \"onder\",\r\n }\r\n : undefined;\r\n\r\n return (\r\n <div class={`dso-ozon-figuur ${bijschrift ? `bijschrift-${bijschrift.locatie}` : \"onder\"}`}>\r\n {titel && <span class=\"figuur-titel\">{titel}</span>}\r\n {bijschrift?.locatie === \"boven\" && (\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n )}\r\n <dso-image-overlay wijzigactie={wijzigactie}>\r\n {titel && (\r\n <div slot=\"titel\">\r\n <span>{titel}</span>\r\n </div>\r\n )}\r\n <img src={illustratie.naam ?? undefined} alt={illustratie.alt ?? titel ?? illustratie.naam ?? undefined} />\r\n {(bijschrift || bron) && (\r\n <div slot=\"bijschrift\">\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n </div>\r\n )}\r\n </dso-image-overlay>\r\n {(bijschrift?.locatie === \"onder\" || (!bijschrift && bron)) && (\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n )}\r\n </div>\r\n );\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"figuur.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/figuur.node.tsx"],"names":[],"mappings":"AAA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gBAAO,KAAK,CAAQ,CAChB,CACP;oBACD,WAAK,GAAG,EAAE,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,SAAS,EAAE,GAAG,EAAE,MAAA,MAAA,MAAA,WAAW,CAAC,GAAG,mCAAI,KAAK,mCAAI,WAAW,CAAC,IAAI,mCAAI,SAAS,GAAI;oBAC7F,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CACvB,WAAK,IAAI,EAAC,YAAY;wBACpB,EAAC,UAAU,IAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,GAAI,CAC1E,CACP,CACiB;gBACnB,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,MAAK,OAAO,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,IAAI,CAC7D,EAAC,UAAU,IAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,GAAI,CAC/E,CACG,CACP,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["import { Fragment, FunctionalComponent, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\ntype BijschriftProps = {\r\n bijschrift?: IBijschrift;\r\n bron?: ChildNode;\r\n mapNodeToJsx: (node: Node | NodeList | Node[]) => JSX.Element;\r\n};\r\n\r\ninterface IBijschrift {\r\n inhoud: NodeListOf<ChildNode>;\r\n locatie: string;\r\n}\r\n\r\ninterface Illustratie {\r\n naam: string;\r\n breedte: number;\r\n hoogte: number;\r\n dpi: number;\r\n uitlijning: \"start\" | \"center\" | \"end\";\r\n alt: string | undefined;\r\n}\r\n\r\nconst Bijschrift: FunctionalComponent<BijschriftProps> = ({ bijschrift, bron, mapNodeToJsx }) => {\r\n return (\r\n <span class=\"figuur-bijschrift\">\r\n {bijschrift && bijschrift.inhoud && mapNodeToJsx(bijschrift.inhoud)}\r\n {bron && (\r\n <Fragment>\r\n {`${bijschrift ? \" \" : \"\"}(bron: `}\r\n {mapNodeToJsx(bron)})\r\n </Fragment>\r\n )}\r\n </span>\r\n );\r\n};\r\n\r\nexport class OzonContentFiguurNode implements OzonContentNode {\r\n name = [\"Figuur\"];\r\n\r\n private getStyle(illustratie: Illustratie) {\r\n const widthPixels = Number(illustratie.breedte);\r\n const heightPixels = Number(illustratie.hoogte);\r\n\r\n const style = {\r\n \"--_dso-ozon-content-illustratie-uitlijning\": illustratie.uitlijning,\r\n };\r\n\r\n if (widthPixels && heightPixels) {\r\n // This is the STOP formula to calculate the width in percentage\r\n // see: https://koop.gitlab.io/stop/standaard/1.4.0-ic/regeltekst_afbeelding.html\r\n // We maximise it to 100% in the case of missing dpi or a calculated percentage greater than 100%\r\n const widthPercentage = Math.min(illustratie.dpi ? (16.4 * widthPixels) / Number(illustratie.dpi) : 100, 100);\r\n\r\n Object.assign(style, {\r\n \"--_dso-ozon-content-illustratie-aspect-ratio\": (widthPixels / heightPixels).toString(),\r\n \"--_dso-ozon-content-illustratie-width\": `${widthPercentage}%`,\r\n });\r\n }\r\n\r\n return style;\r\n }\r\n\r\n private mapIllustratieNode(node: Element): Illustratie {\r\n return {\r\n naam: node.getAttribute(\"naam\") ?? \"\",\r\n breedte: Number(node.getAttribute(\"breedte\")),\r\n hoogte: Number(node.getAttribute(\"hoogte\")),\r\n dpi: Number(node.getAttribute(\"dpi\")),\r\n uitlijning:\r\n [\"start\", \"center\", \"end\"].find((u): u is Illustratie[\"uitlijning\"] => node.getAttribute(\"uitlijning\") === u) ??\r\n \"start\",\r\n alt: node.getAttribute(\"alt\") ?? undefined,\r\n };\r\n }\r\n\r\n render(node: Element, { mapNodeToJsx, urlResolver }: OzonContentNodeContext) {\r\n const childNodes = Array.from(node.childNodes);\r\n const titel = childNodes.find((n) => getNodeName(n) === \"Titel\")?.textContent;\r\n const bron = childNodes.find((n) => getNodeName(n) === \"Bron\");\r\n\r\n const illustratieNode = childNodes.find((n) => getNodeName(n) === \"Illustratie\");\r\n const bijschriftNode = childNodes.find((n) => getNodeName(n) === \"Bijschrift\");\r\n\r\n const wijzigactie = node.getAttribute(\"wijzigactie\") || undefined;\r\n\r\n if (illustratieNode instanceof Element) {\r\n const illustratie = this.mapIllustratieNode(illustratieNode);\r\n\r\n const bijschrift =\r\n bijschriftNode instanceof Element\r\n ? {\r\n inhoud: bijschriftNode.childNodes,\r\n locatie: bijschriftNode.getAttribute(\"locatie\") ?? \"onder\",\r\n }\r\n : undefined;\r\n\r\n const src = urlResolver ? urlResolver(\"Illustratie\", \"naam\", illustratie.naam, node) : illustratie.naam;\r\n\r\n return (\r\n <div\r\n class={`dso-ozon-figuur ${bijschrift ? `bijschrift-${bijschrift.locatie}` : \"onder\"}`}\r\n style={this.getStyle(illustratie)}\r\n >\r\n {titel && <span class=\"figuur-titel\">{titel}</span>}\r\n {bijschrift?.locatie === \"boven\" && (\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n )}\r\n <dso-image-overlay wijzigactie={wijzigactie}>\r\n {titel && (\r\n <div slot=\"titel\">\r\n <span>{titel}</span>\r\n </div>\r\n )}\r\n <img src={src ?? undefined} alt={illustratie.alt ?? titel ?? illustratie.naam ?? undefined} />\r\n {(bijschrift || bron) && (\r\n <div slot=\"bijschrift\">\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n </div>\r\n )}\r\n </dso-image-overlay>\r\n {(bijschrift?.locatie === \"onder\" || (!bijschrift && bron)) && (\r\n <Bijschrift bijschrift={bijschrift} bron={bron} mapNodeToJsx={mapNodeToJsx} />\r\n )}\r\n </div>\r\n );\r\n }\r\n }\r\n}\r\n"]}
@@ -3,9 +3,12 @@ export class OzonContentInlineTekstAfbeeldingNode {
3
3
  constructor() {
4
4
  this.name = ["InlineTekstAfbeelding", "Illustratie"];
5
5
  }
6
- render(node) {
7
- var _a, _b, _c, _d;
8
- 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 }));
6
+ render(node, { urlResolver }) {
7
+ var _a, _b, _c;
8
+ const value = node.getAttribute("naam");
9
+ const name = node.tagName === "InlineTekstAfbeelding" ? "InlineTekstAfbeelding" : "Illustratie";
10
+ const src = urlResolver ? urlResolver(name, "naam", value, node) : value;
11
+ return (h("img", { src: src !== null && src !== void 0 ? src : undefined, alt: (_a = node.getAttribute("naam")) !== null && _a !== void 0 ? _a : undefined, height: (_b = node.getAttribute("hoogte")) !== null && _b !== void 0 ? _b : undefined, width: (_c = node.getAttribute("breedte")) !== null && _c !== void 0 ? _c : undefined }));
9
12
  }
10
13
  }
11
14
  //# sourceMappingURL=inline-tekst-afbeelding.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inline-tekst-afbeelding.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/inline-tekst-afbeelding.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIlC,MAAM,OAAO,oCAAoC;IAAjD;QACE,SAAI,GAAG,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;IAYlD,CAAC;IAVC,MAAM,CAAC,IAAa;;QAClB,OAAO,CACL,WACE,GAAG,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,SAAS,EAC3C,GAAG,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,SAAS,EAC3C,MAAM,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mCAAI,SAAS,EAChD,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,SAAS,GAChD,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentInlineTekstAfbeeldingNode implements OzonContentNode {\r\n name = [\"InlineTekstAfbeelding\", \"Illustratie\"];\r\n\r\n render(node: Element) {\r\n return (\r\n <img\r\n src={node.getAttribute(\"naam\") ?? undefined}\r\n alt={node.getAttribute(\"naam\") ?? undefined}\r\n height={node.getAttribute(\"hoogte\") ?? undefined}\r\n width={node.getAttribute(\"breedte\") ?? undefined}\r\n />\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"inline-tekst-afbeelding.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/inline-tekst-afbeelding.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,oCAAoC;IAAjD;QACE,SAAI,GAAG,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;IAiBlD,CAAC;IAfC,MAAM,CAAC,IAAa,EAAE,EAAE,WAAW,EAA0B;;QAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,IAAI,GACR,IAAI,CAAC,OAAO,KAAK,uBAAuB,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC;QACrF,MAAM,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEzE,OAAO,CACL,WACE,GAAG,EAAE,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,SAAS,EACrB,GAAG,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,mCAAI,SAAS,EAC3C,MAAM,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mCAAI,SAAS,EAChD,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,SAAS,GAChD,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { 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 OzonContentInlineTekstAfbeeldingNode implements OzonContentNode {\r\n name = [\"InlineTekstAfbeelding\", \"Illustratie\"];\r\n\r\n render(node: Element, { urlResolver }: OzonContentNodeContext) {\r\n const value = node.getAttribute(\"naam\");\r\n const name: \"InlineTekstAfbeelding\" | \"Illustratie\" =\r\n node.tagName === \"InlineTekstAfbeelding\" ? \"InlineTekstAfbeelding\" : \"Illustratie\";\r\n const src = urlResolver ? urlResolver(name, \"naam\", value, node) : value;\r\n\r\n return (\r\n <img\r\n src={src ?? undefined}\r\n alt={node.getAttribute(\"naam\") ?? undefined}\r\n height={node.getAttribute(\"hoogte\") ?? undefined}\r\n width={node.getAttribute(\"breedte\") ?? undefined}\r\n />\r\n );\r\n }\r\n}\r\n"]}
@@ -12,7 +12,7 @@ export class OzonContentKopNode {
12
12
  else if (wijzigactie === "verwijder") {
13
13
  content = h("del", { class: "removed-text" }, content);
14
14
  }
15
- return h(Fragment, null, content);
15
+ return (h(Fragment, null, (node.tagName === "Nummer" || node.tagName === "Opschrift") && " ", content));
16
16
  }
17
17
  }
18
18
  //# sourceMappingURL=kop.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kop.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/kop.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,kBAAkB;IAA/B;QACE,SAAI,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAcjD,CAAC;IAZC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;QAC5D,IAAI,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,GAAG,WAAK,KAAK,EAAC,UAAU,IAAE,OAAO,CAAO,CAAC;QAClD,CAAC;aAAM,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;YACvC,OAAO,GAAG,WAAK,KAAK,EAAC,cAAc,IAAE,OAAO,CAAO,CAAC;QACtD,CAAC;QAED,OAAO,kBAAG,OAAO,CAAI,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { h, Fragment } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentKopNode implements OzonContentNode {\r\n name = [\"Opschrift\", \"Label\", \"Nummer\", \"Kop\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n let content = mapNodeToJsx(node.childNodes);\r\n const wijzigactie = node.getAttribute(\"wijzigactie\");\r\n\r\n if (wijzigactie === \"voegtoe\") {\r\n content = <ins class=\"new-text\">{content}</ins>;\r\n } else if (wijzigactie === \"verwijder\") {\r\n content = <del class=\"removed-text\">{content}</del>;\r\n }\r\n\r\n return <>{content}</>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"kop.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/kop.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,kBAAkB;IAA/B;QACE,SAAI,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAmBjD,CAAC;IAjBC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;QAC5D,IAAI,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,GAAG,WAAK,KAAK,EAAC,UAAU,IAAE,OAAO,CAAO,CAAC;QAClD,CAAC;aAAM,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;YACvC,OAAO,GAAG,WAAK,KAAK,EAAC,cAAc,IAAE,OAAO,CAAO,CAAC;QACtD,CAAC;QAED,OAAO,CACL;YACG,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,IAAI,GAAG;YAClE,OAAO,CACP,CACJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { h, Fragment } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentKopNode implements OzonContentNode {\r\n name = [\"Opschrift\", \"Label\", \"Nummer\", \"Kop\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n let content = mapNodeToJsx(node.childNodes);\r\n const wijzigactie = node.getAttribute(\"wijzigactie\");\r\n\r\n if (wijzigactie === \"voegtoe\") {\r\n content = <ins class=\"new-text\">{content}</ins>;\r\n } else if (wijzigactie === \"verwijder\") {\r\n content = <del class=\"removed-text\">{content}</del>;\r\n }\r\n\r\n return (\r\n <>\r\n {(node.tagName === \"Nummer\" || node.tagName === \"Opschrift\") && \" \"}\r\n {content}\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, OzonContentMarkFunction } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n addSpaceBeforeNode: boolean;\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"]}
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 {\r\n OzonContentAnchorClickEvent,\r\n OzonContentMarkFunction,\r\n OzonContentUrlResolver,\r\n} 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 urlResolver: OzonContentUrlResolver | undefined;\r\n}\r\n"]}
@@ -64,14 +64,10 @@ export class Mapper {
64
64
  mapNodeToJsx(node, context, path) {
65
65
  var _a;
66
66
  if (node instanceof NodeList) {
67
- return (h(Fragment, null, Array.from(node).map((n, index) => {
68
- return (h(Fragment, null, context.addSpaceBeforeNode && index > 0 && " ", this.mapNodeToJsx(n, context, path)));
69
- })));
67
+ return h(Fragment, null, Array.from(node).map((n) => this.mapNodeToJsx(n, context, path)));
70
68
  }
71
69
  if (Array.isArray(node)) {
72
- return (h(Fragment, null, node.map((n, index) => {
73
- return (h(Fragment, null, context.addSpaceBeforeNode && index > 0 && " ", this.mapNodeToJsx(n, context, path)));
74
- })));
70
+ return h(Fragment, null, node.map((n) => this.mapNodeToJsx(n, context, path)));
75
71
  }
76
72
  const nodeName = getNodeName(node);
77
73
  const mapper = this.findMapper(nodeName);
@@ -90,6 +86,7 @@ export class Mapper {
90
86
  emitMarkItemHighlight: context.emitMarkItemHighlight,
91
87
  state,
92
88
  path,
89
+ urlResolver: context.urlResolver,
93
90
  });
94
91
  }
95
92
  transform(input, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"ozon-content-mapper.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-mapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAO,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;A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AAG,CAAC;QACtB,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC;gBACZ,OAAO,EAAE,wDAAwD;gBACjE,OAAO;gBACP,KAAK;gBACL,QAAQ;aACT,CAAC,CAAC;YAEH,OAAO,EAAC,QAAQ,OAAG,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IAEO,kBAAkB,CAAC,KAA2B;;QACpD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAA,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,SAAS,EAAE,EAAC;YAEnC,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\r\nimport { OzonContentAbbrNode } from \"./nodes/abbr.node\";\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 { OzonContentKopNode } from \"./nodes/kop.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 OzonContentAbbrNode(),\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentKopNode(),\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 (\r\n <Fragment>\r\n {Array.from(node).map((n, index) => {\r\n return (\r\n <>\r\n {context.addSpaceBeforeNode && index > 0 && \" \"}\r\n {this.mapNodeToJsx(n, context, path)}\r\n </>\r\n );\r\n })}\r\n </Fragment>\r\n );\r\n }\r\n\r\n if (Array.isArray(node)) {\r\n return (\r\n <Fragment>\r\n {node.map((n, index) => {\r\n return (\r\n <>\r\n {context.addSpaceBeforeNode && index > 0 && \" \"}\r\n {this.mapNodeToJsx(n, context, path)}\r\n </>\r\n );\r\n })}\r\n </Fragment>\r\n );\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
+ {"version":3,"file":"ozon-content-mapper.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-mapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAO,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;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AC,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IAEO,kBAAkB,CAAC,KAA2B;;QACpD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAA,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,SAAS,EAAE,EAAC;YAEnC,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\r\nimport { OzonContentAbbrNode } from \"./nodes/abbr.node\";\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 { OzonContentKopNode } from \"./nodes/kop.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 OzonContentAbbrNode(),\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentKopNode(),\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 urlResolver: context.urlResolver,\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, 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"]}
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 {\r\n OzonContentAnchorClickEvent,\r\n OzonContentMarkFunction,\r\n OzonContentUrlResolver,\r\n} 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 urlResolver: OzonContentUrlResolver | undefined;\r\n}\r\n"]}