pixel-react-excel-sheet 1.0.19 → 1.0.21
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/lib/components/Chip/types.d.ts +1 -1
- package/lib/components/ConditionalDropdown/ConditionalDropdown.d.ts +5 -0
- package/lib/components/ConditionalDropdown/OptionsDropdown.d.ts +5 -0
- package/lib/components/ConditionalDropdown/index.d.ts +1 -0
- package/lib/components/ConditionalDropdown/types.d.ts +145 -0
- package/lib/components/CreateVariable/types.d.ts +2 -2
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/LabelEditTextField/types.d.ts +1 -0
- package/lib/components/MachineInputField/types.d.ts +1 -0
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +2 -1
- package/lib/components/MiniModal/types.d.ts +1 -0
- package/lib/components/Modal/types.d.ts +1 -1
- package/lib/components/NLPInput/NlpInput.d.ts +2 -2
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropDownType.d.ts +6 -3
- package/lib/components/NLPInput/components/NlpDropDown/NlpDropdown.d.ts +1 -1
- package/lib/components/NLPInput/sampleData.d.ts +104 -0
- package/lib/components/NLPInput/types.d.ts +80 -0
- package/lib/components/PopUpModal/types.d.ts +2 -1
- package/lib/components/ProgressBar/ProgressBar.d.ts +5 -0
- package/lib/components/ProgressBar/index.d.ts +1 -0
- package/lib/components/ProgressBar/types.d.ts +12 -0
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +1 -1
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/types.d.ts +1 -1
- package/lib/components/TableTree/TableTree.d.ts +2 -2
- package/lib/components/TableTree/Utils/getAllChildIds.d.ts +1 -0
- package/lib/components/TableTree/types.d.ts +1 -1
- package/lib/hooks/useIntersectionObserver.d.ts +9 -0
- package/lib/index.d.ts +154 -37
- package/lib/index.esm.js +817 -516
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +818 -516
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/functionCheck/functionCheck.d.ts +2 -0
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +5 -0
- package/src/assets/Themes/BaseTheme.scss +18 -3
- package/src/assets/Themes/DarkTheme.scss +15 -2
- package/src/assets/icons/ai_search.svg +9 -0
- package/src/assets/icons/help_icon.svg +10 -0
- package/src/assets/icons/import_icon.svg +4 -0
- package/src/assets/icons/ios_icon.svg +11 -0
- package/src/assets/icons/plus_round_icon.svg +38 -0
- package/src/assets/icons/tick_icon.svg +2 -2
- package/src/assets/styles/_colors.scss +1 -1
- package/src/components/AttachmentButton/AttachmentButton.tsx +1 -1
- package/src/components/Checkbox/Checkbox.scss +3 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +32 -77
- package/src/components/Checkbox/Checkbox.tsx +3 -4
- package/src/components/Chip/Chip.scss +15 -5
- package/src/components/Chip/Chip.stories.tsx +10 -1
- package/src/components/Chip/Chip.tsx +5 -1
- package/src/components/Chip/types.ts +1 -1
- package/src/components/{AddVariables/AddVariables.scss → ConditionalDropdown/ConditionalDropdown.scss} +4 -0
- package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +147 -0
- package/src/components/ConditionalDropdown/ConditionalDropdown.tsx +159 -0
- package/src/components/ConditionalDropdown/OptionsDropdown.tsx +44 -0
- package/src/components/ConditionalDropdown/index.ts +1 -0
- package/src/components/ConditionalDropdown/types.ts +160 -0
- package/src/components/CreateVariable/CreateVariableSlider.tsx +2 -2
- package/src/components/CreateVariable/types.ts +2 -2
- package/src/components/EditTextField/EditTextField.scss +1 -1
- package/src/components/EditTextField/EditTextField.tsx +14 -20
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +9 -26
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +4 -2
- package/src/components/Excel/ExcelFile.stories.tsx +1 -1
- package/src/components/Form/Forms.tsx +0 -2
- package/src/components/Icon/iconList.ts +12 -0
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +102 -95
- package/src/components/LabelEditTextField/LabelEditTextField.scss +1 -1
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +29 -36
- package/src/components/LabelEditTextField/types.ts +1 -0
- package/src/components/MachineInputField/MachineInputField.scss +1 -5
- package/src/components/MachineInputField/MachineInputField.stories.tsx +4 -4
- package/src/components/MachineInputField/MachineInputField.tsx +4 -1
- package/src/components/MachineInputField/types.ts +1 -0
- package/src/components/MenuOption/MenuOption.scss +7 -7
- package/src/components/MenuOption/MenuOption.stories.tsx +83 -28
- package/src/components/MenuOption/MenuOption.tsx +9 -13
- package/src/components/MenuOption/types.ts +3 -2
- package/src/components/MiniModal/MiniModal.scss +0 -1
- package/src/components/MiniModal/MiniModal.stories.tsx +6 -1
- package/src/components/MiniModal/MiniModal.tsx +3 -1
- package/src/components/MiniModal/types.ts +1 -0
- package/src/components/Modal/types.ts +1 -1
- package/src/components/MultiSelect/Dropdown.scss +3 -4
- package/src/components/MultiSelect/Dropdown.tsx +4 -3
- package/src/components/MultiSelect/MultiSelect.scss +1 -0
- package/src/components/MultiSelect/MultiSelect.tsx +1 -0
- package/src/components/NLPInput/NLPInput.scss +77 -21
- package/src/components/NLPInput/NlpInput.stories.tsx +43 -109
- package/src/components/NLPInput/NlpInput.tsx +95 -59
- package/src/components/NLPInput/components/NlpDropDown/NlpDropDownType.ts +6 -4
- package/src/components/NLPInput/components/NlpDropDown/NlpDropdown.scss +86 -35
- package/src/components/NLPInput/components/NlpDropDown/NlpDropdown.tsx +220 -80
- package/src/components/NLPInput/sampleData.ts +162 -0
- package/src/components/NLPInput/{type.tsx → types.tsx} +23 -11
- package/src/components/PopUpModal/PopUpModal.stories.tsx +15 -10
- package/src/components/PopUpModal/PopUpModal.tsx +5 -4
- package/src/components/PopUpModal/types.ts +2 -1
- package/src/components/ProgressBar/ProgressBar.scss +46 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +22 -0
- package/src/components/ProgressBar/ProgressBar.tsx +61 -0
- package/src/components/ProgressBar/index.ts +1 -0
- package/src/components/ProgressBar/types.ts +12 -0
- package/src/components/Search/Search.tsx +9 -1
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +8 -0
- package/src/components/SequentialConnectingBranch/components/Branches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +2 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +1 -0
- package/src/components/SequentialConnectingBranch/types.ts +1 -1
- package/src/components/Table/Table.scss +1 -0
- package/src/components/TableTree/Components/TableBody.tsx +3 -1
- package/src/components/TableTree/TableTree.stories.tsx +4 -7
- package/src/components/TableTree/TableTree.tsx +29 -181
- package/src/components/TableTree/Utils/getAllChildIds.ts +2 -0
- package/src/components/TableTree/data.ts +45 -0
- package/src/components/TableTree/types.ts +1 -1
- package/src/hooks/useIntersectionObserver.tsx +56 -0
- package/src/index.ts +4 -3
- package/src/utils/functionCheck/functionCheck.ts +8 -0
- package/src/components/AddVariables/AddVariables.stories.tsx +0 -44
- package/src/components/AddVariables/AddVariables.tsx +0 -113
- package/src/components/AddVariables/index.ts +0 -1
- package/src/components/AddVariables/types.ts +0 -36
|
@@ -103,33 +103,8 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
|
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
return (
|
|
106
|
-
// <th
|
|
107
|
-
// style={{ minWidth: `${columnWidth}px`, position: 'relative' }} //Dynamic value, Inline Styling required
|
|
108
|
-
// className={classNames('ff-spreadsheet-header', {
|
|
109
|
-
// 'ff-spreadsheet-header--selected': selected,
|
|
110
|
-
// })}
|
|
111
|
-
// onClick={handleClick}
|
|
112
|
-
// onContextMenu={contextClick}
|
|
113
|
-
// tabIndex={0}
|
|
114
|
-
// >
|
|
115
|
-
// {label !== undefined ? label : columnIndexToLabel(column)}
|
|
116
|
-
// <div
|
|
117
|
-
// onMouseDown={onMouseDown}
|
|
118
|
-
// onClick={() => activate({ row: -1, column })}
|
|
119
|
-
// style={{
|
|
120
|
-
// zIndex: 'inherit',
|
|
121
|
-
// width: '2px',
|
|
122
|
-
// position: 'absolute',
|
|
123
|
-
// right: 0,
|
|
124
|
-
// top: 0,
|
|
125
|
-
// height: '100%',
|
|
126
|
-
// cursor: 'ew-resize',
|
|
127
|
-
// }}
|
|
128
|
-
// />
|
|
129
|
-
// </th>
|
|
130
|
-
|
|
131
106
|
<th
|
|
132
|
-
style={{ minWidth: `${columnWidth}px
|
|
107
|
+
style={{ minWidth: `${columnWidth}px`, position: 'relative' }}
|
|
133
108
|
className={classNames('ff-spreadsheet-header', {
|
|
134
109
|
'ff-spreadsheet-header--selected': selected,
|
|
135
110
|
})}
|
|
@@ -137,7 +112,15 @@ const ColumnIndicator: Types.ColumnIndicatorComponent = ({
|
|
|
137
112
|
onContextMenu={contextClick}
|
|
138
113
|
tabIndex={0}
|
|
139
114
|
>
|
|
115
|
+
<div
|
|
116
|
+
style={{ position: 'fixed' }}
|
|
117
|
+
onClick={handleClick}
|
|
118
|
+
onContextMenu={contextClick}
|
|
119
|
+
tabIndex={0}>
|
|
120
|
+
|
|
121
|
+
</div>
|
|
140
122
|
{label !== undefined ? label : columnIndexToLabel(column)}
|
|
123
|
+
|
|
141
124
|
<div
|
|
142
125
|
onMouseDown={onMouseDown}
|
|
143
126
|
onClick={() => activate({ row: -1, column })}
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.ff-spreadsheet-corner-header{
|
|
103
|
-
|
|
103
|
+
padding-left: 20px;
|
|
104
104
|
z-index: 1100;
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -109,12 +109,14 @@
|
|
|
109
109
|
color: var(--tooltip-text-color);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
.ff-spreadsheet-header,
|
|
113
112
|
.ff-spreadsheet-data-viewer,
|
|
114
113
|
.ff-spreadsheet-data-editor input {
|
|
115
114
|
padding: 4px;
|
|
116
115
|
box-sizing: border-box;
|
|
117
116
|
}
|
|
117
|
+
.ff-spreadsheet-header{
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
}
|
|
118
120
|
|
|
119
121
|
.ff-spreadsheet-data-viewer--preserve-breaks {
|
|
120
122
|
white-space: pre-wrap;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
2
2
|
import Form from './Form';
|
|
3
|
-
|
|
4
3
|
interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
|
5
4
|
id?: string;
|
|
6
5
|
onSubmit: Form.SubmitHandler<T>;
|
|
@@ -16,7 +15,6 @@ const Forms = <T extends Form.FieldValues>(
|
|
|
16
15
|
ref: React.Ref<any>
|
|
17
16
|
) => {
|
|
18
17
|
const methods = Form.useForm<T>(rest);
|
|
19
|
-
|
|
20
18
|
const { handleSubmit } = methods;
|
|
21
19
|
const extendedMethods = {
|
|
22
20
|
...methods,
|
|
@@ -117,6 +117,8 @@ import HideAccessIcon from '../../assets/icons/hide_access_icon.svg?react';
|
|
|
117
117
|
import AddLocator from '../../assets/icons/add_locator.svg?react';
|
|
118
118
|
import PlusUserIcon from '../../assets/icons/plus_user_icon.svg?react';
|
|
119
119
|
|
|
120
|
+
import IosIcon from '../../assets/icons/ios_icon.svg?react';
|
|
121
|
+
import HelpIcon from '../../assets/icons/help_icon.svg?react';
|
|
120
122
|
import SwitchLicenseIcon from '../../assets/icons/switch_license_icon.svg?react';
|
|
121
123
|
import FireflinkLogo from '../../assets/icons/fireflink_logo.svg?react';
|
|
122
124
|
import WSWBDeleteIcon from '../../assets/icons/wswb_delete_icon.svg?react';
|
|
@@ -142,6 +144,7 @@ import NotificationIcon from '../../assets/icons/notification_icon.svg?react';
|
|
|
142
144
|
import NLPHelpIcon from '../../assets/icons/nlp_help_icon.svg?react';
|
|
143
145
|
import UpdateIcon from '../../assets/icons/update_icon.svg?react';
|
|
144
146
|
import AddFile from '../../assets/icons/add_file.svg?react';
|
|
147
|
+
import PlusRoundIcon from '../../assets/icons/plus_round_icon.svg?react';
|
|
145
148
|
import EyeClosed from '../../assets/icons/eye_closed.svg?react';
|
|
146
149
|
import AttachmentIcon from '../../assets/icons/attachment_icon.svg?react';
|
|
147
150
|
import AuthorizationIcon from '../../assets/icons/authorization_icon.svg?react';
|
|
@@ -192,6 +195,8 @@ import SystemWarning from '../../assets/icons/system_warning.svg?react';
|
|
|
192
195
|
import UserPasswordLock from '../../assets/icons/user_password_lock.svg?react';
|
|
193
196
|
import UserWarning from '../../assets/icons/user_warning.svg?react';
|
|
194
197
|
import UserWithSystem from '../../assets/icons/user_with_system.svg?react';
|
|
198
|
+
import AiSearch from '../../assets/icons/ai_search.svg?react';
|
|
199
|
+
|
|
195
200
|
import Import from '../../assets/icons/import.svg?react';
|
|
196
201
|
import dashboardWebIcon from '../../assets/icons/dashboard_web_icon.svg?react';
|
|
197
202
|
import dashboardMobileIcon from '../../assets/icons/dashboard_mobile_icon.svg?react';
|
|
@@ -246,6 +251,7 @@ import machineEnableIcon from '../../assets/icons/machine_enable_icon.svg?react'
|
|
|
246
251
|
import machineDisableIcon from '../../assets/icons/machine_disable_icon.svg?react';
|
|
247
252
|
import suitesIcon from '../../assets/icons/suites_icon.svg?react';
|
|
248
253
|
import executionsIcon from '../../assets/icons/executions_icon.svg?react';
|
|
254
|
+
import ImportIcon from '../../assets/icons/import_icon.svg?react';
|
|
249
255
|
|
|
250
256
|
Components['success'] = ToastSuccessIcon;
|
|
251
257
|
Components['alert'] = Alert;
|
|
@@ -351,6 +357,8 @@ Components['android_icon'] = AndroidIcon;
|
|
|
351
357
|
Components['plus_user_icon'] = PlusUserIcon;
|
|
352
358
|
Components['label_plus'] = LabelPlusIcon;
|
|
353
359
|
Components['manual_locator'] = ManualLocator;
|
|
360
|
+
Components['ios_icon'] = IosIcon;
|
|
361
|
+
Components['help_icon'] = HelpIcon;
|
|
354
362
|
Components['select_license'] = SwitchLicenseIcon;
|
|
355
363
|
Components['fireflink-logo'] = FireflinkLogo;
|
|
356
364
|
Components['wswb_delete_icon'] = WSWBDeleteIcon;
|
|
@@ -382,6 +390,7 @@ Components['notification_icon'] = NotificationIcon;
|
|
|
382
390
|
Components['nlp_help_icon'] = NLPHelpIcon;
|
|
383
391
|
Components['update_icon'] = UpdateIcon;
|
|
384
392
|
Components['add_file'] = AddFile;
|
|
393
|
+
Components['plus_round_icon'] = PlusRoundIcon;
|
|
385
394
|
Components['clone_icon'] = CloneIcon;
|
|
386
395
|
Components['move_icon'] = MoveIcon;
|
|
387
396
|
Components['jira'] = Jira;
|
|
@@ -394,6 +403,7 @@ Components['hide_access_icon'] = HideAccessIcon;
|
|
|
394
403
|
Components['eye_closed'] = EyeClosed;
|
|
395
404
|
Components['attachment_icon'] = AttachmentIcon;
|
|
396
405
|
Components['authorization_icon'] = AuthorizationIcon;
|
|
406
|
+
Components['ai_search'] = AiSearch;
|
|
397
407
|
|
|
398
408
|
Components['fireflink_platform_logo'] = FireflinkPlatform;
|
|
399
409
|
Components['fireflink_finder_logo'] = FireflinkFinder;
|
|
@@ -488,4 +498,6 @@ Components['machine_enable_icon'] = machineEnableIcon;
|
|
|
488
498
|
Components['machine_disable_icon'] = machineDisableIcon;
|
|
489
499
|
Components['executions_icon'] = executionsIcon;
|
|
490
500
|
Components['suites_icon'] = suitesIcon;
|
|
501
|
+
Components['import_icon'] = ImportIcon;
|
|
502
|
+
|
|
491
503
|
export default Components;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
1
2
|
import classNames from 'classnames';
|
|
2
3
|
import './InputWithDropdown.scss';
|
|
3
4
|
import { InputWithDropdownProps } from './types';
|
|
@@ -5,44 +6,101 @@ import Select from '../Select/Select';
|
|
|
5
6
|
import Typography from '../Typography';
|
|
6
7
|
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
|
7
8
|
|
|
8
|
-
const InputWithDropdown = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
const InputWithDropdown = forwardRef<HTMLInputElement, InputWithDropdownProps>(
|
|
10
|
+
(
|
|
11
|
+
{
|
|
12
|
+
name = '',
|
|
13
|
+
label,
|
|
14
|
+
value,
|
|
15
|
+
disabled = false,
|
|
16
|
+
required = false,
|
|
17
|
+
placeholder,
|
|
18
|
+
error,
|
|
19
|
+
helperText,
|
|
20
|
+
optionsList,
|
|
21
|
+
selectedOption,
|
|
22
|
+
autoComplete = 'off',
|
|
23
|
+
onDropdownChangeHandler = () => {},
|
|
24
|
+
onInputChangeHandler,
|
|
25
|
+
onInputBlurHandler,
|
|
26
|
+
optionsRequired = true,
|
|
27
|
+
dropdownPosition = 'right',
|
|
28
|
+
type = 'text',
|
|
29
|
+
},
|
|
30
|
+
ref
|
|
31
|
+
) => {
|
|
32
|
+
const isValueFilled = !checkEmpty(value) || dropdownPosition === 'left';
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})}
|
|
34
|
-
>
|
|
35
|
-
<fieldset
|
|
36
|
-
className={classNames('ff-input-with-dropdown', {
|
|
37
|
-
'ff-input-with-dropdown--filled': isValueFilled,
|
|
38
|
-
'ff-input-with-dropdown--no-hover': isValueFilled,
|
|
39
|
-
'ff-input-with-dropdown--disabled': !!disabled,
|
|
40
|
-
'ff-input-with-dropdown--error': !!error,
|
|
41
|
-
[`ff-input-with-dropdown--${dropdownPosition}`]: dropdownPosition,
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
className={classNames('ff-input-with-dropdown-container', {
|
|
37
|
+
'ff-input-with-dropdown-container--filled': isValueFilled,
|
|
42
38
|
})}
|
|
43
39
|
>
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
<fieldset
|
|
41
|
+
className={classNames('ff-input-with-dropdown', {
|
|
42
|
+
'ff-input-with-dropdown--filled': isValueFilled,
|
|
43
|
+
'ff-input-with-dropdown--no-hover': isValueFilled,
|
|
44
|
+
'ff-input-with-dropdown--disabled': !!disabled,
|
|
45
|
+
'ff-input-with-dropdown--error': !!error,
|
|
46
|
+
[`ff-input-with-dropdown--${dropdownPosition}`]: dropdownPosition,
|
|
47
|
+
})}
|
|
48
|
+
>
|
|
49
|
+
{dropdownPosition === 'left' && (
|
|
50
|
+
<>
|
|
51
|
+
<Select
|
|
52
|
+
optionsList={optionsList}
|
|
53
|
+
selectedOption={selectedOption}
|
|
54
|
+
showLabel={false}
|
|
55
|
+
showBorder={false}
|
|
56
|
+
onChange={onDropdownChangeHandler}
|
|
57
|
+
disabled={disabled || !optionsRequired}
|
|
58
|
+
optionsRequired={optionsRequired}
|
|
59
|
+
className={classNames('ff-floating-dropdown', {
|
|
60
|
+
'ff-floating-dropdown--disabled': !!disabled,
|
|
61
|
+
'ff-floating-dropdown--error': !!error,
|
|
62
|
+
'ff-floating-dropdown--left': dropdownPosition === 'left',
|
|
63
|
+
})}
|
|
64
|
+
width={94}
|
|
65
|
+
height={30}
|
|
66
|
+
/>
|
|
67
|
+
<div className="seperatorline" />
|
|
68
|
+
</>
|
|
69
|
+
)}
|
|
70
|
+
<div className={classNames('ff-floating-label-input-container')}>
|
|
71
|
+
<Typography
|
|
72
|
+
as="label"
|
|
73
|
+
htmlFor={name}
|
|
74
|
+
className={classNames('ff-floating-label', {
|
|
75
|
+
'ff-floating-label--filled': isValueFilled,
|
|
76
|
+
'ff-floating-label--no-hover': isValueFilled,
|
|
77
|
+
'ff-floating-label--error': !!error,
|
|
78
|
+
})}
|
|
79
|
+
required={required}
|
|
80
|
+
>
|
|
81
|
+
{label}
|
|
82
|
+
</Typography>
|
|
83
|
+
<input
|
|
84
|
+
ref={ref}
|
|
85
|
+
name={name}
|
|
86
|
+
type={type}
|
|
87
|
+
id={name}
|
|
88
|
+
value={value}
|
|
89
|
+
onChange={onInputChangeHandler}
|
|
90
|
+
onBlur={onInputBlurHandler}
|
|
91
|
+
placeholder={placeholder}
|
|
92
|
+
autoComplete={autoComplete}
|
|
93
|
+
required={required}
|
|
94
|
+
disabled={disabled}
|
|
95
|
+
className={classNames('ff-floating-input', {
|
|
96
|
+
'ff-floating-input--filled': isValueFilled,
|
|
97
|
+
'ff-floating-input--disabled': !!disabled,
|
|
98
|
+
'ff-floating-input--error': !!error,
|
|
99
|
+
'ff-floating-input--left-dropdown': dropdownPosition === 'left',
|
|
100
|
+
})}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
{dropdownPosition === 'right' && (
|
|
46
104
|
<Select
|
|
47
105
|
optionsList={optionsList}
|
|
48
106
|
selectedOption={selectedOption}
|
|
@@ -54,69 +112,18 @@ const InputWithDropdown = ({
|
|
|
54
112
|
className={classNames('ff-floating-dropdown', {
|
|
55
113
|
'ff-floating-dropdown--disabled': !!disabled,
|
|
56
114
|
'ff-floating-dropdown--error': !!error,
|
|
57
|
-
'ff-floating-dropdown--left': dropdownPosition === 'left',
|
|
58
115
|
})}
|
|
59
|
-
width={
|
|
116
|
+
width={120}
|
|
60
117
|
height={30}
|
|
61
118
|
/>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<Typography
|
|
67
|
-
as="label"
|
|
68
|
-
htmlFor={name}
|
|
69
|
-
className={classNames('ff-floating-label', {
|
|
70
|
-
'ff-floating-label--filled': isValueFilled,
|
|
71
|
-
'ff-floating-label--no-hover': isValueFilled,
|
|
72
|
-
'ff-floating-label--error': !!error,
|
|
73
|
-
})}
|
|
74
|
-
required={required}
|
|
75
|
-
>
|
|
76
|
-
{label}
|
|
77
|
-
</Typography>
|
|
78
|
-
<input
|
|
79
|
-
name={name}
|
|
80
|
-
type={type}
|
|
81
|
-
id={name}
|
|
82
|
-
value={value}
|
|
83
|
-
onChange={onInputChangeHandler}
|
|
84
|
-
onBlur={onInputBlurHandler}
|
|
85
|
-
placeholder={placeholder}
|
|
86
|
-
autoComplete={autoComplete}
|
|
87
|
-
required={required}
|
|
88
|
-
disabled={disabled}
|
|
89
|
-
className={classNames('ff-floating-input', {
|
|
90
|
-
'ff-floating-input--filled': isValueFilled,
|
|
91
|
-
'ff-floating-input--disabled': !!disabled,
|
|
92
|
-
'ff-floating-input--error': !!error,
|
|
93
|
-
'ff-floating-input--left-dropdown': dropdownPosition === 'left',
|
|
94
|
-
})}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
{dropdownPosition === 'right' && (
|
|
98
|
-
<Select
|
|
99
|
-
optionsList={optionsList}
|
|
100
|
-
selectedOption={selectedOption}
|
|
101
|
-
showLabel={false}
|
|
102
|
-
showBorder={false}
|
|
103
|
-
onChange={onDropdownChangeHandler}
|
|
104
|
-
disabled={disabled || !optionsRequired}
|
|
105
|
-
optionsRequired={optionsRequired}
|
|
106
|
-
className={classNames('ff-floating-dropdown', {
|
|
107
|
-
'ff-floating-dropdown--disabled': !!disabled,
|
|
108
|
-
'ff-floating-dropdown--error': !!error,
|
|
109
|
-
})}
|
|
110
|
-
width={120}
|
|
111
|
-
height={30}
|
|
112
|
-
/>
|
|
119
|
+
)}
|
|
120
|
+
</fieldset>
|
|
121
|
+
{error && helperText && (
|
|
122
|
+
<span className="ff-helper-text">{helperText}</span>
|
|
113
123
|
)}
|
|
114
|
-
</
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</div>
|
|
119
|
-
);
|
|
120
|
-
};
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
121
128
|
|
|
122
129
|
export default InputWithDropdown;
|
|
@@ -5,6 +5,8 @@ import Typography from '../Typography';
|
|
|
5
5
|
import HighlightText from '../HighlightText';
|
|
6
6
|
import Icon from '../Icon';
|
|
7
7
|
import Tooltip from '../Tooltip';
|
|
8
|
+
import Input from '../Input/Input';
|
|
9
|
+
import Select from '../Select/Select';
|
|
8
10
|
|
|
9
11
|
const getErrorMessage = (
|
|
10
12
|
inputValue: string,
|
|
@@ -25,6 +27,7 @@ const getErrorMessage = (
|
|
|
25
27
|
};
|
|
26
28
|
const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
27
29
|
label,
|
|
30
|
+
placeholder,
|
|
28
31
|
text,
|
|
29
32
|
highlightText,
|
|
30
33
|
customError,
|
|
@@ -33,7 +36,7 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
|
33
36
|
cancelIcon,
|
|
34
37
|
variant = 'textField',
|
|
35
38
|
dropdownData = [],
|
|
36
|
-
width,
|
|
39
|
+
// width,
|
|
37
40
|
height,
|
|
38
41
|
isOpen = false,
|
|
39
42
|
confirmAction,
|
|
@@ -47,7 +50,8 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
|
47
50
|
);
|
|
48
51
|
const [showError, setShowError] = useState('');
|
|
49
52
|
const [isTextFieldModified, setIsTextFieldModified] = useState(false);
|
|
50
|
-
const
|
|
53
|
+
const isThrowingError = showError && isEditing ? true : false;
|
|
54
|
+
|
|
51
55
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
52
56
|
const cancelRef = useRef<HTMLDivElement | null>(null); // New ref for cancel icon
|
|
53
57
|
const [clickTimeout, setClickTimeout] = useState<number | null>(null);
|
|
@@ -105,7 +109,6 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
|
105
109
|
setIsEditing(false);
|
|
106
110
|
setShowError('');
|
|
107
111
|
setIsTextFieldModified(false);
|
|
108
|
-
setIsDropdownModified(false);
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
const handleTextFieldChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
@@ -114,12 +117,6 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
|
114
117
|
setShowError('');
|
|
115
118
|
};
|
|
116
119
|
|
|
117
|
-
const handleDropdownChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
|
118
|
-
setDropdownValue(e.target.value);
|
|
119
|
-
setIsDropdownModified(true);
|
|
120
|
-
setShowError('');
|
|
121
|
-
};
|
|
122
|
-
|
|
123
120
|
const handleBlur = (e: MouseEvent) => {
|
|
124
121
|
if (
|
|
125
122
|
containerRef.current &&
|
|
@@ -155,44 +152,40 @@ const LabelEditTextField: FC<LabelEditTextFieldTypes> = ({
|
|
|
155
152
|
}`}
|
|
156
153
|
style={{ height }}
|
|
157
154
|
>
|
|
158
|
-
<
|
|
155
|
+
<Input
|
|
156
|
+
name="input"
|
|
159
157
|
type="text"
|
|
158
|
+
label={label ? label : ''}
|
|
159
|
+
disabled={false}
|
|
160
|
+
error={isThrowingError}
|
|
161
|
+
placeholder={placeholder ? placeholder : ''}
|
|
160
162
|
value={inputValue}
|
|
161
163
|
onChange={handleTextFieldChange}
|
|
162
|
-
className={`
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
164
|
+
className={`
|
|
165
|
+
|
|
166
|
+
${isTextFieldModified ? 'modified' : ''}`}
|
|
167
|
+
/>
|
|
168
|
+
<Select
|
|
169
|
+
label={''}
|
|
170
|
+
optionsList={dropdownData}
|
|
171
|
+
selectedOption={{ value: dropdownValue, label: dropdownValue }}
|
|
172
|
+
onChange={(option) => setDropdownValue(option.value)}
|
|
169
173
|
/>
|
|
170
|
-
{label && <label className="ff-label">{label}</label>}
|
|
171
|
-
<select
|
|
172
|
-
value={dropdownValue}
|
|
173
|
-
onChange={handleDropdownChange}
|
|
174
|
-
className={`dropdown ${isDropdownModified ? 'modified' : ''}`}
|
|
175
|
-
>
|
|
176
|
-
{dropdownData.map((item) => (
|
|
177
|
-
<option key={item.id} value={item.value}>
|
|
178
|
-
{item.label}
|
|
179
|
-
</option>
|
|
180
|
-
))}
|
|
181
|
-
</select>
|
|
182
174
|
</div>
|
|
183
175
|
) : (
|
|
184
176
|
<div className="ff-label-text-field-without-dropdown">
|
|
185
|
-
<
|
|
177
|
+
<Input
|
|
178
|
+
name="input"
|
|
186
179
|
type="text"
|
|
180
|
+
label={label ? label : ''}
|
|
181
|
+
disabled={false}
|
|
182
|
+
placeholder={placeholder ? placeholder : ''}
|
|
187
183
|
value={inputValue}
|
|
188
184
|
onChange={handleTextFieldChange}
|
|
189
|
-
className={`
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
placeholder=" "
|
|
193
|
-
style={{ width, height }}
|
|
185
|
+
className={`
|
|
186
|
+
|
|
187
|
+
${isTextFieldModified ? 'modified' : ''}`}
|
|
194
188
|
/>
|
|
195
|
-
<label className="ff-textfield-label">{label}</label>
|
|
196
189
|
</div>
|
|
197
190
|
)}
|
|
198
191
|
<div className="ff-icon-container">
|
|
@@ -15,15 +15,15 @@ type Story = StoryObj<typeof MachineInputField>;
|
|
|
15
15
|
|
|
16
16
|
// Sample data for the MachineInputField
|
|
17
17
|
const sampleOptions: MachineType[] = [
|
|
18
|
-
{ label: 'Local', type: 'Local' },
|
|
19
|
-
{ label: '121.25.
|
|
20
|
-
{ label: '17, iPhone 15', type: 'mac' },
|
|
18
|
+
{ label: 'Local Environment', type: 'Local' },
|
|
19
|
+
{ label: '121.25.333.344.2', type: 'Google Chrome' },
|
|
20
|
+
{ label: '17, iPhone 15 pro max', type: 'mac' },
|
|
21
21
|
{ label: 'Samsung Galaxy S23', type: 'android' },
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
export const Primary: Story = {
|
|
25
25
|
args: {
|
|
26
|
-
width: '
|
|
26
|
+
width: '530px', // Example width
|
|
27
27
|
options: sampleOptions,
|
|
28
28
|
runCount: 1,
|
|
29
29
|
},
|
|
@@ -4,6 +4,7 @@ import Typography from '../Typography';
|
|
|
4
4
|
import Icon from '../Icon';
|
|
5
5
|
import { MachineInputFieldProps, MachineType } from './types';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
+
import { truncateText } from '../../utils/truncateText/truncateText';
|
|
7
8
|
|
|
8
9
|
const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
|
|
9
10
|
(
|
|
@@ -14,6 +15,7 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
|
|
|
14
15
|
className = '',
|
|
15
16
|
contentReverse = false,
|
|
16
17
|
onClick = () => {},
|
|
18
|
+
modalId = '',
|
|
17
19
|
},
|
|
18
20
|
ref
|
|
19
21
|
) => {
|
|
@@ -36,6 +38,7 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
|
|
|
36
38
|
return (
|
|
37
39
|
<div
|
|
38
40
|
ref={ref}
|
|
41
|
+
id={modalId}
|
|
39
42
|
style={{ width: width }}
|
|
40
43
|
className={classNames('ff-machine-input-field-wrapper', className)}
|
|
41
44
|
onClick={onClick}
|
|
@@ -72,7 +75,7 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
|
|
|
72
75
|
})}
|
|
73
76
|
color="var(--ff-machine-input-field-text-color)"
|
|
74
77
|
>
|
|
75
|
-
{label}
|
|
78
|
+
{truncateText(label, 15)}
|
|
76
79
|
</Typography>
|
|
77
80
|
</div>
|
|
78
81
|
))}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ff-option-card {
|
|
48
|
-
position:
|
|
48
|
+
position: absolute;
|
|
49
49
|
margin: 4px;
|
|
50
50
|
border: 1px solid var(--option-card-border-color);
|
|
51
51
|
background: var(--option-card-bg-color);
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
min-width: 110px;
|
|
55
55
|
width: max-content;
|
|
56
56
|
border-radius: 4px;
|
|
57
|
-
&--primary{
|
|
57
|
+
&--primary {
|
|
58
58
|
background: var(--brand-color);
|
|
59
59
|
color: var(--primary-button-text-color);
|
|
60
60
|
svg {
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
fill: var(--primary-icon-color);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
:hover{
|
|
65
|
+
:hover {
|
|
66
66
|
color: var(--brand-color);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
svg {
|
|
68
|
+
path {
|
|
69
|
+
fill: var(--brand-color);
|
|
70
|
+
}
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
}
|
|
73
73
|
}
|
|
74
74
|
.ff-options {
|
|
75
75
|
@extend .fontSm;
|