MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / addZIndex

Function addZIndex

apps/OpenSign/src/constant/Utils.js:1159–1186  ·  view source on GitHub ↗
(signerPos, key, setZIndex)

Source from the content-addressed store, hash-verified

1157};
1158
1159export const addZIndex = (signerPos, key, setZIndex) => {
1160 return signerPos.map((item) => {
1161 if (item.placeHolder && item.placeHolder.length > 0) {
1162 // If there is a nested array, recursively add the field to the last object
1163 return {
1164 ...item,
1165 placeHolder: addZIndex(item.placeHolder, key, setZIndex)
1166 };
1167 } else if (item.pos && item.pos.length > 0) {
1168 // If there is no nested array, add the new field
1169 return {
1170 ...item,
1171 pos: addZIndex(item.pos, key, setZIndex)
1172 // Adjust this line to add the desired field
1173 };
1174 } else {
1175 if (item.key === key) {
1176 setZIndex(item.zIndex);
1177 return {
1178 ...item,
1179 zIndex: item.zIndex ? item.zIndex + 1 : 1
1180 };
1181 } else {
1182 return { ...item };
1183 }
1184 }
1185 });
1186};
1187
1188//function for save widgets value on onchange function
1189export const onChangeInput = (

Callers 2

handleStopFunction · 0.90
handleStopFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected