@pronto-tools-and-more/components 6.18.1 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "6.18.1",
3
+ "version": "6.20.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -9,7 +9,7 @@
9
9
  "type-check": "tsc",
10
10
  "test": "node --unhandled-rejections=warn --experimental-vm-modules ./node_modules/jest/bin/jest.js --detectOpenHandles --forceExit",
11
11
  "test:watch": "node --unhandled-rejections=warn --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
12
- "build": "esbuild src/main.ts --bundle --format=esm --outfile=dist/main.js && rm tsconfig.tsbuildinfo && npx tsc -b",
12
+ "build": "esbuild src/main.ts --bundle --format=esm --outfile=dist/main.js && rm -f tsconfig.build.tsbuildinfo && npx tsc -p tsconfig.build.json",
13
13
  "build:watch": "esbuild src/main.ts --bundle --format=esm --outfile=dist/main.js --watch"
14
14
  },
15
15
  "keywords": [],
@@ -19,6 +19,7 @@
19
19
  "@types/node": "^22.5.0",
20
20
  "@types/react": "^18.3.4",
21
21
  "esbuild": "^0.24.0",
22
+ "react": "^18.3.1",
22
23
  "ts-jest": "^29.2.5"
23
24
  }
24
25
  }
@@ -1,3 +1,4 @@
1
+ export * from "../JsonComponent/JsonComponent.tsx";
1
2
  export * from "../Login/Login.tsx";
2
- export * from "../SearchField/SearchField.tsx";
3
3
  export * from "../MenuItems/MenuItems.tsx";
4
+ export * from "../SearchField/SearchField.tsx";
@@ -0,0 +1,6 @@
1
+ import type React from "react";
2
+
3
+ export const JsonComponent = ({ json }): React.ReactElement => {
4
+ const node = json as React.ReactElement;
5
+ return node;
6
+ };
@@ -1,5 +1,9 @@
1
- export const Login = () => {
2
- return {
1
+ import type React from "react";
2
+ import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
3
+
4
+ export const Login = (): React.ReactNode => {
5
+ const json = {
3
6
  type: "login",
4
7
  };
8
+ return <JsonComponent json={json} />;
5
9
  };
@@ -1,5 +1,7 @@
1
+ import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
2
+
1
3
  export const MenuItems = ({ menuName }: { menuName: string }) => {
2
- return {
4
+ const json = {
3
5
  dataSource: {
4
6
  type: "menu",
5
7
  filter: {
@@ -11,4 +13,5 @@ export const MenuItems = ({ menuName }: { menuName: string }) => {
11
13
  type: "menu",
12
14
  template: "STATIC",
13
15
  };
16
+ return <JsonComponent json={json} />;
14
17
  };
@@ -0,0 +1,21 @@
1
+ import { jest } from "@jest/globals";
2
+
3
+ // jest.unstable_mockModule("react", () => {
4
+ // return {
5
+ // createElement(key, props, children) {
6
+ // return {
7
+ // key,
8
+ // props,
9
+ // children,
10
+ // };
11
+ // },
12
+ // };
13
+ // });
14
+
15
+ // jest.unstable_mockModule("react/jsx-runtime", () => {
16
+ // return {
17
+ // jsx(fn, props) {
18
+ // return fn(props);
19
+ // },
20
+ // };
21
+ // });
@@ -1,5 +1,7 @@
1
+ import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
2
+
1
3
  export const NoSearchResults = () => {
2
- return {
4
+ const json = {
3
5
  tag: "p",
4
6
  type: "html",
5
7
  content: "SEARCH_RESULT_NO_SEARCH",
@@ -9,4 +11,5 @@ export const NoSearchResults = () => {
9
11
  operation: "NOT_SET",
10
12
  },
11
13
  };
14
+ return <JsonComponent json={json} />;
12
15
  };
@@ -1,6 +1,11 @@
1
- export const SearchField = () => {
2
- return {
1
+ import React from "react";
2
+ import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
3
+
4
+ export const SearchField = (): React.ReactElement => {
5
+ const json = {
3
6
  type: "search-field",
4
7
  className: "searchfield",
8
+ key: "",
5
9
  };
10
+ return <JsonComponent json={json} />;
6
11
  };