pixel-react-excel-sheet 1.0.11 → 1.0.12
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/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/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/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/Select/components/types.d.ts +1 -0
- package/lib/components/Select/types.d.ts +2 -0
- 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/index.d.ts +303 -17
- package/lib/index.esm.js +3370 -746
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3375 -745
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
- package/package.json +2 -1
- package/src/assets/Themes/BaseTheme.scss +14 -0
- package/src/assets/Themes/DarkTheme.scss +68 -41
- 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/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/DonutChart/DonutChart.tsx +8 -3
- 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/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 +2 -1
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +37 -21
- 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 +23 -21
- 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/FileDropzone.scss +0 -1
- package/src/components/Icon/iconList.ts +45 -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.tsx +99 -88
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
- 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/MultiSelect/MultiSelect.scss +29 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +19 -5
- package/src/components/MultiSelect/MultiSelect.tsx +29 -19
- 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/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/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 +0 -1
- package/src/index.ts +14 -1
- package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
- package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface CommentType {
|
|
2
|
+
id?: string | number;
|
|
3
|
+
description?: string;
|
|
4
|
+
createdBy?: string;
|
|
5
|
+
modifiedBy?: string;
|
|
6
|
+
createdByUname?: string;
|
|
7
|
+
modifiedByUname?: string;
|
|
8
|
+
createdOn?: string;
|
|
9
|
+
modifiedOn?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
emailId?: string[];
|
|
12
|
+
commentParentId?: string;
|
|
13
|
+
comments: CommentType[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type HandleAddComment = (
|
|
17
|
+
newComment: CommentType,
|
|
18
|
+
parentCommentId?: string
|
|
19
|
+
) => void;
|
|
20
|
+
|
|
21
|
+
// Handles editing an existing comment
|
|
22
|
+
export type HandleEditComment = (
|
|
23
|
+
commentId: string,
|
|
24
|
+
updatedDescription: string
|
|
25
|
+
) => void;
|
|
26
|
+
|
|
27
|
+
// Handles deleting a comment
|
|
28
|
+
export type HandleDeleteComment = (commentId: string) => void;
|
|
29
|
+
export type HandleNodeFunction = (commentId: string, value: string) => void;
|
|
30
|
+
export interface CommentsProps {
|
|
31
|
+
commentsData: any;
|
|
32
|
+
handleAddComment: HandleAddComment;
|
|
33
|
+
handleEditComment: HandleEditComment;
|
|
34
|
+
handleDeleteComment: HandleDeleteComment;
|
|
35
|
+
onCommentsDataChange: (data: any) => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.ff-create-variable-slider {
|
|
2
|
+
padding: 8px;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
.ff-hide-value-content {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ff-create-slider-footer {
|
|
13
|
+
width: 100%;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: flex-end;
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import CreateVariableSlider from './CreateVariableSlider';
|
|
4
|
+
import { CreateVariableProps } from './types';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof CreateVariableSlider> = {
|
|
8
|
+
title: 'Components/CreateVariableSlider',
|
|
9
|
+
component: CreateVariableSlider,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof CreateVariableSlider>;
|
|
14
|
+
|
|
15
|
+
export const WithState: Story = {
|
|
16
|
+
render: (args) => {
|
|
17
|
+
const [variableName, setVariableName] = useState('');
|
|
18
|
+
const [value, setValue] = useState('');
|
|
19
|
+
const [selectedVariableType, setSelectedVariableType] = useState({
|
|
20
|
+
label: 'Local Variable',
|
|
21
|
+
value: 'LOCAL',
|
|
22
|
+
});
|
|
23
|
+
const [hideValue, setHideValue] = useState(false);
|
|
24
|
+
|
|
25
|
+
const variableTypeList = [
|
|
26
|
+
{ label: 'Local Variable', value: 'LOCAL' },
|
|
27
|
+
{ label: 'Global Variable', value: 'GLOBAL' },
|
|
28
|
+
{ label: 'Project Environment Variable', value: 'PROJECT_ENVIRONMENT' },
|
|
29
|
+
];
|
|
30
|
+
const handleNameChange = (value) => {
|
|
31
|
+
setVariableName(value);
|
|
32
|
+
};
|
|
33
|
+
const handleValueChange = (value) => {
|
|
34
|
+
setValue(value);
|
|
35
|
+
};
|
|
36
|
+
const handleTypeChange = (value) => {
|
|
37
|
+
setSelectedVariableType(value);
|
|
38
|
+
};
|
|
39
|
+
const handleSubmit = () => {
|
|
40
|
+
let variable = {
|
|
41
|
+
name: variableName,
|
|
42
|
+
value,
|
|
43
|
+
type: selectedVariableType.value,
|
|
44
|
+
hideValue,
|
|
45
|
+
};
|
|
46
|
+
console.log('Variable :', variable);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<CreateVariableSlider
|
|
51
|
+
{...args}
|
|
52
|
+
isOpen={true} // Ensures the drawer is open for interaction
|
|
53
|
+
variableName={variableName}
|
|
54
|
+
value={value}
|
|
55
|
+
selectedVariableType={selectedVariableType}
|
|
56
|
+
hideValue={hideValue}
|
|
57
|
+
variableTypesList={variableTypeList}
|
|
58
|
+
onNameChange={handleNameChange}
|
|
59
|
+
onValueChange={handleValueChange}
|
|
60
|
+
onVariableTypeChange={handleTypeChange}
|
|
61
|
+
onHideChange={setHideValue}
|
|
62
|
+
handleSubmit={handleSubmit}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type FC, type JSX } from 'react';
|
|
2
|
+
import Drawer from '../Drawer';
|
|
3
|
+
import { CreateVariableProps } from './types';
|
|
4
|
+
import Input from '../Input';
|
|
5
|
+
import Select from '../Select';
|
|
6
|
+
import './CreateVariableSlider.scss';
|
|
7
|
+
import Checkbox from '../Checkbox';
|
|
8
|
+
import Icon from '../Icon';
|
|
9
|
+
import Button from '../Button';
|
|
10
|
+
import Tooltip from '../Tooltip';
|
|
11
|
+
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
|
12
|
+
|
|
13
|
+
const CreateVariableSlider: FC<CreateVariableProps> = ({
|
|
14
|
+
isOpen,
|
|
15
|
+
variableTypesList = [],
|
|
16
|
+
onClose,
|
|
17
|
+
onNameChange,
|
|
18
|
+
onValueChange,
|
|
19
|
+
variableName,
|
|
20
|
+
value,
|
|
21
|
+
onVariableTypeChange,
|
|
22
|
+
selectedVariableType,
|
|
23
|
+
hideValue = false,
|
|
24
|
+
onHideChange,
|
|
25
|
+
handleSubmit,
|
|
26
|
+
}): JSX.Element => {
|
|
27
|
+
const FooterContent: FC = (): JSX.Element => {
|
|
28
|
+
return (
|
|
29
|
+
<div className="ff-create-slider-footer">
|
|
30
|
+
<Button onClick={onClose} label="Cancel" variant="tertiary" />
|
|
31
|
+
<Button
|
|
32
|
+
variant="primary"
|
|
33
|
+
label="create"
|
|
34
|
+
type="submit"
|
|
35
|
+
onClick={handleSubmit}
|
|
36
|
+
disabled={checkEmpty(variableName) || checkEmpty(value)}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
return (
|
|
42
|
+
<Drawer
|
|
43
|
+
onClose={onClose}
|
|
44
|
+
isOpen={isOpen}
|
|
45
|
+
title="Create Variable"
|
|
46
|
+
width="284px"
|
|
47
|
+
height="222px"
|
|
48
|
+
top="35%"
|
|
49
|
+
right={8}
|
|
50
|
+
isFooterRequired={true}
|
|
51
|
+
overlay
|
|
52
|
+
footerContent={<FooterContent />}
|
|
53
|
+
>
|
|
54
|
+
<div className="ff-create-variable-slider">
|
|
55
|
+
<Input
|
|
56
|
+
label="Variable Name"
|
|
57
|
+
required
|
|
58
|
+
type="text"
|
|
59
|
+
name="variable name"
|
|
60
|
+
value={variableName}
|
|
61
|
+
onChange={(event) => onNameChange(event.target.value)}
|
|
62
|
+
/>
|
|
63
|
+
<Select
|
|
64
|
+
label="Variable Type"
|
|
65
|
+
required
|
|
66
|
+
onChange={(option: any) => onVariableTypeChange(option)}
|
|
67
|
+
selectedOption={selectedVariableType}
|
|
68
|
+
optionsList={variableTypesList}
|
|
69
|
+
optionZIndex={99999}
|
|
70
|
+
/>
|
|
71
|
+
<Input
|
|
72
|
+
label="Variable Value"
|
|
73
|
+
required
|
|
74
|
+
type="text"
|
|
75
|
+
name="value"
|
|
76
|
+
value={value}
|
|
77
|
+
onChange={(event) => onValueChange(event.target.value)}
|
|
78
|
+
/>
|
|
79
|
+
<div className="ff-hide-value-content">
|
|
80
|
+
<Checkbox
|
|
81
|
+
onChange={(event) => onHideChange(event.target.checked)}
|
|
82
|
+
name="hide value"
|
|
83
|
+
label="Hide Value"
|
|
84
|
+
checked={hideValue}
|
|
85
|
+
/>
|
|
86
|
+
<Tooltip title="Once the value is hidden, it cannot be undone">
|
|
87
|
+
<Icon name="info" width={12} height={12} />
|
|
88
|
+
</Tooltip>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</Drawer>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default CreateVariableSlider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CreateVariableSlider';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type variableType = 'LOCAL' | 'GLOBAL' | 'GROUP' | 'PROJECT_ENVIRONMENT';
|
|
2
|
+
|
|
3
|
+
export type DynamicObj = {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export interface CreateVariableProps {
|
|
8
|
+
/**
|
|
9
|
+
* Open Create variable Slider
|
|
10
|
+
*/
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Value for the variable name
|
|
14
|
+
*/
|
|
15
|
+
variableName: string;
|
|
16
|
+
/**
|
|
17
|
+
* Value for the variable to be created
|
|
18
|
+
*/
|
|
19
|
+
value: string;
|
|
20
|
+
/**
|
|
21
|
+
* List for the variable types
|
|
22
|
+
*/
|
|
23
|
+
variableTypesList: DynamicObj[];
|
|
24
|
+
/**
|
|
25
|
+
* Selected variable type
|
|
26
|
+
*/
|
|
27
|
+
selectedVariableType: DynamicObj;
|
|
28
|
+
/**
|
|
29
|
+
* Function to handle variable type change
|
|
30
|
+
* @param option
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
onVariableTypeChange: (option: DynamicObj) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Function to handle close
|
|
36
|
+
*/
|
|
37
|
+
onClose?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* onChange of name
|
|
40
|
+
*/
|
|
41
|
+
onNameChange: (value: string | boolean) => void;
|
|
42
|
+
/**
|
|
43
|
+
* onChange of value
|
|
44
|
+
*/
|
|
45
|
+
onValueChange: (value: string | boolean) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Hide value
|
|
48
|
+
*/
|
|
49
|
+
hideValue: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* onChange for hide value
|
|
52
|
+
*/
|
|
53
|
+
onHideChange: (value: boolean) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Function to handle submit
|
|
56
|
+
*/
|
|
57
|
+
handleSubmit: () => void;
|
|
58
|
+
}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
right: 0;
|
|
20
20
|
bottom: 0;
|
|
21
21
|
top: 87px;
|
|
22
|
-
min-width: 450px;
|
|
23
22
|
background-color: var(--primary-button-text-color);
|
|
24
23
|
z-index: 999;
|
|
25
24
|
transform: translateX(100%);
|
|
@@ -78,7 +77,7 @@
|
|
|
78
77
|
display: flex;
|
|
79
78
|
align-items: center;
|
|
80
79
|
justify-content: space-between;
|
|
81
|
-
gap:
|
|
80
|
+
gap: 8px;
|
|
82
81
|
height: 24px;
|
|
83
82
|
|
|
84
83
|
.ff-action-button {
|
|
@@ -101,6 +100,7 @@
|
|
|
101
100
|
.ff-custom-header {
|
|
102
101
|
background-color: var(--drawer-footer-bg);
|
|
103
102
|
padding: 4px 8px;
|
|
103
|
+
width: 100%;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
z-index: 1000;
|
|
124
124
|
background-color: var(--base-bg-color);
|
|
125
125
|
transform: translateY(3px);
|
|
126
|
+
border-radius: 0 0 4px 4px;
|
|
126
127
|
|
|
127
128
|
.button-container {
|
|
128
129
|
display: flex;
|
|
@@ -36,6 +36,9 @@ const Drawer: FC<DrawerProps> = ({
|
|
|
36
36
|
zIndex = 999,
|
|
37
37
|
secondLayerZIndex = false,
|
|
38
38
|
top,
|
|
39
|
+
height,
|
|
40
|
+
width,
|
|
41
|
+
right = 0,
|
|
39
42
|
}: DrawerProps) => {
|
|
40
43
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
41
44
|
|
|
@@ -85,7 +88,7 @@ const Drawer: FC<DrawerProps> = ({
|
|
|
85
88
|
className={classNames('ff-drawer', `ff-drawer--${drawerSize}`, {
|
|
86
89
|
'ff-drawer--open': isOpen,
|
|
87
90
|
})}
|
|
88
|
-
style={{ zIndex, top }}
|
|
91
|
+
style={{ zIndex, top, height, width, right }}
|
|
89
92
|
>
|
|
90
93
|
{showHeader && (
|
|
91
94
|
<div
|
|
@@ -141,4 +141,17 @@ export interface DrawerProps {
|
|
|
141
141
|
* Custom top for the drawer
|
|
142
142
|
*/
|
|
143
143
|
top?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Height of the drawer
|
|
146
|
+
*/
|
|
147
|
+
height?: string;
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* width of the drawer
|
|
151
|
+
*/
|
|
152
|
+
width?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Position from right
|
|
155
|
+
*/
|
|
156
|
+
right?: string | number;
|
|
144
157
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import Editor from './Editor';
|
|
4
4
|
import { EditorProps } from './types';
|
|
5
|
-
import {
|
|
5
|
+
import { variableList } from './constants';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
const meta: Meta<EditorProps> = {
|
|
@@ -49,6 +49,6 @@ export const Default: Story = {
|
|
|
49
49
|
width: '100%',
|
|
50
50
|
height: '90vh',
|
|
51
51
|
readOnly: false,
|
|
52
|
-
variableOptionsList:
|
|
52
|
+
variableOptionsList: variableList,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
@@ -115,8 +115,8 @@ const Editor = forwardRef<any, EditorProps>(
|
|
|
115
115
|
option?.type === 'GLOBAL'
|
|
116
116
|
? 'GV'
|
|
117
117
|
: option?.type === 'LOCAL'
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
? 'LV'
|
|
119
|
+
: 'PEV'
|
|
120
120
|
);
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -235,6 +235,8 @@ const Editor = forwardRef<any, EditorProps>(
|
|
|
235
235
|
/>
|
|
236
236
|
{showDropdown && dropdownPosition && (
|
|
237
237
|
<VariableDropdown
|
|
238
|
+
position="absolute"
|
|
239
|
+
width="300px"
|
|
238
240
|
optionsList={variableOptionsList}
|
|
239
241
|
onSelectVariable={handleSelectVariable}
|
|
240
242
|
dropdownPosition={dropdownPosition}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
.ff-variable-dropdown {
|
|
2
|
-
position: absolute;
|
|
3
|
-
width: 200px;
|
|
4
2
|
height: 300px;
|
|
5
3
|
display: flex;
|
|
6
4
|
flex-direction: column;
|
|
@@ -8,6 +6,14 @@
|
|
|
8
6
|
border: 1px solid var(--border-color);
|
|
9
7
|
border-radius: 3px;
|
|
10
8
|
z-index: 9999;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
&.absolute {
|
|
12
|
+
position: absolute;
|
|
13
|
+
}
|
|
14
|
+
&.relative {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
.ff-variable-option {
|
|
13
19
|
display: flex;
|
|
@@ -3,19 +3,27 @@ import { VariableDropdownProps, DyanamicObj } from './types';
|
|
|
3
3
|
import Icon from '../Icon';
|
|
4
4
|
import './VariableDropdown.scss';
|
|
5
5
|
import Typography from '../Typography';
|
|
6
|
+
import cx from 'classnames';
|
|
6
7
|
|
|
7
8
|
const VariableDropdown: FC<VariableDropdownProps> = ({
|
|
8
9
|
optionsList = [],
|
|
9
10
|
onSelectVariable,
|
|
10
11
|
dropdownPosition,
|
|
12
|
+
position = 'relative',
|
|
13
|
+
width = '300px',
|
|
11
14
|
}): ReactNode => {
|
|
12
15
|
return (
|
|
13
16
|
<div
|
|
14
|
-
className=
|
|
15
|
-
style={
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
className={cx('ff-variable-dropdown', position)}
|
|
18
|
+
style={
|
|
19
|
+
dropdownPosition
|
|
20
|
+
? {
|
|
21
|
+
top: dropdownPosition.top + 30,
|
|
22
|
+
left: dropdownPosition.left - 30,
|
|
23
|
+
width,
|
|
24
|
+
}
|
|
25
|
+
: { width }
|
|
26
|
+
}
|
|
19
27
|
>
|
|
20
28
|
{optionsList?.map((option: DyanamicObj): ReactNode => {
|
|
21
29
|
return (
|
|
@@ -32,8 +40,8 @@ const VariableDropdown: FC<VariableDropdownProps> = ({
|
|
|
32
40
|
option?.type === 'LOCAL'
|
|
33
41
|
? 'local_variable_icon'
|
|
34
42
|
: option?.type === 'GLOBAL'
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
? 'global_variable_icon'
|
|
44
|
+
: 'project_env_variable_icon'
|
|
37
45
|
}
|
|
38
46
|
height={16}
|
|
39
47
|
width={16}
|
|
@@ -58,10 +58,20 @@ export interface dropdownPositionType {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface VariableDropdownProps {
|
|
61
|
+
/**
|
|
62
|
+
* Position whether absoloute or relative
|
|
63
|
+
*/
|
|
64
|
+
position: 'absolute' | 'relative';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Dropdown width
|
|
68
|
+
*/
|
|
69
|
+
width: string;
|
|
70
|
+
|
|
61
71
|
/**
|
|
62
72
|
* List of variables
|
|
63
73
|
*/
|
|
64
|
-
optionsList:
|
|
74
|
+
optionsList: DyanamicObj[];
|
|
65
75
|
|
|
66
76
|
/**
|
|
67
77
|
* Function to handle click on variable
|
|
@@ -71,7 +81,7 @@ export interface VariableDropdownProps {
|
|
|
71
81
|
/**
|
|
72
82
|
* Dropdown postion used for dropdown placement
|
|
73
83
|
*/
|
|
74
|
-
dropdownPosition
|
|
84
|
+
dropdownPosition?: dropdownPositionType;
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
export interface option {
|
|
@@ -9,7 +9,10 @@ import { toast } from '../../Toastify/Toastify';
|
|
|
9
9
|
import { ContextMenuState } from './ExcelFileComponents/types';
|
|
10
10
|
import ExcelContextMenu from '../ExcelContextMenu/ExcelContextMenu';
|
|
11
11
|
import Typography from '../../Typography';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
convertStyleToBackend,
|
|
14
|
+
convertStyleToFrontend,
|
|
15
|
+
} from '../dataConversion';
|
|
13
16
|
import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
|
|
14
17
|
|
|
15
18
|
interface ExcelFileProps {
|
|
@@ -34,7 +37,9 @@ interface ExcelFileProps {
|
|
|
34
37
|
|
|
35
38
|
const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
36
39
|
excelData,
|
|
37
|
-
onSave = (saveData) => {
|
|
40
|
+
onSave = (saveData) => {
|
|
41
|
+
saveData();
|
|
42
|
+
},
|
|
38
43
|
}) => {
|
|
39
44
|
const [sheetNames, setSheetNames] = useState<string[]>([]);
|
|
40
45
|
const [contextMenu, setContextMenu] = React.useState<ContextMenuState>({
|
|
@@ -46,11 +51,19 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
46
51
|
const EmptyRow: CellBase = {
|
|
47
52
|
value: '',
|
|
48
53
|
style: {
|
|
49
|
-
color: 'var(--
|
|
54
|
+
color: 'var(--input-hover-border-color)',
|
|
50
55
|
backgroundColor: 'var(--drawer-footer-bg)',
|
|
51
|
-
borderColor: 'var(--
|
|
52
|
-
textDecoration: 'none',
|
|
53
|
-
|
|
56
|
+
borderColor: 'var(--excel-sheet-border)',
|
|
57
|
+
textDecoration: 'none solid',
|
|
58
|
+
borderRight: `1px solid var(--excel-sheet-border)`,
|
|
59
|
+
borderLeft: `1px solid var(--excel-sheet-border)`,
|
|
60
|
+
borderTop: `1px solid var(--excel-sheet-border)`,
|
|
61
|
+
borderBottom: `1px solid var(--excel-sheet-border)`,
|
|
62
|
+
fontSize: '15px',
|
|
63
|
+
fontWeight: 'normal',
|
|
64
|
+
fontStyle: 'normal',
|
|
65
|
+
fontFamily: 'Times New Roman',
|
|
66
|
+
textAlign: 'center',
|
|
54
67
|
},
|
|
55
68
|
};
|
|
56
69
|
|
|
@@ -128,7 +141,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
128
141
|
}
|
|
129
142
|
spreadsheetData[rowIndex][colIndex] = {
|
|
130
143
|
value: checkVal(cell.value),
|
|
131
|
-
style: convertStyleToFrontend(cell?.style)
|
|
144
|
+
style: convertStyleToFrontend(cell?.style),
|
|
132
145
|
type: true,
|
|
133
146
|
};
|
|
134
147
|
}
|
|
@@ -153,7 +166,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
153
166
|
},
|
|
154
167
|
[onSave]
|
|
155
168
|
);
|
|
156
|
-
|
|
169
|
+
|
|
157
170
|
React.useEffect(() => {
|
|
158
171
|
document.addEventListener('keydown', handleSave);
|
|
159
172
|
return () => {
|
|
@@ -176,18 +189,21 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
176
189
|
}, -1);
|
|
177
190
|
|
|
178
191
|
const filteredRow = row
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
.map((cell, index) => {
|
|
193
|
+
if (cell && cell.value !== null) {
|
|
194
|
+
return {
|
|
195
|
+
value: cell.value,
|
|
196
|
+
styles: convertStyleToBackend(cell.style ?? {}),
|
|
197
|
+
};
|
|
198
|
+
} else if ((cell && cell.type) || index <= lastIndex) {
|
|
199
|
+
return {
|
|
200
|
+
value: '',
|
|
201
|
+
styles: convertStyleToBackend(cell?.style ?? {}),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
})
|
|
206
|
+
.filter((cell) => cell !== null);
|
|
191
207
|
|
|
192
208
|
return filteredRow.length > 0 ? filteredRow : [];
|
|
193
209
|
}) || [];
|
|
@@ -208,7 +224,7 @@ const ExcelFile: React.FC<ExcelFileProps> = ({
|
|
|
208
224
|
onSave(savedData);
|
|
209
225
|
toast.success('File saved successfully!');
|
|
210
226
|
};
|
|
211
|
-
|
|
227
|
+
|
|
212
228
|
const onEvaluateChange = (data: Matrix.Matrix<CellBase>) => {
|
|
213
229
|
setWorksheetsData((prev) => ({ ...prev, [pageRef.current]: data }));
|
|
214
230
|
onSaveWorksheetData();
|
|
@@ -21,6 +21,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
21
21
|
[dispatch]
|
|
22
22
|
);
|
|
23
23
|
const edit = React.useCallback(() => dispatch(Actions.edit()), [dispatch]);
|
|
24
|
+
const autoFill = React.useCallback(
|
|
25
|
+
(value: boolean) => dispatch(Actions.autoFill(value)),
|
|
26
|
+
[dispatch]
|
|
27
|
+
);
|
|
24
28
|
const commit = React.useCallback(
|
|
25
29
|
(changes: Types.CommitChanges<Types.CellBase>) =>
|
|
26
30
|
dispatch(Actions.commit(changes)),
|
|
@@ -103,6 +107,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
103
107
|
const DataEditor = (cell && cell.DataEditor) || props.DataEditor;
|
|
104
108
|
const readOnly = cell && cell.readOnly;
|
|
105
109
|
|
|
110
|
+
const handleMouseDown = React.useCallback(() => {
|
|
111
|
+
mode === 'view' ? autoFill(true) : autoFill(false);
|
|
112
|
+
}, [mode, autoFill]);
|
|
113
|
+
|
|
106
114
|
return hidden ? null : (
|
|
107
115
|
<div
|
|
108
116
|
ref={rootRef}
|
|
@@ -124,6 +132,10 @@ const ActiveCell: React.FC<Props> = (props) => {
|
|
|
124
132
|
exitEditMode={view}
|
|
125
133
|
/>
|
|
126
134
|
)}
|
|
135
|
+
<div
|
|
136
|
+
onMouseDown={handleMouseDown}
|
|
137
|
+
className="select_dot"
|
|
138
|
+
></div>
|
|
127
139
|
</div>
|
|
128
140
|
);
|
|
129
141
|
};
|