pixel-react-excel-sheet 1.0.11 → 1.0.13
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/.yarn/install-state.gz +0 -0
- package/lib/1fb4472b34e4fe07.css +1 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/types.d.ts +12 -0
- package/lib/components/AddVariables/AddVariables.d.ts +5 -0
- package/lib/components/AddVariables/index.d.ts +1 -0
- package/lib/components/AddVariables/types.d.ts +35 -0
- package/lib/components/AppHeader/types.d.ts +2 -0
- package/lib/components/AttachImage/AttachImage.d.ts +1 -6
- package/lib/components/AttachImage/types.d.ts +8 -0
- package/lib/components/Avatar/types.d.ts +9 -1
- package/lib/components/Charts/BarChart/BarChart.d.ts +1 -0
- package/lib/components/Charts/DashboardDonutChart/types.d.ts +6 -0
- package/lib/components/Checkbox/types.d.ts +4 -0
- package/lib/components/Comment/Comments.d.ts +4 -0
- package/lib/components/Comment/comment/Comment.d.ts +11 -0
- package/lib/components/Comment/comment/useNode.d.ts +7 -0
- package/lib/components/Comment/index.d.ts +1 -0
- package/lib/components/Comment/type.d.ts +25 -0
- package/lib/components/CreateVariable/CreateVariableSlider.d.ts +5 -0
- package/lib/components/CreateVariable/index.d.ts +1 -0
- package/lib/components/CreateVariable/types.d.ts +56 -0
- package/lib/components/Drawer/Types.d.ts +13 -0
- package/lib/components/Editor/constants.d.ts +1 -1
- package/lib/components/Editor/types.d.ts +10 -2
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +8 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +2 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +13 -6
- package/lib/components/FileDropzone/RadioFilePreview.d.ts +4 -0
- package/lib/components/FileDropzone/types.d.ts +61 -0
- package/lib/components/IconButton/IconButton.d.ts +1 -2
- package/lib/components/IconButton/types.d.ts +1 -0
- package/lib/components/Input/Input.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +3 -2
- package/lib/components/MiniModal/types.d.ts +7 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/PhoneInput/PhoneInput.d.ts +6 -0
- package/lib/components/PhoneInput/index.d.ts +1 -0
- package/lib/components/PhoneInput/types.d.ts +10 -0
- package/lib/components/PopUpModal/types.d.ts +1 -0
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/types.d.ts +4 -0
- package/lib/components/Select/components/types.d.ts +1 -0
- package/lib/components/Select/types.d.ts +2 -0
- package/lib/components/Table/Types.d.ts +1 -1
- package/lib/components/TableTree/Components/TableBody.d.ts +4 -0
- package/lib/components/TableTree/Components/TableCell.d.ts +4 -0
- package/lib/components/TableTree/Components/TableHead.d.ts +4 -0
- package/lib/components/TableTree/Components/TableRow.d.ts +4 -0
- package/lib/components/TableTree/Utils/getAllChildIds.d.ts +1 -0
- package/lib/components/TableTree/types.d.ts +38 -5
- package/lib/components/TableWithAccordion/TableWithAccordion.d.ts +5 -0
- package/lib/components/TableWithAccordion/data.d.ts +8 -0
- package/lib/components/TableWithAccordion/index.d.ts +1 -0
- package/lib/components/TableWithAccordion/types.d.ts +67 -0
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +395 -39
- package/lib/index.esm.js +3859 -1017
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3866 -1016
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/FormatString/FormatString.d.ts +1 -0
- package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
- package/package.json +2 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +15 -0
- package/src/assets/Themes/BaseTheme.scss +16 -0
- package/src/assets/Themes/DarkTheme.scss +71 -42
- package/src/assets/icons/add_file.svg +4 -17
- package/src/assets/icons/add_variable.svg +11 -0
- package/src/assets/icons/authorization.svg +4 -0
- package/src/assets/icons/authorization_icon.svg +1 -0
- package/src/assets/icons/backward.svg +10 -0
- package/src/assets/icons/capture_icon.svg +3 -0
- package/src/assets/icons/depends_on_script.svg +7 -0
- package/src/assets/icons/download_file_icon.svg +2 -9
- package/src/assets/icons/email_group.svg +3 -0
- package/src/assets/icons/executions_icon.svg +3 -0
- package/src/assets/icons/forward.svg +3 -0
- package/src/assets/icons/labels.svg +8 -0
- package/src/assets/icons/machine_disable_icon.svg +18 -0
- package/src/assets/icons/machine_enable_icon.svg +10 -0
- package/src/assets/icons/parameters.svg +3 -0
- package/src/assets/icons/pre_post_condition.svg +8 -0
- package/src/assets/icons/program_element.svg +8 -0
- package/src/assets/icons/project_status_icon.svg +10 -0
- package/src/assets/icons/refresh_icon.svg +4 -0
- package/src/assets/icons/rotate_icon.svg +10 -0
- package/src/assets/icons/suites_icon.svg +3 -0
- package/src/assets/icons/swipe_icon.svg +9 -0
- package/src/assets/icons/tap_icon.svg +4 -0
- package/src/assets/icons/test_data.svg +5 -0
- package/src/assets/icons/test_data_set.svg +7 -0
- package/src/assets/icons/variable_set.svg +5 -0
- package/src/assets/icons/window_maximize.svg +1 -2
- package/src/assets/icons/window_restore.svg +4 -0
- package/src/assets/styles/_colors.scss +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/Accordion/Accordion.tsx +7 -1
- package/src/components/Accordion/types.ts +12 -0
- package/src/components/AddVariables/AddVariables.scss +14 -0
- package/src/components/AddVariables/AddVariables.stories.tsx +44 -0
- package/src/components/AddVariables/AddVariables.tsx +113 -0
- package/src/components/AddVariables/index.ts +1 -0
- package/src/components/AddVariables/types.ts +36 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +1 -1
- package/src/components/AppHeader/AppHeader.scss +40 -1
- package/src/components/AppHeader/AppHeader.stories.tsx +133 -5
- package/src/components/AppHeader/AppHeader.tsx +111 -112
- package/src/components/AppHeader/types.ts +10 -9
- package/src/components/AttachImage/AttachImage.stories.tsx +2 -0
- package/src/components/AttachImage/AttachImage.tsx +5 -9
- package/src/components/AttachImage/types.ts +25 -18
- package/src/components/Avatar/Avatar.scss +4 -0
- package/src/components/Avatar/Avatar.stories.tsx +38 -18
- package/src/components/Avatar/Avatar.tsx +19 -3
- package/src/components/Avatar/types.ts +9 -1
- package/src/components/Charts/BarChart/BarChart.scss +4 -1
- package/src/components/Charts/BarChart/BarChart.tsx +23 -9
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +10 -3
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +2 -1
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +54 -25
- package/src/components/Charts/DashboardDonutChart/types.ts +7 -1
- package/src/components/Charts/DonutChart/DonutChart.tsx +8 -3
- package/src/components/Charts/LineChart/LineChart.scss +13 -9
- package/src/components/Charts/LineChart/LineChart.tsx +6 -2
- package/src/components/Charts/RadialChart/RadialChart.scss +4 -0
- package/src/components/Charts/RadialChart/RadialChart.tsx +51 -45
- package/src/components/Checkbox/Checkbox.scss +57 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +91 -15
- package/src/components/Checkbox/Checkbox.tsx +4 -1
- package/src/components/Checkbox/types.ts +4 -0
- package/src/components/Comment/Comments.scss +166 -0
- package/src/components/Comment/Comments.stories.tsx +212 -0
- package/src/components/Comment/Comments.tsx +51 -0
- package/src/components/Comment/comment/Comment.tsx +206 -0
- package/src/components/Comment/comment/useNode.ts +51 -0
- package/src/components/Comment/index.ts +1 -0
- package/src/components/Comment/type.ts +36 -0
- package/src/components/CreateVariable/CreateVariableSlider.scss +18 -0
- package/src/components/CreateVariable/CreateVariableSlider.stories.tsx +66 -0
- package/src/components/CreateVariable/CreateVariableSlider.tsx +95 -0
- package/src/components/CreateVariable/index.ts +1 -0
- package/src/components/CreateVariable/types.ts +58 -0
- package/src/components/DatePicker/DatePicker.scss +11 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +19 -0
- package/src/components/DatePicker/DatePicker.tsx +73 -22
- package/src/components/Drawer/Drawer.scss +3 -2
- package/src/components/Drawer/Drawer.stories.tsx +0 -1
- package/src/components/Drawer/Drawer.tsx +4 -1
- package/src/components/Drawer/Types.ts +13 -0
- package/src/components/Editor/Editor.stories.tsx +2 -2
- package/src/components/Editor/Editor.tsx +4 -2
- package/src/components/Editor/VariableDropdown.scss +8 -2
- package/src/components/Editor/VariableDropdown.tsx +15 -7
- package/src/components/Editor/constants.ts +1 -1
- package/src/components/Editor/types.ts +12 -2
- package/src/components/Excel/ExcelFile/ExcelFile.scss +0 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +41 -25
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +12 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +2 -34
- package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +26 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +24 -22
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +1 -3
- package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +13 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +53 -26
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +81 -14
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +17 -6
- package/src/components/Excel/ExcelFile.stories.tsx +4 -4
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +36 -19
- package/src/components/Excel/dataConversion.ts +43 -20
- package/src/components/FieldSet/FieldSet.scss +2 -1
- package/src/components/FieldSet/FieldSet.stories.tsx +2 -1
- package/src/components/FileDropzone/Dropzone.tsx +76 -28
- package/src/components/FileDropzone/FileDropzone.scss +30 -3
- package/src/components/FileDropzone/FileDropzone.stories.tsx +125 -4
- package/src/components/FileDropzone/FileDropzone.tsx +46 -13
- package/src/components/FileDropzone/RadioFilePreview.tsx +76 -0
- package/src/components/FileDropzone/types.ts +73 -0
- package/src/components/Icon/iconList.ts +47 -2
- package/src/components/IconButton/IconButton.scss +11 -11
- package/src/components/IconButton/IconButton.stories.tsx +1 -0
- package/src/components/IconButton/IconButton.tsx +6 -8
- package/src/components/IconButton/types.ts +2 -1
- package/src/components/IconRadioGroup/IconRadioGroup.scss +2 -1
- package/src/components/Input/Input.scss +137 -125
- package/src/components/Input/Input.tsx +110 -93
- package/src/components/InputWithDropdown/InputWithDropdown.scss +9 -2
- package/src/components/InputWithDropdown/types.ts +3 -3
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
- package/src/components/MenuOption/MenuOption.stories.tsx +4 -3
- package/src/components/MenuOption/MenuOption.tsx +1 -1
- package/src/components/MenuOption/types.ts +4 -2
- package/src/components/MiniModal/MiniModal.scss +0 -4
- package/src/components/MiniModal/MiniModal.stories.tsx +3 -2
- package/src/components/MiniModal/MiniModal.tsx +28 -10
- package/src/components/MiniModal/types.ts +7 -0
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/ModulesChip/ModuleChip.scss +21 -8
- package/src/components/ModulesChip/ModuleChip.stories.tsx +2 -2
- package/src/components/ModulesChip/ModuleChip.tsx +6 -9
- package/src/components/MultiSelect/Dropdown.tsx +12 -5
- package/src/components/MultiSelect/MultiSelect.scss +29 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +31 -14
- package/src/components/MultiSelect/MultiSelect.tsx +32 -21
- package/src/components/PhoneInput/PhoneInput.d.ts +3 -0
- package/src/components/PhoneInput/PhoneInput.stories.tsx +95 -0
- package/src/components/PhoneInput/PhoneInput.tsx +90 -0
- package/src/components/PhoneInput/index.ts +1 -0
- package/src/components/PhoneInput/phoneInput.scss +3 -0
- package/src/components/PhoneInput/types.ts +10 -0
- package/src/components/PopUpModal/PopUpModal.stories.tsx +14 -13
- package/src/components/PopUpModal/PopUpModal.tsx +2 -1
- package/src/components/PopUpModal/types.ts +14 -13
- package/src/components/Search/Search.stories.tsx +28 -9
- package/src/components/Search/Search.tsx +32 -29
- package/src/components/Search/types.ts +4 -0
- package/src/components/Select/Select.scss +20 -0
- package/src/components/Select/Select.stories.tsx +50 -1
- package/src/components/Select/Select.tsx +34 -7
- package/src/components/Select/components/Dropdown.scss +9 -0
- package/src/components/Select/components/Dropdown.tsx +20 -6
- package/src/components/Select/components/types.ts +1 -0
- package/src/components/Select/types.ts +12 -2
- package/src/components/Table/Table.scss +6 -5
- package/src/components/Table/Types.ts +1 -1
- package/src/components/TableTree/Components/TableBody.tsx +35 -0
- package/src/components/TableTree/Components/TableCell.tsx +59 -0
- package/src/components/TableTree/Components/TableHead.tsx +39 -0
- package/src/components/TableTree/Components/TableRow.tsx +37 -0
- package/src/components/TableTree/TableTree.scss +8 -5
- package/src/components/TableTree/TableTree.tsx +16 -46
- package/src/components/TableTree/Utils/getAllChildIds.ts +12 -0
- package/src/components/TableTree/Utils/renderSpaces.ts +0 -0
- package/src/components/TableTree/types.ts +43 -5
- package/src/components/TableWithAccordion/TableWithAccordion.scss +54 -0
- package/src/components/TableWithAccordion/TableWithAccordion.stories.tsx +94 -0
- package/src/components/TableWithAccordion/TableWithAccordion.tsx +174 -0
- package/src/components/TableWithAccordion/data.ts +37 -0
- package/src/components/TableWithAccordion/index.ts +1 -0
- package/src/components/TableWithAccordion/types.ts +70 -0
- package/src/components/Tabs/Tabs.scss +58 -5
- package/src/components/Tabs/Tabs.stories.tsx +31 -12
- package/src/components/Tabs/Tabs.tsx +27 -18
- package/src/components/Tabs/types.ts +1 -1
- package/src/components/TextArea/Textarea.stories.tsx +1 -1
- package/src/hooks/useFileDropzone.tsx +2 -1
- package/src/index.ts +18 -1
- package/src/utils/FormatString/FormatString.stories.tsx +58 -0
- package/src/utils/FormatString/FormatString.tsx +41 -0
- package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
- package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
|
@@ -1,103 +1,120 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
1
2
|
import classNames from 'classnames';
|
|
2
3
|
import './Input.scss';
|
|
3
4
|
import { InputProps } from './types';
|
|
4
5
|
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
|
5
6
|
|
|
6
|
-
const Input = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'ff-input-container--disabled': !!disabled,
|
|
36
|
-
})}
|
|
37
|
-
>
|
|
38
|
-
{isLabelRequired && (
|
|
39
|
-
<label
|
|
40
|
-
htmlFor={name}
|
|
41
|
-
className={classNames(
|
|
42
|
-
`ff-input-label-container ff-input-label-container--${size}`,
|
|
43
|
-
{
|
|
44
|
-
'ff-input-label-container--danger': !!error,
|
|
45
|
-
}
|
|
46
|
-
)}
|
|
47
|
-
>
|
|
48
|
-
{required && <span className="required-asterisk">*</span>}
|
|
49
|
-
<span
|
|
50
|
-
className={classNames(`ff-input-label ff-input-label--${variant}`, {
|
|
51
|
-
'ff-input-label--no-hover': !!value,
|
|
52
|
-
'ff-input-label--disabled': !!disabled,
|
|
53
|
-
'ff-input-label--danger': !!error,
|
|
54
|
-
})}
|
|
55
|
-
>
|
|
56
|
-
{label}
|
|
57
|
-
</span>
|
|
58
|
-
</label>
|
|
59
|
-
)}
|
|
7
|
+
const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
8
|
+
(
|
|
9
|
+
{
|
|
10
|
+
type = 'text',
|
|
11
|
+
variant = 'primary',
|
|
12
|
+
name = '',
|
|
13
|
+
label,
|
|
14
|
+
disabled = false,
|
|
15
|
+
required = false,
|
|
16
|
+
placeholder = 'Enter input',
|
|
17
|
+
value = '',
|
|
18
|
+
helperText = '',
|
|
19
|
+
error,
|
|
20
|
+
noBorder,
|
|
21
|
+
className = '',
|
|
22
|
+
onChange,
|
|
23
|
+
onBlur,
|
|
24
|
+
onFocus,
|
|
25
|
+
autoComplete = 'off',
|
|
26
|
+
minValue = -Infinity,
|
|
27
|
+
maxValue = Infinity,
|
|
28
|
+
transparentBackground = false,
|
|
29
|
+
size = 'small',
|
|
30
|
+
isLabelRequired = true,
|
|
31
|
+
...props
|
|
32
|
+
},
|
|
33
|
+
ref
|
|
34
|
+
) => {
|
|
35
|
+
const isValueFilled = !checkEmpty(value);
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
'ff-input--no-hover': !!value,
|
|
72
|
-
'ff-input--disabled': !!disabled,
|
|
73
|
-
'ff-input--danger': !!error,
|
|
74
|
-
'ff-input--no-border': !!noBorder,
|
|
75
|
-
'ff-input--placeholder': !isLabelRequired,
|
|
76
|
-
},
|
|
77
|
-
`${className}`
|
|
78
|
-
)}
|
|
79
|
-
placeholder={placeholder}
|
|
80
|
-
disabled={disabled}
|
|
81
|
-
onChange={onChange}
|
|
82
|
-
onFocus={onFocus}
|
|
83
|
-
onBlur={onBlur}
|
|
84
|
-
autoComplete={autoComplete}
|
|
85
|
-
min={minValue}
|
|
86
|
-
max={maxValue}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
|
|
90
|
-
{helperText && error && (
|
|
91
|
-
<span
|
|
92
|
-
className={classNames('ff-input-message', {
|
|
93
|
-
'ff-input-message--danger': !!error,
|
|
37
|
+
return (
|
|
38
|
+
<fieldset
|
|
39
|
+
className={classNames('ff-input-fieldset', {
|
|
40
|
+
'ff-input-fieldset--disabled': disabled,
|
|
41
|
+
})}
|
|
42
|
+
>
|
|
43
|
+
<div
|
|
44
|
+
className={classNames('ff-input-container', {
|
|
45
|
+
'ff-input-container--float': isValueFilled,
|
|
46
|
+
'ff-input-container--disabled': !!disabled,
|
|
94
47
|
})}
|
|
95
48
|
>
|
|
96
|
-
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
49
|
+
{isLabelRequired && (
|
|
50
|
+
<label
|
|
51
|
+
htmlFor={name}
|
|
52
|
+
className={classNames(
|
|
53
|
+
`ff-input-label-container ff-input-label-container--${size}`,
|
|
54
|
+
{
|
|
55
|
+
'ff-input-label-container--danger': !!error,
|
|
56
|
+
}
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
{required && <span className="required-asterisk">*</span>}
|
|
60
|
+
<span
|
|
61
|
+
className={classNames(
|
|
62
|
+
`ff-input-label ff-input-label--${variant}`,
|
|
63
|
+
{
|
|
64
|
+
'ff-input-label--no-hover': !!value,
|
|
65
|
+
'ff-input-label--disabled': !!disabled,
|
|
66
|
+
'ff-input-label--danger': !!error,
|
|
67
|
+
}
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
{label}
|
|
71
|
+
</span>
|
|
72
|
+
</label>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
<input
|
|
76
|
+
ref={ref} // Forward the ref here
|
|
77
|
+
name={name}
|
|
78
|
+
value={value}
|
|
79
|
+
type={type}
|
|
80
|
+
spellCheck={false}
|
|
81
|
+
id={name}
|
|
82
|
+
className={classNames(
|
|
83
|
+
`ff-input ff-input-${variant} default-input ff-input--${size}`,
|
|
84
|
+
{
|
|
85
|
+
['ff-input--transparentBackground']: !!transparentBackground,
|
|
86
|
+
'ff-input--no-hover': !!value,
|
|
87
|
+
'ff-input--disabled': !!disabled,
|
|
88
|
+
'ff-input--danger': !!error,
|
|
89
|
+
'ff-input--no-border': !!noBorder,
|
|
90
|
+
'ff-input--placeholder': !isLabelRequired,
|
|
91
|
+
},
|
|
92
|
+
`${className}`
|
|
93
|
+
)}
|
|
94
|
+
placeholder={placeholder}
|
|
95
|
+
disabled={disabled}
|
|
96
|
+
onChange={onChange}
|
|
97
|
+
onFocus={onFocus}
|
|
98
|
+
onBlur={onBlur}
|
|
99
|
+
autoComplete={autoComplete}
|
|
100
|
+
min={minValue}
|
|
101
|
+
max={maxValue}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
{helperText && error && (
|
|
106
|
+
<span
|
|
107
|
+
className={classNames('ff-input-message', {
|
|
108
|
+
'ff-input-message--danger': !!error,
|
|
109
|
+
})}
|
|
110
|
+
>
|
|
111
|
+
{helperText}
|
|
112
|
+
</span>
|
|
113
|
+
)}
|
|
114
|
+
</div>
|
|
115
|
+
</fieldset>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
102
119
|
|
|
103
120
|
export default Input;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
border-radius: 4px;
|
|
11
11
|
padding: 0;
|
|
12
12
|
position: relative;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
|
|
13
15
|
.ff-input-with-dropdown--left {
|
|
14
16
|
display: flex;
|
|
15
17
|
flex-direction: row-reverse;
|
|
@@ -24,6 +26,8 @@
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
.ff-floating-label-input-container {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex: 1;
|
|
27
31
|
.ff-floating-label {
|
|
28
32
|
position: absolute;
|
|
29
33
|
z-index: 9;
|
|
@@ -48,7 +52,7 @@
|
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
.ff-floating-input {
|
|
51
|
-
|
|
55
|
+
width: 100%;
|
|
52
56
|
padding: 6px 7px;
|
|
53
57
|
line-height: 18px;
|
|
54
58
|
border: none;
|
|
@@ -92,7 +96,7 @@
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
.ff-floating-dropdown {
|
|
95
|
-
|
|
99
|
+
width: 100%;
|
|
96
100
|
border: none;
|
|
97
101
|
outline: none;
|
|
98
102
|
margin: 0;
|
|
@@ -100,6 +104,9 @@
|
|
|
100
104
|
&:disabled {
|
|
101
105
|
cursor: not-allowed;
|
|
102
106
|
}
|
|
107
|
+
&:hover {
|
|
108
|
+
background-color: var(--dropdown-bg-color);
|
|
109
|
+
}
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
.ff-floating-dropdown--left {
|
|
@@ -19,9 +19,9 @@ export interface InputWithDropdownProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* value | input field value
|
|
21
21
|
*/
|
|
22
|
-
value?: string | number
|
|
22
|
+
value?: string | number;
|
|
23
23
|
|
|
24
|
-
type?: 'text' | 'password' | 'number' | 'email' | 'url' | 'time'
|
|
24
|
+
type?: 'text' | 'password' | 'number' | 'email' | 'url' | 'time';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* variants to set color/style of the input field
|
|
@@ -109,5 +109,5 @@ export interface InputWithDropdownProps {
|
|
|
109
109
|
*/
|
|
110
110
|
optionsRequired?: boolean;
|
|
111
111
|
|
|
112
|
-
dropdownPosition?: 'left' | 'right'
|
|
112
|
+
dropdownPosition?: 'left' | 'right';
|
|
113
113
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import MenuOption from './MenuOption';
|
|
3
3
|
import './MenuOption.scss';
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { ReactNode } from 'react';
|
|
5
|
+
import Icon from '../Icon';
|
|
5
6
|
|
|
6
7
|
const meta: Meta<typeof MenuOption> = {
|
|
7
8
|
title: 'Components/MenuOption',
|
|
@@ -48,7 +49,7 @@ const meta: Meta<typeof MenuOption> = {
|
|
|
48
49
|
type Story = StoryObj<typeof MenuOption>;
|
|
49
50
|
|
|
50
51
|
const options = [
|
|
51
|
-
{ label:
|
|
52
|
+
{ label: <div style={{display:'flex', justifyContent:"center", alignItems:"center",gap:"8px"}}>hello <Icon name='edit'/></div>, value: 'opt1', icon: 'success' },
|
|
52
53
|
{ label: 'Option 2', value: 'opt2', icon: 'success' },
|
|
53
54
|
{
|
|
54
55
|
label: 'Delete',
|
|
@@ -58,7 +59,7 @@ const options = [
|
|
|
58
59
|
},
|
|
59
60
|
];
|
|
60
61
|
|
|
61
|
-
const handleOptionClick = (option: { label: string }) => {
|
|
62
|
+
const handleOptionClick = (option: { label: string|ReactNode }) => {
|
|
62
63
|
alert(`Option clicked: ${option.label}`);
|
|
63
64
|
};
|
|
64
65
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
1
3
|
interface OptionClick {
|
|
2
4
|
/**
|
|
3
5
|
* The label displayed for the option.
|
|
4
6
|
* @type {string}
|
|
5
7
|
* @required
|
|
6
8
|
*/
|
|
7
|
-
label: string;
|
|
9
|
+
label: string |ReactNode;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* The value(s) associated with the option, which can be a single string or an array of strings.
|
|
@@ -24,7 +26,7 @@ interface OptionType extends OptionClick {
|
|
|
24
26
|
|
|
25
27
|
iconColor?: string;
|
|
26
28
|
|
|
27
|
-
name?: string;
|
|
29
|
+
name?: string | ReactNode;
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* Indicates whether the option is disabled.
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
&.popover-arrow-top {
|
|
36
36
|
bottom: 100%;
|
|
37
37
|
left: 30px;
|
|
38
|
-
border-width: 0 10px 10px 10px;
|
|
39
38
|
padding: 0 3px 0 0;
|
|
40
39
|
border-color: transparent transparent var(--ff-mini-modal-border)
|
|
41
40
|
transparent;
|
|
@@ -46,7 +45,6 @@
|
|
|
46
45
|
}
|
|
47
46
|
&.popover-arrow-left {
|
|
48
47
|
left: -15px; //align the arrow with modal for the right side modal
|
|
49
|
-
border-width: 10px 10px 10px 0;
|
|
50
48
|
border-color: transparent var(--ff-mini-modal-border) transparent
|
|
51
49
|
transparent;
|
|
52
50
|
filter: drop-shadow(-1px 0 1px var(--ff-mini-modal-arrow-shadow));
|
|
@@ -58,7 +56,6 @@
|
|
|
58
56
|
&.popover-arrow-bottom {
|
|
59
57
|
top: 100%;
|
|
60
58
|
left: 30px;
|
|
61
|
-
border-width: 10px 10px 0 10px;
|
|
62
59
|
border-color: var(--ff-mini-modal-border) transparent transparent
|
|
63
60
|
transparent; // Bottom part of the arrow with the correct color
|
|
64
61
|
filter: drop-shadow(0 2px 1px var(--ff-mini-modal-arrow-shadow));
|
|
@@ -70,7 +67,6 @@
|
|
|
70
67
|
&.popover-arrow-right {
|
|
71
68
|
right: -10px;
|
|
72
69
|
top: 66px;
|
|
73
|
-
border-width: 10px 0 10px 10px;
|
|
74
70
|
border-color: transparent transparent transparent
|
|
75
71
|
var(--ff-mini-modal-border);
|
|
76
72
|
filter: drop-shadow(2px 0 1px var(--ff-mini-modal-arrow-shadow));
|
|
@@ -55,7 +55,7 @@ const BasicModalComponent = () => {
|
|
|
55
55
|
isOverlay: true,
|
|
56
56
|
zIndexOverlay: 99,
|
|
57
57
|
}}
|
|
58
|
-
modalProperties={{ width: 300, height: 180 }}
|
|
58
|
+
modalProperties={{ width: 300, height: 180, left: 180, top: 250 }}
|
|
59
59
|
headerProps={
|
|
60
60
|
<>
|
|
61
61
|
<Typography as="p">Modal 1</Typography>
|
|
@@ -271,7 +271,8 @@ export const CustomModalWithArrow = () => {
|
|
|
271
271
|
isOverlay: true,
|
|
272
272
|
zIndexOverlay: 99,
|
|
273
273
|
}}
|
|
274
|
-
modalProperties={{ width: 300, height: 250 }}
|
|
274
|
+
modalProperties={{ width: 300, height: 250, left: 180 }}
|
|
275
|
+
arrowProperties={{ left: 270, size: 6 }}
|
|
275
276
|
arrowZIndex={1000}
|
|
276
277
|
headerProps={
|
|
277
278
|
<>
|
|
@@ -31,6 +31,7 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
|
31
31
|
extraLeftSpace,
|
|
32
32
|
isIconModel,
|
|
33
33
|
wrapperProperties,
|
|
34
|
+
arrowProperties,
|
|
34
35
|
arrowZIndex,
|
|
35
36
|
overlay,
|
|
36
37
|
outSideClick,
|
|
@@ -43,7 +44,21 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
|
43
44
|
});
|
|
44
45
|
const [isVisible, setIsVisible] = useState(false);
|
|
45
46
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
47
|
+
const {
|
|
48
|
+
width: modalWidth,
|
|
49
|
+
height: modalHeight,
|
|
50
|
+
borderRadius: modalBorderRadius = 4,
|
|
51
|
+
zIndex: modalZIndex = 99,
|
|
52
|
+
boxShadow: modalBoxShadow,
|
|
53
|
+
left: modalLeft,
|
|
54
|
+
top: modalTop,
|
|
55
|
+
} = modalProperties || {};
|
|
46
56
|
|
|
57
|
+
const {
|
|
58
|
+
left: popOverLeft,
|
|
59
|
+
top: popOverTop,
|
|
60
|
+
size: popOverSize = 10,
|
|
61
|
+
} = arrowProperties || {};
|
|
47
62
|
// Function to calculate available space
|
|
48
63
|
const getAvailableSpace = (rect: Rect): AvailableSpace => {
|
|
49
64
|
const { top, left, bottom, right } = rect;
|
|
@@ -196,14 +211,6 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
|
196
211
|
};
|
|
197
212
|
}, [calculatePosition]);
|
|
198
213
|
|
|
199
|
-
const {
|
|
200
|
-
width: modalWidth,
|
|
201
|
-
height: modalHeight,
|
|
202
|
-
borderRadius: modalBorderRadius = 4,
|
|
203
|
-
zIndex: modalZIndex = 99,
|
|
204
|
-
boxShadow: modalBoxShadow,
|
|
205
|
-
} = modalProperties || {};
|
|
206
|
-
|
|
207
214
|
const {
|
|
208
215
|
width: wrapperWidth = 35,
|
|
209
216
|
zIndex: wrapperZIndex = 101,
|
|
@@ -234,8 +241,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
|
234
241
|
animatedModal: isAnimated,
|
|
235
242
|
})}
|
|
236
243
|
style={{
|
|
237
|
-
top: `${calculatedModalTop}px`,
|
|
238
|
-
left: `${calculatedModalLeft}px`,
|
|
244
|
+
top: `${modalTop ?? calculatedModalTop}px`,
|
|
245
|
+
left: `${modalLeft ?? calculatedModalLeft}px`,
|
|
239
246
|
}}
|
|
240
247
|
>
|
|
241
248
|
{isPopOver && (
|
|
@@ -251,6 +258,17 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
|
|
|
251
258
|
} ${getArrowClassName()}`}
|
|
252
259
|
style={{
|
|
253
260
|
zIndex: `${arrowZIndex}`,
|
|
261
|
+
top: `${popOverTop && popOverTop}px`,
|
|
262
|
+
left: `${popOverLeft && popOverLeft}px`,
|
|
263
|
+
borderWidth: `${
|
|
264
|
+
modalPosition === 'right'
|
|
265
|
+
? `${popOverSize}px ${popOverSize}px ${popOverSize}px 0`
|
|
266
|
+
: modalPosition === 'top'
|
|
267
|
+
? `${popOverSize}px ${popOverSize}px 0 ${popOverSize}px`
|
|
268
|
+
: modalPosition === 'left'
|
|
269
|
+
? `${popOverSize}px 0 ${popOverSize}px ${popOverSize}px`
|
|
270
|
+
: `0 ${popOverSize}px ${popOverSize}px ${popOverSize}px`
|
|
271
|
+
}`,
|
|
254
272
|
}}
|
|
255
273
|
/>
|
|
256
274
|
)}
|
|
@@ -5,6 +5,8 @@ interface ModalDimensions {
|
|
|
5
5
|
borderRadius?: number;
|
|
6
6
|
zIndex?: number;
|
|
7
7
|
boxShadow?: string;
|
|
8
|
+
left?: number;
|
|
9
|
+
top?: number;
|
|
8
10
|
}
|
|
9
11
|
export interface MiniEditModalProps {
|
|
10
12
|
/**
|
|
@@ -94,6 +96,11 @@ export interface MiniEditModalProps {
|
|
|
94
96
|
boxShadow?: string;
|
|
95
97
|
};
|
|
96
98
|
arrowZIndex?: number;
|
|
99
|
+
arrowProperties?: {
|
|
100
|
+
left?: number;
|
|
101
|
+
top?: number;
|
|
102
|
+
size?: number;
|
|
103
|
+
};
|
|
97
104
|
overlay?: {
|
|
98
105
|
isOverlay?: boolean;
|
|
99
106
|
zIndexOverlay?: number;
|
|
@@ -2,19 +2,32 @@
|
|
|
2
2
|
@use '../../assets/styles/mixins';
|
|
3
3
|
|
|
4
4
|
.ff-Module-chip {
|
|
5
|
-
width:
|
|
6
|
-
height:
|
|
7
|
-
|
|
5
|
+
width: 68px;
|
|
6
|
+
height: 30px;
|
|
7
|
+
color: var(--table-column-text-color);
|
|
8
|
+
border: 1px solid var(--ff-editor-line-bg);
|
|
8
9
|
border-radius: 16px;
|
|
9
|
-
color: var(--brand-color);
|
|
10
10
|
cursor: pointer;
|
|
11
11
|
@include mixins.center-content();
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
color: var(--ff-header-text-color);
|
|
15
|
-
}
|
|
12
|
+
.module-typography {
|
|
13
|
+
color: var(--table-column-text-color);
|
|
16
14
|
}
|
|
17
15
|
&--active {
|
|
16
|
+
border: 0.5px solid var(--brand-color);
|
|
18
17
|
background: var(--brand-color);
|
|
18
|
+
.module-typography {
|
|
19
|
+
color: var(--base-bg-color);
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&--hover {
|
|
24
|
+
&:hover {
|
|
25
|
+
border: 0.5px solid var(--brand-color);
|
|
26
|
+
background-color: var(--hover-color);
|
|
27
|
+
.module-typography {
|
|
28
|
+
color: var(--table-column-text-color);
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
19
32
|
}
|
|
20
33
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
import ModuleChip from './ModuleChip';
|
|
3
4
|
import { useState } from 'react';
|
|
@@ -6,7 +7,7 @@ const meta: Meta<typeof ModuleChip> = {
|
|
|
6
7
|
title: 'Components/ModuleChip',
|
|
7
8
|
component: ModuleChip,
|
|
8
9
|
parameters: {
|
|
9
|
-
layout: '
|
|
10
|
+
layout: 'centered',
|
|
10
11
|
},
|
|
11
12
|
argTypes: {
|
|
12
13
|
isActive: Boolean,
|
|
@@ -18,7 +19,6 @@ type Story = StoryObj<typeof ModuleChip>;
|
|
|
18
19
|
|
|
19
20
|
const defaultArgs = {
|
|
20
21
|
label: 'Modules',
|
|
21
|
-
isActive: false,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const Controlled: Story = {
|
|
@@ -12,18 +12,15 @@ const ModuleChip: React.FC<ModuleChipProps> = ({
|
|
|
12
12
|
<div
|
|
13
13
|
className={classNames('ff-Module-chip', {
|
|
14
14
|
'ff-Module-chip--active': isActive,
|
|
15
|
+
'ff-Module-chip--hover': !isActive,
|
|
15
16
|
})}
|
|
16
17
|
onClick={onClick}
|
|
17
18
|
>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
<Typography fontSize={'14px'} fontWeight="regular" lineHeight="21px">
|
|
24
|
-
{label}
|
|
25
|
-
</Typography>
|
|
26
|
-
</div>
|
|
19
|
+
<Typography
|
|
20
|
+
lineHeight="18px"
|
|
21
|
+
className="module-typography"
|
|
22
|
+
children={label}
|
|
23
|
+
/>
|
|
27
24
|
</div>
|
|
28
25
|
);
|
|
29
26
|
};
|
|
@@ -9,7 +9,7 @@ import Typography from '../Typography';
|
|
|
9
9
|
import Checkbox from '../Checkbox';
|
|
10
10
|
import Tooltip from '../Tooltip';
|
|
11
11
|
import { truncateText } from '../../utils/truncateText/truncateText';
|
|
12
|
-
import { getLabel } from '../../utils/getSelectOptionValue/getSelectOptionValue';
|
|
12
|
+
import { getLabel, getValue } from '../../utils/getSelectOptionValue/getSelectOptionValue';
|
|
13
13
|
|
|
14
14
|
const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
15
15
|
(
|
|
@@ -20,13 +20,14 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
20
20
|
dropdownPosition = {},
|
|
21
21
|
zIndex,
|
|
22
22
|
withSelectButton,
|
|
23
|
-
labelAccessor,
|
|
23
|
+
labelAccessor='label',
|
|
24
|
+
valueAccessor='value'
|
|
24
25
|
},
|
|
25
26
|
ref
|
|
26
27
|
) => {
|
|
27
28
|
const filteredOptions = options
|
|
28
29
|
? options.filter((option) =>
|
|
29
|
-
|
|
30
|
+
getValue(option, valueAccessor)
|
|
30
31
|
?.toLowerCase()
|
|
31
32
|
.includes(searchedKeyword.toLowerCase())
|
|
32
33
|
)
|
|
@@ -38,6 +39,12 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
38
39
|
e.stopPropagation();
|
|
39
40
|
handleOptionChange({}, false);
|
|
40
41
|
};
|
|
42
|
+
const renderOption=(info:any, labelAccessor:string)=>{
|
|
43
|
+
if(typeof info[labelAccessor] ==='string'){
|
|
44
|
+
return truncateText(getLabel(info, labelAccessor), 25)
|
|
45
|
+
}
|
|
46
|
+
return info[labelAccessor]
|
|
47
|
+
}
|
|
41
48
|
const topPosition = useMemo(() => {
|
|
42
49
|
let calculatedDropdownHeight = Math.min(
|
|
43
50
|
filteredOptions.length * optionHeight,
|
|
@@ -107,14 +114,14 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
|
|
|
107
114
|
<Tooltip
|
|
108
115
|
zIndex={zIndex + 1}
|
|
109
116
|
title={
|
|
110
|
-
|
|
117
|
+
typeof info[labelAccessor]==='string' && getLabel(info, labelAccessor)?.length > 25
|
|
111
118
|
? getLabel(info, labelAccessor)
|
|
112
119
|
: ''
|
|
113
120
|
}
|
|
114
121
|
children={
|
|
115
122
|
<Typography
|
|
116
123
|
className="dropdown-option-label"
|
|
117
|
-
children={
|
|
124
|
+
children={renderOption(info,labelAccessor)}
|
|
118
125
|
/>
|
|
119
126
|
}
|
|
120
127
|
/>
|