@omniumretail/component-library 1.2.7 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.2.07",
3
+ "version": "1.2.09",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -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'),
@@ -95,7 +95,7 @@ export const SingleQuestion = ({
95
95
  };
96
96
 
97
97
  useEffect(() => {
98
- const selectedResponseType = form.getFieldValue(['questions', name, 'responseType']);
98
+ const selectedResponseType = form?.getFieldValue(['questions', name, 'responseType']);
99
99
 
100
100
  if (selectedResponseType) {
101
101
  const selectedAnswerType = sortedAnswerTypeOptions.find(
@@ -122,7 +122,7 @@ export const SingleQuestion = ({
122
122
  }));
123
123
  };
124
124
 
125
- const canDrag = !((restField.fieldKey === 0 || restField.fieldKey === 1) && isTheHeader);
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 = ((sourceIndex === 0 || sourceIndex === 1) && isTheHeader);
40
- const isProtectedDestination = ((destinationIndex === 0 || destinationIndex === 1) && isTheHeader);
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" isDropDisabled={isDropDisabled}>
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 = ((restField.fieldKey === 0 || restField.fieldKey === 1) && isTheHeader);
75
+ const cantDrag = (restField.fieldKey === 0 && isTheHeader);
78
76
 
79
77
  return (
80
78
  <Draggable isDragDisabled={cantDrag} key={key} draggableId={`${key}`} index={key}>