@omniumretail/component-library 1.2.6 → 1.2.8

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.06",
3
+ "version": "1.2.08",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -22,8 +22,8 @@ export const SingleQuestion = ({
22
22
  ...restField
23
23
  }: any) => {
24
24
 
25
- const responseTypeCurrentValue = form.getFieldsValue().questions?.[name]?.responseType;
26
- const initialEmphasisValue = form.getFieldsValue().questions?.[name]?.emphasis;
25
+ const responseTypeCurrentValue = form?.getFieldsValue()?.questions?.[name]?.responseType;
26
+ const initialEmphasisValue = form?.getFieldsValue()?.questions?.[name]?.emphasis;
27
27
 
28
28
  const [mandatoryCheckbox, setMandatoryCheckbox] = useState<boolean>(false);
29
29
  const [emphasisCheckbox, setEmphasisCheckbox] = useState<boolean>(initialEmphasisValue ? initialEmphasisValue : true);
@@ -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(
@@ -224,7 +224,7 @@ export const SingleQuestion = ({
224
224
  <span>{t('components.category.mandatoryAnswer')}</span>
225
225
  </div>
226
226
 
227
- {filteredResponsesEmphasised?.includes(form.getFieldsValue().questions?.[name]?.responseType) &&
227
+ {filteredResponsesEmphasised?.includes(form?.getFieldsValue()?.questions?.[name]?.responseType) &&
228
228
  <div className={styles.checkboxContainer}>
229
229
  <Input
230
230
  addonBefore={
@@ -253,7 +253,7 @@ export const SingleQuestion = ({
253
253
  </div>
254
254
  }
255
255
 
256
- {filteredResponsesMultiple?.includes(form.getFieldsValue().questions?.[name]?.responseType) &&
256
+ {filteredResponsesMultiple?.includes(form?.getFieldsValue()?.questions?.[name]?.responseType) &&
257
257
  < div className={styles.checkboxContainer}>
258
258
  <Form.Item
259
259
  {...restField}