@simple-reporting/base 1.0.33 → 1.0.35

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 (58) hide show
  1. package/dev/package.json +2 -1
  2. package/dev/src/assets/scss/app.scss +5 -0
  3. package/dev/src/assets/scss/pdf.scss +1 -1
  4. package/dev/vite.config.ts +4 -1
  5. package/devTools/SrlDevTools.vue +234 -0
  6. package/devTools/assets/Svg/Check.vue +7 -0
  7. package/devTools/assets/Svg/Close.vue +5 -0
  8. package/devTools/assets/Svg/Eye.vue +16 -0
  9. package/devTools/assets/Svg/Info.vue +7 -0
  10. package/devTools/assets/Svg/Settings.vue +5 -0
  11. package/devTools/assets/Svg/Uncheck.vue +7 -0
  12. package/devTools/box/Content.vue +93 -0
  13. package/devTools/components/BoxPanel.vue +23 -0
  14. package/devTools/components/Content.vue +17 -0
  15. package/devTools/config.ts +34 -0
  16. package/devTools/dialog/Colors.vue +33 -0
  17. package/devTools/dialog/Grid.vue +111 -0
  18. package/devTools/dialog/Settings.vue +62 -0
  19. package/devTools/dialog/Spacer.vue +110 -0
  20. package/devTools/dialog/ViewPort.vue +33 -0
  21. package/devTools/panel/Content.vue +50 -0
  22. package/devTools/settings.ts +28 -0
  23. package/devTools/utils/index.ts +7 -0
  24. package/devTools/utils/wheelResizeHandler.ts +19 -0
  25. package/livingdocs/010.Titles/020.title-h2/scss/general.scss +1 -16
  26. package/livingdocs/010.Titles/020.title-h2/scss/pdf.scss +16 -0
  27. package/livingdocs/010.Titles/020.title-h2/scss/web.scss +16 -0
  28. package/livingdocs/010.Titles/030.title-h3/scss/general.scss +0 -15
  29. package/livingdocs/010.Titles/030.title-h3/scss/pdf.scss +16 -0
  30. package/livingdocs/010.Titles/030.title-h3/scss/web.scss +16 -0
  31. package/livingdocs/010.Titles/040.title-h4/scss/general.scss +0 -15
  32. package/livingdocs/010.Titles/040.title-h4/scss/pdf.scss +16 -0
  33. package/livingdocs/010.Titles/040.title-h4/scss/web.scss +16 -0
  34. package/livingdocs/040.Media/010.table/scss/general.scss +6 -3
  35. package/livingdocs/110.PDF/100.pdf-toc-item/scss/general.scss +6 -1
  36. package/livingdocs/110.PDF/100.pdf-toc-item/scss/pdf.scss +6 -0
  37. package/package.json +8 -3
  38. package/plugins/viteSrlPlugin.js +19 -6
  39. package/scripts/build.d.ts +2 -0
  40. package/scripts/build.js +68 -3
  41. package/scripts/css/stripMediaFromCss.d.ts +17 -0
  42. package/scripts/css/stripMediaFromCss.js +147 -0
  43. package/scripts/vue/components.js +9 -2
  44. package/srl/.srl/App.vue +7 -1
  45. package/srl/.srl/components/Srl/Article/Accordion.vue +1 -0
  46. package/srl/.srl/components/Srl/Article/Root.vue +4 -4
  47. package/srl/.srl/components/Srl/Category/Accordion/Toggle.vue +2 -1
  48. package/srl/.srl/components/Srl/Menu/Item.vue +58 -24
  49. package/srl/.srl/components/Srl/Menu.vue +43 -17
  50. package/srl/.srl/composables/config.ts +4 -3
  51. package/srl/.srl/composables/index.ts +3 -0
  52. package/srl/.srl/composables/menu.ts +6 -3
  53. package/srl/.srl/composables/srlConfig.ts +3 -0
  54. package/srl/.srl/types/global.d.ts +11 -0
  55. package/srl/.srl/types/nswow.d.ts +5 -0
  56. package/srl/.srl/utils/html.ts +2 -2
  57. package/srl/.srl/utils/index.ts +27 -25
  58. package/srl/.srl/utils/object.ts +60 -0
@@ -91,9 +91,12 @@ export default function useMenu(
91
91
  try {
92
92
  const route = useRoute();
93
93
  menus[name] = computed<NsWowNavigationItem[]>(() => {
94
- return config.value.menus[config.value.locale][name].map((item) => {
95
- return buildNav(item, route);
96
- });
94
+ if (config.value.menus[config.value.locale][name]) {
95
+ return config.value.menus[config.value.locale][name].map((item) => {
96
+ return buildNav(item, route);
97
+ });
98
+ }
99
+ return [];
97
100
  });
98
101
 
99
102
  return menus[name];
@@ -0,0 +1,3 @@
1
+ export default function useSrlConfig(): unknown {
2
+ return {}
3
+ }
@@ -1,6 +1,17 @@
1
1
  import { App } from 'vue'
2
2
  export {}
3
3
  declare global {
4
+ type SrlDevToolsSettings = {
5
+ active: boolean
6
+ size: string
7
+ position: string
8
+ opacity: number
9
+ darkMode: boolean
10
+ overlay: {
11
+ grid: boolean
12
+ }
13
+ }
14
+ type SrlDevToolsDialog = null | "grid" | "spacer" | "typo" | "colors" | "settings" | "viewport"
4
15
  interface Window {
5
16
  app: App;
6
17
  }
@@ -1,3 +1,5 @@
1
+ import type { VNode } from 'vue';
2
+
1
3
  export {};
2
4
  declare global {
3
5
  type NsWowSettings = {
@@ -98,6 +100,9 @@ declare global {
98
100
  icon?: string;
99
101
  iconBefore?: string;
100
102
  iconAfter?: string;
103
+ svg?: VNode | string;
104
+ svgBefore?: VNode | string;
105
+ svgAfter?: VNode | string;
101
106
  img?: {
102
107
  src: string;
103
108
  alt?: string;
@@ -77,8 +77,8 @@ export function prepareHtmlContent(text: string): string {
77
77
  });
78
78
 
79
79
  text = text.replace(
80
- /<template-([a-z]+)>([\s\S]*?)<\/template-\1>/g,
81
- (_match, name, content) => `<template #${name}>${content}</template>`
80
+ /<template-([a-z]+)([^>]*)>([\s\S]*?)<\/template-\1>/g,
81
+ (_match, name, attrs, content) => `<template ${attrs} #${name}>${content}</template>`
82
82
  );
83
83
 
84
84
  text = text.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, (match, p1) => {
@@ -1,33 +1,35 @@
1
1
  import { isFilePath, isRouterPath, isExternalPath } from './uri';
2
2
  import { camelCase } from './string';
3
3
  import { prepareHtmlContent } from './html';
4
+ import { objectDeepAssign } from './object'
4
5
  import {
5
- usePageState,
6
- clearPageState,
7
- isDialogStored,
8
- addDialogToStorage,
9
- getDialogFromStorage,
10
- getDialogStorage,
11
- isAccordionAnchored,
12
- setAccordionAnchored,
13
- isMounted,
14
- setMounted
6
+ usePageState,
7
+ clearPageState,
8
+ isDialogStored,
9
+ addDialogToStorage,
10
+ getDialogFromStorage,
11
+ getDialogStorage,
12
+ isAccordionAnchored,
13
+ setAccordionAnchored,
14
+ isMounted,
15
+ setMounted
15
16
  } from './pageState.ts';
16
17
 
17
18
  export {
18
- isFilePath,
19
- isRouterPath,
20
- isExternalPath,
21
- camelCase,
22
- prepareHtmlContent,
23
- usePageState,
24
- clearPageState,
25
- isAccordionAnchored,
26
- setAccordionAnchored,
27
- isDialogStored,
28
- addDialogToStorage,
29
- getDialogFromStorage,
30
- getDialogStorage,
31
- setMounted,
32
- isMounted,
19
+ isFilePath,
20
+ isRouterPath,
21
+ isExternalPath,
22
+ camelCase,
23
+ prepareHtmlContent,
24
+ usePageState,
25
+ clearPageState,
26
+ isAccordionAnchored,
27
+ setAccordionAnchored,
28
+ isDialogStored,
29
+ addDialogToStorage,
30
+ getDialogFromStorage,
31
+ getDialogStorage,
32
+ setMounted,
33
+ isMounted,
34
+ objectDeepAssign
33
35
  };
@@ -0,0 +1,60 @@
1
+ type PlainObject = Record<string, any>;
2
+
3
+ export function objectDeepAssign<T extends PlainObject>(target: T, source: Partial<T>): T {
4
+ // Defensive guard: API erwartet Root-Objekte, keine Arrays.
5
+ if (Array.isArray(target) || Array.isArray(source)) {
6
+ throw new TypeError('objectDeepAssign erwartet Objekte als Root-Parameter');
7
+ }
8
+
9
+ for (const key in source) {
10
+ if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
11
+
12
+ const sourceValue = (source as PlainObject)[key];
13
+ const targetValue = (target as PlainObject)[key];
14
+
15
+ (target as PlainObject)[key] = mergeNode(targetValue, sourceValue);
16
+ }
17
+
18
+ return target;
19
+ }
20
+
21
+ function mergeNode(targetValue: any, sourceValue: any): any {
22
+ // Arrays nur intern behandeln (verschachtelte Knoten)
23
+ if (Array.isArray(sourceValue)) {
24
+ const targetArr = Array.isArray(targetValue) ? targetValue : [];
25
+ return mergeArray(targetArr, sourceValue);
26
+ }
27
+
28
+ // Plain Objects rekursiv mergen
29
+ if (isPlainObject(sourceValue)) {
30
+ const base = isPlainObject(targetValue) ? targetValue : {};
31
+ return objectDeepAssign(base, sourceValue);
32
+ }
33
+
34
+ // Primitive / null / Funktionen etc. überschreiben
35
+ return sourceValue;
36
+ }
37
+
38
+ function mergeArray(targetArr: any[], sourceArr: any[]): any[] {
39
+ // Vereint beide Längen: neue source-Elemente kommen dazu,
40
+ // bestehende target-Reste bleiben erhalten.
41
+ const maxLen = Math.max(targetArr.length, sourceArr.length);
42
+ const result = new Array(maxLen);
43
+
44
+ for (let i = 0; i < maxLen; i++) {
45
+ const hasSource = i < sourceArr.length;
46
+
47
+ if (!hasSource) {
48
+ result[i] = targetArr[i];
49
+ continue;
50
+ }
51
+
52
+ result[i] = mergeNode(targetArr[i], sourceArr[i]);
53
+ }
54
+
55
+ return result;
56
+ }
57
+
58
+ function isPlainObject(value: unknown): value is PlainObject {
59
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
60
+ }