lu-lowcode-package-form 0.9.32 → 0.9.33
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/dist/index.cjs.js +102 -102
- package/dist/index.es.js +2952 -2953
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.jsx +4 -0
- package/src/components/field/table/index copy 3.jsx +163 -0
- package/src/components/field/table/index.jsx +60 -50
- package/src/components/form-container/index.jsx +8 -4
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.fabsolute{position:absolute}.frelative{position:relative}.fleft-0{left:0}.ftop-0{top:0}.fz-10{z-index:10}.f-mx-1{margin-left:-.25rem;margin-right:-.25rem}.fmy-2{margin-top:.5rem;margin-bottom:.5rem}.fmt-2{margin-top:.5rem}.fbox-border{box-sizing:border-box}.fflex{display:flex}.fhidden{display:none}.fh-11{height:2.75rem}.fh-12{height:3rem}.fh-24{height:6rem}.fh-5{height:1.25rem}.fh-8{height:2rem}.fh-full{height:100%}.fmax-h-full{max-height:100%}.fmin-h-20{min-height:5rem}.fmin-h-5{min-height:1.25rem}.fw-12{width:3rem}.fw-24{width:6rem}.fw-5{width:1.25rem}.fw-\[960px\]{width:960px}.fw-full{width:100%}.fmin-w-36{min-width:9rem}.fmin-w-full{min-width:100%}.fmax-w-full{max-width:100%}.fflex-1{flex:1 1 0%}.fcursor-not-allowed{cursor:not-allowed}.fcursor-pointer{cursor:pointer}.fflex-col{flex-direction:column}.fflex-wrap{flex-wrap:wrap}.fflex-nowrap{flex-wrap:nowrap}.fitems-center{align-items:center}.fitems-stretch{align-items:stretch}.fjustify-center{justify-content:center}.fjustify-between{justify-content:space-between}.fgap-1{gap:.25rem}.fgap-2{gap:.5rem}.fgap-3{gap:.75rem}.fgap-x-1{column-gap:.25rem}.fgap-y-2{row-gap:.5rem}.foverflow-hidden{overflow:hidden}.foverflow-x-auto{overflow-x:auto}.ftext-nowrap{text-wrap:nowrap}.frounded{border-radius:.25rem}.fborder{border-width:1px}.fborder-b{border-bottom-width:1px}.fborder-l-4{border-left-width:4px}.fborder-r{border-right-width:1px}.fborder-dashed{border-style:dashed}.fborder-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.fborder-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.fborder-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.fborder-r-\[\#e9e9e9\]{--tw-border-opacity: 1;border-right-color:rgb(233 233 233 / var(--tw-border-opacity))}.fbg-\[\#fafafa\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.fbg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.fbg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.fbg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.fbg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.fbg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.fbg-transparent{background-color:transparent}.fbg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fbg-opacity-50{--tw-bg-opacity: .5}.fobject-contain{object-fit:contain}.fp-0{padding:0}.fp-2{padding:.5rem}.fp-4{padding:1rem}.fp-6{padding:1.5rem}.fpx-1{padding-left:.25rem;padding-right:.25rem}.fpx-2{padding-left:.5rem;padding-right:.5rem}.fpy-2{padding-top:.5rem;padding-bottom:.5rem}.fpb-10{padding-bottom:2.5rem}.fpl-2{padding-left:.5rem}.ftext-lg{font-size:1.125rem;line-height:1.75rem}.ftext-sm{font-size:.875rem;line-height:1.25rem}.ftext-xl{font-size:1.25rem;line-height:1.75rem}.ftext-xs{font-size:.75rem;line-height:1rem}.ffont-bold{font-weight:700}.ffont-medium{font-weight:500}.ffont-semibold{font-weight:600}.ftext-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.ftext-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.ftext-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.ftext-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.ftext-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.ftext-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.fopacity-5{opacity:.05}.hover\:fborder-\[\#3e92f8\]:hover{--tw-border-opacity: 1;border-color:rgb(62 146 248 / var(--tw-border-opacity))}.hover\:ftext-\[\#3e92f8\]:hover{--tw-text-opacity: 1;color:rgb(62 146 248 / var(--tw-text-opacity))}.hover\:ftext-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.fgroup:hover .group-hover\:fflex{display:flex}.fgroup:hover .group-hover\:fbg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}/*!
|
|
1
|
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.fabsolute{position:absolute}.frelative{position:relative}.fsticky{position:-webkit-sticky;position:sticky}.fleft-0{left:0}.fright-0{right:0}.ftop-0{top:0}.fz-10{z-index:10}.f-mx-1{margin-left:-.25rem;margin-right:-.25rem}.fmy-2{margin-top:.5rem;margin-bottom:.5rem}.fmt-2{margin-top:.5rem}.fbox-border{box-sizing:border-box}.fflex{display:flex}.fhidden{display:none}.fh-11{height:2.75rem}.fh-12{height:3rem}.fh-24{height:6rem}.fh-5{height:1.25rem}.fh-8{height:2rem}.fh-full{height:100%}.fmax-h-full{max-height:100%}.fmin-h-20{min-height:5rem}.fmin-h-5{min-height:1.25rem}.fw-12{width:3rem}.fw-24{width:6rem}.fw-5{width:1.25rem}.fw-\[960px\]{width:960px}.fw-full{width:100%}.fmin-w-36{min-width:9rem}.fmin-w-full{min-width:100%}.fmax-w-full{max-width:100%}.fflex-1{flex:1 1 0%}.fcursor-not-allowed{cursor:not-allowed}.fcursor-pointer{cursor:pointer}.fflex-col{flex-direction:column}.fflex-wrap{flex-wrap:wrap}.fflex-nowrap{flex-wrap:nowrap}.fitems-center{align-items:center}.fitems-stretch{align-items:stretch}.fjustify-center{justify-content:center}.fjustify-between{justify-content:space-between}.fgap-1{gap:.25rem}.fgap-2{gap:.5rem}.fgap-3{gap:.75rem}.fgap-x-1{column-gap:.25rem}.fgap-y-2{row-gap:.5rem}.foverflow-hidden{overflow:hidden}.foverflow-x-auto{overflow-x:auto}.ftext-nowrap{text-wrap:nowrap}.frounded{border-radius:.25rem}.fborder{border-width:1px}.fborder-b{border-bottom-width:1px}.fborder-l-4{border-left-width:4px}.fborder-r{border-right-width:1px}.fborder-dashed{border-style:dashed}.fborder-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.fborder-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.fborder-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.fborder-r-\[\#e9e9e9\]{--tw-border-opacity: 1;border-right-color:rgb(233 233 233 / var(--tw-border-opacity))}.fbg-\[\#fafafa\]{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.fbg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.fbg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.fbg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.fbg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.fbg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.fbg-transparent{background-color:transparent}.fbg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fbg-opacity-50{--tw-bg-opacity: .5}.fobject-contain{object-fit:contain}.fp-0{padding:0}.fp-2{padding:.5rem}.fp-4{padding:1rem}.fp-6{padding:1.5rem}.fpx-1{padding-left:.25rem;padding-right:.25rem}.fpx-2{padding-left:.5rem;padding-right:.5rem}.fpy-2{padding-top:.5rem;padding-bottom:.5rem}.fpb-10{padding-bottom:2.5rem}.fpl-2{padding-left:.5rem}.ftext-lg{font-size:1.125rem;line-height:1.75rem}.ftext-sm{font-size:.875rem;line-height:1.25rem}.ftext-xl{font-size:1.25rem;line-height:1.75rem}.ftext-xs{font-size:.75rem;line-height:1rem}.ffont-bold{font-weight:700}.ffont-medium{font-weight:500}.ffont-semibold{font-weight:600}.ftext-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.ftext-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.ftext-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.ftext-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.ftext-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.ftext-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.fopacity-5{opacity:.05}.hover\:fborder-\[\#3e92f8\]:hover{--tw-border-opacity: 1;border-color:rgb(62 146 248 / var(--tw-border-opacity))}.hover\:ftext-\[\#3e92f8\]:hover{--tw-text-opacity: 1;color:rgb(62 146 248 / var(--tw-text-opacity))}.hover\:ftext-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.fgroup:hover .group-hover\:fflex{display:flex}.fgroup:hover .group-hover\:fbg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}/*!
|
|
2
2
|
* Quill Editor v1.3.7
|
|
3
3
|
* https://quilljs.com/
|
|
4
4
|
* Copyright (c) 2014, Jason Chen
|
package/package.json
CHANGED
package/src/App.jsx
CHANGED
|
@@ -104,6 +104,10 @@ function App() {
|
|
|
104
104
|
<Layout.FormGroupTitle title={"基本信息"} />
|
|
105
105
|
<Layout.FormRow layout={'1'}>
|
|
106
106
|
<Field.Table label="子表格" __id="table" >
|
|
107
|
+
<Field.Input isRequired={true} label="商品价格" __id="product_price11" />
|
|
108
|
+
<Field.Input isRequired={true} label="商品价格" __id="product_price12" />
|
|
109
|
+
<Field.Input isRequired={true} label="商品价格" __id="product_price13" />
|
|
110
|
+
<Field.Input isRequired={true} label="商品价格" __id="product_price14" />
|
|
107
111
|
<Field.Input isRequired={true} label="商品价格" __id="product_price1" />
|
|
108
112
|
<Field.Input isRequired={true} label="商品个数" __id="product_num1" />
|
|
109
113
|
<Field.Input label="商品总价" __id="product_sum1"
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef } from "react";
|
|
2
|
+
import { Button, Form, Input } from "antd";
|
|
3
|
+
import { DeleteOutlined } from "@ant-design/icons";
|
|
4
|
+
import { BaseWrapper } from "../base.jsx"
|
|
5
|
+
|
|
6
|
+
const TableAction = ({ height, label, subTableIndex, children, subTableHead = false, ...props }) => {
|
|
7
|
+
return <div className="fw-12" style={height ? { height: `${height}px` } : {}}>
|
|
8
|
+
<div className="frelative fw-full fh-full fflex fflex-col foverflow-hidden">
|
|
9
|
+
{label && subTableHead && <div className='fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fflex-nowrap ftext-nowrap fjustify-between fitems-center fpx-2 fborder-b'>{label}</div>}
|
|
10
|
+
{!subTableHead && <div className="fw-full fflex-1 fflex fitems-center fjustify-center fp-2 fbox-border ">
|
|
11
|
+
{children}
|
|
12
|
+
</div>
|
|
13
|
+
}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const TableCol = ({ children, width, ...props }) => {
|
|
20
|
+
const [sWidth, setSWidth] = useState(0);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setSWidth(width);
|
|
23
|
+
}, [width]);
|
|
24
|
+
return <div className="fflex-1 fpx-1" style={{ minWidth: `${sWidth}px` }} {...props}>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Table = ({ children, ...props }) => {
|
|
30
|
+
const name = props.componentId || props.__id
|
|
31
|
+
const rules = []
|
|
32
|
+
const rowsRef = useRef([]);
|
|
33
|
+
const [fieldsLength, setFieldsLength] = useState(0);
|
|
34
|
+
const [heights, setHeights] = useState([]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
console.log("rowsRef.heights", heights)
|
|
37
|
+
}, [heights])
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
// 清空当前的 observers
|
|
41
|
+
rowsRef.current.forEach((row, index) => {
|
|
42
|
+
if (row && row.observer) {
|
|
43
|
+
row.observer.disconnect();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
// 重新设置 observers
|
|
47
|
+
rowsRef.current.forEach((row, index) => {
|
|
48
|
+
if (row) {
|
|
49
|
+
const observer = new ResizeObserver(entries => {
|
|
50
|
+
for (let entry of entries) {
|
|
51
|
+
setHeights(prevHeights => {
|
|
52
|
+
const newHeights = [...prevHeights];
|
|
53
|
+
newHeights[index] = entry.contentRect.height;
|
|
54
|
+
return newHeights;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
observer.observe(row);
|
|
59
|
+
row.observer = observer; // 将 observer 保存到 row 对象中,以便后续可以清理
|
|
60
|
+
}
|
|
61
|
+
else setHeights(prevHeights => { return heights.slice(0, index) });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// 清理函数
|
|
66
|
+
return () => {
|
|
67
|
+
rowsRef.current.forEach((row, index) => {
|
|
68
|
+
if (row && row.observer) {
|
|
69
|
+
row.observer.disconnect();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}, [fieldsLength]);
|
|
74
|
+
if (props.isRequired)
|
|
75
|
+
rules.push({ required: true, message: `子表[${props.label}]必须填写` });
|
|
76
|
+
return <Form.List name={name} rules={rules}>
|
|
77
|
+
{(fields, { add, remove }) => {
|
|
78
|
+
if (fields.length !== fieldsLength) {
|
|
79
|
+
setFieldsLength(fields.length);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (fields.length === 0) add();
|
|
83
|
+
return <div className="fw-full ">
|
|
84
|
+
<div className="fflex ">
|
|
85
|
+
<div className="fflex-1 frelative fmin-h-20 foverflow-x-auto">
|
|
86
|
+
<div key={`tableHead`} className="fborder-b fflex flex-nowrap fmin-w-full ">
|
|
87
|
+
{React.Children.map(children, (child, childIndex) => {
|
|
88
|
+
return <TableCol width={150} key={`row_${0}_col_${childIndex}`}>
|
|
89
|
+
{React.cloneElement(child, {
|
|
90
|
+
key: `row_${0}_child_${childIndex}`,
|
|
91
|
+
subTable: true,
|
|
92
|
+
subTableHead: true
|
|
93
|
+
})}
|
|
94
|
+
</TableCol>
|
|
95
|
+
})}
|
|
96
|
+
<TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
|
|
97
|
+
</TableAction>
|
|
98
|
+
</div>
|
|
99
|
+
{fields.map((field, index) => (
|
|
100
|
+
<div key={field.key} className="fborder-b fflex flex-nowrap fmin-w-full " ref={el => (rowsRef.current[index] = el)}>
|
|
101
|
+
{React.Children.map(children, (child, childIndex) => {
|
|
102
|
+
let { props } = child;
|
|
103
|
+
const col_id = child?.props?.componentId || child?.props?.__id || childIndex;
|
|
104
|
+
if (field?.[col_id] === undefined) field[col_id] = "";
|
|
105
|
+
const rules = []
|
|
106
|
+
if (props.isRequired)
|
|
107
|
+
rules.push({ required: true, message: `${props.label}必须填写` });
|
|
108
|
+
if (props.rules)
|
|
109
|
+
if (Array.isArray(props.rules)) {
|
|
110
|
+
const pattern = props.rules.join("|")
|
|
111
|
+
rules.push({ pattern: new RegExp(pattern), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
rules.push({ pattern: new RegExp(props.rules), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return <TableCol width={150} key={`row_${index}_col_${childIndex}`}>
|
|
118
|
+
<Form.Item
|
|
119
|
+
style={{ marginBottom: 0 }}
|
|
120
|
+
label=""
|
|
121
|
+
name={[field.name, col_id]}
|
|
122
|
+
rules={rules}
|
|
123
|
+
>
|
|
124
|
+
{React.cloneElement(child, {
|
|
125
|
+
key: `row_${index}_child_${childIndex}`,
|
|
126
|
+
subTable: true,
|
|
127
|
+
subTableIndex: index,
|
|
128
|
+
})}
|
|
129
|
+
</Form.Item>
|
|
130
|
+
</TableCol>
|
|
131
|
+
})}
|
|
132
|
+
<TableAction key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
|
|
133
|
+
<DeleteOutlined className="fcursor-pointer" onClick={() => remove(index)} />
|
|
134
|
+
</TableAction>
|
|
135
|
+
</div>
|
|
136
|
+
))}
|
|
137
|
+
</div>
|
|
138
|
+
<div className="fw-12">
|
|
139
|
+
<TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
|
|
140
|
+
</TableAction>
|
|
141
|
+
{heights.map((height, index) => (
|
|
142
|
+
<TableAction height={height} key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
|
|
143
|
+
<DeleteOutlined className="fcursor-pointer" onClick={() => remove(index)} />
|
|
144
|
+
</TableAction>
|
|
145
|
+
))}
|
|
146
|
+
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<Button onClick={() => add()} className="fmy-2">新增一行</Button>
|
|
151
|
+
</div>
|
|
152
|
+
}}
|
|
153
|
+
</Form.List>
|
|
154
|
+
}
|
|
155
|
+
const TableWrapper = (props) => {
|
|
156
|
+
return (
|
|
157
|
+
<BaseWrapper {...props} higLabel={true} >
|
|
158
|
+
<Table {...props} />
|
|
159
|
+
</BaseWrapper>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
export default TableWrapper;
|
|
163
|
+
export { TableCol, TableAction };
|
|
@@ -4,7 +4,8 @@ import { DeleteOutlined } from "@ant-design/icons";
|
|
|
4
4
|
import { BaseWrapper } from "../base.jsx"
|
|
5
5
|
|
|
6
6
|
const TableAction = ({ label, subTableIndex, children, subTableHead = false, ...props }) => {
|
|
7
|
-
|
|
7
|
+
//fsticky fright-0
|
|
8
|
+
return <div className="fw-12 ">
|
|
8
9
|
<div className="frelative fw-full fh-full fflex fflex-col foverflow-hidden">
|
|
9
10
|
{label && subTableHead && <div className='fh-12 ffont-semibold fbg-[#fafafa] ftext-sm fflex fflex-nowrap ftext-nowrap fjustify-between fitems-center fpx-2 fborder-b'>{label}</div>}
|
|
10
11
|
{!subTableHead && <div className="fw-full fflex-1 fflex fitems-center fjustify-center fp-2 fbox-border ">
|
|
@@ -27,67 +28,76 @@ const TableCol = ({ children, width, ...props }) => {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
const Table = ({ children, ...props }) => {
|
|
31
|
+
const [init, setInit] = useState(false);
|
|
30
32
|
const name = props.componentId || props.__id
|
|
31
33
|
const rules = []
|
|
34
|
+
const handleAdd = (add)=>{
|
|
35
|
+
if (!init) setInit(true);
|
|
36
|
+
typeof add === "function" && add();
|
|
37
|
+
}
|
|
32
38
|
if (props.isRequired)
|
|
33
39
|
rules.push({ required: true, message: `子表[${props.label}]必须填写` });
|
|
34
40
|
return <Form.List name={name} rules={rules}>
|
|
35
|
-
{(fields, { add, remove }) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{React.cloneElement(child, {
|
|
41
|
-
key: `row_${0}_child_${childIndex}`,
|
|
42
|
-
subTable: true,
|
|
43
|
-
subTableHead: true
|
|
44
|
-
})}
|
|
45
|
-
</TableCol>
|
|
46
|
-
})}
|
|
47
|
-
<TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
|
|
48
|
-
</TableAction>
|
|
49
|
-
</div>
|
|
50
|
-
{fields.map((field, index) => (
|
|
51
|
-
<div key={field.key} className="fborder-b fflex flex-nowrap fmin-w-full ">
|
|
41
|
+
{(fields, { add, remove }) => {
|
|
42
|
+
if (fields.length === 0 && !init) handleAdd(add);
|
|
43
|
+
return <div className="fw-full ">
|
|
44
|
+
<div className="fw-full frelative fmin-h-20 foverflow-x-auto">
|
|
45
|
+
<div key={`tableHead`} className="fborder-b fflex flex-nowrap fmin-w-full ">
|
|
52
46
|
{React.Children.map(children, (child, childIndex) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (props.rules)
|
|
60
|
-
if (Array.isArray(props.rules)) {
|
|
61
|
-
const pattern = props.rules.join("|")
|
|
62
|
-
rules.push({ pattern: new RegExp(pattern), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
rules.push({ pattern: new RegExp(props.rules), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return <TableCol width={150} key={`row_${index}_col_${childIndex}`}>
|
|
69
|
-
<Form.Item
|
|
70
|
-
style={{ marginBottom: 0 }}
|
|
71
|
-
label=""
|
|
72
|
-
name={[field.name, col_id]}
|
|
73
|
-
rules={rules}
|
|
74
|
-
>
|
|
75
|
-
{React.cloneElement(child, {
|
|
76
|
-
key: `row_${index}_child_${childIndex}`,
|
|
77
|
-
subTable: true,
|
|
78
|
-
subTableIndex: index,
|
|
79
|
-
})}
|
|
80
|
-
</Form.Item>
|
|
47
|
+
return <TableCol width={100} key={`row_${0}_col_${childIndex}`}>
|
|
48
|
+
{React.cloneElement(child, {
|
|
49
|
+
key: `row_${0}_child_${childIndex}`,
|
|
50
|
+
subTable: true,
|
|
51
|
+
subTableHead: true
|
|
52
|
+
})}
|
|
81
53
|
</TableCol>
|
|
82
54
|
})}
|
|
83
|
-
<TableAction key={`row_${
|
|
84
|
-
<DeleteOutlined className="fcursor-pointer" onClick={() => remove(index)} />
|
|
55
|
+
<TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
|
|
85
56
|
</TableAction>
|
|
86
57
|
</div>
|
|
87
|
-
|
|
58
|
+
{fields.map((field, index) => (
|
|
59
|
+
<div key={field.key} className="fborder-b fflex flex-nowrap fmin-w-full ">
|
|
60
|
+
|
|
61
|
+
{React.Children.map(children, (child, childIndex) => {
|
|
62
|
+
let { props } = child;
|
|
63
|
+
const col_id = child?.props?.componentId || child?.props?.__id || childIndex;
|
|
64
|
+
if (field?.[col_id] === undefined) field[col_id] = "";
|
|
65
|
+
const rules = []
|
|
66
|
+
if (props.isRequired)
|
|
67
|
+
rules.push({ required: true, message: `${props.label}必须填写` });
|
|
68
|
+
if (props.rules)
|
|
69
|
+
if (Array.isArray(props.rules)) {
|
|
70
|
+
const pattern = props.rules.join("|")
|
|
71
|
+
rules.push({ pattern: new RegExp(pattern), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
rules.push({ pattern: new RegExp(props.rules), message: props.rulesFailMessage ? props.rulesFailMessage : `${props.label}格式错误` })
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return <TableCol width={100} key={`row_${index}_col_${childIndex}`}>
|
|
78
|
+
<Form.Item
|
|
79
|
+
style={{ marginBottom: 0 }}
|
|
80
|
+
label=""
|
|
81
|
+
name={[field.name, col_id]}
|
|
82
|
+
rules={rules}
|
|
83
|
+
>
|
|
84
|
+
{React.cloneElement(child, {
|
|
85
|
+
key: `row_${index}_child_${childIndex}`,
|
|
86
|
+
subTable: true,
|
|
87
|
+
subTableIndex: index,
|
|
88
|
+
})}
|
|
89
|
+
</Form.Item>
|
|
90
|
+
</TableCol>
|
|
91
|
+
})}
|
|
92
|
+
<TableAction key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
|
|
93
|
+
<DeleteOutlined className="fcursor-pointer" onClick={() => remove(index)} />
|
|
94
|
+
</TableAction>
|
|
95
|
+
</div>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
88
98
|
<Button onClick={() => add()} className="fmy-2">新增一行</Button>
|
|
89
99
|
</div>
|
|
90
|
-
|
|
100
|
+
}}
|
|
91
101
|
</Form.List>
|
|
92
102
|
}
|
|
93
103
|
const TableWrapper = (props) => {
|
|
@@ -65,6 +65,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
|
65
65
|
if (componentName && (componentName.startsWith('Field.') || componentName.startsWith('Layout.'))) {
|
|
66
66
|
let identifier = props?.componentId || props?.__id;
|
|
67
67
|
let withIds = []
|
|
68
|
+
console.log("currentNode",currentNode)
|
|
68
69
|
if(parentNode && parentNode?.props) {
|
|
69
70
|
identifier = `${parentNode?.props?.componentId || parentNode?.props?.__id}.${identifier}`
|
|
70
71
|
}
|
|
@@ -87,7 +88,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
|
87
88
|
const element = childrenArray[index];
|
|
88
89
|
traverse(element)
|
|
89
90
|
}
|
|
90
|
-
console.log("fields", fields)
|
|
91
|
+
// console.log("fields", fields)
|
|
91
92
|
fields.forEach(field => {
|
|
92
93
|
const { identifier } = field;
|
|
93
94
|
dependencyMap.current.set(identifier, {
|
|
@@ -98,7 +99,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
|
98
99
|
show: true,
|
|
99
100
|
});
|
|
100
101
|
});
|
|
101
|
-
console.log("dependencyMap", dependencyMap.current)
|
|
102
|
+
// console.log("dependencyMap", dependencyMap.current)
|
|
102
103
|
initializeFieldVisibility();
|
|
103
104
|
};
|
|
104
105
|
|
|
@@ -120,8 +121,9 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
|
120
121
|
identifier = identifier.filter(item=>typeof item == "string").join(".")
|
|
121
122
|
}
|
|
122
123
|
if (dependencyMap.current.has(identifier)) {
|
|
124
|
+
// console.log("dependencyMap.current.get(identifier)",dependencyMap.current.get(identifier))
|
|
123
125
|
const dependentChildren = dependencyMap.current.get(identifier).children;
|
|
124
|
-
console.log("dependentChildren", dependentChildren)
|
|
126
|
+
// console.log("dependentChildren", dependentChildren)
|
|
125
127
|
|
|
126
128
|
dependentChildren.forEach(child => {
|
|
127
129
|
if (child.component.props.withFunc && typeof child.component.props.withFunc === 'function') {
|
|
@@ -213,9 +215,11 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
|
213
215
|
return result
|
|
214
216
|
})
|
|
215
217
|
}
|
|
218
|
+
// console.log("formula", formula)
|
|
216
219
|
if (formula && formula.length > 0) {
|
|
217
220
|
const formulaResult = evalFormula(formula);
|
|
218
|
-
|
|
221
|
+
// console.log("formulaResult", formulaResult)
|
|
222
|
+
form.setFieldValue(childIdentifier, formulaResult)
|
|
219
223
|
handleFieldsWith(childIdentifier, form.getFieldsValue())
|
|
220
224
|
}
|
|
221
225
|
}
|