pixel-react 1.2.6 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- package/.yarn/install-state.gz +0 -0
- package/lib/components/Drawer/Types.d.ts +29 -17
- package/lib/components/{ExcelFile → Excel}/ExcelFile/ExcelFile.d.ts +1 -0
- package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.d.ts +39 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
- package/lib/components/{ExcelFile → Excel}/ExcelToolBar/ExcelToolBar.d.ts +7 -3
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +4 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
- package/lib/components/Select/Select.stories.d.ts +1 -0
- package/lib/components/Toastify/Toastify.d.ts +5 -4
- package/lib/components/Toastify/types.d.ts +1 -0
- package/lib/index.d.ts +76 -24
- package/lib/index.esm.js +1467 -1038
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1468 -1038
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/getSequentialPayload/types.d.ts +30 -0
- package/package.json +3 -3
- package/src/assets/Themes/BaseTheme.scss +4 -0
- package/src/assets/icons/maximize_icon.svg +5 -0
- package/src/assets/styles/_fonts.scss +1 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
- package/src/components/Drawer/Drawer.scss +1 -0
- package/src/components/Drawer/Drawer.stories.tsx +8 -9
- package/src/components/Drawer/Drawer.tsx +8 -5
- package/src/components/Drawer/Types.ts +27 -14
- package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
- package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
- package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
- package/src/components/Form/Form.scss +54 -35
- package/src/components/Form/Form.stories.tsx +264 -225
- package/src/components/Form/Forms.tsx +5 -1
- package/src/components/Icon/iconList.ts +2 -1
- package/src/components/Input/Input.tsx +0 -1
- package/src/components/MenuOption/MenuOption.scss +0 -1
- package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
- package/src/components/MenuOption/MenuOption.tsx +5 -4
- package/src/components/MenuOption/types.ts +4 -0
- package/src/components/ModulesChip/ModuleChip.scss +2 -2
- package/src/components/ModulesChip/ModuleChip.tsx +4 -4
- package/src/components/MultiSelect/Dropdown.tsx +5 -2
- package/src/components/MultiSelect/MultiSelect.scss +16 -11
- package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
- package/src/components/MultiSelect/MultiSelect.tsx +49 -26
- package/src/components/MultiSelect/MultiSelectTypes.ts +2 -1
- package/src/components/Select/Select.stories.tsx +161 -18
- package/src/components/Select/Select.tsx +41 -33
- package/src/components/Table/Table.scss +6 -5
- package/src/components/Table/Table.stories.tsx +0 -9
- package/src/components/Table/Table.tsx +2 -2
- package/src/components/TableTree/TableTree.scss +1 -1
- package/src/components/TableTree/TableTree.tsx +3 -1
- package/src/components/Toastify/Toastify.stories.tsx +29 -10
- package/src/components/Toastify/Toastify.tsx +42 -16
- package/src/components/Toastify/types.ts +2 -0
- package/src/components/Tooltip/Tooltip.scss +1 -1
- package/src/index.ts +4 -2
- package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
- package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
- package/src/utils/getSequentialPayload/types.ts +35 -0
- package/lib/components/AddButton/AddButton.d.ts +0 -5
- package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
- package/lib/components/AddButton/index.d.ts +0 -1
- package/lib/components/AddButton/types.d.ts +0 -4
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
- package/lib/utils/find/findAndInsert.d.ts +0 -7
- package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
- package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
- /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.d.ts +0 -0
- /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/ExcelFile.stories.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/Types.d.ts +0 -0
- /package/lib/components/{ExcelFile → Excel}/index.d.ts +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
- /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
- /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
- /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
- /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -10,14 +10,14 @@ const ModuleChip: React.FC<ModuleChipProps> = ({
|
|
10
10
|
}) => {
|
11
11
|
return (
|
12
12
|
<div
|
13
|
-
className={classNames('ff-
|
14
|
-
'ff-
|
13
|
+
className={classNames('ff-Module-chip', {
|
14
|
+
'ff-Module-chip--active': isActive,
|
15
15
|
})}
|
16
16
|
onClick={onClick}
|
17
17
|
>
|
18
18
|
<div
|
19
|
-
className={classNames(`ff-label-chip `, {
|
20
|
-
'ff-label-chip--active': isActive,
|
19
|
+
className={classNames(`ff-Module-label-chip `, {
|
20
|
+
'ff-Module-label-chip--active': isActive,
|
21
21
|
})}
|
22
22
|
>
|
23
23
|
<Typography fontSize={'14px'} fontWeight="regular" lineHeight="21px">
|
@@ -6,6 +6,7 @@ import { ThemeContext } from '../ThemeProvider/ThemeProvider';
|
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import Button from '../Button';
|
8
8
|
import Typography from '../Typography';
|
9
|
+
import Checkbox from '../Checkbox';
|
9
10
|
|
10
11
|
const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
11
12
|
(
|
@@ -80,9 +81,11 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
80
81
|
role="option"
|
81
82
|
className={`dropdown-option-container`}
|
82
83
|
key={info.label}
|
83
|
-
onClick={() =>
|
84
|
+
onClick={() =>
|
85
|
+
!info?.isDisabled && handleOptionChange(info, !info.isChecked)
|
86
|
+
}
|
84
87
|
>
|
85
|
-
<
|
88
|
+
<Checkbox checked={info.isChecked} disabled={info?.isDisabled}/>
|
86
89
|
<Typography
|
87
90
|
as="span"
|
88
91
|
className="dropdown-option-label"
|
@@ -58,7 +58,9 @@
|
|
58
58
|
color: var(--default-icon-color);
|
59
59
|
line-height: 18px;
|
60
60
|
}
|
61
|
-
|
61
|
+
.ff-required-asterisk {
|
62
|
+
color: var(--error-light);
|
63
|
+
}
|
62
64
|
.active-default-label {
|
63
65
|
@extend .font-size-8;
|
64
66
|
font-size: 8px !important;
|
@@ -89,12 +91,15 @@
|
|
89
91
|
@extend .fontXs;
|
90
92
|
line-height: 14px;
|
91
93
|
color: var(--tooltip-bg-color);
|
92
|
-
&.
|
94
|
+
&.label-padding {
|
93
95
|
padding: 5px 2px;
|
94
96
|
}
|
95
97
|
}
|
96
98
|
.ff-multiselect-chip-close-icon {
|
99
|
+
color: var(--brand-color);
|
97
100
|
cursor: pointer;
|
101
|
+
padding-right: 0px;
|
102
|
+
padding-left: 0px;
|
98
103
|
}
|
99
104
|
}
|
100
105
|
.ff-multiselect-input-container {
|
@@ -114,15 +119,15 @@
|
|
114
119
|
}
|
115
120
|
}
|
116
121
|
}
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
122
|
+
}
|
123
|
+
.ff-multiselect-more-chip {
|
124
|
+
display: flex;
|
125
|
+
align-items: center;
|
126
|
+
width: 1rem;
|
127
|
+
@extend .fontSm;
|
128
|
+
font-weight: 600;
|
129
|
+
line-height: 16px;
|
130
|
+
color: var(--brand-color);
|
126
131
|
}
|
127
132
|
&__toggle {
|
128
133
|
display: flex;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
2
2
|
import MultiSelect from './MultiSelect';
|
3
|
-
import { useState } from 'react';
|
3
|
+
import { useEffect, useState } from 'react';
|
4
|
+
import { Option } from './MultiSelectTypes';
|
4
5
|
|
5
6
|
const meta: Meta<typeof MultiSelect> = {
|
6
7
|
title: 'Components/MultiSelect',
|
@@ -93,24 +94,27 @@ export const EmailGroup: Story = {
|
|
93
94
|
|
94
95
|
export const Controlled: Story = {
|
95
96
|
render: () => {
|
96
|
-
const [options] = useState([
|
97
|
-
{ label: 'Apple', value: 'apple' },
|
98
|
-
{ label: 'Banana', value: 'banana' },
|
99
|
-
{ label: 'Cherry', value: 'cherry' },
|
100
|
-
{ label: 'Date', value: 'date' },
|
101
|
-
{ label: 'Grape', value: 'grape' },
|
102
|
-
{ label: 'Kiwi', value: 'kiwi' },
|
103
|
-
{ label: 'Mango', value: 'mango' },
|
104
|
-
{ label: 'Orange', value: 'orange' },
|
105
|
-
{ label: 'Peach', value: 'peach' },
|
106
|
-
{ label: 'Strawberry', value: 'strawberry' },
|
107
|
-
]);
|
97
|
+
const [options, setOptions] = useState<Option[]>([]);
|
108
98
|
const [selectedOptions, setSelectedOptions] = useState<
|
109
99
|
{ label?: string; value?: string }[]
|
110
100
|
>([{ label: 'Apple', value: 'apple' }]);
|
111
101
|
const onChange = (options: { label?: string; value?: string }[]) => {
|
112
102
|
setSelectedOptions(options);
|
113
103
|
};
|
104
|
+
useEffect(() => {
|
105
|
+
setOptions([
|
106
|
+
{ label: 'Apple', value: 'apple' },
|
107
|
+
{ label: 'Banana', value: 'banana' },
|
108
|
+
{ label: 'Cherry', value: 'cherry' },
|
109
|
+
{ label: 'Date', value: 'date' },
|
110
|
+
{ label: 'Grape', value: 'grape' },
|
111
|
+
{ label: 'Kiwi', value: 'kiwi' },
|
112
|
+
{ label: 'Mango', value: 'mango' },
|
113
|
+
{ label: 'Orange', value: 'orange' },
|
114
|
+
{ label: 'Peach', value: 'peach' },
|
115
|
+
{ label: 'Strawberry', value: 'strawberry' },
|
116
|
+
]);
|
117
|
+
}, []);
|
114
118
|
return (
|
115
119
|
<MultiSelect
|
116
120
|
label={'Fruits'}
|
@@ -6,26 +6,40 @@ import Dropdown from './Dropdown';
|
|
6
6
|
import Icon from '../Icon';
|
7
7
|
import { MultiSelectProps, Option } from './MultiSelectTypes';
|
8
8
|
import Typography from '../Typography';
|
9
|
+
import Tooltip from '../Tooltip';
|
9
10
|
|
10
11
|
const ChipElement = ({
|
11
12
|
label,
|
12
13
|
onChipCloseClick,
|
14
|
+
disableChip,
|
13
15
|
}: {
|
14
16
|
label: string;
|
15
17
|
onChipCloseClick: (e: React.MouseEvent<HTMLDivElement>) => void;
|
18
|
+
disableChip: boolean;
|
16
19
|
}) => {
|
17
20
|
if (label) {
|
18
21
|
return (
|
19
22
|
<div className="ff-multiselect-chip">
|
20
|
-
<span
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
<span
|
24
|
+
className={`ff-multiselect-chip-label ${
|
25
|
+
disableChip && 'label-padding'
|
26
|
+
}`}
|
27
|
+
>
|
28
|
+
<Tooltip
|
29
|
+
placement="bottom"
|
30
|
+
title={label?.length > 25 ? label : ''}
|
31
|
+
zIndex={101}
|
32
|
+
>
|
33
|
+
{label?.length > 25 ? label?.slice(0, 25) + '...' : label}
|
34
|
+
</Tooltip>
|
35
|
+
</span>
|
36
|
+
{!disableChip && (
|
37
|
+
<Icon
|
38
|
+
className="ff-multiselect-chip-close-icon"
|
39
|
+
onClick={onChipCloseClick}
|
40
|
+
name="close_pill"
|
41
|
+
/>
|
42
|
+
)}
|
29
43
|
</div>
|
30
44
|
);
|
31
45
|
}
|
@@ -46,12 +60,10 @@ const MultiSelect = ({
|
|
46
60
|
withSelectButton = false,
|
47
61
|
onSelect = () => {},
|
48
62
|
displayCount = false,
|
63
|
+
placeholderForSearching = 'Search',
|
49
64
|
}: MultiSelectProps) => {
|
50
65
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
51
66
|
const [allOptions, setAllOptions] = useState(options);
|
52
|
-
useEffect(() => {
|
53
|
-
setAllOptions(options);
|
54
|
-
}, [options]);
|
55
67
|
|
56
68
|
const [searchedKeyword, setSearchedKeyword] = useState('');
|
57
69
|
const [isSelectFocusedOnce, setIsSelectFocusedOnce] =
|
@@ -175,12 +187,20 @@ const MultiSelect = ({
|
|
175
187
|
calculatePosition();
|
176
188
|
}
|
177
189
|
}, [isOpen, allOptions]);
|
190
|
+
function getScrollbarWidth(): number {
|
191
|
+
const div = document.createElement('div');
|
192
|
+
div.style.visibility = 'hidden';
|
193
|
+
div.style.overflow = 'scroll';
|
194
|
+
document.body.appendChild(div);
|
195
|
+
const scrollbarWidth = div.offsetWidth - div.clientWidth;
|
196
|
+
document.body.removeChild(div);
|
197
|
+
return scrollbarWidth;
|
198
|
+
}
|
178
199
|
const onSelectToggleScroll = (isEnabled: boolean) => {
|
179
|
-
const bodyScrollWidth =
|
200
|
+
const bodyScrollWidth = getScrollbarWidth();
|
180
201
|
document.body.style.paddingRight = isEnabled ? '' : `${bodyScrollWidth}px`;
|
181
202
|
document.body.style.overflow = isEnabled ? '' : 'hidden';
|
182
203
|
};
|
183
|
-
|
184
204
|
useEffect(() => {
|
185
205
|
if (isOpen) {
|
186
206
|
onSelectToggleScroll(!isOpen);
|
@@ -204,6 +224,8 @@ const MultiSelect = ({
|
|
204
224
|
}));
|
205
225
|
setAllOptions(initializeOptions);
|
206
226
|
}
|
227
|
+
}, [options]);
|
228
|
+
useEffect(() => {
|
207
229
|
const handleClickAnywhere = (event: MouseEvent) => {
|
208
230
|
if (
|
209
231
|
dropdownWrapper.current &&
|
@@ -229,6 +251,7 @@ const MultiSelect = ({
|
|
229
251
|
document.body.style.overflow = 'auto';
|
230
252
|
};
|
231
253
|
}, []);
|
254
|
+
|
232
255
|
return (
|
233
256
|
<div
|
234
257
|
ref={selectWrapper}
|
@@ -250,9 +273,10 @@ const MultiSelect = ({
|
|
250
273
|
selectedOptions?.length ||
|
251
274
|
(isFieldSkipped && required),
|
252
275
|
'default-label': !isOpen && !selectedOptions?.length,
|
253
|
-
})}
|
254
|
-
|
255
|
-
|
276
|
+
})}>
|
277
|
+
{required && <span className="ff-required-asterisk">*</span>}
|
278
|
+
{label}
|
279
|
+
</Typography>
|
256
280
|
|
257
281
|
<div className="ff-multiselect-chip-container">
|
258
282
|
{displayCount ? (
|
@@ -262,6 +286,7 @@ const MultiSelect = ({
|
|
262
286
|
key={option?.label}
|
263
287
|
label={option?.label || ''}
|
264
288
|
onChipCloseClick={(e) => handleChipCloseClick(option, e)}
|
289
|
+
disableChip={option?.isDisabled || false}
|
265
290
|
/>
|
266
291
|
))}
|
267
292
|
</>
|
@@ -271,6 +296,7 @@ const MultiSelect = ({
|
|
271
296
|
key={option?.label}
|
272
297
|
label={option?.label || ''}
|
273
298
|
onChipCloseClick={(e) => handleChipCloseClick(option, e)}
|
299
|
+
disableChip={option?.isDisabled || false}
|
274
300
|
/>
|
275
301
|
))
|
276
302
|
)}
|
@@ -279,7 +305,7 @@ const MultiSelect = ({
|
|
279
305
|
value={searchedKeyword}
|
280
306
|
type={type}
|
281
307
|
autoComplete="off"
|
282
|
-
placeholder=
|
308
|
+
placeholder={placeholderForSearching}
|
283
309
|
ref={inputRef}
|
284
310
|
onChange={handleSearch}
|
285
311
|
onKeyDown={handleKeyEnter}
|
@@ -291,16 +317,13 @@ const MultiSelect = ({
|
|
291
317
|
}}
|
292
318
|
/>
|
293
319
|
</div>
|
294
|
-
{hiddenCount > 0 && (
|
295
|
-
<div
|
296
|
-
className="ff-multiselect-more-chip"
|
297
|
-
onClick={toggleDropdown}
|
298
|
-
>
|
299
|
-
+{hiddenCount}
|
300
|
-
</div>
|
301
|
-
)}
|
302
320
|
</div>
|
303
321
|
</div>
|
322
|
+
{hiddenCount > 0 && displayCount && (
|
323
|
+
<div className="ff-multiselect-more-chip" onClick={toggleDropdown}>
|
324
|
+
+{hiddenCount}
|
325
|
+
</div>
|
326
|
+
)}
|
304
327
|
<div onClick={toggleDropdown} className="ff-multiselect__toggle">
|
305
328
|
<Icon
|
306
329
|
name="arrow_down"
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import Select from './Select';
|
3
3
|
import { useState } from 'react';
|
4
4
|
import { Option } from './types';
|
5
|
+
import RadioGroup from '../RadioGroup';
|
5
6
|
|
6
7
|
const meta: Meta<typeof Select> = {
|
7
8
|
title: 'Components/Select',
|
@@ -20,9 +21,26 @@ export const Primary: Story = {
|
|
20
21
|
labelAccessor: 'name',
|
21
22
|
valueAccessor: 'value',
|
22
23
|
optionsList: [
|
23
|
-
{
|
24
|
-
|
25
|
-
|
24
|
+
{
|
25
|
+
label: 'fire-flink-LIC4900-onPrem',
|
26
|
+
value: 'fire-flink-LIC4900-onPrem',
|
27
|
+
name: 'fireflink',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
label: 'fire-flink-LIC3179',
|
31
|
+
value: 'fire-flink-LIC3179',
|
32
|
+
name: 'local',
|
33
|
+
},
|
34
|
+
{
|
35
|
+
label: 'fire-flink-LIC4937',
|
36
|
+
value: 'fire-flink-LIC4937',
|
37
|
+
name: 'browser stack',
|
38
|
+
},
|
39
|
+
{
|
40
|
+
label: 'fire-flink-LIC4999',
|
41
|
+
value: 'fire-flink-LIC4999',
|
42
|
+
name: 'lambda test',
|
43
|
+
},
|
26
44
|
],
|
27
45
|
},
|
28
46
|
};
|
@@ -31,9 +49,22 @@ export const WithError: Story = {
|
|
31
49
|
args: {
|
32
50
|
label: 'Select',
|
33
51
|
optionsList: [
|
34
|
-
{
|
35
|
-
|
36
|
-
|
52
|
+
{
|
53
|
+
label: 'fire-flink-LIC4900-onPrem',
|
54
|
+
value: 'fire-flink-LIC4900-onPrem',
|
55
|
+
},
|
56
|
+
{
|
57
|
+
label: 'fire-flink-LIC3179',
|
58
|
+
value: 'fire-flink-LIC3179',
|
59
|
+
},
|
60
|
+
{
|
61
|
+
label: 'fire-flink-LIC4937',
|
62
|
+
value: 'fire-flink-LIC4937',
|
63
|
+
},
|
64
|
+
{
|
65
|
+
label: 'fire-flink-LIC4999',
|
66
|
+
value: 'fire-flink-LIC4999',
|
67
|
+
},
|
37
68
|
],
|
38
69
|
errorMsg: 'Please select a option',
|
39
70
|
},
|
@@ -43,9 +74,22 @@ export const WithoutLabel: Story = {
|
|
43
74
|
args: {
|
44
75
|
showLabel: false,
|
45
76
|
optionsList: [
|
46
|
-
{
|
47
|
-
|
48
|
-
|
77
|
+
{
|
78
|
+
label: 'fire-flink-LIC4900-onPrem',
|
79
|
+
value: 'fire-flink-LIC4900-onPrem',
|
80
|
+
},
|
81
|
+
{
|
82
|
+
label: 'fire-flink-LIC3179',
|
83
|
+
value: 'fire-flink-LIC3179',
|
84
|
+
},
|
85
|
+
{
|
86
|
+
label: 'fire-flink-LIC4937',
|
87
|
+
value: 'fire-flink-LIC4937',
|
88
|
+
},
|
89
|
+
{
|
90
|
+
label: 'fire-flink-LIC4999',
|
91
|
+
value: 'fire-flink-LIC4999',
|
92
|
+
},
|
49
93
|
],
|
50
94
|
},
|
51
95
|
};
|
@@ -69,11 +113,24 @@ export const Disable: Story = {
|
|
69
113
|
export const WithInitialValue: Story = {
|
70
114
|
args: {
|
71
115
|
label: 'Select',
|
72
|
-
selectedOption: { label: 'Option 2', value: '2' },
|
116
|
+
selectedOption: { label: 'Option 2', value: 'Option 2' },
|
73
117
|
optionsList: [
|
74
|
-
{
|
75
|
-
|
76
|
-
|
118
|
+
{
|
119
|
+
label: 'fire-flink-LIC4900-onPrem',
|
120
|
+
value: 'fire-flink-LIC4900-onPrem',
|
121
|
+
},
|
122
|
+
{
|
123
|
+
label: 'fire-flink-LIC3179',
|
124
|
+
value: 'fire-flink-LIC3179',
|
125
|
+
},
|
126
|
+
{
|
127
|
+
label: 'fire-flink-LIC4937',
|
128
|
+
value: 'fire-flink-LIC4937',
|
129
|
+
},
|
130
|
+
{
|
131
|
+
label: 'fire-flink-LIC4999',
|
132
|
+
value: 'fire-flink-LIC4999',
|
133
|
+
},
|
77
134
|
],
|
78
135
|
},
|
79
136
|
};
|
@@ -81,14 +138,27 @@ export const WithInitialValue: Story = {
|
|
81
138
|
export const OptionSelection: Story = {
|
82
139
|
render: () => {
|
83
140
|
const optionsList = [
|
84
|
-
{
|
85
|
-
|
86
|
-
|
141
|
+
{
|
142
|
+
label: 'fire-flink-LIC4900-onPrem',
|
143
|
+
value: 'fire-flink-LIC4900-onPrem',
|
144
|
+
},
|
145
|
+
{
|
146
|
+
label: 'fire-flink-LIC3179',
|
147
|
+
value: 'fire-flink-LIC3179',
|
148
|
+
},
|
149
|
+
{
|
150
|
+
label: 'fire-flink-LIC4937',
|
151
|
+
value: 'fire-flink-LIC4937',
|
152
|
+
},
|
153
|
+
{
|
154
|
+
label: 'fire-flink-LIC4999',
|
155
|
+
value: 'fire-flink-LIC4999',
|
156
|
+
},
|
87
157
|
];
|
88
158
|
|
89
159
|
const [selectedOption, setSelectedOption] = useState<Option>({
|
90
|
-
label: '
|
91
|
-
value: '
|
160
|
+
label: 'fire-flink-LIC3179',
|
161
|
+
value: 'fire-flink-LIC3179',
|
92
162
|
});
|
93
163
|
|
94
164
|
const handleChange = (option: Option) => {
|
@@ -155,4 +225,77 @@ export const CustomJSX: Story = {
|
|
155
225
|
},
|
156
226
|
};
|
157
227
|
|
228
|
+
export const updateOptionFromOutside: Story = {
|
229
|
+
render: () => {
|
230
|
+
const [selectedOption, setSelectedOption] = useState<Option>({
|
231
|
+
label: 'fire-flink-LIC4900-onPrem',
|
232
|
+
value: 'fire-flink-LIC4900-onPrem',
|
233
|
+
});
|
234
|
+
|
235
|
+
const optionsList = [
|
236
|
+
{
|
237
|
+
label: 'fire-flink-LIC4900-onPrem',
|
238
|
+
value: 'fire-flink-LIC4900-onPrem',
|
239
|
+
},
|
240
|
+
{
|
241
|
+
label: 'fire-flink-LIC3179',
|
242
|
+
value: 'fire-flink-LIC3179',
|
243
|
+
},
|
244
|
+
{
|
245
|
+
label: 'fire-flink-LIC4937',
|
246
|
+
value: 'fire-flink-LIC4937',
|
247
|
+
},
|
248
|
+
{
|
249
|
+
label: 'fire-flink-LIC4999',
|
250
|
+
value: 'fire-flink-LIC4999',
|
251
|
+
},
|
252
|
+
];
|
253
|
+
|
254
|
+
const handleChange = (option: Option) => {
|
255
|
+
setSelectedOption(option);
|
256
|
+
};
|
257
|
+
|
258
|
+
const radioOptions = [
|
259
|
+
{
|
260
|
+
label: 'fire-flink-LIC4900-onPrem',
|
261
|
+
value: 'fire-flink-LIC4900-onPrem',
|
262
|
+
},
|
263
|
+
{
|
264
|
+
label: 'fire-flink-LIC3179',
|
265
|
+
value: 'fire-flink-LIC3179',
|
266
|
+
},
|
267
|
+
{
|
268
|
+
label: 'fire-flink-LIC4937',
|
269
|
+
value: 'fire-flink-LIC4937',
|
270
|
+
},
|
271
|
+
{
|
272
|
+
label: 'fire-flink-LIC4999',
|
273
|
+
value: 'fire-flink-LIC4999',
|
274
|
+
},
|
275
|
+
];
|
276
|
+
const [selectedRadioOption, setSelectedRadioOption] = useState('option2');
|
277
|
+
const handleOptionChange = (option: Option) => {
|
278
|
+
setSelectedRadioOption(option.value);
|
279
|
+
setSelectedOption(option);
|
280
|
+
};
|
281
|
+
|
282
|
+
return (
|
283
|
+
<div>
|
284
|
+
<Select
|
285
|
+
optionsList={optionsList}
|
286
|
+
selectedOption={selectedOption}
|
287
|
+
onChange={handleChange}
|
288
|
+
showLabel={false}
|
289
|
+
/>
|
290
|
+
<RadioGroup
|
291
|
+
selectedValue={selectedRadioOption}
|
292
|
+
onChange={handleOptionChange}
|
293
|
+
name="option"
|
294
|
+
options={radioOptions}
|
295
|
+
/>
|
296
|
+
</div>
|
297
|
+
);
|
298
|
+
},
|
299
|
+
};
|
300
|
+
|
158
301
|
export default meta;
|
@@ -251,6 +251,12 @@ const Select = ({
|
|
251
251
|
}
|
252
252
|
}, []);
|
253
253
|
|
254
|
+
useEffect(() => {
|
255
|
+
if (!checkEmpty(selectedOption.label)) {
|
256
|
+
onSelectOptionSelector(selectedOption);
|
257
|
+
}
|
258
|
+
}, [selectedOption]);
|
259
|
+
|
254
260
|
const applyActiveOptionClasses = !isInputFocused && Boolean(option);
|
255
261
|
|
256
262
|
return (
|
@@ -312,39 +318,41 @@ const Select = ({
|
|
312
318
|
color={iconColor}
|
313
319
|
/>
|
314
320
|
)}
|
315
|
-
|
316
|
-
|
317
|
-
'ff-select-fieldset
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
'ff-select-legend
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
321
|
+
{(!checkEmpty(option) || showOptions) && (
|
322
|
+
<fieldset
|
323
|
+
className={classNames('ff-select-fieldset', {
|
324
|
+
'ff-select-fieldset--no-label': !showLabel,
|
325
|
+
'ff-select-fieldset--default': !isInputFocused,
|
326
|
+
'ff-select-fieldset--active': isInputFocused,
|
327
|
+
'ff-select-fieldset--option': applyActiveOptionClasses,
|
328
|
+
'ff-select-fieldset--error': errorMsg,
|
329
|
+
'ff-select-fieldset--border-radius': !borderRadius,
|
330
|
+
'ff-select-fieldset--no-border': !showBorder,
|
331
|
+
})}
|
332
|
+
>
|
333
|
+
{showLabel && (
|
334
|
+
<legend
|
335
|
+
className={classNames('ff-select-legend', {
|
336
|
+
'ff-select-legend--default': !isInputFocused,
|
337
|
+
'ff-select-legend--active': isInputFocused,
|
338
|
+
'ff-select-legend--option': applyActiveOptionClasses,
|
339
|
+
'ff-select-legend--error': errorMsg,
|
340
|
+
})}
|
341
|
+
>
|
342
|
+
{required && (
|
343
|
+
<Typography
|
344
|
+
fontSize={8}
|
345
|
+
color={'var(--error-light)'}
|
346
|
+
className="ff-select-legend--required"
|
347
|
+
>
|
348
|
+
*
|
349
|
+
</Typography>
|
350
|
+
)}
|
351
|
+
{label}
|
352
|
+
</legend>
|
353
|
+
)}
|
354
|
+
</fieldset>
|
355
|
+
)}
|
348
356
|
</div>
|
349
357
|
|
350
358
|
{errorMsg && (
|
@@ -24,10 +24,10 @@
|
|
24
24
|
th {
|
25
25
|
@extend .fontMd;
|
26
26
|
border-bottom: 1px solid var(--slider-table-color);
|
27
|
-
text-transform: uppercase;
|
28
27
|
}
|
29
|
-
th
|
30
|
-
|
28
|
+
th{
|
29
|
+
.ff-label-checkbox-container{
|
30
|
+
display: flex;
|
31
31
|
align-items: center;
|
32
32
|
.ff-table-checkbox {
|
33
33
|
padding-right: 8px;
|
@@ -66,8 +66,9 @@
|
|
66
66
|
cursor: pointer;
|
67
67
|
}
|
68
68
|
}
|
69
|
-
td
|
70
|
-
|
69
|
+
td{
|
70
|
+
.ff-data-checkbox-container {
|
71
|
+
display: flex;
|
71
72
|
align-items: center;
|
72
73
|
.ff-table-checkbox {
|
73
74
|
padding-right: 8px;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { useEffect, useState } from 'react';
|
2
2
|
import { StoryObj, Meta } from '@storybook/react';
|
3
3
|
import Table from './Table';
|
4
|
-
import Icon from '../Icon';
|
5
4
|
|
6
5
|
const meta: Meta<typeof Table> = {
|
7
6
|
title: 'Components/Table',
|
@@ -160,14 +159,6 @@ const columnsData = [
|
|
160
159
|
return (
|
161
160
|
<div title={e.value} style={{ color: 'blue' }}>
|
162
161
|
{e.value}
|
163
|
-
<div style={{ textAlign: 'right' }} className="icon-container">
|
164
|
-
<span>
|
165
|
-
<Icon name="edit_icon" height={12} width={12} />
|
166
|
-
</span>
|
167
|
-
<span>
|
168
|
-
<Icon name="delete" height={12} width={12} />
|
169
|
-
</span>
|
170
|
-
</div>
|
171
162
|
</div>
|
172
163
|
);
|
173
164
|
},
|