@omniumretail/component-library 1.2.8 → 1.2.9
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
|
@@ -105,12 +105,6 @@ export const CategorySidebar = (props: SidebarProps) => {
|
|
|
105
105
|
info: '',
|
|
106
106
|
responseType: '-1'
|
|
107
107
|
},
|
|
108
|
-
{
|
|
109
|
-
grade: '',
|
|
110
|
-
question: t('components.category.author'),
|
|
111
|
-
info: '',
|
|
112
|
-
responseType: '-1'
|
|
113
|
-
},
|
|
114
108
|
{
|
|
115
109
|
grade: '',
|
|
116
110
|
question: t('components.category.date'),
|
|
@@ -122,7 +122,7 @@ export const SingleQuestion = ({
|
|
|
122
122
|
}));
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
const canDrag = !(
|
|
125
|
+
const canDrag = !(restField.fieldKey === 0 && isTheHeader);
|
|
126
126
|
|
|
127
127
|
const questionStyle = classnames({
|
|
128
128
|
[styles.responseTypeQuestion]: responseTypeComponent
|
|
@@ -36,8 +36,8 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
36
36
|
const destinationIndex = result?.destination?.index;
|
|
37
37
|
|
|
38
38
|
// Bloquear drag-and-drop apenas para os itens 0 e 1 quando isTheHeader for true
|
|
39
|
-
const isProtectedSource = (
|
|
40
|
-
const isProtectedDestination = (
|
|
39
|
+
const isProtectedSource = (sourceIndex === 0 && isTheHeader);
|
|
40
|
+
const isProtectedDestination = (destinationIndex === 0 && isTheHeader);
|
|
41
41
|
|
|
42
42
|
if (isProtectedSource || isProtectedDestination) {
|
|
43
43
|
return; // Impede o drag-and-drop se for um dos itens protegidos
|
|
@@ -64,17 +64,15 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
64
64
|
return field = { ...field, name: index, key: index, fieldKey: index };
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
const isDropDisabled = ((fieldsUpdated[0] || fieldsUpdated[1]) && isTheHeader);
|
|
68
|
-
|
|
69
67
|
return (
|
|
70
68
|
<>
|
|
71
69
|
<DragDropContext onDragEnd={onDragEnd}>
|
|
72
|
-
<Droppable droppableId="droppable"
|
|
70
|
+
<Droppable droppableId="droppable">
|
|
73
71
|
{(provided) => (
|
|
74
72
|
<div {...provided.droppableProps} ref={provided.innerRef}>
|
|
75
73
|
<>
|
|
76
74
|
{fieldsUpdated?.map(({ key, name, ...restField }) => {
|
|
77
|
-
const cantDrag = (
|
|
75
|
+
const cantDrag = (restField.fieldKey === 0 && isTheHeader);
|
|
78
76
|
|
|
79
77
|
return (
|
|
80
78
|
<Draggable isDragDisabled={cantDrag} key={key} draggableId={`${key}`} index={key}>
|