@omniumretail/component-library 1.1.33 → 1.1.35

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.1.33",
3
+ "version": "1.1.35",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -19,6 +19,7 @@ const defaultInitialValues = {
19
19
  generalEvaluationLevel: "0",
20
20
  questions: [],
21
21
  openAnswer: false,
22
+ isYesOrNo: false
22
23
  };
23
24
 
24
25
  export const CategoryContent = (props: categoryContent) => {
@@ -69,6 +70,7 @@ export const CategoryContent = (props: categoryContent) => {
69
70
  form.resetFields();
70
71
  form.setFieldsValue(initialValues);
71
72
  setSwitchOpenAnswStatus(initialValues?.openAnswer || false);
73
+ setSwitchYesOrNoAnswStatus(initialValues?.isYesOrNo || false);
72
74
  }, [form, initialValues]);
73
75
 
74
76
  return (
@@ -118,7 +120,7 @@ export const CategoryContent = (props: categoryContent) => {
118
120
 
119
121
  {!categorySidebarData?.data?.children?.length &&
120
122
  <>
121
- {!switchYesOrNoAnswStatus &&
123
+ {switchOpenAnswStatus &&
122
124
  <div className={styles.openAnswer}>
123
125
  <Label isUppercase>
124
126
  {t('components.categoryContent.openAnswer')}
@@ -131,13 +133,13 @@ export const CategoryContent = (props: categoryContent) => {
131
133
  </div>
132
134
  }
133
135
 
134
- {!switchOpenAnswStatus &&
136
+ {switchYesOrNoAnswStatus &&
135
137
  <div className={styles.yesNoAnswer}>
136
138
  <Label isUppercase>
137
139
  {t('components.categoryContent.yesNoAnswer')}
138
140
  </Label>
139
141
  <Form.Item
140
- name={['yesNoAnswer']}
142
+ name={['isYesOrNo']}
141
143
  >
142
144
  <Switch onChange={(enabled: boolean) => { yesNoSwitchHandler(enabled) }} checked={switchYesOrNoAnswStatus} />
143
145
  </Form.Item>
@@ -20,7 +20,8 @@ const Template: Story<ResponsiveTableCustomProps> = (args) => {
20
20
  // For example, trigger an API call
21
21
  };
22
22
 
23
- return <ResponsiveTable columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo} actionsArray={
23
+ return <ResponsiveTable scroll={{ x: 4000 }}
24
+ columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo} actionsArray={
24
25
  [
25
26
  { key: '1', label: `${t('actions.one')}`, onClick: () => {
26
27
  console.log('onClick');
@@ -30,7 +31,7 @@ const Template: Story<ResponsiveTableCustomProps> = (args) => {
30
31
  key: '3', label: 'label 3'
31
32
  }
32
33
  ]
33
- } {...args}></ResponsiveTable>;
34
+ } fixedColumns={[{dataIndex: 'action' , side: 'right'}]} {...args}></ResponsiveTable>;
34
35
  };
35
36
 
36
37
  export const Primary = Template.bind({});
@@ -185,7 +186,7 @@ Primary.args = {
185
186
  ],
186
187
  pagination: {
187
188
  total: 24,
188
- pageSize: 20
189
+ pageSize: 4
189
190
  },
190
191
  hiddenColumns: ['id'],
191
192
  sortByColumns: true,
@@ -189,15 +189,14 @@ export const ResponsiveTable = (props: ResponsiveTableCustomProps) => {
189
189
 
190
190
  }).filter(el => el !== undefined) as any;
191
191
 
192
- let columnActions = {
192
+ const columnActions = {
193
193
  key: 'action',
194
194
  title: headingTranslationsKey ? t(`${headingTranslationsKey}.${'action'}`) : 'action',
195
- dataIndex: 6,
195
+ dataIndex: 'action',
196
196
  ellipsis: false,
197
197
  align: 'right',
198
198
  render: () => {
199
- if (!items?.[0]) return null; // Verifica se o array items é nulo
200
-
199
+ if (!items?.[0]) return null;
201
200
  return (
202
201
  <Space size="middle">
203
202
  <Dropdown menu={{ items }}>