@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,19 +1,19 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import styles from './styles.module.scss';
|
|
3
|
-
export interface LabelProps {
|
|
4
|
-
forAttribute?: string;
|
|
5
|
-
children?: any;
|
|
6
|
-
customStyle?: string;
|
|
7
|
-
isUppercase?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Label = (props: LabelProps) => {
|
|
11
|
-
const { forAttribute, children, customStyle, isUppercase } = props;
|
|
12
|
-
|
|
13
|
-
const labelClasses = classNames({
|
|
14
|
-
[styles.label]: true,
|
|
15
|
-
[styles.uppercase]: isUppercase,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return <label className={ classNames(labelClasses, customStyle) } htmlFor={ forAttribute }>{ children }</label>
|
|
19
|
-
};
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import styles from './styles.module.scss';
|
|
3
|
+
export interface LabelProps {
|
|
4
|
+
forAttribute?: string;
|
|
5
|
+
children?: any;
|
|
6
|
+
customStyle?: string;
|
|
7
|
+
isUppercase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Label = (props: LabelProps) => {
|
|
11
|
+
const { forAttribute, children, customStyle, isUppercase } = props;
|
|
12
|
+
|
|
13
|
+
const labelClasses = classNames({
|
|
14
|
+
[styles.label]: true,
|
|
15
|
+
[styles.uppercase]: isUppercase,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return <label className={ classNames(labelClasses, customStyle) } htmlFor={ forAttribute }>{ children }</label>
|
|
19
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
.label {
|
|
3
|
-
display: block;
|
|
4
|
-
color: var(--color-black);
|
|
5
|
-
text-transform: capitalize;
|
|
6
|
-
font-size: var(--font-size-body-base);
|
|
7
|
-
line-height: 125%;
|
|
8
|
-
font-weight: var(--font-weight-semibold);
|
|
9
|
-
|
|
10
|
-
&:not(:first-child) {
|
|
11
|
-
margin-top: 8px;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.uppercase {
|
|
16
|
-
text-transform: uppercase;
|
|
1
|
+
|
|
2
|
+
.label {
|
|
3
|
+
display: block;
|
|
4
|
+
color: var(--color-black);
|
|
5
|
+
text-transform: capitalize;
|
|
6
|
+
font-size: var(--font-size-body-base);
|
|
7
|
+
line-height: 125%;
|
|
8
|
+
font-weight: var(--font-weight-semibold);
|
|
9
|
+
|
|
10
|
+
&:not(:first-child) {
|
|
11
|
+
margin-top: 8px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.uppercase {
|
|
16
|
+
text-transform: uppercase;
|
|
17
17
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { Link, CustomLinkProps } from '.';
|
|
3
|
-
import { SearchOutlined } from '@ant-design/icons';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Link',
|
|
7
|
-
component: Link,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
const Template: Story<CustomLinkProps> = (args) => <Link {...args}> this is a link </Link>;
|
|
11
|
-
|
|
12
|
-
export const Primary = Template.bind({});
|
|
13
|
-
Primary.args = {
|
|
14
|
-
href: '#',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export const Secondary = Template.bind({});
|
|
19
|
-
Secondary.args = {
|
|
20
|
-
href: '#',
|
|
21
|
-
linkSecondary: true
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const iconAlignRight = Template.bind({});
|
|
25
|
-
iconAlignRight.args = {
|
|
26
|
-
href: '#',
|
|
27
|
-
iconAlignRight: true,
|
|
28
|
-
linkSecondary: true,
|
|
29
|
-
icon: <SearchOutlined />
|
|
30
|
-
};
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Link, CustomLinkProps } from '.';
|
|
3
|
+
import { SearchOutlined } from '@ant-design/icons';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Link',
|
|
7
|
+
component: Link,
|
|
8
|
+
} as Meta;
|
|
9
|
+
|
|
10
|
+
const Template: Story<CustomLinkProps> = (args) => <Link {...args}> this is a link </Link>;
|
|
11
|
+
|
|
12
|
+
export const Primary = Template.bind({});
|
|
13
|
+
Primary.args = {
|
|
14
|
+
href: '#',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export const Secondary = Template.bind({});
|
|
19
|
+
Secondary.args = {
|
|
20
|
+
href: '#',
|
|
21
|
+
linkSecondary: true
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const iconAlignRight = Template.bind({});
|
|
25
|
+
iconAlignRight.args = {
|
|
26
|
+
href: '#',
|
|
27
|
+
iconAlignRight: true,
|
|
28
|
+
linkSecondary: true,
|
|
29
|
+
icon: <SearchOutlined />
|
|
30
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Button as AntButton, ButtonProps } from 'antd';
|
|
2
|
-
import styles from './styles.module.scss';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
export interface CustomLinkProps extends ButtonProps {
|
|
6
|
-
iconAlignRight?: boolean;
|
|
7
|
-
linkSecondary?: boolean;
|
|
8
|
-
customClass?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Link = ({customClass, iconAlignRight, linkSecondary, ...props}: CustomLinkProps) => {
|
|
12
|
-
const linkClasses = classNames({
|
|
13
|
-
[styles.iconAlignRight]: iconAlignRight,
|
|
14
|
-
[styles.linkSecondary]: linkSecondary,
|
|
15
|
-
[`${customClass}`]: customClass,
|
|
16
|
-
}, [styles.link]);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AntButton { ...props } className={ linkClasses } type={'link'} />
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import { Button as AntButton, ButtonProps } from 'antd';
|
|
2
|
+
import styles from './styles.module.scss';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
export interface CustomLinkProps extends ButtonProps {
|
|
6
|
+
iconAlignRight?: boolean;
|
|
7
|
+
linkSecondary?: boolean;
|
|
8
|
+
customClass?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Link = ({customClass, iconAlignRight, linkSecondary, ...props}: CustomLinkProps) => {
|
|
12
|
+
const linkClasses = classNames({
|
|
13
|
+
[styles.iconAlignRight]: iconAlignRight,
|
|
14
|
+
[styles.linkSecondary]: linkSecondary,
|
|
15
|
+
[`${customClass}`]: customClass,
|
|
16
|
+
}, [styles.link]);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<AntButton { ...props } className={ linkClasses } type={'link'} />
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
.link {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
text-decoration: none;
|
|
4
|
-
height: auto;
|
|
5
|
-
|
|
6
|
-
color: var(--color-black);
|
|
7
|
-
font-size: var(--font-size-body-3);
|
|
8
|
-
line-height: 100%;
|
|
9
|
-
font-weight: 300;
|
|
10
|
-
font-style: var(--font-style-italic);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.linkSecondary {
|
|
14
|
-
color: var(--color-orange);
|
|
15
|
-
font-style: var(--font-style-normal);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iconAlignRight {
|
|
19
|
-
span:nth-child(2) {
|
|
20
|
-
margin-inline-end: 8px;
|
|
21
|
-
margin-inline-start: 0;
|
|
22
|
-
order: -1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
.link {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
text-decoration: none;
|
|
4
|
+
height: auto;
|
|
5
|
+
|
|
6
|
+
color: var(--color-black);
|
|
7
|
+
font-size: var(--font-size-body-3);
|
|
8
|
+
line-height: 100%;
|
|
9
|
+
font-weight: 300;
|
|
10
|
+
font-style: var(--font-style-italic);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.linkSecondary {
|
|
14
|
+
color: var(--color-orange);
|
|
15
|
+
font-style: var(--font-style-normal);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.iconAlignRight {
|
|
19
|
+
span:nth-child(2) {
|
|
20
|
+
margin-inline-end: 8px;
|
|
21
|
+
margin-inline-start: 0;
|
|
22
|
+
order: -1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { Menu } from '.';
|
|
3
|
-
import { MenuProps } from 'antd';
|
|
4
|
-
import { getItem } from './helpers/codeMutation';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Menu',
|
|
8
|
-
component: Menu,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: Story<MenuProps> = (args) => {
|
|
12
|
-
const data = [
|
|
13
|
-
{
|
|
14
|
-
"Year": 2023,
|
|
15
|
-
"EvaluationCycles": [
|
|
16
|
-
{
|
|
17
|
-
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
18
|
-
"Type": "Permanent",
|
|
19
|
-
"Name": "EV1",
|
|
20
|
-
"Year": 2023,
|
|
21
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
22
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
23
|
-
"Users": [
|
|
24
|
-
{
|
|
25
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
26
|
-
"UserAnswer": null,
|
|
27
|
-
"UserScore": null,
|
|
28
|
-
"SupervisorId": null,
|
|
29
|
-
"SupervisorAnswer": null,
|
|
30
|
-
"SupervisorScore": null
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
34
|
-
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
35
|
-
"UserScore": 3.333,
|
|
36
|
-
"SupervisorId": null,
|
|
37
|
-
"SupervisorAnswer": null,
|
|
38
|
-
"SupervisorScore": null
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
42
|
-
"UserAnswer": null,
|
|
43
|
-
"UserScore": null,
|
|
44
|
-
"SupervisorId": null,
|
|
45
|
-
"SupervisorAnswer": null,
|
|
46
|
-
"SupervisorScore": null
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
50
|
-
"State": "Started",
|
|
51
|
-
"Notifications": [],
|
|
52
|
-
"NotificationAgenda": null,
|
|
53
|
-
"Status": "A",
|
|
54
|
-
"IsOnlyForUsers": false,
|
|
55
|
-
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
56
|
-
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
57
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
58
|
-
"UpdateUserId": null,
|
|
59
|
-
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
60
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
64
|
-
"Type": "Permanent",
|
|
65
|
-
"Name": "EV1",
|
|
66
|
-
"Year": 2023,
|
|
67
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
68
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
69
|
-
"Users": [],
|
|
70
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
71
|
-
"State": "Draft",
|
|
72
|
-
"Notifications": [],
|
|
73
|
-
"NotificationAgenda": null,
|
|
74
|
-
"Status": "A",
|
|
75
|
-
"IsOnlyForUsers": false,
|
|
76
|
-
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
77
|
-
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
78
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
79
|
-
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
80
|
-
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
81
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"Year": 2024,
|
|
87
|
-
"EvaluationCycles": [
|
|
88
|
-
{
|
|
89
|
-
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
90
|
-
"Type": "Permanent",
|
|
91
|
-
"Name": "EV2",
|
|
92
|
-
"Year": 2024,
|
|
93
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
94
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
95
|
-
"Users": [
|
|
96
|
-
{
|
|
97
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
98
|
-
"UserAnswer": null,
|
|
99
|
-
"UserScore": null,
|
|
100
|
-
"SupervisorId": null,
|
|
101
|
-
"SupervisorAnswer": null,
|
|
102
|
-
"SupervisorScore": null
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
106
|
-
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
107
|
-
"UserScore": 3.333,
|
|
108
|
-
"SupervisorId": null,
|
|
109
|
-
"SupervisorAnswer": null,
|
|
110
|
-
"SupervisorScore": null
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
114
|
-
"UserAnswer": null,
|
|
115
|
-
"UserScore": null,
|
|
116
|
-
"SupervisorId": null,
|
|
117
|
-
"SupervisorAnswer": null,
|
|
118
|
-
"SupervisorScore": null
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
122
|
-
"State": "Started",
|
|
123
|
-
"Notifications": [],
|
|
124
|
-
"NotificationAgenda": null,
|
|
125
|
-
"Status": "A",
|
|
126
|
-
"IsOnlyForUsers": false,
|
|
127
|
-
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
128
|
-
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
129
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
130
|
-
"UpdateUserId": null,
|
|
131
|
-
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
132
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
136
|
-
"Type": "Permanent",
|
|
137
|
-
"Name": "EV2",
|
|
138
|
-
"Year": 2024,
|
|
139
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
140
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
141
|
-
"Users": [],
|
|
142
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
143
|
-
"State": "Draft",
|
|
144
|
-
"Notifications": [],
|
|
145
|
-
"NotificationAgenda": null,
|
|
146
|
-
"Status": "A",
|
|
147
|
-
"IsOnlyForUsers": false,
|
|
148
|
-
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
149
|
-
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
150
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
151
|
-
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
152
|
-
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
153
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
const items = data.map((el: any, index: any) => {
|
|
160
|
-
return (
|
|
161
|
-
getItem(
|
|
162
|
-
el.Year,
|
|
163
|
-
index,
|
|
164
|
-
<></>,
|
|
165
|
-
el.EvaluationCycles?.map((evCycle: any, subIndex: any) => {
|
|
166
|
-
return getItem(evCycle.Name, `${index}-${subIndex}`);
|
|
167
|
-
})
|
|
168
|
-
)
|
|
169
|
-
)
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return <Menu {...args} items={items}></Menu>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export const Primary = Template.bind({});
|
|
177
|
-
Primary.args = {
|
|
178
|
-
};
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Menu } from '.';
|
|
3
|
+
import { MenuProps } from 'antd';
|
|
4
|
+
import { getItem } from './helpers/codeMutation';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Menu',
|
|
8
|
+
component: Menu,
|
|
9
|
+
} as Meta;
|
|
10
|
+
|
|
11
|
+
const Template: Story<MenuProps> = (args) => {
|
|
12
|
+
const data = [
|
|
13
|
+
{
|
|
14
|
+
"Year": 2023,
|
|
15
|
+
"EvaluationCycles": [
|
|
16
|
+
{
|
|
17
|
+
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
18
|
+
"Type": "Permanent",
|
|
19
|
+
"Name": "EV1",
|
|
20
|
+
"Year": 2023,
|
|
21
|
+
"StartDate": "2023-03-01T00:00:00Z",
|
|
22
|
+
"EndDate": "2023-05-31T23:00:00Z",
|
|
23
|
+
"Users": [
|
|
24
|
+
{
|
|
25
|
+
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
26
|
+
"UserAnswer": null,
|
|
27
|
+
"UserScore": null,
|
|
28
|
+
"SupervisorId": null,
|
|
29
|
+
"SupervisorAnswer": null,
|
|
30
|
+
"SupervisorScore": null
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
34
|
+
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
35
|
+
"UserScore": 3.333,
|
|
36
|
+
"SupervisorId": null,
|
|
37
|
+
"SupervisorAnswer": null,
|
|
38
|
+
"SupervisorScore": null
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
42
|
+
"UserAnswer": null,
|
|
43
|
+
"UserScore": null,
|
|
44
|
+
"SupervisorId": null,
|
|
45
|
+
"SupervisorAnswer": null,
|
|
46
|
+
"SupervisorScore": null
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
50
|
+
"State": "Started",
|
|
51
|
+
"Notifications": [],
|
|
52
|
+
"NotificationAgenda": null,
|
|
53
|
+
"Status": "A",
|
|
54
|
+
"IsOnlyForUsers": false,
|
|
55
|
+
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
56
|
+
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
57
|
+
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
58
|
+
"UpdateUserId": null,
|
|
59
|
+
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
60
|
+
"CancelDate": "0001-01-01T00:00:00Z"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
64
|
+
"Type": "Permanent",
|
|
65
|
+
"Name": "EV1",
|
|
66
|
+
"Year": 2023,
|
|
67
|
+
"StartDate": "2023-03-01T00:00:00Z",
|
|
68
|
+
"EndDate": "2023-05-31T23:00:00Z",
|
|
69
|
+
"Users": [],
|
|
70
|
+
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
71
|
+
"State": "Draft",
|
|
72
|
+
"Notifications": [],
|
|
73
|
+
"NotificationAgenda": null,
|
|
74
|
+
"Status": "A",
|
|
75
|
+
"IsOnlyForUsers": false,
|
|
76
|
+
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
77
|
+
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
78
|
+
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
79
|
+
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
80
|
+
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
81
|
+
"CancelDate": "0001-01-01T00:00:00Z"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"Year": 2024,
|
|
87
|
+
"EvaluationCycles": [
|
|
88
|
+
{
|
|
89
|
+
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
90
|
+
"Type": "Permanent",
|
|
91
|
+
"Name": "EV2",
|
|
92
|
+
"Year": 2024,
|
|
93
|
+
"StartDate": "2023-03-01T00:00:00Z",
|
|
94
|
+
"EndDate": "2023-05-31T23:00:00Z",
|
|
95
|
+
"Users": [
|
|
96
|
+
{
|
|
97
|
+
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
98
|
+
"UserAnswer": null,
|
|
99
|
+
"UserScore": null,
|
|
100
|
+
"SupervisorId": null,
|
|
101
|
+
"SupervisorAnswer": null,
|
|
102
|
+
"SupervisorScore": null
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
106
|
+
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
107
|
+
"UserScore": 3.333,
|
|
108
|
+
"SupervisorId": null,
|
|
109
|
+
"SupervisorAnswer": null,
|
|
110
|
+
"SupervisorScore": null
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
114
|
+
"UserAnswer": null,
|
|
115
|
+
"UserScore": null,
|
|
116
|
+
"SupervisorId": null,
|
|
117
|
+
"SupervisorAnswer": null,
|
|
118
|
+
"SupervisorScore": null
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
122
|
+
"State": "Started",
|
|
123
|
+
"Notifications": [],
|
|
124
|
+
"NotificationAgenda": null,
|
|
125
|
+
"Status": "A",
|
|
126
|
+
"IsOnlyForUsers": false,
|
|
127
|
+
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
128
|
+
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
129
|
+
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
130
|
+
"UpdateUserId": null,
|
|
131
|
+
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
132
|
+
"CancelDate": "0001-01-01T00:00:00Z"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
136
|
+
"Type": "Permanent",
|
|
137
|
+
"Name": "EV2",
|
|
138
|
+
"Year": 2024,
|
|
139
|
+
"StartDate": "2023-03-01T00:00:00Z",
|
|
140
|
+
"EndDate": "2023-05-31T23:00:00Z",
|
|
141
|
+
"Users": [],
|
|
142
|
+
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
143
|
+
"State": "Draft",
|
|
144
|
+
"Notifications": [],
|
|
145
|
+
"NotificationAgenda": null,
|
|
146
|
+
"Status": "A",
|
|
147
|
+
"IsOnlyForUsers": false,
|
|
148
|
+
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
149
|
+
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
150
|
+
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
151
|
+
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
152
|
+
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
153
|
+
"CancelDate": "0001-01-01T00:00:00Z"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
const items = data.map((el: any, index: any) => {
|
|
160
|
+
return (
|
|
161
|
+
getItem(
|
|
162
|
+
el.Year,
|
|
163
|
+
index,
|
|
164
|
+
<></>,
|
|
165
|
+
el.EvaluationCycles?.map((evCycle: any, subIndex: any) => {
|
|
166
|
+
return getItem(evCycle.Name, `${index}-${subIndex}`);
|
|
167
|
+
})
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
return <Menu {...args} items={items}></Menu>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export const Primary = Template.bind({});
|
|
177
|
+
Primary.args = {
|
|
178
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { MenuProps } from 'antd';
|
|
2
|
-
|
|
3
|
-
export type MenuItem = Required<MenuProps>['items'][number];
|
|
4
|
-
|
|
5
|
-
export function getItem(
|
|
6
|
-
label: React.ReactNode,
|
|
7
|
-
key: React.Key,
|
|
8
|
-
icon?: React.ReactNode,
|
|
9
|
-
children?: MenuItem[],
|
|
10
|
-
type?: 'group',
|
|
11
|
-
): MenuItem {
|
|
12
|
-
return {
|
|
13
|
-
key,
|
|
14
|
-
icon,
|
|
15
|
-
children,
|
|
16
|
-
label,
|
|
17
|
-
type,
|
|
18
|
-
} as MenuItem;
|
|
19
|
-
}
|
|
1
|
+
import type { MenuProps } from 'antd';
|
|
2
|
+
|
|
3
|
+
export type MenuItem = Required<MenuProps>['items'][number];
|
|
4
|
+
|
|
5
|
+
export function getItem(
|
|
6
|
+
label: React.ReactNode,
|
|
7
|
+
key: React.Key,
|
|
8
|
+
icon?: React.ReactNode,
|
|
9
|
+
children?: MenuItem[],
|
|
10
|
+
type?: 'group',
|
|
11
|
+
): MenuItem {
|
|
12
|
+
return {
|
|
13
|
+
key,
|
|
14
|
+
icon,
|
|
15
|
+
children,
|
|
16
|
+
label,
|
|
17
|
+
type,
|
|
18
|
+
} as MenuItem;
|
|
19
|
+
}
|