lu-lowcode-package-form 0.11.59 → 0.11.61

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": "lu-lowcode-package-form",
3
- "version": "0.11.59",
3
+ "version": "0.11.61",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
@@ -12,11 +12,12 @@ const DragHead = ({ childrenDesc, initialWidth, changeWidth, showAction, showLab
12
12
  const startPositionRef = useRef(0)
13
13
 
14
14
  useEffect(()=>{
15
+ console.log("DragHead initialWidth", initialWidth)
15
16
  if(Array.isArray(initialWidth) && !_.isEqual(initialWidth, headWidths)){
16
17
  setHeadWidths(initialWidth)
17
18
  }
18
19
  },[initialWidth])
19
-
20
+
20
21
  const getColumnWidth = (index) => {
21
22
  return headWidths[index] || 150
22
23
  }
@@ -50,11 +50,18 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
50
50
 
51
51
  useEffect(() => {
52
52
  console.log("Table props", props)
53
+ console.log("Table props.columnsWidth", props?.columnsWidth)
53
54
  if (Array.isArray(props?.columnsWidth) && !_.isEqual(props?.columnsWidth, headWidths)) {
54
55
  setHeadWidths(props?.columnsWidth)
56
+ setInitialWidth(props?.columnsWidth)
55
57
  }
56
58
  }, [props])
57
59
 
60
+ useEffect(()=>{
61
+ console.log("Table headWidths", headWidths)
62
+ },[headWidths])
63
+
64
+ const [initialWidth, setInitialWidth] = useState([])
58
65
  const [headWidths, setHeadWidths] = useState([])
59
66
  const tableComponentId = props.componentId || props.__id
60
67
  const newidRefs = useRef(React.Children.map(children, () => nanoid()));
@@ -145,7 +152,7 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
145
152
  return <div className="fw-full ">
146
153
 
147
154
  <div className="fw-full frelative fmin-h-20 foverflow-x-auto" style={{ position: 'relative' }}>
148
- <DragHead changeWidth={handleChangeWidth} initialWidth={props?.columnsWidth} showAction={disabled != true && readonly != true} childrenDesc={childrenDesc}/>
155
+ <DragHead changeWidth={handleChangeWidth} initialWidth={initialWidth} showAction={disabled != true && readonly != true} childrenDesc={childrenDesc}/>
149
156
  {fields.length === 0 && <div key={`tableHead`} className="fborder-b fflex flex-nowrap fmin-w-full ">
150
157
  {React.Children.map(children, (child, childIndex) => {
151
158
  const hidden = (child?.props?.calcHidden || !getDependencyMapShow(child?.props?.componentId || child?.props?.__id)) && mode != "desgin";