pixel-react 1.2.7 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/Drawer/Types.d.ts +23 -12
- package/lib/components/Editor/Editor.d.ts +5 -0
- package/lib/components/Editor/Editor.stories.d.ts +6 -0
- package/lib/components/Editor/VariableDropdown.d.ts +5 -0
- package/lib/components/Editor/constants.d.ts +3 -0
- package/lib/components/Editor/index.d.ts +1 -0
- package/lib/components/Editor/types.d.ts +71 -0
- package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFile.d.ts +20 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.d.ts +7 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Cell.d.ts +4 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Copied.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataEditor.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/DataViewer.d.ts +8 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.d.ts +10 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/HeaderRow.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Row.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.d.ts +5 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Selected.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +80 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Table.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +203 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/areModelsEqual.d.ts +1 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/context.d.ts +8 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +22 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +17 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/index.d.ts +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +21 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-hash.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-set.d.ts +24 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/index.d.ts +13 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/matrix.d.ts +67 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/point-range.d.ts +22 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/point.d.ts +11 -0
- 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/Excel/ExcelFile/ExcelFileComponents/selection.d.ts +95 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +178 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-dispatch.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/use-selector.d.ts +3 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/util.d.ts +44 -0
- package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
- package/lib/components/Excel/ExcelToolBar/ExcelToolBar.d.ts +19 -0
- package/lib/components/Excel/Types.d.ts +129 -0
- package/lib/components/Excel/index.d.ts +1 -0
- package/lib/components/ExcelFile/ColorBarselector/ColorBarSelector.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +7 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +5 -49
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +48 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +12 -11
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +0 -16
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +0 -12
- package/lib/components/ExcelFile/Types.d.ts +49 -2
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/InputWithDropdown/types.d.ts +3 -1
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +4 -0
- package/lib/components/Select/Select.d.ts +3 -2
- package/lib/components/Select/Select.stories.d.ts +1 -0
- package/lib/components/Select/components/Dropdown.d.ts +5 -0
- package/lib/components/Select/components/types.d.ts +18 -0
- package/lib/components/Select/types.d.ts +2 -42
- package/lib/components/Toastify/Toastify.d.ts +5 -4
- package/lib/components/Toastify/types.d.ts +1 -0
- package/lib/index.d.ts +75 -30
- package/lib/index.esm.js +1734 -1441
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1734 -1440
- 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 +1 -1
- package/src/assets/Themes/BaseTheme.scss +5 -0
- package/src/assets/Themes/DarkTheme.scss +2 -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/Types.ts +24 -13
- 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/Icon/Icons.scss +4 -0
- package/src/components/Icon/iconList.ts +2 -1
- package/src/components/Input/Input.tsx +0 -1
- package/src/components/InputWithDropdown/InputWithDropdown.scss +30 -1
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +45 -16
- package/src/components/InputWithDropdown/types.ts +5 -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/MultiSelect/MultiSelect.scss +5 -1
- package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
- package/src/components/MultiSelect/MultiSelect.tsx +27 -14
- package/src/components/Select/Select.scss +121 -188
- package/src/components/Select/Select.stories.tsx +164 -18
- package/src/components/Select/Select.tsx +142 -290
- package/src/components/Select/components/Dropdown.scss +50 -0
- package/src/components/Select/components/Dropdown.tsx +94 -0
- package/src/components/Select/components/types.ts +20 -0
- package/src/components/Select/types.ts +15 -39
- 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/index.ts +4 -2
- package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +1 -1
- 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/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/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
@@ -20,8 +20,11 @@ const InputWithDropdown = ({
|
|
20
20
|
onInputChangeHandler,
|
21
21
|
onInputBlurHandler,
|
22
22
|
optionsRequired = true,
|
23
|
+
dropdownPosition = 'right',
|
24
|
+
type = 'text',
|
23
25
|
}: InputWithDropdownProps) => {
|
24
|
-
const isValueFilled = !checkEmpty(value);
|
26
|
+
const isValueFilled = !checkEmpty(value) || dropdownPosition==='left';
|
27
|
+
|
25
28
|
return (
|
26
29
|
<div
|
27
30
|
className={classNames('ff-input-with-dropdown-container', {
|
@@ -34,8 +37,29 @@ const InputWithDropdown = ({
|
|
34
37
|
'ff-input-with-dropdown--no-hover': isValueFilled,
|
35
38
|
'ff-input-with-dropdown--disabled': !!disabled,
|
36
39
|
'ff-input-with-dropdown--error': !!error,
|
40
|
+
[`ff-input-with-dropdown--${dropdownPosition}`]: dropdownPosition,
|
37
41
|
})}
|
38
42
|
>
|
43
|
+
{dropdownPosition === 'left' && (
|
44
|
+
<>
|
45
|
+
<Select
|
46
|
+
optionsList={optionsList}
|
47
|
+
selectedOption={selectedOption}
|
48
|
+
showLabel={false}
|
49
|
+
showBorder={false}
|
50
|
+
onChange={onDropdownChangeHandler}
|
51
|
+
disabled={disabled || !optionsRequired}
|
52
|
+
optionsRequired={optionsRequired}
|
53
|
+
className={classNames('ff-floating-dropdown', {
|
54
|
+
'ff-floating-dropdown--disabled': !!disabled,
|
55
|
+
'ff-floating-dropdown--error': !!error,
|
56
|
+
'ff-floating-dropdown--left': dropdownPosition === 'left'
|
57
|
+
})}
|
58
|
+
width={94}
|
59
|
+
/>
|
60
|
+
<div className='seperatorline'/>
|
61
|
+
</>
|
62
|
+
)}
|
39
63
|
<div className={classNames('ff-floating-label-input-container')}>
|
40
64
|
<Typography
|
41
65
|
as="label"
|
@@ -45,13 +69,13 @@ const InputWithDropdown = ({
|
|
45
69
|
'ff-floating-label--no-hover': isValueFilled,
|
46
70
|
'ff-floating-label--error': !!error,
|
47
71
|
})}
|
72
|
+
required={required}
|
48
73
|
>
|
49
|
-
{required && <span className="ff-required-asterisk">*</span>}{' '}
|
50
74
|
{label}
|
51
75
|
</Typography>
|
52
76
|
<input
|
53
77
|
name={name}
|
54
|
-
type=
|
78
|
+
type={type}
|
55
79
|
id={name}
|
56
80
|
value={value}
|
57
81
|
onChange={onInputChangeHandler}
|
@@ -63,22 +87,26 @@ const InputWithDropdown = ({
|
|
63
87
|
'ff-floating-input--filled': isValueFilled,
|
64
88
|
'ff-floating-input--disabled': !!disabled,
|
65
89
|
'ff-floating-input--error': !!error,
|
90
|
+
'ff-floating-input--left-dropdown': dropdownPosition === 'left',
|
66
91
|
})}
|
67
92
|
/>
|
68
93
|
</div>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
'ff-floating-dropdown
|
79
|
-
|
80
|
-
|
81
|
-
|
94
|
+
{dropdownPosition === 'right' && (
|
95
|
+
<Select
|
96
|
+
optionsList={optionsList}
|
97
|
+
selectedOption={selectedOption}
|
98
|
+
showLabel={false}
|
99
|
+
showBorder={false}
|
100
|
+
onChange={onDropdownChangeHandler}
|
101
|
+
disabled={disabled || !optionsRequired}
|
102
|
+
optionsRequired={optionsRequired}
|
103
|
+
className={classNames('ff-floating-dropdown', {
|
104
|
+
'ff-floating-dropdown--disabled': !!disabled,
|
105
|
+
'ff-floating-dropdown--error': !!error,
|
106
|
+
})}
|
107
|
+
width={120}
|
108
|
+
/>
|
109
|
+
)}
|
82
110
|
</fieldset>
|
83
111
|
{error && helperText && (
|
84
112
|
<span className="ff-helper-text">{helperText}</span>
|
@@ -87,4 +115,5 @@ const InputWithDropdown = ({
|
|
87
115
|
);
|
88
116
|
};
|
89
117
|
|
118
|
+
|
90
119
|
export default InputWithDropdown;
|
@@ -19,7 +19,9 @@ export interface InputWithDropdownProps {
|
|
19
19
|
/**
|
20
20
|
* value | input field value
|
21
21
|
*/
|
22
|
-
value?: number
|
22
|
+
value?: string | number
|
23
|
+
|
24
|
+
type?: 'text' | 'password' | 'number' | 'email' | 'url' | 'time'
|
23
25
|
|
24
26
|
/**
|
25
27
|
* variants to set color/style of the input field
|
@@ -106,4 +108,6 @@ export interface InputWithDropdownProps {
|
|
106
108
|
* optionsRequired:false prop removes options from dropdown & shows static label only
|
107
109
|
*/
|
108
110
|
optionsRequired?: boolean;
|
111
|
+
|
112
|
+
dropdownPosition?: 'left' | 'right'
|
109
113
|
}
|
@@ -28,6 +28,7 @@ export const DefaultMenuOption: Story = {
|
|
28
28
|
icon: 'success',
|
29
29
|
},
|
30
30
|
],
|
31
|
+
zIndex:1000000,
|
31
32
|
},
|
32
33
|
};
|
33
34
|
|
@@ -139,6 +140,7 @@ export const MenuOptionWithDisabledHoverEffect: Story = {
|
|
139
140
|
icon: 'success',
|
140
141
|
},
|
141
142
|
];
|
143
|
+
const zIndex=1000000;
|
142
144
|
return (
|
143
145
|
<MenuOption
|
144
146
|
iconName="more"
|
@@ -146,6 +148,7 @@ export const MenuOptionWithDisabledHoverEffect: Story = {
|
|
146
148
|
tooltipPlacement="top"
|
147
149
|
dropdownPlacement="right"
|
148
150
|
options={options}
|
151
|
+
zIndex={zIndex}
|
149
152
|
/>
|
150
153
|
);
|
151
154
|
},
|
@@ -52,6 +52,7 @@ const MenuOption = ({
|
|
52
52
|
iconButtonBorderRadius = 7,
|
53
53
|
iconSize = 16,
|
54
54
|
variant = 'light',
|
55
|
+
zIndex=1000,
|
55
56
|
}: MenuOptionProps) => {
|
56
57
|
const [isClicked, setIsClicked] = useState(false);
|
57
58
|
const menuRef = useRef<HTMLDivElement>(null);
|
@@ -71,14 +72,14 @@ const MenuOption = ({
|
|
71
72
|
const dropdownPositionStyles = () => {
|
72
73
|
switch (dropdownPlacement) {
|
73
74
|
case 'top':
|
74
|
-
return { bottom: '100%', left: -2 };
|
75
|
+
return { bottom: '100%', left: -2 ,zIndex};
|
75
76
|
case 'left':
|
76
|
-
return { top: -2, right: '100%' };
|
77
|
+
return { top: -2, right: '100%' ,zIndex};
|
77
78
|
case 'right':
|
78
|
-
return { top: -2, left: '100%' };
|
79
|
+
return { top: -2, left: '100%' ,zIndex};
|
79
80
|
case 'down':
|
80
81
|
default:
|
81
|
-
return { top: '100%', left: -2 };
|
82
|
+
return { top: '100%', left: -2 ,zIndex};
|
82
83
|
}
|
83
84
|
};
|
84
85
|
|
@@ -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;
|
@@ -96,6 +98,8 @@
|
|
96
98
|
.ff-multiselect-chip-close-icon {
|
97
99
|
color: var(--brand-color);
|
98
100
|
cursor: pointer;
|
101
|
+
padding-right: 0px;
|
102
|
+
padding-left: 0px;
|
99
103
|
}
|
100
104
|
}
|
101
105
|
.ff-multiselect-input-container {
|
@@ -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'}
|
@@ -20,7 +20,11 @@ const ChipElement = ({
|
|
20
20
|
if (label) {
|
21
21
|
return (
|
22
22
|
<div className="ff-multiselect-chip">
|
23
|
-
<span
|
23
|
+
<span
|
24
|
+
className={`ff-multiselect-chip-label ${
|
25
|
+
disableChip && 'label-padding'
|
26
|
+
}`}
|
27
|
+
>
|
24
28
|
<Tooltip
|
25
29
|
placement="bottom"
|
26
30
|
title={label?.length > 25 ? label : ''}
|
@@ -60,9 +64,6 @@ const MultiSelect = ({
|
|
60
64
|
}: MultiSelectProps) => {
|
61
65
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
62
66
|
const [allOptions, setAllOptions] = useState(options);
|
63
|
-
useEffect(() => {
|
64
|
-
setAllOptions(options);
|
65
|
-
}, [options]);
|
66
67
|
|
67
68
|
const [searchedKeyword, setSearchedKeyword] = useState('');
|
68
69
|
const [isSelectFocusedOnce, setIsSelectFocusedOnce] =
|
@@ -186,12 +187,20 @@ const MultiSelect = ({
|
|
186
187
|
calculatePosition();
|
187
188
|
}
|
188
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
|
+
}
|
189
199
|
const onSelectToggleScroll = (isEnabled: boolean) => {
|
190
|
-
const bodyScrollWidth =
|
200
|
+
const bodyScrollWidth = getScrollbarWidth();
|
191
201
|
document.body.style.paddingRight = isEnabled ? '' : `${bodyScrollWidth}px`;
|
192
202
|
document.body.style.overflow = isEnabled ? '' : 'hidden';
|
193
203
|
};
|
194
|
-
|
195
204
|
useEffect(() => {
|
196
205
|
if (isOpen) {
|
197
206
|
onSelectToggleScroll(!isOpen);
|
@@ -215,6 +224,8 @@ const MultiSelect = ({
|
|
215
224
|
}));
|
216
225
|
setAllOptions(initializeOptions);
|
217
226
|
}
|
227
|
+
}, [options]);
|
228
|
+
useEffect(() => {
|
218
229
|
const handleClickAnywhere = (event: MouseEvent) => {
|
219
230
|
if (
|
220
231
|
dropdownWrapper.current &&
|
@@ -240,6 +251,7 @@ const MultiSelect = ({
|
|
240
251
|
document.body.style.overflow = 'auto';
|
241
252
|
};
|
242
253
|
}, []);
|
254
|
+
|
243
255
|
return (
|
244
256
|
<div
|
245
257
|
ref={selectWrapper}
|
@@ -261,9 +273,10 @@ const MultiSelect = ({
|
|
261
273
|
selectedOptions?.length ||
|
262
274
|
(isFieldSkipped && required),
|
263
275
|
'default-label': !isOpen && !selectedOptions?.length,
|
264
|
-
})}
|
265
|
-
|
266
|
-
|
276
|
+
})}>
|
277
|
+
{required && <span className="ff-required-asterisk">*</span>}
|
278
|
+
{label}
|
279
|
+
</Typography>
|
267
280
|
|
268
281
|
<div className="ff-multiselect-chip-container">
|
269
282
|
{displayCount ? (
|
@@ -306,11 +319,11 @@ const MultiSelect = ({
|
|
306
319
|
</div>
|
307
320
|
</div>
|
308
321
|
</div>
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
322
|
+
{hiddenCount > 0 && displayCount && (
|
323
|
+
<div className="ff-multiselect-more-chip" onClick={toggleDropdown}>
|
324
|
+
+{hiddenCount}
|
325
|
+
</div>
|
326
|
+
)}
|
314
327
|
<div onClick={toggleDropdown} className="ff-multiselect__toggle">
|
315
328
|
<Icon
|
316
329
|
name="arrow_down"
|