@simple-reporting/base 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dev/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "postinstall": "npx srl prepare"
20
20
  },
21
21
  "dependencies": {
22
- "@simple-reporting/base": "^1.0.11",
22
+ "@simple-reporting/base": "^1.0.12",
23
23
  "axios": "^1.9.0",
24
24
  "chalk": "^5.4.1",
25
25
  "exceljs": "^4.4.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-reporting/base",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Manage srl templates, build and publish",
5
5
  "bin": {
6
6
  "srl": "cli.js"
@@ -24,6 +24,16 @@ function centerText(text: string): string {
24
24
  );
25
25
  }
26
26
 
27
+ function isVersionGreater(v1, v2) {
28
+ const a = v1.split('.').map(Number);
29
+ const b = v2.split('.').map(Number);
30
+ for (let i = 0; i < 3; i++) {
31
+ if (a[i] > b[i]) return true;
32
+ if (a[i] < b[i]) return false;
33
+ }
34
+ return false; // gleich
35
+ }
36
+
27
37
  function checkSrlVersion() {
28
38
  try {
29
39
  const pkgPath = join(folders.packagePath, 'package.json');
@@ -37,7 +47,7 @@ function checkSrlVersion() {
37
47
  .toString()
38
48
  .trim();
39
49
 
40
- if (current < latest) {
50
+ if (isVersionGreater(latest, current)) {
41
51
  console.log('');
42
52
  console.log(chalk.bgWhiteBright(centerText('')));
43
53
  console.log(
package/srl/utils/html.ts CHANGED
@@ -36,7 +36,7 @@ function replaceAccordionContainer(text: string): string {
36
36
  const innerContent = replaceAccordionContainer(text.slice(openTagRegex.lastIndex, end - 6));
37
37
 
38
38
  result += text.slice(lastIndex, start);
39
- result += `<srl-note-accordion${attrs}>${innerContent}</srl-note-accordion>`;
39
+ result += `<srl-note-accordion v-slot="{ id, open, toggle }"${attrs}>${innerContent}</srl-note-accordion>`;
40
40
  lastIndex = end;
41
41
  openTagRegex.lastIndex = end;
42
42
  }
@@ -61,7 +61,7 @@ function replaceAccordionToggle(text: string): string {
61
61
  const innerContent = text.slice(contentStart, end);
62
62
 
63
63
  result += text.slice(lastIndex, start);
64
- result += `<srl-note-accordion-toggle${attrs}>${innerContent}</srl-note-accordion-toggle>`;
64
+ result += `<srl-note-accordion-toggle :id="id" :open="open" :toggle="toggle"${attrs}>${innerContent}</srl-note-accordion-toggle>`;
65
65
  lastIndex = end + closeTag.length;
66
66
  openTagRegex.lastIndex = lastIndex;
67
67
  }
@@ -97,7 +97,7 @@ function replaceAccordionContent(text: string): string {
97
97
  const innerContent = replaceAccordionContent(text.slice(openTagRegex.lastIndex, end - 6));
98
98
 
99
99
  result += text.slice(lastIndex, start);
100
- result += `<srl-note-accordion-content${attrs}>${innerContent}</srl-note-accordion-content>`;
100
+ result += `<srl-note-accordion-content :id="id" :open="open"${attrs}>${innerContent}</srl-note-accordion-content>`;
101
101
  lastIndex = end;
102
102
  openTagRegex.lastIndex = end;
103
103
  }
@@ -169,9 +169,9 @@ export function prepareHtmlContent(text: string): string {
169
169
  (_match, name, content) => `<template #${name}>${content}</template>`
170
170
  );
171
171
 
172
- text = replaceAccordionContainer(text)
173
- text = replaceAccordionToggle(text)
174
- text = replaceAccordionContent(text)
172
+ text = replaceAccordionContainer(text);
173
+ text = replaceAccordionToggle(text);
174
+ text = replaceAccordionContent(text);
175
175
 
176
176
  text = text.replaceAll('../', `./`);
177
177