diff --git a/buildtime/client/README.md b/buildtime/client/README.md index 80c960f61..2c3f8ef46 100644 --- a/buildtime/client/README.md +++ b/buildtime/client/README.md @@ -47,5 +47,33 @@ HeroIcon Lib mit der MIT Lizenz ([tailwindlabs/heroicons: A set of free MIT-lice npm install @heroicons/react ``` +#### CSS Helper Tailwind CSS +Zur schnellen Erstellung von Layout: [tailwindlabs/tailwindcss: A utility-first CSS framework for rapid UI development.](https://github.com/tailwindlabs/tailwindcss) + +```bash +npm install tailwindcss @tailwindcss/vite +``` +Dann die Datei vite.config.ts editieren + +```javascript + +edit vite.config.ts + +import { defineConfig } from 'vite' +import tailwindcss from '@tailwindcss/vite' + +export default defineConfig({ + plugins: [ + tailwindcss(), + ], +}) + +``` +In der Scriptdatei: +```javascript +@import "tailwindcss"; +``` + +Dokumentation : diff --git a/buildtime/client/logical-editor/src/App.css b/buildtime/client/logical-editor/src/App.css index 2607db802..84ab6a229 100644 --- a/buildtime/client/logical-editor/src/App.css +++ b/buildtime/client/logical-editor/src/App.css @@ -1,10 +1,12 @@ + + .navbar { padding: 16px; color: gray; display: flex; background: var(--code-bg); box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - height: 50px; + height: 80px; } .navbar h1 { @@ -100,5 +102,8 @@ footer { display: flex; background: var(--code-bg); box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - height: 20px; -} \ No newline at end of file + height: 40px; +} + + +@import "tailwindcss"; diff --git a/buildtime/client/logical-editor/src/components/PropertySideBar.jsx b/buildtime/client/logical-editor/src/components/PropertySideBar.jsx index 8527c6213..0d67c529c 100644 --- a/buildtime/client/logical-editor/src/components/PropertySideBar.jsx +++ b/buildtime/client/logical-editor/src/components/PropertySideBar.jsx @@ -1,18 +1,22 @@ import React, { Component } from 'react'; import { useState } from 'react'; -import { Tree } from 'react-arborist'; -import TreeView from './TreeView'; +import PropertyTreeView from './PropertyTreeView'; -const PropertySideBar = ({ properties, setUpdate }) => { +const PropertySideBar = ({ properties }) => { return ( ); }; diff --git a/buildtime/client/logical-editor/src/components/PropertyTreeView.jsx b/buildtime/client/logical-editor/src/components/PropertyTreeView.jsx new file mode 100644 index 000000000..7ed5f1920 --- /dev/null +++ b/buildtime/client/logical-editor/src/components/PropertyTreeView.jsx @@ -0,0 +1,47 @@ +import React from 'react'; +import { useState } from 'react'; + +import { ChevronRightIcon } from '@heroicons/react/16/solid'; +import { DocumentIcon, FolderIcon } from '@heroicons/react/24/solid'; + +const PropertyTreeView = ({ node, key }) => { + const [expanded, setExpanded] = useState(true); + console.log('node:', key, node.id, node.label, node.subPropertygroups); + return ( +
  • + + {node.subPropertygroups && node.subPropertygroups.length > 0 && ( + + )} + + {node.subPropertygroups ? ( + + ) : ( + + )} + {node.label} + + + {expanded && ( + + )} +
  • + + ); +}; + +export default PropertyTreeView; + + diff --git a/buildtime/client/logical-editor/src/components/TreeView.jsx b/buildtime/client/logical-editor/src/components/TreeView.jsx deleted file mode 100644 index 3dc319e3d..000000000 --- a/buildtime/client/logical-editor/src/components/TreeView.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import {Tree} from 'react-arborist'; - -const TreeView = ({ data, setUpdate }) => { - return ( - - {Node} - - ); -}; - -const Node = ({ node, style, dragHandle, tree }) => { - console.log(node, tree); - - return ( -
    {setUpdate(prev => !prev); node.toggle()}}> - {node.isLeaf ? "📄" : node.isOpen ? "📂" : "📁"} - {node.data.label} -
    - ); -}; - -export default TreeView; - - diff --git a/buildtime/client/logical-editor/src/index.css b/buildtime/client/logical-editor/src/index.css index ac19b3e7b..cb61a2f99 100644 --- a/buildtime/client/logical-editor/src/index.css +++ b/buildtime/client/logical-editor/src/index.css @@ -1,3 +1,4 @@ + :root { --text: #6b6375; --text-h: #08060d; diff --git a/buildtime/client/logical-editor/src/main.jsx b/buildtime/client/logical-editor/src/main.jsx index b9a1a6dea..9d3b33bfc 100644 --- a/buildtime/client/logical-editor/src/main.jsx +++ b/buildtime/client/logical-editor/src/main.jsx @@ -1,6 +1,7 @@ import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import './index.css' + import App from './App.jsx' createRoot(document.getElementById('root')).render( diff --git a/buildtime/client/logical-editor/src/pages/PropertyPage.jsx b/buildtime/client/logical-editor/src/pages/PropertyPage.jsx index be6cebc51..7c6a53dff 100644 --- a/buildtime/client/logical-editor/src/pages/PropertyPage.jsx +++ b/buildtime/client/logical-editor/src/pages/PropertyPage.jsx @@ -5,15 +5,14 @@ import UseFetch from '../components/tools/UseFetch'; const PropertyPage = () => { const { data: properties, isLoading, error } = UseFetch(`http://localhost:8088/propertygroup/1`) - const [update, setUpdate] = useState(false) if (isLoading) return

    Loading profile...

    if (error) return

    Error: {error}

    return (
    -
    -
    +
    +
    {JSON.stringify(properties)}
    ); }; diff --git a/buildtime/client/logical-editor/vite.config.js b/buildtime/client/logical-editor/vite.config.js index 8b0f57b91..c4069b770 100644 --- a/buildtime/client/logical-editor/vite.config.js +++ b/buildtime/client/logical-editor/vite.config.js @@ -1,7 +1,8 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import tailwindcss from '@tailwindcss/vite' // https://vite.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [react(), tailwindcss()], })