@omniumretail/component-library 1.0.65 → 1.0.66
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/.storybook/main.js +16 -16
- package/.storybook/preview-head.html +20 -20
- package/.storybook/preview.js +27 -27
- package/README.md +54 -54
- package/bitbucket-pipelines.yml +94 -94
- package/package.json +198 -198
- package/src/assets/scss/_global.scss +89 -89
- package/src/assets/scss/index.scss +2 -2
- package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +236 -236
- package/src/components/AnalyticsBar/helpers/codeMutation.tsx +19 -19
- package/src/components/AnalyticsBar/index.tsx +76 -76
- package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +13 -13
- package/src/components/AnalyticsBar/styles.module.scss +108 -108
- package/src/components/Button/Button.stories.tsx +26 -26
- package/src/components/Button/index.tsx +24 -24
- package/src/components/Button/styles.module.scss +65 -65
- package/src/components/Category/Category.stories.tsx +88 -88
- package/src/components/Category/CategoryContent/index.tsx +188 -188
- package/src/components/Category/CategoryContent/styles.module.scss +51 -51
- package/src/components/Category/CategorySidebar/index.tsx +268 -268
- package/src/components/Category/CategorySidebar/styles.module.scss +28 -28
- package/src/components/Category/index.tsx +76 -76
- package/src/components/Category/styles.module.scss +13 -13
- package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +270 -270
- package/src/components/CategoryReadOnly/evaluationOptions.tsx +81 -81
- package/src/components/CategoryReadOnly/index.tsx +254 -254
- package/src/components/CategoryReadOnly/styles.module.scss +184 -184
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +251 -251
- package/src/components/CategoryResponse/evaluationOptions.tsx +81 -81
- package/src/components/CategoryResponse/index.tsx +277 -277
- package/src/components/CategoryResponse/styles.module.scss +160 -160
- package/src/components/DatePicker/DatePicker.stories.tsx +16 -16
- package/src/components/DatePicker/index.tsx +38 -38
- package/src/components/DatePicker/styles.module.scss +3 -3
- package/src/components/DatePickerTag/DatePickerTag.stories.tsx +19 -19
- package/src/components/DatePickerTag/index.tsx +89 -89
- package/src/components/DatePickerTag/styles.module.scss +31 -31
- package/src/components/Footer/Footer.stories.tsx +14 -14
- package/src/components/Footer/index.tsx +38 -38
- package/src/components/Footer/styles.module.scss +38 -38
- package/src/components/Input/Input.stories.tsx +13 -13
- package/src/components/Input/index.tsx +31 -31
- package/src/components/Input/styles.module.scss +8 -8
- package/src/components/InputCountryCode/index.tsx +75 -75
- package/src/components/InputCountryCode/inputCountryCode.stories.tsx +55 -55
- package/src/components/InputCountryCode/styles.module.scss +3 -3
- package/src/components/Label/Label.stories.tsx +21 -21
- package/src/components/Label/index.tsx +19 -19
- package/src/components/Label/styles.module.scss +16 -16
- package/src/components/Link/Link.stories.tsx +30 -30
- package/src/components/Link/index.tsx +21 -21
- package/src/components/Link/styles.module.scss +24 -24
- package/src/components/Menu/Menu.stories.tsx +178 -178
- package/src/components/Menu/helpers/codeMutation.tsx +19 -19
- package/src/components/Menu/index.tsx +23 -23
- package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +40 -40
- package/src/components/ModalConfirmation/ModalStatusList.tsx +5 -5
- package/src/components/ModalConfirmation/index.tsx +70 -70
- package/src/components/ModalConfirmation/styles.module.scss +62 -62
- package/src/components/ModalWithTable/ModalWithTable.stories.tsx +96 -96
- package/src/components/ModalWithTable/index.tsx +232 -232
- package/src/components/ModalWithTable/styles.module.scss +77 -77
- package/src/components/Navigation/Navigation.stories.tsx +17 -17
- package/src/components/Navigation/index.tsx +33 -33
- package/src/components/Navigation/styles.module.scss +42 -42
- package/src/components/Notification/Notification.stories.tsx +29 -29
- package/src/components/Notification/index.tsx +21 -21
- package/src/components/Questions/Questions.stories.tsx +37 -37
- package/src/components/Questions/SingleQuestion/index.tsx +84 -84
- package/src/components/Questions/SingleQuestion/styles.module.scss +81 -81
- package/src/components/Questions/index.tsx +78 -78
- package/src/components/Radio/Radio.stories.tsx +43 -43
- package/src/components/Radio/index.tsx +26 -26
- package/src/components/Radio/styles.module.scss +23 -23
- package/src/components/Select/Select.stories.tsx +39 -39
- package/src/components/Select/index.tsx +27 -27
- package/src/components/Select/styles.module.scss +13 -13
- package/src/components/Separator/Separator.stories.tsx +22 -22
- package/src/components/Separator/index.tsx +27 -27
- package/src/components/Separator/styles.module.scss +25 -25
- package/src/components/Sidebar/Sidebar.stories.tsx +85 -61
- package/src/components/Sidebar/index.tsx +104 -58
- package/src/components/Sidebar/styles.module.scss +86 -73
- package/src/components/Switch/Switch.stories.tsx +14 -14
- package/src/components/Switch/index.tsx +8 -8
- package/src/components/Switch/styles.module.scss +7 -7
- package/src/components/Table/Table.stories.tsx +221 -221
- package/src/components/Table/index.tsx +271 -271
- package/src/components/Table/styles.module.scss +75 -75
- package/src/components/Tag/Tag.stories.tsx +22 -22
- package/src/components/Tag/index.tsx +189 -189
- package/src/components/Tag/styles.module.scss +60 -60
- package/src/components/Upload/Upload.stories.tsx +45 -45
- package/src/components/Upload/index.tsx +91 -91
- package/src/components/UserInfo/UserInfo.stories.tsx +37 -37
- package/src/components/UserInfo/index.tsx +62 -62
- package/src/components/UserInfo/styles.module.scss +29 -29
- package/src/components/index.tsx +25 -25
- package/src/constants/i18n.ts +25 -25
- package/src/constants/translationHelper.ts +7 -7
- package/src/index.ts +2 -2
- package/src/locales/en.json +86 -86
- package/src/locales/es.json +86 -86
- package/src/locales/pt.json +86 -86
- package/src/types/Global.d.ts +4 -4
- package/tsconfig.json +29 -29
- package/webpack.config.js +51 -51
- package/dist/bundle.js +0 -12047
- package/dist/main.css +0 -1199
- package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -5
- package/dist/types/components/AnalyticsBar/helpers/codeMutation.d.ts +0 -4
- package/dist/types/components/AnalyticsBar/index.d.ts +0 -2
- package/dist/types/components/AnalyticsBar/interfaces/analyticsBar.d.ts +0 -12
- package/dist/types/components/Button/Button.stories.d.ts +0 -6
- package/dist/types/components/Button/index.d.ts +0 -7
- package/dist/types/components/Category/Category.stories.d.ts +0 -4
- package/dist/types/components/Category/CategoryContent/index.d.ts +0 -7
- package/dist/types/components/Category/CategorySidebar/index.d.ts +0 -26
- package/dist/types/components/Category/index.d.ts +0 -7
- package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -4
- package/dist/types/components/CategoryReadOnly/evaluationOptions.d.ts +0 -10
- package/dist/types/components/CategoryReadOnly/index.d.ts +0 -9
- package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -4
- package/dist/types/components/CategoryResponse/evaluationOptions.d.ts +0 -10
- package/dist/types/components/CategoryResponse/index.d.ts +0 -9
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +0 -5
- package/dist/types/components/DatePicker/index.d.ts +0 -8
- package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -5
- package/dist/types/components/DatePickerTag/index.d.ts +0 -6
- package/dist/types/components/Footer/Footer.stories.d.ts +0 -5
- package/dist/types/components/Footer/index.d.ts +0 -4
- package/dist/types/components/Input/Input.stories.d.ts +0 -5
- package/dist/types/components/Input/index.d.ts +0 -10
- package/dist/types/components/InputCountryCode/index.d.ts +0 -10
- package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -5
- package/dist/types/components/Label/Label.stories.d.ts +0 -6
- package/dist/types/components/Label/index.d.ts +0 -7
- package/dist/types/components/Link/Link.stories.d.ts +0 -7
- package/dist/types/components/Link/index.d.ts +0 -7
- package/dist/types/components/Menu/Menu.stories.d.ts +0 -5
- package/dist/types/components/Menu/helpers/codeMutation.d.ts +0 -4
- package/dist/types/components/Menu/index.d.ts +0 -2
- package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -5
- package/dist/types/components/ModalConfirmation/ModalStatusList.d.ts +0 -5
- package/dist/types/components/ModalConfirmation/index.d.ts +0 -9
- package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -5
- package/dist/types/components/ModalWithTable/index.d.ts +0 -13
- package/dist/types/components/Navigation/Navigation.stories.d.ts +0 -5
- package/dist/types/components/Navigation/index.d.ts +0 -10
- package/dist/types/components/Notification/Notification.stories.d.ts +0 -5
- package/dist/types/components/Notification/index.d.ts +0 -9
- package/dist/types/components/Questions/Questions.stories.d.ts +0 -4
- package/dist/types/components/Questions/SingleQuestion/index.d.ts +0 -1
- package/dist/types/components/Questions/index.d.ts +0 -5
- package/dist/types/components/Radio/Radio.stories.d.ts +0 -5
- package/dist/types/components/Radio/index.d.ts +0 -10
- package/dist/types/components/Select/Select.stories.d.ts +0 -6
- package/dist/types/components/Select/index.d.ts +0 -5
- package/dist/types/components/Separator/Separator.stories.d.ts +0 -6
- package/dist/types/components/Separator/index.d.ts +0 -11
- package/dist/types/components/Sidebar/Sidebar.stories.d.ts +0 -6
- package/dist/types/components/Sidebar/index.d.ts +0 -13
- package/dist/types/components/Switch/Switch.stories.d.ts +0 -5
- package/dist/types/components/Switch/index.d.ts +0 -2
- package/dist/types/components/Table/Table.stories.d.ts +0 -9
- package/dist/types/components/Table/index.d.ts +0 -36
- package/dist/types/components/Tag/Tag.stories.d.ts +0 -5
- package/dist/types/components/Tag/index.d.ts +0 -8
- package/dist/types/components/Upload/Upload.stories.d.ts +0 -4
- package/dist/types/components/Upload/index.d.ts +0 -8
- package/dist/types/components/UserInfo/UserInfo.stories.d.ts +0 -4
- package/dist/types/components/UserInfo/index.d.ts +0 -8
- package/dist/types/components/index.d.ts +0 -25
- package/dist/types/constants/i18n.d.ts +0 -1
- package/dist/types/constants/translationHelper.d.ts +0 -2
- package/dist/types/index.d.ts +0 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import styles from './styles.module.scss';
|
|
2
|
-
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
|
3
|
-
import type { MenuProps } from 'antd';
|
|
4
|
-
import { Menu as MenuAntd} from 'antd';
|
|
5
|
-
|
|
6
|
-
export const Menu = (props: MenuProps) => {
|
|
7
|
-
const {
|
|
8
|
-
items
|
|
9
|
-
} = props;
|
|
10
|
-
|
|
11
|
-
const onClick: MenuProps['onClick'] = (e) => {
|
|
12
|
-
// console.log('click ', e);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<MenuAntd
|
|
17
|
-
onClick={onClick}
|
|
18
|
-
mode="inline"
|
|
19
|
-
items={items}
|
|
20
|
-
expandIcon={({ isOpen }) => (isOpen ? <MinusOutlined /> : <PlusOutlined />)}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
1
|
+
import styles from './styles.module.scss';
|
|
2
|
+
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
|
3
|
+
import type { MenuProps } from 'antd';
|
|
4
|
+
import { Menu as MenuAntd} from 'antd';
|
|
5
|
+
|
|
6
|
+
export const Menu = (props: MenuProps) => {
|
|
7
|
+
const {
|
|
8
|
+
items
|
|
9
|
+
} = props;
|
|
10
|
+
|
|
11
|
+
const onClick: MenuProps['onClick'] = (e) => {
|
|
12
|
+
// console.log('click ', e);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<MenuAntd
|
|
17
|
+
onClick={onClick}
|
|
18
|
+
mode="inline"
|
|
19
|
+
items={items}
|
|
20
|
+
expandIcon={({ isOpen }) => (isOpen ? <MinusOutlined /> : <PlusOutlined />)}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { ModalConfirmation, ModalConfirmationProps } from '.';
|
|
4
|
-
import { ModalStatus } from './ModalStatusList';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'ModalConfirmation',
|
|
8
|
-
component: ModalConfirmation,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: Story<ModalConfirmationProps> = (args) => {
|
|
12
|
-
const [modalData, setModalData] = useState<any>({});
|
|
13
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
14
|
-
|
|
15
|
-
console.log(modalData);
|
|
16
|
-
|
|
17
|
-
const onClickMe = () => {
|
|
18
|
-
setIsModalOpen(true);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
setIsModalOpen(modalData.status === ModalStatus.OPEN);
|
|
23
|
-
}, [modalData])
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
<button onClick={() => onClickMe()}> Button </button>
|
|
29
|
-
<ModalConfirmation {...args} isOpen={isModalOpen} modalData={setModalData}></ModalConfirmation>
|
|
30
|
-
</>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const Primary = Template.bind({});
|
|
35
|
-
Primary.args = {
|
|
36
|
-
closeText: 'cancelar',
|
|
37
|
-
title: 'Tem a certeza que deseja alterar o tipo de ciclo?',
|
|
38
|
-
description: 'Ao alterar, todos os dados inseridos serão eliminados.',
|
|
39
|
-
buttonText: 'Alterar',
|
|
40
|
-
};
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { ModalConfirmation, ModalConfirmationProps } from '.';
|
|
4
|
+
import { ModalStatus } from './ModalStatusList';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'ModalConfirmation',
|
|
8
|
+
component: ModalConfirmation,
|
|
9
|
+
} as Meta;
|
|
10
|
+
|
|
11
|
+
const Template: Story<ModalConfirmationProps> = (args) => {
|
|
12
|
+
const [modalData, setModalData] = useState<any>({});
|
|
13
|
+
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
14
|
+
|
|
15
|
+
console.log(modalData);
|
|
16
|
+
|
|
17
|
+
const onClickMe = () => {
|
|
18
|
+
setIsModalOpen(true);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setIsModalOpen(modalData.status === ModalStatus.OPEN);
|
|
23
|
+
}, [modalData])
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<button onClick={() => onClickMe()}> Button </button>
|
|
29
|
+
<ModalConfirmation {...args} isOpen={isModalOpen} modalData={setModalData}></ModalConfirmation>
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Primary = Template.bind({});
|
|
35
|
+
Primary.args = {
|
|
36
|
+
closeText: 'cancelar',
|
|
37
|
+
title: 'Tem a certeza que deseja alterar o tipo de ciclo?',
|
|
38
|
+
description: 'Ao alterar, todos os dados inseridos serão eliminados.',
|
|
39
|
+
buttonText: 'Alterar',
|
|
40
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export const ModalStatus = {
|
|
2
|
-
CANCELED: "CANCELED",
|
|
3
|
-
OPEN: "OPEN",
|
|
4
|
-
REQUESTED_CHANGES: "REQUESTED_CHANGES",
|
|
5
|
-
}
|
|
1
|
+
export const ModalStatus = {
|
|
2
|
+
CANCELED: "CANCELED",
|
|
3
|
+
OPEN: "OPEN",
|
|
4
|
+
REQUESTED_CHANGES: "REQUESTED_CHANGES",
|
|
5
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { Button } from '../Button';
|
|
2
|
-
import { Modal } from 'antd';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { CloseOutlined } from '@ant-design/icons';
|
|
5
|
-
import styles from './styles.module.scss';
|
|
6
|
-
import { ModalStatus } from './ModalStatusList';
|
|
7
|
-
|
|
8
|
-
export interface ModalConfirmationProps {
|
|
9
|
-
closeText: string;
|
|
10
|
-
title: string;
|
|
11
|
-
description: string;
|
|
12
|
-
buttonText: string;
|
|
13
|
-
isOpen: boolean;
|
|
14
|
-
modalData?: any;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const ModalConfirmation = (props: ModalConfirmationProps) => {
|
|
18
|
-
const {
|
|
19
|
-
closeText,
|
|
20
|
-
title,
|
|
21
|
-
description,
|
|
22
|
-
buttonText,
|
|
23
|
-
isOpen = false,
|
|
24
|
-
modalData,
|
|
25
|
-
} = props;
|
|
26
|
-
|
|
27
|
-
const [status, setStatus] = useState<string>('');
|
|
28
|
-
|
|
29
|
-
useEffect(()=> {
|
|
30
|
-
isOpen &&
|
|
31
|
-
setStatus(ModalStatus.OPEN);
|
|
32
|
-
}, [isOpen])
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const closeAndChangeStatus = (status: string) => {
|
|
36
|
-
setStatus(status);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
modalData({
|
|
41
|
-
"status": status,
|
|
42
|
-
});
|
|
43
|
-
}, [status]);
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<>
|
|
47
|
-
<Modal
|
|
48
|
-
destroyOnClose={true}
|
|
49
|
-
closeIcon={
|
|
50
|
-
<div className={styles.closeButton}>
|
|
51
|
-
<p>{closeText}</p><CloseOutlined />
|
|
52
|
-
</div>
|
|
53
|
-
}
|
|
54
|
-
open={status === ModalStatus.OPEN}
|
|
55
|
-
onCancel={() => closeAndChangeStatus(ModalStatus.CANCELED)}
|
|
56
|
-
centered
|
|
57
|
-
width={'742px'}
|
|
58
|
-
footer={[
|
|
59
|
-
<Button key="submit" onClick={() => closeAndChangeStatus(ModalStatus.REQUESTED_CHANGES)}>
|
|
60
|
-
{buttonText}
|
|
61
|
-
</Button>
|
|
62
|
-
]}
|
|
63
|
-
className={styles.modal}
|
|
64
|
-
>
|
|
65
|
-
<h2 className={styles.title}>{title}</h2>
|
|
66
|
-
<p className={styles.description}>{description}</p>
|
|
67
|
-
</Modal>
|
|
68
|
-
</>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
1
|
+
import { Button } from '../Button';
|
|
2
|
+
import { Modal } from 'antd';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { CloseOutlined } from '@ant-design/icons';
|
|
5
|
+
import styles from './styles.module.scss';
|
|
6
|
+
import { ModalStatus } from './ModalStatusList';
|
|
7
|
+
|
|
8
|
+
export interface ModalConfirmationProps {
|
|
9
|
+
closeText: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
buttonText: string;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
modalData?: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const ModalConfirmation = (props: ModalConfirmationProps) => {
|
|
18
|
+
const {
|
|
19
|
+
closeText,
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
buttonText,
|
|
23
|
+
isOpen = false,
|
|
24
|
+
modalData,
|
|
25
|
+
} = props;
|
|
26
|
+
|
|
27
|
+
const [status, setStatus] = useState<string>('');
|
|
28
|
+
|
|
29
|
+
useEffect(()=> {
|
|
30
|
+
isOpen &&
|
|
31
|
+
setStatus(ModalStatus.OPEN);
|
|
32
|
+
}, [isOpen])
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const closeAndChangeStatus = (status: string) => {
|
|
36
|
+
setStatus(status);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
modalData({
|
|
41
|
+
"status": status,
|
|
42
|
+
});
|
|
43
|
+
}, [status]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<Modal
|
|
48
|
+
destroyOnClose={true}
|
|
49
|
+
closeIcon={
|
|
50
|
+
<div className={styles.closeButton}>
|
|
51
|
+
<p>{closeText}</p><CloseOutlined />
|
|
52
|
+
</div>
|
|
53
|
+
}
|
|
54
|
+
open={status === ModalStatus.OPEN}
|
|
55
|
+
onCancel={() => closeAndChangeStatus(ModalStatus.CANCELED)}
|
|
56
|
+
centered
|
|
57
|
+
width={'742px'}
|
|
58
|
+
footer={[
|
|
59
|
+
<Button key="submit" onClick={() => closeAndChangeStatus(ModalStatus.REQUESTED_CHANGES)}>
|
|
60
|
+
{buttonText}
|
|
61
|
+
</Button>
|
|
62
|
+
]}
|
|
63
|
+
className={styles.modal}
|
|
64
|
+
>
|
|
65
|
+
<h2 className={styles.title}>{title}</h2>
|
|
66
|
+
<p className={styles.description}>{description}</p>
|
|
67
|
+
</Modal>
|
|
68
|
+
</>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
.modal {
|
|
2
|
-
:global {
|
|
3
|
-
.ant-modal-close {
|
|
4
|
-
width: auto;
|
|
5
|
-
color: var(--button-default-background);
|
|
6
|
-
|
|
7
|
-
&:hover {
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
color: var(--button-default-background-hover-color);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ant-modal-content {
|
|
14
|
-
padding: 36px 24px;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
text-align: center;
|
|
20
|
-
|
|
21
|
-
@media(min-width: 742px) {
|
|
22
|
-
padding: 64px;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ant-modal-close {
|
|
28
|
-
&:hover {
|
|
29
|
-
.closeButton {
|
|
30
|
-
color: red;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.closeButton {
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
flex-direction: row;
|
|
40
|
-
gap: 8px;
|
|
41
|
-
color: inherit;
|
|
42
|
-
font-size: var(--font-size-body-3);
|
|
43
|
-
line-height: 100%;
|
|
44
|
-
font-weight: var(--font-weight-light);
|
|
45
|
-
text-transform: capitalize;
|
|
46
|
-
letter-spacing: .6px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.title {
|
|
50
|
-
color: var(--color-blue);
|
|
51
|
-
font-weight: var(--font-weight-semibold);
|
|
52
|
-
font-size: var(--font-size-body-6);
|
|
53
|
-
line-height: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.description {
|
|
57
|
-
color: var(--color-black);
|
|
58
|
-
font-size: var(--font-size-body-4);
|
|
59
|
-
margin: 12px 0 24px 0;
|
|
60
|
-
padding: 0;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
.modal {
|
|
2
|
+
:global {
|
|
3
|
+
.ant-modal-close {
|
|
4
|
+
width: auto;
|
|
5
|
+
color: var(--button-default-background);
|
|
6
|
+
|
|
7
|
+
&:hover {
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
color: var(--button-default-background-hover-color);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-modal-content {
|
|
14
|
+
padding: 36px 24px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
text-align: center;
|
|
20
|
+
|
|
21
|
+
@media(min-width: 742px) {
|
|
22
|
+
padding: 64px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ant-modal-close {
|
|
28
|
+
&:hover {
|
|
29
|
+
.closeButton {
|
|
30
|
+
color: red;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.closeButton {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
gap: 8px;
|
|
41
|
+
color: inherit;
|
|
42
|
+
font-size: var(--font-size-body-3);
|
|
43
|
+
line-height: 100%;
|
|
44
|
+
font-weight: var(--font-weight-light);
|
|
45
|
+
text-transform: capitalize;
|
|
46
|
+
letter-spacing: .6px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.title {
|
|
50
|
+
color: var(--color-blue);
|
|
51
|
+
font-weight: var(--font-weight-semibold);
|
|
52
|
+
font-size: var(--font-size-body-6);
|
|
53
|
+
line-height: 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.description {
|
|
57
|
+
color: var(--color-black);
|
|
58
|
+
font-size: var(--font-size-body-4);
|
|
59
|
+
margin: 12px 0 24px 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { ModalWithTable, ModalWithTableProps } from '.';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'ModalWithTable',
|
|
7
|
-
component: ModalWithTable,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
const Template: Story<ModalWithTableProps> = (args) => {
|
|
11
|
-
const [modalData, setModalData] = useState<any>({});
|
|
12
|
-
const [isFetching, setIsFetching] = useState<boolean>(false);
|
|
13
|
-
const [tagsData, setTagsData] = useState<any>({});
|
|
14
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
15
|
-
const [selectedSupervisors, setSelectedSupervisors] = useState<any>(['232']);
|
|
16
|
-
|
|
17
|
-
const onClickMe = () => {
|
|
18
|
-
setIsModalOpen(true);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let data = {
|
|
22
|
-
dataSource: [
|
|
23
|
-
{
|
|
24
|
-
key: `1`,
|
|
25
|
-
name: `John Brown`,
|
|
26
|
-
mecanographicNumber: "232",
|
|
27
|
-
store: `Levi's Sta Catarina`,
|
|
28
|
-
role: `Gerente`,
|
|
29
|
-
type: `Efetivo`
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: `2`,
|
|
33
|
-
name: `Mary Brown`,
|
|
34
|
-
mecanographicNumber: "32",
|
|
35
|
-
store: `Levi's Sta Catarina`,
|
|
36
|
-
role: `Comercial`,
|
|
37
|
-
type: `Efetivo`
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: `3`,
|
|
41
|
-
name: `Anna Astori`,
|
|
42
|
-
mecanographicNumber: "3212",
|
|
43
|
-
store: `Levi's Sta Catarina`,
|
|
44
|
-
role: `Funcionário`,
|
|
45
|
-
type: `Efetivo`
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
key: `4`,
|
|
49
|
-
name: `Yield Ona`,
|
|
50
|
-
mecanographicNumber: "21232",
|
|
51
|
-
store: `Adidas Restaurantes`,
|
|
52
|
-
role: `Gerente`,
|
|
53
|
-
type: `Efetivo`
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
pagination: {
|
|
57
|
-
total: 4,
|
|
58
|
-
pageSize: 2
|
|
59
|
-
},
|
|
60
|
-
rowKeyValue: 'mecanographicNumber',
|
|
61
|
-
rowSelection: {
|
|
62
|
-
type: 'checkbox',
|
|
63
|
-
selectedRowKeys: selectedSupervisors?.length > 0 ? selectedSupervisors : []
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if(modalData?.tagsInfo?.length > 0 && tagsData !== modalData?.tagsInfo) {
|
|
69
|
-
setTagsData(modalData.tagsInfo);
|
|
70
|
-
setIsFetching(true);
|
|
71
|
-
|
|
72
|
-
setTimeout(() => {
|
|
73
|
-
setIsFetching(false);
|
|
74
|
-
}, 1000);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if(modalData?.rowSelectionInfo?.length !== undefined) {
|
|
78
|
-
setSelectedSupervisors(modalData.rowSelectionInfo);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
setIsModalOpen(modalData?.open!);
|
|
82
|
-
}, [modalData]);
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<>
|
|
86
|
-
<button onClick={() => onClickMe()}> Button </button>
|
|
87
|
-
<ModalWithTable {...args} modalData={setModalData} isLoading={isFetching} tableData={data} isOpen={isModalOpen} advancedTagsList={['Country', 'County']}></ModalWithTable>
|
|
88
|
-
</>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export const Primary = Template.bind({});
|
|
93
|
-
Primary.args = {
|
|
94
|
-
closeText: 'cancelar',
|
|
95
|
-
buttonText: 'Alterar',
|
|
96
|
-
};
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { ModalWithTable, ModalWithTableProps } from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'ModalWithTable',
|
|
7
|
+
component: ModalWithTable,
|
|
8
|
+
} as Meta;
|
|
9
|
+
|
|
10
|
+
const Template: Story<ModalWithTableProps> = (args) => {
|
|
11
|
+
const [modalData, setModalData] = useState<any>({});
|
|
12
|
+
const [isFetching, setIsFetching] = useState<boolean>(false);
|
|
13
|
+
const [tagsData, setTagsData] = useState<any>({});
|
|
14
|
+
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
15
|
+
const [selectedSupervisors, setSelectedSupervisors] = useState<any>(['232']);
|
|
16
|
+
|
|
17
|
+
const onClickMe = () => {
|
|
18
|
+
setIsModalOpen(true);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let data = {
|
|
22
|
+
dataSource: [
|
|
23
|
+
{
|
|
24
|
+
key: `1`,
|
|
25
|
+
name: `John Brown`,
|
|
26
|
+
mecanographicNumber: "232",
|
|
27
|
+
store: `Levi's Sta Catarina`,
|
|
28
|
+
role: `Gerente`,
|
|
29
|
+
type: `Efetivo`
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: `2`,
|
|
33
|
+
name: `Mary Brown`,
|
|
34
|
+
mecanographicNumber: "32",
|
|
35
|
+
store: `Levi's Sta Catarina`,
|
|
36
|
+
role: `Comercial`,
|
|
37
|
+
type: `Efetivo`
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: `3`,
|
|
41
|
+
name: `Anna Astori`,
|
|
42
|
+
mecanographicNumber: "3212",
|
|
43
|
+
store: `Levi's Sta Catarina`,
|
|
44
|
+
role: `Funcionário`,
|
|
45
|
+
type: `Efetivo`
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: `4`,
|
|
49
|
+
name: `Yield Ona`,
|
|
50
|
+
mecanographicNumber: "21232",
|
|
51
|
+
store: `Adidas Restaurantes`,
|
|
52
|
+
role: `Gerente`,
|
|
53
|
+
type: `Efetivo`
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
pagination: {
|
|
57
|
+
total: 4,
|
|
58
|
+
pageSize: 2
|
|
59
|
+
},
|
|
60
|
+
rowKeyValue: 'mecanographicNumber',
|
|
61
|
+
rowSelection: {
|
|
62
|
+
type: 'checkbox',
|
|
63
|
+
selectedRowKeys: selectedSupervisors?.length > 0 ? selectedSupervisors : []
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if(modalData?.tagsInfo?.length > 0 && tagsData !== modalData?.tagsInfo) {
|
|
69
|
+
setTagsData(modalData.tagsInfo);
|
|
70
|
+
setIsFetching(true);
|
|
71
|
+
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
setIsFetching(false);
|
|
74
|
+
}, 1000);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if(modalData?.rowSelectionInfo?.length !== undefined) {
|
|
78
|
+
setSelectedSupervisors(modalData.rowSelectionInfo);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setIsModalOpen(modalData?.open!);
|
|
82
|
+
}, [modalData]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<>
|
|
86
|
+
<button onClick={() => onClickMe()}> Button </button>
|
|
87
|
+
<ModalWithTable {...args} modalData={setModalData} isLoading={isFetching} tableData={data} isOpen={isModalOpen} advancedTagsList={['Country', 'County']}></ModalWithTable>
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const Primary = Template.bind({});
|
|
93
|
+
Primary.args = {
|
|
94
|
+
closeText: 'cancelar',
|
|
95
|
+
buttonText: 'Alterar',
|
|
96
|
+
};
|