@simple-reporting/base 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dev/package.json +1 -1
  2. package/dev/src/App.vue +1 -0
  3. package/dev/src/assets/scss/app.scss +0 -1
  4. package/dev/src/assets/scss/components/{note/accordion.scss → accordion.scss} +20 -0
  5. package/dev/src/assets/scss/editor.scss +1 -0
  6. package/dev/src/assets/scss/general.scss +18 -0
  7. package/dev/src/assets/scss/pdf.scss +11 -0
  8. package/dev/src/assets/scss/placeholders/grid.scss +6 -0
  9. package/dev/src/assets/scss/web.scss +1 -1
  10. package/dev/src/assets/scss/xbrl.scss +12 -1
  11. package/dev/src/components/PageMain.vue +5 -3
  12. package/dev/src/entries/pdf.ts +5 -0
  13. package/dev/srl.config.json +72 -7
  14. package/livingdocs/010.Titles/010.title-h1/scss/_spacing-variations.scss +0 -2
  15. package/livingdocs/010.Titles/010.title-h1/scss/general.scss +1 -2
  16. package/livingdocs/010.Titles/010.title-h1/scss/web.scss +7 -0
  17. package/livingdocs/010.Titles/020.title-h2/scss/_spacing-variations.scss +0 -2
  18. package/livingdocs/010.Titles/020.title-h2/scss/general.scss +12 -2
  19. package/livingdocs/010.Titles/020.title-h2/scss/xbrl.scss +2 -1
  20. package/livingdocs/010.Titles/030.title-h3/scss/_spacing-variations.scss +0 -2
  21. package/livingdocs/010.Titles/030.title-h3/scss/general.scss +2 -2
  22. package/livingdocs/010.Titles/030.title-h3/scss/xbrl.scss +2 -1
  23. package/livingdocs/010.Titles/040.title-h4/scss/_spacing-variations.scss +0 -2
  24. package/livingdocs/010.Titles/040.title-h4/scss/general.scss +2 -2
  25. package/livingdocs/010.Titles/040.title-h4/scss/xbrl.scss +2 -1
  26. package/livingdocs/010.Titles/050.title-h5/scss/_spacing-variations.scss +0 -2
  27. package/livingdocs/010.Titles/050.title-h5/scss/general.scss +1 -2
  28. package/livingdocs/010.Titles/060.title-h6/scss/_spacing-variations.scss +0 -2
  29. package/livingdocs/010.Titles/060.title-h6/scss/general.scss +2 -2
  30. package/livingdocs/020.Text/010.lead/scss/general.scss +1 -2
  31. package/livingdocs/020.Text/020.paragraph/scss/_spacing-variations.scss +1 -2
  32. package/livingdocs/020.Text/020.paragraph/scss/general.scss +5 -2
  33. package/livingdocs/020.Text/040.link/scss/_spacing-variations.scss +22 -0
  34. package/livingdocs/020.Text/040.link/scss/general.scss +22 -2
  35. package/livingdocs/020.Text/050.quote/scss/general.scss +2 -0
  36. package/livingdocs/020.Text/060.quote-with-portrait/scss/_spacing-variations.scss +1 -2
  37. package/livingdocs/020.Text/060.quote-with-portrait/scss/general.scss +13 -2
  38. package/livingdocs/020.Text/060.quote-with-portrait/scss/web.scss +7 -0
  39. package/livingdocs/020.Text/070.footnote-container/scss/_spacing-variations.scss +0 -2
  40. package/livingdocs/020.Text/080.footnote-item/scss/general.scss +1 -2
  41. package/livingdocs/020.Text/080.footnote-item/scss/word.scss +8 -0
  42. package/livingdocs/030.Lists/010.unordered-list/scss/_spacing-variations.scss +0 -2
  43. package/livingdocs/030.Lists/010.unordered-list/scss/general.scss +1 -2
  44. package/livingdocs/030.Lists/040.list-item-unordered-list/scss/general.scss +1 -2
  45. package/livingdocs/040.Media/010.table/scss/_spacing-variations.scss +0 -2
  46. package/livingdocs/040.Media/010.table/scss/general.scss +8 -2
  47. package/livingdocs/040.Media/010.table/scss/word.scss +18 -0
  48. package/livingdocs/040.Media/020.image/scss/_spacing-variations.scss +0 -2
  49. package/livingdocs/040.Media/020.image/scss/general.scss +1 -2
  50. package/livingdocs/040.Media/020.image/scss/pdf.scss +1 -0
  51. package/livingdocs/040.Media/020.image/scss/web.scss +19 -5
  52. package/livingdocs/040.Media/030.video/ld-conf.json +1 -6
  53. package/livingdocs/040.Media/030.video/properties.json +7 -0
  54. package/livingdocs/040.Media/030.video/scss/_spacing-variations.scss +0 -2
  55. package/livingdocs/040.Media/030.video/scss/editor.scss +10 -0
  56. package/livingdocs/040.Media/030.video/scss/general.scss +7 -3
  57. package/livingdocs/040.Media/030.video/scss/pdf.scss +8 -0
  58. package/livingdocs/040.Media/030.video/video.html +27 -30
  59. package/livingdocs/040.Media/030.video/video.vue +71 -32
  60. package/livingdocs/060.Buttons/010.button-container/button-container.html +6 -1
  61. package/livingdocs/060.Buttons/020.button/button.html +7 -1
  62. package/livingdocs/060.Buttons/020.button/scss/general.scss +2 -2
  63. package/livingdocs/070.Container/010.aside-content-container/aside-content-container.html +1 -1
  64. package/livingdocs/070.Container/010.aside-content-container/ld-conf.json +1 -1
  65. package/livingdocs/070.Container/010.aside-content-container/scss/general.scss +4 -0
  66. package/livingdocs/070.Container/010.aside-content-container/scss/pdf.scss +5 -0
  67. package/livingdocs/070.Container/010.aside-content-container/scss/web.scss +12 -0
  68. package/livingdocs/070.Container/020.columns-container/columns-container.html +1 -1
  69. package/livingdocs/070.Container/020.columns-container/ld-conf.json +1 -1
  70. package/livingdocs/070.Container/020.columns-container/scss/app.scss +1 -0
  71. package/livingdocs/070.Container/020.columns-container/scss/general.scss +5 -0
  72. package/livingdocs/070.Container/020.columns-container/scss/pdf.scss +7 -0
  73. package/livingdocs/070.Container/020.columns-container/scss/word.scss +1 -0
  74. package/livingdocs/070.Container/020.columns-container/scss/xbrl.scss +2 -0
  75. package/livingdocs/070.Container/030.background-container/scss/general.scss +1 -2
  76. package/livingdocs/080.CV/010.cv/scss/editor.scss +10 -1
  77. package/livingdocs/080.CV/010.cv/scss/general.scss +1 -2
  78. package/livingdocs/080.CV/010.cv/scss/web.scss +1 -1
  79. package/livingdocs/080.CV/010.cv/scss/xbrl.scss +2 -1
  80. package/livingdocs/080.CV/020.cv-time-span/scss/_spacing-variations.scss +0 -2
  81. package/livingdocs/080.CV/020.cv-time-span/scss/general.scss +1 -2
  82. package/livingdocs/080.CV/020.cv-time-span/scss/xbrl.scss +2 -1
  83. package/livingdocs/090.Signatures/010.signature-container/scss/xbrl.scss +3 -1
  84. package/livingdocs/090.Signatures/020.signature-item/scss/xbrl.scss +1 -0
  85. package/livingdocs/100.Misc/010.anchor/scss/editor.scss +4 -0
  86. package/livingdocs/100.Misc/020.accordion/accordion.html +9 -9
  87. package/livingdocs/110.PDF/010.pdf-pagebreak/scss/editor.scss +1 -0
  88. package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/editor.scss +1 -0
  89. package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/properties.json +2 -2
  90. package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/general.scss +3 -0
  91. package/livingdocs/110.PDF/075.pdf-chapter-navigation-item/scss/editor.scss +1 -0
  92. package/livingdocs/110.PDF/075.pdf-chapter-navigation-item/scss/web.scss +1 -0
  93. package/livingdocs/110.PDF/100.pdf-toc-item/scss/general.scss +6 -8
  94. package/livingdocs/120.Startpage/010.hero-video/hero-video.html +15 -0
  95. package/livingdocs/120.Startpage/010.hero-video/ld-conf.json +5 -0
  96. package/livingdocs/120.Startpage/010.hero-video/properties.json +1 -0
  97. package/livingdocs/120.Startpage/010.hero-video/scss/_spacing-variations.scss +3 -0
  98. package/livingdocs/120.Startpage/010.hero-video/scss/app.scss +2 -0
  99. package/livingdocs/120.Startpage/010.hero-video/scss/editor.scss +9 -0
  100. package/livingdocs/120.Startpage/010.hero-video/scss/web.scss +77 -0
  101. package/livingdocs/120.Startpage/020.teaser-title-image-quote/ld-conf.json +18 -0
  102. package/livingdocs/120.Startpage/020.teaser-title-image-quote/properties.json +1 -0
  103. package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/_spacing-variations.scss +4 -0
  104. package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/app.scss +2 -0
  105. package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/editor.scss +22 -0
  106. package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/web.scss +40 -0
  107. package/livingdocs/120.Startpage/020.teaser-title-image-quote/teaser-title-image-quote.html +50 -0
  108. package/livingdocs/120.Startpage/030.teaser-quote/ld-conf.json +25 -0
  109. package/livingdocs/120.Startpage/030.teaser-quote/properties.json +1 -0
  110. package/livingdocs/120.Startpage/030.teaser-quote/scss/_spacing-variations.scss +3 -0
  111. package/livingdocs/120.Startpage/030.teaser-quote/scss/app.scss +2 -0
  112. package/livingdocs/120.Startpage/030.teaser-quote/scss/editor.scss +6 -0
  113. package/livingdocs/120.Startpage/030.teaser-quote/scss/web.scss +125 -0
  114. package/livingdocs/120.Startpage/030.teaser-quote/teaser-quote.html +53 -0
  115. package/livingdocs/120.Startpage/040.teaser/ld-conf.json +23 -0
  116. package/livingdocs/120.Startpage/040.teaser/scss/_spacing-variations.scss +3 -0
  117. package/livingdocs/120.Startpage/040.teaser/scss/app.scss +2 -0
  118. package/livingdocs/120.Startpage/040.teaser/scss/editor.scss +6 -0
  119. package/livingdocs/120.Startpage/040.teaser/scss/web.scss +72 -0
  120. package/livingdocs/120.Startpage/040.teaser/teaser.html +39 -0
  121. package/livingdocs/130.Hosting_Components/010.download-center/download-center.html +6 -2
  122. package/livingdocs/130.Hosting_Components/020.search/scss/web.scss +11 -44
  123. package/livingdocs/130.Hosting_Components/020.search/search.html +7 -1
  124. package/livingdocs/130.Hosting_Components/020.search/search.vue +1 -1
  125. package/livingdocs/130.Hosting_Components/020.search/searchHighlightOnTarget.vue +249 -0
  126. package/livingdocs/999.Properties/background-color/properties.json +23 -0
  127. package/livingdocs/999.Properties/font-color/properties.json +15 -0
  128. package/package.json +1 -1
  129. package/scripts/config.js +7 -4
  130. package/scss/colors/mixins.scss +3 -0
  131. package/scss/helpers/mixins.scss +22 -0
  132. package/scss/spacer/mixins.scss +121 -12
  133. package/srl/srl/fa/index.scss +2 -2
  134. package/srl/srl/fa/source-free.scss +1 -4
  135. package/srl/srl/pdf/PDFNestedContainers.ts +122 -0
  136. package/srl/srl/pdf/PDFNotes.ts +4 -2
  137. package/srl/srl/pdf/PDFSetPageNumbers.ts +3 -1
  138. package/dev/src/assets/scss/margins.scss +0 -57
  139. /package/livingdocs/{110.PDF/060.pdf-chapter-navigation-item → 070.Container/020.columns-container}/scss/editor.scss +0 -0
  140. /package/livingdocs/{110.PDF/021.pdf-columnbreak → 070.Container/020.columns-container}/scss/web.scss +0 -0
  141. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/ld-conf.json +0 -0
  142. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/pdf-columnbreak.html +0 -0
  143. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/general.scss +0 -0
  144. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/pdf.scss +0 -0
  145. /package/livingdocs/110.PDF/{030.pdf-publication-title → 020.pdf-columnbreak}/scss/web.scss +0 -0
  146. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/word.scss +0 -0
  147. /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/xbrl.scss +0 -0
  148. /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/ld-conf.json +0 -0
  149. /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/pdf-column-container.html +0 -0
  150. /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/properties.json +0 -0
  151. /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/scss/editor.scss +0 -0
  152. /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/scss/pdf.scss +0 -0
  153. /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/ld-conf.json +0 -0
  154. /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/pdf-cover.html +0 -0
  155. /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/editor.scss +0 -0
  156. /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/pdf.scss +0 -0
  157. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 030.pdf-cover}/scss/web.scss +0 -0
  158. /package/livingdocs/110.PDF/{030.pdf-publication-title → 030.pdf-cover}/scss/word.scss +0 -0
  159. /package/livingdocs/110.PDF/{030.pdf-publication-title → 030.pdf-cover}/scss/xbrl.scss +0 -0
  160. /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/ld-conf.json +0 -0
  161. /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/pdf-landscape-container.html +0 -0
  162. /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/properties.json +0 -0
  163. /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/scss/pdf.scss +0 -0
  164. /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/ld-conf.json +0 -0
  165. /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/pdf-publication-title.html +0 -0
  166. /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/editor.scss +0 -0
  167. /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/general.scss +0 -0
  168. /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/pdf.scss +0 -0
  169. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 050.pdf-publication-title}/scss/web.scss +0 -0
  170. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 050.pdf-publication-title}/scss/word.scss +0 -0
  171. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 050.pdf-publication-title}/scss/xbrl.scss +0 -0
  172. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/ld-conf.json +0 -0
  173. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/pdf-chapter-title.html +0 -0
  174. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/editor.scss +0 -0
  175. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/general.scss +0 -0
  176. /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/pdf.scss +0 -0
  177. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 060.pdf-chapter-title}/scss/web.scss +0 -0
  178. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 060.pdf-chapter-title}/scss/word.scss +0 -0
  179. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 060.pdf-chapter-title}/scss/xbrl.scss +0 -0
  180. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/ld-conf.json +0 -0
  181. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/pdf-chapter-navigation.html +0 -0
  182. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/editor.scss +0 -0
  183. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/general.scss +0 -0
  184. /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/pdf.scss +0 -0
  185. /package/livingdocs/110.PDF/{070.pdf-cover → 070.pdf-chapter-navigation-container}/scss/web.scss +0 -0
  186. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 070.pdf-chapter-navigation-container}/scss/word.scss +0 -0
  187. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 070.pdf-chapter-navigation-container}/scss/xbrl.scss +0 -0
  188. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/ld-conf.json +0 -0
  189. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/pdf-chapter-navigation-item.html +0 -0
  190. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/properties.json +0 -0
  191. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/scss/general.scss +0 -0
  192. /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/scss/pdf.scss +0 -0
  193. /package/livingdocs/110.PDF/{070.pdf-cover → 075.pdf-chapter-navigation-item}/scss/word.scss +0 -0
  194. /package/livingdocs/110.PDF/{070.pdf-cover → 075.pdf-chapter-navigation-item}/scss/xbrl.scss +0 -0
@@ -0,0 +1,249 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, onBeforeUnmount, onMounted, watch } from 'vue'
3
+ import { useRoute } from 'vue-router'
4
+
5
+ const props = withDefaults(defineProps<{
6
+ rootSelector?: string
7
+ highlightClass?: string
8
+ queryParam?: string
9
+ }>(), {
10
+ rootSelector: '#srl-page-main',
11
+ highlightClass: 'searchTarget',
12
+ queryParam: 'searchTarget'
13
+ })
14
+
15
+ const route = useRoute()
16
+
17
+ let mutationObserver: MutationObserver | null = null
18
+ let highlightTimeout: ReturnType<typeof setTimeout> | null = null
19
+ let isApplyingHighlight = false
20
+ let hasScrolledToHighlight = false
21
+
22
+ function getRootElement(): HTMLElement | null {
23
+ return document.querySelector(props.rootSelector)
24
+ }
25
+
26
+ function escapeRegExp(value: string): string {
27
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
28
+ }
29
+
30
+ function removeHighlights(root: HTMLElement): void {
31
+ const highlights = root.querySelectorAll(`span.${props.highlightClass}`)
32
+
33
+ highlights.forEach((highlight) => {
34
+ const parent = highlight.parentNode
35
+ if (!parent) return
36
+
37
+ parent.replaceChild(document.createTextNode(highlight.textContent ?? ''), highlight)
38
+ parent.normalize()
39
+ })
40
+ }
41
+
42
+ function highlightTextNodes(root: HTMLElement, term: string): number {
43
+ const safeTermPattern = escapeRegExp(term)
44
+ const regex = new RegExp(`(${safeTermPattern})`, 'gi')
45
+
46
+ const walker = document.createTreeWalker(
47
+ root,
48
+ NodeFilter.SHOW_TEXT,
49
+ {
50
+ acceptNode(node) {
51
+ const parent = node.parentElement
52
+ if (!parent) return NodeFilter.FILTER_REJECT
53
+
54
+ const tag = parent.tagName.toLowerCase()
55
+ if (
56
+ tag === 'script' ||
57
+ tag === 'style' ||
58
+ tag === 'noscript' ||
59
+ tag === 'textarea'
60
+ ) {
61
+ return NodeFilter.FILTER_REJECT
62
+ }
63
+
64
+ if (parent.closest(`.${props.highlightClass}`)) {
65
+ return NodeFilter.FILTER_REJECT
66
+ }
67
+
68
+ const text = node.textContent
69
+ if (!text || !text.trim()) return NodeFilter.FILTER_SKIP
70
+
71
+ regex.lastIndex = 0
72
+ if (!regex.test(text)) return NodeFilter.FILTER_SKIP
73
+
74
+ return NodeFilter.FILTER_ACCEPT
75
+ }
76
+ }
77
+ )
78
+
79
+ const textNodes: Text[] = []
80
+ let node: Node | null = null
81
+
82
+ while ((node = walker.nextNode())) {
83
+ textNodes.push(node as Text)
84
+ }
85
+
86
+ let hitCount = 0
87
+
88
+ for (const textNode of textNodes) {
89
+ const text = textNode.textContent ?? ''
90
+ regex.lastIndex = 0
91
+
92
+ const matches = [...text.matchAll(regex)]
93
+ if (!matches.length) continue
94
+
95
+ const fragment = document.createDocumentFragment()
96
+ let lastIndex = 0
97
+
98
+ for (const match of matches) {
99
+ const matchText = match[0]
100
+ const index = match.index ?? 0
101
+
102
+ if (index > lastIndex) {
103
+ fragment.appendChild(document.createTextNode(text.slice(lastIndex, index)))
104
+ }
105
+
106
+ const span = document.createElement('span')
107
+ span.className = props.highlightClass
108
+ span.textContent = matchText
109
+ fragment.appendChild(span)
110
+
111
+ lastIndex = index + matchText.length
112
+ hitCount++
113
+ }
114
+
115
+ if (lastIndex < text.length) {
116
+ fragment.appendChild(document.createTextNode(text.slice(lastIndex)))
117
+ }
118
+
119
+ textNode.parentNode?.replaceChild(fragment, textNode)
120
+ }
121
+
122
+ return hitCount
123
+ }
124
+
125
+ function scrollToFirstHighlight(root: HTMLElement): void {
126
+ const firstHighlight = root.querySelector<HTMLElement>(`.${props.highlightClass}`)
127
+ if (!firstHighlight) return
128
+
129
+ firstHighlight.scrollIntoView({
130
+ behavior: 'smooth',
131
+ block: 'center',
132
+ inline: 'nearest'
133
+ })
134
+ }
135
+
136
+ function stopObserver(): void {
137
+ mutationObserver?.disconnect()
138
+ }
139
+
140
+ function startObserver(): void {
141
+ const root = getRootElement()
142
+ if (!root) return
143
+
144
+ stopObserver()
145
+
146
+ mutationObserver = new MutationObserver(() => {
147
+ if (isApplyingHighlight) return
148
+ scheduleHighlight()
149
+ })
150
+
151
+ mutationObserver.observe(root, {
152
+ childList: true,
153
+ subtree: true,
154
+ characterData: true
155
+ })
156
+ }
157
+
158
+ function scheduleHighlight(): void {
159
+ if (highlightTimeout) {
160
+ clearTimeout(highlightTimeout)
161
+ }
162
+
163
+ highlightTimeout = setTimeout(() => {
164
+ void applySearchHighlight()
165
+ }, 0)
166
+ }
167
+
168
+ async function applySearchHighlight(): Promise<void> {
169
+ const root = getRootElement()
170
+ if (!root || isApplyingHighlight) return
171
+
172
+ const rawSearchTarget = route.query[props.queryParam]
173
+ const searchTarget =
174
+ typeof rawSearchTarget === 'string'
175
+ ? decodeURIComponent(rawSearchTarget).trim()
176
+ : ''
177
+
178
+ isApplyingHighlight = true
179
+ stopObserver()
180
+
181
+ try {
182
+ removeHighlights(root)
183
+
184
+ if (!searchTarget) {
185
+ hasScrolledToHighlight = false
186
+ return
187
+ }
188
+
189
+ await nextTick()
190
+
191
+ const hitCount = highlightTextNodes(root, searchTarget)
192
+
193
+ if (hitCount > 0 && !hasScrolledToHighlight) {
194
+ await nextTick()
195
+ scrollToFirstHighlight(root)
196
+ hasScrolledToHighlight = true
197
+ }
198
+ } finally {
199
+ isApplyingHighlight = false
200
+ startObserver()
201
+ }
202
+ }
203
+
204
+ onMounted(async () => {
205
+ await nextTick()
206
+ startObserver()
207
+ await applySearchHighlight()
208
+ })
209
+
210
+ watch(
211
+ () => route.fullPath,
212
+ async () => {
213
+ hasScrolledToHighlight = false
214
+ await nextTick()
215
+ scheduleHighlight()
216
+ }
217
+ )
218
+
219
+ watch(
220
+ () => props.rootSelector,
221
+ async () => {
222
+ hasScrolledToHighlight = false
223
+ await nextTick()
224
+ startObserver()
225
+ scheduleHighlight()
226
+ }
227
+ )
228
+
229
+ onBeforeUnmount(() => {
230
+ stopObserver()
231
+
232
+ if (highlightTimeout) {
233
+ clearTimeout(highlightTimeout)
234
+ }
235
+ })
236
+ </script>
237
+
238
+ <template />
239
+
240
+ <style lang="scss">
241
+ @use "srl";
242
+ .searchTarget {
243
+ background-color: srl.colors-primary-1000();
244
+ color: srl.colors-white-1000();
245
+ padding: srl.spacer-get(50);
246
+ text-box-trim: trim-both;
247
+ border-radius: srl.spacer-get(50);
248
+ }
249
+ </style>
@@ -0,0 +1,23 @@
1
+ {
2
+ "background-color": {
3
+ "label": "Background color",
4
+ "type": "select",
5
+ "options": [
6
+ {
7
+ "caption": "None"
8
+ },
9
+ {
10
+ "caption": "Primary",
11
+ "value": "srl-bg-primary-1000"
12
+ },
13
+ {
14
+ "caption": "Secondary",
15
+ "value": "srl-bg-secondary-1000"
16
+ },
17
+ {
18
+ "caption": "Tertiary",
19
+ "value": "srl-bg-tertiary-1000"
20
+ }
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "font-color": {
3
+ "label": "Font color",
4
+ "type": "select",
5
+ "options": [
6
+ {
7
+ "caption": "Default"
8
+ },
9
+ {
10
+ "caption": "white",
11
+ "value": "srl-color-white-1000"
12
+ }
13
+ ]
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-reporting/base",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Manage srl templates, build and publish",
5
5
  "repository": {
6
6
  "url": "https://github.com/mmssolutionsio/simple-reporting-library"
package/scripts/config.js CHANGED
@@ -29,18 +29,21 @@ export const baseComponentsToInstall = [
29
29
  '090.Signatures/020.signature-item',
30
30
  '100.Misc/010.anchor',
31
31
  '110.PDF/010.pdf-pagebreak',
32
- '110.PDF/030.pdf-publication-title',
33
- '110.PDF/040.pdf-chapter-title',
34
- '110.PDF/070.pdf-cover',
32
+ '110.PDF/030.pdf-cover',
33
+ '110.PDF/050.pdf-publication-title',
34
+ '110.PDF/060.pdf-chapter-title',
35
35
  '110.PDF/080.pdf-toc-page',
36
36
  '110.PDF/090.pdf-toc-item-title',
37
37
  '110.PDF/100.pdf-toc-item',
38
+ '130.Hosting_Components/010.download-center',
39
+ '130.Hosting_Components/020.search',
38
40
  '999.Properties/alignment',
41
+ '999.Properties/font-color',
42
+ '999.Properties/grid',
39
43
  '999.Properties/hide-quote-characters',
40
44
  '999.Properties/icon',
41
45
  '999.Properties/pdf-spacer',
42
46
  '999.Properties/reverse',
43
- '999.Properties/grid',
44
47
  ];
45
48
 
46
49
  export const nsWowInternalLddUrl = 'https://nswow-ld.nswow.ch/designs';
@@ -16,6 +16,9 @@
16
16
  background-color: functions.get($colorName);
17
17
  @if map.has-key(variables.$colors, $onKey) {
18
18
  color: functions.get($onKey);
19
+ * {
20
+ color: inherit;
21
+ }
19
22
  }
20
23
  }
21
24
  }
@@ -41,6 +41,28 @@
41
41
  }
42
42
  }
43
43
 
44
+ @mixin editor-label($text) {
45
+ position: relative;
46
+ &:after {
47
+ content: "#{$text}";
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ margin-top: 4px;
52
+ margin-left: 4px;
53
+ border: 1px solid;
54
+ padding: 2px 7px;
55
+ font-size: 14px;
56
+ font-weight: 400;
57
+ line-height: 1.2;
58
+ border-radius: 7px;
59
+ z-index: 10001;
60
+ color: rgb(148 148 148);
61
+ background: rgb(248 248 248);
62
+ cursor: pointer;
63
+ }
64
+ }
65
+
44
66
  @mixin core-styles {
45
67
  .#{variables.$class-prefix}list-reset {
46
68
  @include list-reset;
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:list';
2
3
  @use 'variables';
3
4
  @use 'functions';
4
5
  @use '../grid';
@@ -9,27 +10,53 @@
9
10
  }
10
11
 
11
12
  @mixin margin-block($spacer) {
12
- margin-block: functions.get($spacer);
13
+ @if system.$build == "word" {
14
+ margin-top: functions.get($spacer);
15
+ margin-bottom: functions.get($spacer);
16
+ } @else {
17
+ margin-block: functions.get($spacer);
18
+ }
13
19
  }
14
20
 
15
21
  @mixin margin-inline($spacer) {
16
- margin-inline: functions.get($spacer);
22
+ @if system.$build == "word" {
23
+ margin-left: functions.get($spacer);
24
+ margin-right: functions.get($spacer);
25
+ } @else {
26
+ margin-inline: functions.get($spacer);
27
+ }
17
28
  }
18
29
 
19
30
  @mixin margin-top($spacer) {
20
- margin-block-start: functions.get($spacer);
31
+ @if system.$build == "word" {
32
+ margin-top: functions.get($spacer);
33
+ } @else {
34
+ margin-block-start: functions.get($spacer);
35
+ }
21
36
  }
22
37
 
23
38
  @mixin margin-right($spacer) {
24
- margin-inline-end: functions.get($spacer);
39
+ @if system.$build == "word" {
40
+ margin-right: functions.get($spacer);
41
+ } @else {
42
+ margin-inline-end: functions.get($spacer);
43
+ }
25
44
  }
26
45
 
27
46
  @mixin margin-bottom($spacer) {
28
- margin-block-end: functions.get($spacer);
47
+ @if system.$build == "word" {
48
+ margin-bottom: functions.get($spacer);
49
+ } @else {
50
+ margin-block-end: functions.get($spacer);
51
+ }
29
52
  }
30
53
 
31
54
  @mixin margin-left($spacer) {
32
- margin-inline-start: functions.get($spacer);
55
+ @if system.$build == "word" {
56
+ margin-left: functions.get($spacer);
57
+ } @else {
58
+ margin-inline-start: functions.get($spacer);
59
+ }
33
60
  }
34
61
 
35
62
  @mixin padding($spacer) {
@@ -37,27 +64,53 @@
37
64
  }
38
65
 
39
66
  @mixin padding-block($spacer) {
40
- padding-block: functions.get($spacer);
67
+ @if system.$build == "word" {
68
+ padding-top: functions.get($spacer);
69
+ padding-bottom: functions.get($spacer);
70
+ } @else {
71
+ padding-block: functions.get($spacer);
72
+ }
41
73
  }
42
74
 
43
75
  @mixin padding-inline($spacer) {
44
- padding-inline: functions.get($spacer);
76
+ @if system.$build == "word" {
77
+ padding-left: functions.get($spacer);
78
+ padding-right: functions.get($spacer);
79
+ } @else {
80
+ padding-inline: functions.get($spacer);
81
+ }
45
82
  }
46
83
 
47
84
  @mixin padding-top($spacer) {
48
- padding-block-start: functions.get($spacer);
85
+ @if system.$build == "word" {
86
+ padding-top: functions.get($spacer);
87
+ } @else {
88
+ padding-block-start: functions.get($spacer);
89
+ }
49
90
  }
50
91
 
51
92
  @mixin padding-right($spacer) {
52
- padding-inline-end: functions.get($spacer);
93
+ @if system.$build == "word" {
94
+ padding-right: functions.get($spacer);
95
+ } @else {
96
+ padding-inline-end: functions.get($spacer);
97
+ }
53
98
  }
54
99
 
55
100
  @mixin padding-bottom($spacer) {
56
- padding-block-end: functions.get($spacer);
101
+ @if system.$build == "word" {
102
+ padding-bottom: functions.get($spacer);
103
+ } @else {
104
+ padding-block-end: functions.get($spacer);
105
+ }
57
106
  }
58
107
 
59
108
  @mixin padding-left($spacer) {
60
- padding-inline-start: functions.get($spacer);
109
+ @if system.$build == "word" {
110
+ padding-left: functions.get($spacer);
111
+ } @else {
112
+ padding-inline-start: functions.get($spacer);
113
+ }
61
114
  }
62
115
 
63
116
  @mixin gap($spacer) {
@@ -72,6 +125,62 @@
72
125
  column-gap: functions.get($spacer);
73
126
  }
74
127
 
128
+ @mixin component-margin($spacing-rules) {
129
+ @each $pair, $margin in $spacing-rules {
130
+ $from: list.nth($pair, 1);
131
+ $to: list.nth($pair, 2);
132
+
133
+ @if $to == '*' {
134
+ #{$from} + * {
135
+ @include margin-top($margin);
136
+ }
137
+ } @else {
138
+ #{$from} + #{$to} {
139
+ @include margin-top($margin);
140
+ }
141
+ }
142
+
143
+ @if system.$build == "pdf" {
144
+ @if $to == '*' {
145
+ #{$from} + *,
146
+ #{$from}-last + * {
147
+ @include margin-top($margin);
148
+ }
149
+ } @else {
150
+ #{$from} + #{$to},
151
+ #{$from} + #{$to}-first,
152
+ #{$from}-last + #{$to},
153
+ #{$from}-last + #{$to}-first {
154
+ @include margin-top($margin);
155
+ }
156
+ }
157
+ } @else {
158
+ $wrappers: null;
159
+
160
+ @if system.$build != "xbrl" {
161
+ $wrappers: ('.srl-nested-container');
162
+ } @else {
163
+ $wrappers: ('.srl-nested-container', '.ixbrl-element');
164
+ }
165
+ @each $wrapper in $wrappers {
166
+ @if $to == '*' {
167
+ #{$from} + #{$wrapper}:has(:first-child),
168
+ #{$wrapper}:has(#{$from}:last-child) + * {
169
+ @include margin-top($margin);
170
+ }
171
+ } @else {
172
+ #{$from} + #{$wrapper}:has(#{$to}:first-child),
173
+ #{$wrapper}:has(#{$from}:last-child) + #{$to},
174
+ #{$wrapper}:has(#{$from}:first-child) + #{$wrapper}:has(#{$to}:last-child),
175
+ #{$wrapper}:has(#{$from}:last-child) + #{$wrapper}:has(#{$to}:first-child) {
176
+ @include margin-top($margin);
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+
75
184
  @mixin core-styles {
76
185
  @at-root {
77
186
  @each $spacer, $spacerValue in variables.$spacer {
@@ -63,7 +63,7 @@
63
63
  @return 900;
64
64
  }
65
65
 
66
- @mixin content($icon, $style: solid) {
66
+ @mixin content($icon, $style: v.$default-style) {
67
67
  @if not map.has-key(v.$brand-icons, $icon) and not map.has-key(v.$icons, $icon) {
68
68
  @debug "Icon "#{$icon}" not found in Font Awesome 7.";
69
69
  } @else {
@@ -88,7 +88,7 @@
88
88
  }
89
89
  }
90
90
 
91
- @mixin content-before($icon, $style: solid) {
91
+ @mixin content-before($icon, $style: v.$default-style) {
92
92
  @if not map.has-key(v.$brand-icons, $icon) and not map.has-key(v.$icons, $icon) {
93
93
  @debug "Icon "#{$icon}" not found in Font Awesome 7.";
94
94
  } @else {
@@ -8,7 +8,4 @@
8
8
  @forward "@fortawesome/fontawesome-free/scss/variables";
9
9
  @forward "@fortawesome/fontawesome-free/scss/mixins";
10
10
  $type: free;
11
- $default-style: light;
12
- @if map.has-key(meta.$meta, icon, default-style) {
13
- $default-style: map.get(meta.$meta, icon, default-style);
14
- }
11
+ $default-style: solid;
@@ -0,0 +1,122 @@
1
+ export interface PDFNestedContainerMarkerConfig {
2
+ selector?: string;
3
+ }
4
+
5
+ export class PDFNestedContainers {
6
+ private containers: NodeListOf<HTMLElement>;
7
+
8
+ private excludedClasses = [
9
+ 'srl-grid',
10
+ 'srl-linkable',
11
+ 'srl-nested-container',
12
+ 'srl-editor-component',
13
+ 'srl-pdf-columnbreak',
14
+ ];
15
+
16
+ private wrapperClasses = ['srl-grid'];
17
+
18
+ constructor(config: PDFNestedContainerMarkerConfig = {}) {
19
+ const { selector = '.srl-nested-container' } = config;
20
+
21
+ this.containers = document.querySelectorAll(selector);
22
+
23
+ if (this.containers.length === 0) {
24
+ return;
25
+ }
26
+
27
+ this.markContainers();
28
+ }
29
+
30
+ private markContainers(): void {
31
+ this.containers.forEach((container) => {
32
+ const firstElement = this.findEdgeElement(container, 'first');
33
+ const lastElement = this.findEdgeElement(container, 'last');
34
+
35
+ const firstClass = firstElement
36
+ ? this.getRelevantClass(firstElement)
37
+ : null;
38
+ const lastClass = lastElement ? this.getRelevantClass(lastElement) : null;
39
+
40
+ if (firstClass) {
41
+ container.classList.add(`${firstClass}-first`);
42
+ }
43
+
44
+ if (lastClass) {
45
+ container.classList.add(`${lastClass}-last`);
46
+ }
47
+ });
48
+ }
49
+
50
+ private findEdgeElement(
51
+ root: HTMLElement,
52
+ direction: 'first' | 'last',
53
+ ): HTMLElement | null {
54
+ const children = Array.from(root.children) as HTMLElement[];
55
+ const orderedChildren =
56
+ direction === 'first' ? children : [...children].reverse();
57
+
58
+ for (const child of orderedChildren) {
59
+ const relevantClass = this.getRelevantClass(child);
60
+
61
+ if (relevantClass) {
62
+ return child;
63
+ }
64
+
65
+ if (this.isLayoutWrapper(child)) {
66
+ const nestedElement = this.findEdgeElement(child, direction);
67
+
68
+ if (nestedElement) {
69
+ return nestedElement;
70
+ }
71
+
72
+ continue;
73
+ }
74
+
75
+ const nestedElement = this.findEdgeElement(child, direction);
76
+
77
+ if (nestedElement) {
78
+ return nestedElement;
79
+ }
80
+ }
81
+
82
+ return null;
83
+ }
84
+
85
+ private isLayoutWrapper(el: HTMLElement): boolean {
86
+ const classes = Array.from(el.classList);
87
+
88
+ if (classes.some((cls) => this.wrapperClasses.includes(cls))) {
89
+ return true;
90
+ }
91
+
92
+ if (classes.some((cls) => cls.includes('__'))) {
93
+ return true;
94
+ }
95
+
96
+ if (el.hasAttribute('doc-container') && !this.getRelevantClass(el)) {
97
+ return true;
98
+ }
99
+
100
+ return false;
101
+ }
102
+
103
+ private getRelevantClass(el: HTMLElement): string | null {
104
+ const classes = Array.from(el.classList);
105
+
106
+ const relevant = classes.find((cls) => {
107
+ if (!cls.startsWith('srl-')) return false;
108
+ if (this.excludedClasses.includes(cls)) return false;
109
+ if (cls.includes('__')) return false;
110
+ if (this.wrapperClasses.includes(cls)) return false;
111
+ if (cls.endsWith('-first')) return false;
112
+ if (cls.endsWith('-last')) return false;
113
+ if (cls.startsWith('srl-text-alignment-')) return false;
114
+
115
+ return true;
116
+ });
117
+
118
+ return relevant || null;
119
+ }
120
+ }
121
+
122
+ export default PDFNestedContainers;