| | |
| | | |
| | | const { index: overIndex } = findCard(`${targetId}`) |
| | | let targetIndex = overIndex |
| | | // if (!target) { |
| | | |
| | | targetIndex++ |
| | | // } |
| | | // if (targetIndex < 0) { |
| | | // targetIndex = 0 |
| | | // } |
| | | |
| | | const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] }) |
| | | setCards(_cards) |
| | |
| | | return ( |
| | | <div ref={drop} className="ant-row modal-fields-row"> |
| | | {cards.map(card => ( |
| | | <Col key={card.uuid} span={card.type !== 'textarea' ? _cols : 24}> |
| | | <Col key={card.uuid} className={card.type === 'textarea' ? 'textarea' + setting.cols : ''} span={card.type !== 'textarea' ? _cols : 24}> |
| | | <Card |
| | | id={`${card.uuid}`} |
| | | id={card.uuid} |
| | | cols={setting.cols} |
| | | card={card} |
| | | moveCard={moveCard} |
| | | editCard={editCard} |