workflow底层UI库整合至项目,优化构建逻辑
This commit is contained in:
245
easyflow-ui-admin/packages/tinyflow-ui/src/styles/base.less
Normal file
245
easyflow-ui-admin/packages/tinyflow-ui/src/styles/base.less
Normal file
@@ -0,0 +1,245 @@
|
||||
.tf-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 2px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
height: fit-content;
|
||||
width: fit-content;
|
||||
|
||||
svg {
|
||||
fill: currentColor;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border: 1px solid var(--tf-primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.tf-btn.tf-btn-primary {
|
||||
background: var(--tf-primary-color);
|
||||
color: #fff;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid #ccc;
|
||||
background: #3a6fe3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tf-input, .tf-textarea {
|
||||
display: flex;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px 8px;
|
||||
box-sizing: border-box;
|
||||
resize: vertical;
|
||||
outline: none;
|
||||
line-height: normal;
|
||||
overflow-y: hidden;
|
||||
|
||||
&::placeholder {
|
||||
color: #ccc;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
// 获得焦点时的样式
|
||||
&:focus {
|
||||
border-color: var(--tf-primary-color);
|
||||
box-shadow: 0 0 5px rgba(81, 203, 238, .2);
|
||||
}
|
||||
|
||||
// 禁用时的样式
|
||||
&[disabled] {
|
||||
background-color: #f0f0f0;
|
||||
cursor: not-allowed;
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tf-select {
|
||||
&-input {
|
||||
display: flex;
|
||||
border: 1px solid #ccc;
|
||||
padding: 3px 10px;
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
height: 27px;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--tf-primary-color);
|
||||
box-shadow: 0 0 5px rgba(81, 203, 238, .2);
|
||||
}
|
||||
|
||||
&-value {
|
||||
height: 21px;
|
||||
min-width: 10px;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&-arrow {
|
||||
display: block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
&-placeholder {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
&-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
margin-top: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
width: max-content;
|
||||
min-width: 100%;
|
||||
z-index: 999;
|
||||
box-sizing: border-box;
|
||||
max-height: 220px;
|
||||
overflow: auto;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 10px;
|
||||
border: none;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
line-height: 100%;
|
||||
gap: 2px;
|
||||
|
||||
span {
|
||||
width: 16px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
}
|
||||
|
||||
&-children {
|
||||
padding-left: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tf-checkbox {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.tf-tabs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
border: none;
|
||||
background: #F4F4F5;
|
||||
|
||||
.tf-tabs-item {
|
||||
flex-grow: 1;
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
color: #808088;
|
||||
}
|
||||
|
||||
.tf-tabs-item.active {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
h3.tf-heading {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
margin-top: 2px;
|
||||
margin-bottom: 3px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
||||
.tf-collapse {
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
//padding: 5px;
|
||||
|
||||
&-item {
|
||||
|
||||
&-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
|
||||
&-icon {
|
||||
display: flex;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
color: #2563EB;
|
||||
background: #cedafb;
|
||||
border-radius: 5px;
|
||||
padding: 3px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
color: #3474ff;
|
||||
}
|
||||
}
|
||||
|
||||
&-arrow {
|
||||
display: block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&-description {
|
||||
font-size: 12px;
|
||||
margin: 10px 0;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import './variable.less';
|
||||
import './base.less';
|
||||
import './tinyflow.less';
|
||||
160
easyflow-ui-admin/packages/tinyflow-ui/src/styles/tinyflow.less
Normal file
160
easyflow-ui-admin/packages/tinyflow-ui/src/styles/tinyflow.less
Normal file
@@ -0,0 +1,160 @@
|
||||
|
||||
.svelte-flow__nodes {
|
||||
|
||||
.svelte-flow__node {
|
||||
border: 3px solid transparent;
|
||||
border-radius: 5px;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.svelte-flow__handle {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: none;
|
||||
|
||||
&::after {
|
||||
content: ' ';
|
||||
background: #2563EB;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 100%;
|
||||
transition: width 0.1s, height 0.1s;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::after {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.loop_handle_wrapper {
|
||||
&::after {
|
||||
content: '循环体';
|
||||
background: #2563EB;
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
border-radius: 0;
|
||||
display: flex;
|
||||
color: #fff;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&::after {
|
||||
width: 100px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
border-radius: 5px;
|
||||
top: -2px;
|
||||
left: -2px;
|
||||
border: 1px solid #ccc;
|
||||
height: calc(100% + 2px);
|
||||
width: calc(100% + 2px);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border: 3px solid #bacaef7d;
|
||||
}
|
||||
|
||||
&.selectable.selected {
|
||||
border: 3px solid #bacaef7d;
|
||||
box-shadow: var(--xy-node-boxshadow-selected);
|
||||
}
|
||||
|
||||
&:hover:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.selectable.selected:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tf-node-wrapper {
|
||||
border-radius: 5px;
|
||||
min-width: 300px;
|
||||
background: #fff;
|
||||
|
||||
&-body {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.svelte-flow__attribution a {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tf-toolbar {
|
||||
z-index: 200;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
transition: transform 0.5s ease, opacity 0.5s ease;
|
||||
transform: translateX(calc(-100% + 20px)); /* 完全移出视口 */
|
||||
|
||||
&.show {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
&-container {
|
||||
background: #fff;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
padding: 10px;
|
||||
width: fit-content;
|
||||
|
||||
&-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
&-body {
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
|
||||
.tf-toolbar-container-base, .tf-toolbar-container-tools {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
flex-grow: 1;
|
||||
|
||||
.tf-btn {
|
||||
border: none;
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
height: 40px;
|
||||
gap: 10px;
|
||||
cursor: grabbing;
|
||||
border-radius: 5px;
|
||||
|
||||
svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: #2563EB;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
:root,
|
||||
:root .tf-theme-light {
|
||||
--tf-primary-color: #2563EB;
|
||||
--xy-node-boxshadow-selected: 0 0 0 1px var(--tf-primary-color);
|
||||
--xy-handle-background-color: var(--tf-primary-color);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//the dark theme variables
|
||||
:root .tf-theme-dark {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user