lu-lowcode-package-form 0.11.60 → 0.11.62
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 +188 -188
- package/dist/index.es.js +7435 -7436
- package/package.json +1 -1
- package/src/components/field/table/index.jsx +17 -16
package/package.json
CHANGED
@@ -44,21 +44,8 @@ const TableCol = ({ children, width, hidden, ...props }) => {
|
|
44
44
|
}
|
45
45
|
|
46
46
|
const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, getTableWithIds, removeLastFieldsValues, mode, isAllowCopy = false, isAllowAdd = true, getDependencyMapItem, ...props }) => {
|
47
|
-
|
48
|
-
|
49
|
-
}, [form])
|
50
|
-
|
51
|
-
useEffect(() => {
|
52
|
-
console.log("Table props", props)
|
53
|
-
if (Array.isArray(props?.columnsWidth) && !_.isEqual(props?.columnsWidth, headWidths)) {
|
54
|
-
setHeadWidths(props?.columnsWidth)
|
55
|
-
}
|
56
|
-
}, [props])
|
57
|
-
|
58
|
-
useEffect(()=>{
|
59
|
-
console.log("Table headWidths", headWidths)
|
60
|
-
},[headWidths])
|
61
|
-
|
47
|
+
|
48
|
+
const [initialWidth, setInitialWidth] = useState([])
|
62
49
|
const [headWidths, setHeadWidths] = useState([])
|
63
50
|
const tableComponentId = props.componentId || props.__id
|
64
51
|
const newidRefs = useRef(React.Children.map(children, () => nanoid()));
|
@@ -84,6 +71,20 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
84
71
|
eventEmitter.off('reloadTable', handleReloadTable);
|
85
72
|
}
|
86
73
|
}, [])
|
74
|
+
useEffect(() => {
|
75
|
+
// console.log("Table form reload", form)
|
76
|
+
}, [form])
|
77
|
+
|
78
|
+
useEffect(() => {
|
79
|
+
if (Array.isArray(props?.columnsWidth) && !_.isEqual(props?.columnsWidth, headWidths)) {
|
80
|
+
setHeadWidths(props?.columnsWidth)
|
81
|
+
setInitialWidth(props?.columnsWidth)
|
82
|
+
}
|
83
|
+
}, [props])
|
84
|
+
|
85
|
+
useEffect(()=>{
|
86
|
+
console.log("Table headWidths", headWidths)
|
87
|
+
},[headWidths])
|
87
88
|
|
88
89
|
useEffect(()=>{
|
89
90
|
const childrenDesc = React.Children.map(children, (child) => {
|
@@ -149,7 +150,7 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
149
150
|
return <div className="fw-full ">
|
150
151
|
|
151
152
|
<div className="fw-full frelative fmin-h-20 foverflow-x-auto" style={{ position: 'relative' }}>
|
152
|
-
<DragHead changeWidth={handleChangeWidth} initialWidth={
|
153
|
+
<DragHead changeWidth={handleChangeWidth} initialWidth={initialWidth} showAction={disabled != true && readonly != true} childrenDesc={childrenDesc}/>
|
153
154
|
{fields.length === 0 && <div key={`tableHead`} className="fborder-b fflex flex-nowrap fmin-w-full ">
|
154
155
|
{React.Children.map(children, (child, childIndex) => {
|
155
156
|
const hidden = (child?.props?.calcHidden || !getDependencyMapShow(child?.props?.componentId || child?.props?.__id)) && mode != "desgin";
|