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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { CommentType } from '../type';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import '../Comments.scss';
|
|
4
|
+
import Icon from '../../Icon';
|
|
5
|
+
|
|
6
|
+
interface CommentProps {
|
|
7
|
+
handleInsertNode: any;
|
|
8
|
+
handleEditNode: any;
|
|
9
|
+
handleDeleteNode: (commentId: any) => any;
|
|
10
|
+
comment: CommentType;
|
|
11
|
+
depth?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Comment = ({
|
|
15
|
+
handleInsertNode,
|
|
16
|
+
handleEditNode,
|
|
17
|
+
handleDeleteNode,
|
|
18
|
+
comment,
|
|
19
|
+
depth = 0,
|
|
20
|
+
}: CommentProps) => {
|
|
21
|
+
const [input, setInput] = useState('');
|
|
22
|
+
const [editMode, setEditMode] = useState(false);
|
|
23
|
+
const [showInput, setShowInput] = useState(false);
|
|
24
|
+
const [expand, setExpand] = useState(true);
|
|
25
|
+
|
|
26
|
+
const { modifiedByUname, createdByUname, modifiedOn, createdOn } =
|
|
27
|
+
comment || {};
|
|
28
|
+
const randomPastTime = modifiedOn ?? createdOn ?? new Date().toLocaleString();
|
|
29
|
+
const firstName = modifiedByUname ?? createdByUname ?? 'Anonymous';
|
|
30
|
+
|
|
31
|
+
const isDepthLimitReached = depth > 2;
|
|
32
|
+
const avatar = firstName ? firstName.charAt(0).toUpperCase() : 'A';
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (editMode && comment.description) {
|
|
36
|
+
setInput(comment.description);
|
|
37
|
+
}
|
|
38
|
+
}, [editMode, comment.description]);
|
|
39
|
+
|
|
40
|
+
const handleNewComment = () => {
|
|
41
|
+
setExpand(!expand);
|
|
42
|
+
setShowInput(true);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const onAddComment = () => {
|
|
46
|
+
if (input.length === 0) return;
|
|
47
|
+
if (editMode) {
|
|
48
|
+
handleEditNode(comment.id, input);
|
|
49
|
+
} else {
|
|
50
|
+
setExpand(true);
|
|
51
|
+
handleInsertNode(comment.id, input);
|
|
52
|
+
setShowInput(false);
|
|
53
|
+
setInput('');
|
|
54
|
+
}
|
|
55
|
+
if (editMode) setEditMode(false);
|
|
56
|
+
};
|
|
57
|
+
return (
|
|
58
|
+
<div className="commentsContainer">
|
|
59
|
+
<div className={depth === 0 ? 'comment-wrapper-one' : 'comment-wrapper'}>
|
|
60
|
+
<div className={depth === 0 ? 'inputContainer' : 'commentContainer'}>
|
|
61
|
+
{depth === 0 ? (
|
|
62
|
+
<div className="first-comment">
|
|
63
|
+
<h5 className="first-comment-heading">Comments</h5>
|
|
64
|
+
<div className="input-wrapper">
|
|
65
|
+
<textarea
|
|
66
|
+
className="inputContainer__input first_input"
|
|
67
|
+
rows={3}
|
|
68
|
+
autoFocus
|
|
69
|
+
value={input}
|
|
70
|
+
onChange={(e) => setInput(e.target.value)}
|
|
71
|
+
placeholder={'Add a comment'}
|
|
72
|
+
/>
|
|
73
|
+
<span className="reply comment reply-comment">
|
|
74
|
+
<Icon
|
|
75
|
+
name="send_to_steps"
|
|
76
|
+
onClick={onAddComment}
|
|
77
|
+
color="71347B"
|
|
78
|
+
/>
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
) : (
|
|
83
|
+
<>
|
|
84
|
+
<div className="commentContainer__avatar">{avatar}</div>
|
|
85
|
+
<div className="ff-message-container">
|
|
86
|
+
<div className="ff-message">
|
|
87
|
+
<div className="ff-message-name" style={{ fontWeight: 700 }}>
|
|
88
|
+
{firstName}
|
|
89
|
+
</div>
|
|
90
|
+
<div className="ff-message-time">{randomPastTime}</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div className="editable-text">{comment.description}</div>
|
|
94
|
+
</div>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
{editMode && (
|
|
100
|
+
<div className="inputContainer">
|
|
101
|
+
<input
|
|
102
|
+
type="text"
|
|
103
|
+
className="editable-text inputContainer__input"
|
|
104
|
+
value={input}
|
|
105
|
+
onChange={(e) => setInput(e.target.value)}
|
|
106
|
+
autoFocus
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
{depth > 0 && (
|
|
111
|
+
<div className="comment-actions">
|
|
112
|
+
{editMode ? (
|
|
113
|
+
<>
|
|
114
|
+
<div
|
|
115
|
+
className="reply"
|
|
116
|
+
onClick={() => {
|
|
117
|
+
onAddComment();
|
|
118
|
+
setEditMode(false);
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<Icon name="save_as_step" width={12} height={12} />
|
|
122
|
+
</div>
|
|
123
|
+
<div
|
|
124
|
+
className="reply"
|
|
125
|
+
onClick={() => {
|
|
126
|
+
setEditMode(false);
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<Icon name="close" color="#A91224" width={10} height={10} />
|
|
130
|
+
</div>
|
|
131
|
+
</>
|
|
132
|
+
) : (
|
|
133
|
+
<>
|
|
134
|
+
{!isDepthLimitReached && (
|
|
135
|
+
<div className="reply" onClick={handleNewComment}>
|
|
136
|
+
{expand ? (
|
|
137
|
+
<Icon name="window_minimize" width={12} height={12} />
|
|
138
|
+
) : (
|
|
139
|
+
<>
|
|
140
|
+
<Icon name="plus_icon" width={12} height={12} />
|
|
141
|
+
<Icon name="add_page" width={12} height={12} />
|
|
142
|
+
</>
|
|
143
|
+
)}
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
<div className="reply" onClick={() => setEditMode(true)}>
|
|
147
|
+
<Icon name="edit" width={12} height={12} />
|
|
148
|
+
</div>
|
|
149
|
+
<div
|
|
150
|
+
className="reply"
|
|
151
|
+
onClick={() => handleDeleteNode(comment.id)}
|
|
152
|
+
>
|
|
153
|
+
<Icon name="delete" color="#A91224" width={12} height={12} />
|
|
154
|
+
</div>
|
|
155
|
+
</>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
<div
|
|
160
|
+
className={comment?.comments?.length > 0 ? 'child-comments' : ''}
|
|
161
|
+
style={{
|
|
162
|
+
display: expand ? 'block' : 'none',
|
|
163
|
+
paddingLeft: 25,
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
{showInput && (
|
|
167
|
+
<div className="inputContainer">
|
|
168
|
+
<input
|
|
169
|
+
type="text"
|
|
170
|
+
className="inputContainer__input adding-text"
|
|
171
|
+
autoFocus
|
|
172
|
+
onChange={(e) => setInput(e.target.value)}
|
|
173
|
+
/>
|
|
174
|
+
<div className="reply-text">
|
|
175
|
+
<div className="reply" onClick={onAddComment}>
|
|
176
|
+
<Icon name="send_to_steps" width={12} height={12} />
|
|
177
|
+
</div>
|
|
178
|
+
<div
|
|
179
|
+
className="reply"
|
|
180
|
+
onClick={() => {
|
|
181
|
+
setShowInput(false);
|
|
182
|
+
if (!comment?.comments?.length) setExpand(false);
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
<Icon name="close" width={10} height={10} color="#A91224" />
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
)}
|
|
190
|
+
{comment?.comments?.map((cmnt) => (
|
|
191
|
+
<Comment
|
|
192
|
+
key={cmnt.id}
|
|
193
|
+
handleInsertNode={handleInsertNode}
|
|
194
|
+
handleEditNode={handleEditNode}
|
|
195
|
+
handleDeleteNode={handleDeleteNode}
|
|
196
|
+
comment={cmnt}
|
|
197
|
+
depth={depth + 1}
|
|
198
|
+
/>
|
|
199
|
+
))}
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export default Comment;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CommentType } from '../type';
|
|
2
|
+
|
|
3
|
+
const useNode = () => {
|
|
4
|
+
const insertNode = (
|
|
5
|
+
tree: CommentType,
|
|
6
|
+
commentId: number | string,
|
|
7
|
+
item: string
|
|
8
|
+
): CommentType => {
|
|
9
|
+
if (tree.id === commentId) {
|
|
10
|
+
tree.comments.push({
|
|
11
|
+
id: Date.now().toString(),
|
|
12
|
+
description: item,
|
|
13
|
+
comments: [],
|
|
14
|
+
});
|
|
15
|
+
return tree;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
tree.comments = tree.comments.map((child) =>
|
|
19
|
+
insertNode(child, commentId, item)
|
|
20
|
+
);
|
|
21
|
+
return tree;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const editNode = (
|
|
25
|
+
tree: CommentType,
|
|
26
|
+
commentId: number | string,
|
|
27
|
+
value: string
|
|
28
|
+
): CommentType => {
|
|
29
|
+
if (tree.id === commentId) {
|
|
30
|
+
tree.description = value;
|
|
31
|
+
return tree;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
tree.comments = tree.comments.map((child) =>
|
|
35
|
+
editNode(child, commentId, value)
|
|
36
|
+
);
|
|
37
|
+
return tree;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const deleteNode = (tree: CommentType, commentId: number): CommentType => {
|
|
41
|
+
if (!tree) return tree;
|
|
42
|
+
tree.comments = tree.comments
|
|
43
|
+
.filter((child) => child.id !== commentId)
|
|
44
|
+
.map((child) => deleteNode(child, commentId));
|
|
45
|
+
return tree;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return { insertNode, editNode, deleteNode };
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default useNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Comments';
|
|
@@ -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
|
+
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
--rdp-accent-color: var(--brand-color);
|
|
9
9
|
--rdp-day-height: 24px;
|
|
10
10
|
--rdp-day-width: 36px;
|
|
11
|
+
--rdp-day_button-height: 24px;
|
|
12
|
+
--rdp-day_button-width: 36px;
|
|
11
13
|
@include fonts.fontPoppins(12px);
|
|
12
14
|
--rdp-font-family: 'Poppins', sans-serif;
|
|
13
15
|
}
|
|
@@ -157,6 +159,15 @@
|
|
|
157
159
|
background-color: var(--brand-color);
|
|
158
160
|
color: var(--primary-button-text-color);
|
|
159
161
|
}
|
|
162
|
+
&--disabled {
|
|
163
|
+
color: var(--text-color-light);
|
|
164
|
+
cursor: default;
|
|
165
|
+
|
|
166
|
+
&.ff-custom-month--selected,
|
|
167
|
+
&.ff-custom-year--selected {
|
|
168
|
+
background-color: var(--disable-color);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
160
171
|
}
|
|
161
172
|
}
|
|
162
173
|
|
|
@@ -172,3 +172,22 @@ export const Dateonly: Story = {
|
|
|
172
172
|
);
|
|
173
173
|
},
|
|
174
174
|
};
|
|
175
|
+
|
|
176
|
+
export const PastOneYear: Story = {
|
|
177
|
+
render: (args) => {
|
|
178
|
+
const [selectedDate, setSelectDate] = useState<Date | undefined>();
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<CustomDatePicker
|
|
182
|
+
{...args}
|
|
183
|
+
value={selectedDate}
|
|
184
|
+
onChange={setSelectDate}
|
|
185
|
+
calendarWidth={240}
|
|
186
|
+
maxDate={new Date()}
|
|
187
|
+
minDate={new Date(new Date().setFullYear(new Date().getFullYear() - 1))}
|
|
188
|
+
dateOnly
|
|
189
|
+
dateFormat="dd MMM yyyy"
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
},
|
|
193
|
+
};
|