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
|
@@ -32,6 +32,31 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
@mixin ff-scroll-style {
|
|
37
|
+
|
|
38
|
+
&::-webkit-scrollbar {
|
|
39
|
+
width: 4px;
|
|
40
|
+
height: 40px;
|
|
41
|
+
border-radius: 12px 0px 0px 0px;
|
|
42
|
+
background: var(--description-text);
|
|
43
|
+
|
|
44
|
+
&-track {
|
|
45
|
+
background: var(--ff-select-scroll-track-bg);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-thumb {
|
|
49
|
+
background: var(--ff-select-scroll-thumb-color);
|
|
50
|
+
border-radius: 10px;
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background: var(--ff-select-scroll-thumb-hover);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
35
60
|
.ff-multiselect-container-with-icon {
|
|
36
61
|
display: flex;
|
|
37
62
|
align-items: center;
|
|
@@ -83,7 +108,11 @@
|
|
|
83
108
|
display: flex;
|
|
84
109
|
flex-wrap: wrap;
|
|
85
110
|
align-items: center;
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
max-height: 64px;
|
|
86
113
|
gap: 5px;
|
|
114
|
+
@include ff-scroll-style;
|
|
115
|
+
|
|
87
116
|
.ff-multiselect-chip {
|
|
88
117
|
@include flex-center;
|
|
89
118
|
box-sizing: border-box;
|
|
@@ -80,14 +80,10 @@ export const NameAccessor: Story = {
|
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
args: {
|
|
85
|
-
...defaultArgs,
|
|
86
|
-
},
|
|
87
|
-
};
|
|
83
|
+
|
|
88
84
|
export const EmailGroup: Story = {
|
|
89
85
|
render: () => {
|
|
90
|
-
const [options,setOptions] = useState([
|
|
86
|
+
const [options, setOptions] = useState([
|
|
91
87
|
{
|
|
92
88
|
label: 'Sample1@gmail.com',
|
|
93
89
|
value: 'sample1@gmail.com',
|
|
@@ -109,9 +105,9 @@ export const EmailGroup: Story = {
|
|
|
109
105
|
) => {
|
|
110
106
|
setSelectedOptions(options);
|
|
111
107
|
};
|
|
112
|
-
const onEnter=(newOption:string)=>{
|
|
113
|
-
setOptions(prev=>[...prev,{label:newOption,value:newOption}])
|
|
114
|
-
setSelectedOptions(prev=>[...prev,{label:newOption,value:newOption}])
|
|
108
|
+
const onEnter = (newOption: string) => {
|
|
109
|
+
setOptions(prev => [...prev, { label: newOption, value: newOption }])
|
|
110
|
+
setSelectedOptions(prev => [...prev, { label: newOption, value: newOption }])
|
|
115
111
|
}
|
|
116
112
|
return (
|
|
117
113
|
<MultiSelect
|
|
@@ -124,6 +120,7 @@ setSelectedOptions(prev=>[...prev,{label:newOption,value:newOption}])
|
|
|
124
120
|
acceptNewOption={true}
|
|
125
121
|
displayCount={true}
|
|
126
122
|
labelAccessor="label"
|
|
123
|
+
valueAccessor='value'
|
|
127
124
|
onEnter={onEnter}
|
|
128
125
|
/>
|
|
129
126
|
);
|
|
@@ -153,8 +150,21 @@ export const Controlled: Story = {
|
|
|
153
150
|
{ label: 'Kiwi', value: 'kiwi' },
|
|
154
151
|
{ label: 'Mango', value: 'mango' },
|
|
155
152
|
{ label: 'Orange', value: 'orange' },
|
|
156
|
-
{ label: '
|
|
153
|
+
{ label: 'Plum', value: 'plum' },
|
|
154
|
+
{ label: 'Berry', value: 'berry' },
|
|
155
|
+
{ label: 'Watermelon', value: 'watermelon' },
|
|
156
|
+
{ label: 'Guava', value: 'guava' },
|
|
157
|
+
{ label: 'Pineapple', value: 'pineapple' },
|
|
157
158
|
{ label: 'Strawberry', value: 'strawberry' },
|
|
159
|
+
{ label: 'Pear', value: 'pear' },
|
|
160
|
+
{ label: 'Peach', value: 'peach' },
|
|
161
|
+
{ label: 'Lemon', value: 'lemon' },
|
|
162
|
+
{ label: 'Papaya', value: 'papaya' },
|
|
163
|
+
{ label: 'Apricot', value: 'apricot' },
|
|
164
|
+
{ label: 'Raspberry', value: 'raspberry' },
|
|
165
|
+
{ label: 'Pomegranate', value: 'pomegranate' },
|
|
166
|
+
{ label: 'Cantaloupe', value: 'cantaloupe' },
|
|
167
|
+
{ label: 'Lychee', value: 'lychee' }
|
|
158
168
|
]);
|
|
159
169
|
}, []);
|
|
160
170
|
return (
|
|
@@ -162,6 +172,7 @@ export const Controlled: Story = {
|
|
|
162
172
|
label={'Fruits'}
|
|
163
173
|
required
|
|
164
174
|
options={options}
|
|
175
|
+
displayCount
|
|
165
176
|
selectedOptions={selectedOptions}
|
|
166
177
|
onChange={onChange}
|
|
167
178
|
/>
|
|
@@ -220,19 +231,19 @@ export const Machines: Story = {
|
|
|
220
231
|
render: () => {
|
|
221
232
|
const [options] = useState<Option[]>([
|
|
222
233
|
{
|
|
223
|
-
label:
|
|
234
|
+
label: <h2>Machine 1</h2>,
|
|
224
235
|
value: 'machine 1',
|
|
225
236
|
},
|
|
226
237
|
{
|
|
227
|
-
label:
|
|
238
|
+
label: <h2>Machine 2</h2>,
|
|
228
239
|
value: 'machine 2',
|
|
229
240
|
},
|
|
230
241
|
{
|
|
231
|
-
label:
|
|
242
|
+
label: <h2>Machine 3</h2>,
|
|
232
243
|
value: 'machine 3',
|
|
233
244
|
},
|
|
234
245
|
{
|
|
235
|
-
label:
|
|
246
|
+
label: <h2>Machine 4</h2>,
|
|
236
247
|
value: 'machine 4',
|
|
237
248
|
},
|
|
238
249
|
]);
|
|
@@ -251,6 +262,8 @@ export const Machines: Story = {
|
|
|
251
262
|
key={index}
|
|
252
263
|
label="Machines"
|
|
253
264
|
variant="machines"
|
|
265
|
+
// labelAccessor='label'
|
|
266
|
+
// valueAccessor='value'
|
|
254
267
|
options={options}
|
|
255
268
|
onSelectButtonClick={handleSelectChange}
|
|
256
269
|
highlightedMachine={machine.label}
|
|
@@ -259,6 +272,8 @@ export const Machines: Story = {
|
|
|
259
272
|
))}
|
|
260
273
|
<MultiSelect
|
|
261
274
|
label="Machines"
|
|
275
|
+
labelAccessor='label'
|
|
276
|
+
valueAccessor='value'
|
|
262
277
|
withSelectButton
|
|
263
278
|
options={options}
|
|
264
279
|
onSelectButtonClick={handleSelectChange}
|
|
@@ -270,4 +285,6 @@ export const Machines: Story = {
|
|
|
270
285
|
},
|
|
271
286
|
};
|
|
272
287
|
|
|
288
|
+
|
|
289
|
+
|
|
273
290
|
export default meta;
|
|
@@ -29,9 +29,8 @@ const ChipElement = ({
|
|
|
29
29
|
return (
|
|
30
30
|
<div className="ff-multiselect-chip">
|
|
31
31
|
<span
|
|
32
|
-
className={`ff-multiselect-chip-label ${
|
|
33
|
-
|
|
34
|
-
}`}
|
|
32
|
+
className={`ff-multiselect-chip-label ${disableChip && 'label-padding'
|
|
33
|
+
}`}
|
|
35
34
|
>
|
|
36
35
|
<Tooltip
|
|
37
36
|
placement="bottom"
|
|
@@ -39,7 +38,8 @@ const ChipElement = ({
|
|
|
39
38
|
zIndex={zIndex + 1}
|
|
40
39
|
>
|
|
41
40
|
<Typography fontSize={10} lineHeight={'14px'} className="stye">
|
|
42
|
-
|
|
41
|
+
|
|
42
|
+
{typeof label==='string'? truncateText(label, 25):label}
|
|
43
43
|
</Typography>
|
|
44
44
|
</Tooltip>
|
|
45
45
|
</span>
|
|
@@ -59,26 +59,26 @@ const MultiSelect = ({
|
|
|
59
59
|
options = [],
|
|
60
60
|
type = 'text',
|
|
61
61
|
selectedOptions = [],
|
|
62
|
-
onChange = () => {},
|
|
62
|
+
onChange = () => { },
|
|
63
63
|
acceptNewOption = false,
|
|
64
64
|
zIndex = 100,
|
|
65
65
|
label = '',
|
|
66
|
-
onSearch = () => {},
|
|
66
|
+
onSearch = () => { },
|
|
67
67
|
required = false,
|
|
68
68
|
disabled = false,
|
|
69
69
|
errorMessage = 'Fill this field',
|
|
70
|
-
displayCount = false,
|
|
70
|
+
displayCount: initialDisplayCount = false,
|
|
71
71
|
placeholderForSearching = 'Search',
|
|
72
72
|
variant = 'default',
|
|
73
|
-
onLabelPlusIconClick = () => {},
|
|
74
|
-
onManageLabelsClick = () => {},
|
|
73
|
+
onLabelPlusIconClick = () => { },
|
|
74
|
+
onManageLabelsClick = () => { },
|
|
75
75
|
className = '',
|
|
76
76
|
highlightedMachine = '',
|
|
77
77
|
onSelectButtonClick = () => {},
|
|
78
|
-
labelAccessor = '',
|
|
79
|
-
valueAccessor =
|
|
78
|
+
labelAccessor = 'label',
|
|
79
|
+
valueAccessor = 'value',
|
|
80
80
|
withSelectButton = variant === 'machines' ? true : false,
|
|
81
|
-
onEnter=()=>{}
|
|
81
|
+
onEnter = () => { },
|
|
82
82
|
}: MultiSelectProps) => {
|
|
83
83
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
84
84
|
const [allOptions, setAllOptions] = useState(options);
|
|
@@ -88,6 +88,8 @@ const MultiSelect = ({
|
|
|
88
88
|
useState<boolean>(false);
|
|
89
89
|
const [inputError, setInputError] = useState<string>('');
|
|
90
90
|
const [displayIcon, setDisplayIcon] = useState<boolean>(false);
|
|
91
|
+
const [displayCount, setDisplayCount] =
|
|
92
|
+
useState<boolean>(initialDisplayCount);
|
|
91
93
|
|
|
92
94
|
const [dropdownPosition, setDropdownPosition] = useState<{
|
|
93
95
|
top: number;
|
|
@@ -109,7 +111,7 @@ const MultiSelect = ({
|
|
|
109
111
|
|
|
110
112
|
let isFieldSkipped = isSelectFocusedOnce && selectedOptions.length === 0;
|
|
111
113
|
|
|
112
|
-
const maxVisibleChips =
|
|
114
|
+
const maxVisibleChips = 12;
|
|
113
115
|
const hiddenCount = selectedOptions.length - maxVisibleChips;
|
|
114
116
|
|
|
115
117
|
const handleClick = () => {
|
|
@@ -132,7 +134,7 @@ const MultiSelect = ({
|
|
|
132
134
|
inputRef.current?.focus();
|
|
133
135
|
const updatedOptions = allOptions.map((option) =>
|
|
134
136
|
getValue(option, valueAccessor) ===
|
|
135
|
-
|
|
137
|
+
getValue(selectedOption, valueAccessor)
|
|
136
138
|
? { ...option, isChecked }
|
|
137
139
|
: option
|
|
138
140
|
);
|
|
@@ -169,7 +171,7 @@ const MultiSelect = ({
|
|
|
169
171
|
return;
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
|
-
|
|
174
|
+
onEnter?.(searchedKeyword);
|
|
173
175
|
setSearchedKeyword('');
|
|
174
176
|
setIsOpen(false);
|
|
175
177
|
}
|
|
@@ -202,17 +204,23 @@ const MultiSelect = ({
|
|
|
202
204
|
if (input.length > 2) {
|
|
203
205
|
const matchedOption = allOptions.find(
|
|
204
206
|
(option) =>
|
|
205
|
-
getLabel(option,
|
|
207
|
+
getLabel(option, valueAccessor)?.toLowerCase() === input.toLowerCase()
|
|
206
208
|
);
|
|
207
209
|
setDisplayIcon(!matchedOption);
|
|
208
210
|
} else {
|
|
209
211
|
setDisplayIcon(false);
|
|
210
212
|
}
|
|
211
213
|
};
|
|
214
|
+
|
|
215
|
+
const handleHiddenChips = () => {
|
|
216
|
+
setIsOpen(false);
|
|
217
|
+
setDisplayCount(false);
|
|
218
|
+
};
|
|
212
219
|
useEffect(() => {
|
|
213
220
|
const rect = dropdownWrapper.current?.getBoundingClientRect();
|
|
214
221
|
setDropdownPosition((prev) => ({ ...prev, width: rect?.width as number }));
|
|
215
222
|
}, [displayIcon]);
|
|
223
|
+
|
|
216
224
|
useEffect(() => {
|
|
217
225
|
if (isOpen) {
|
|
218
226
|
calculatePosition();
|
|
@@ -249,15 +257,15 @@ const MultiSelect = ({
|
|
|
249
257
|
};
|
|
250
258
|
}, [isOpen]);
|
|
251
259
|
useEffect(() => {
|
|
252
|
-
if (!checkEmpty(options
|
|
260
|
+
if (!checkEmpty(options)) {
|
|
253
261
|
let initializeOptions=options;
|
|
254
|
-
if(!checkEmpty(selectedOptions
|
|
262
|
+
if(!checkEmpty(selectedOptions)){
|
|
255
263
|
initializeOptions = options.map((option) => ({
|
|
256
264
|
...option,
|
|
257
265
|
isChecked: selectedOptions.some(
|
|
258
266
|
(selectedOption) =>
|
|
259
267
|
getValue(selectedOption, valueAccessor) ===
|
|
260
|
-
|
|
268
|
+
getValue(option, valueAccessor)
|
|
261
269
|
),
|
|
262
270
|
}));
|
|
263
271
|
}
|
|
@@ -392,7 +400,10 @@ const MultiSelect = ({
|
|
|
392
400
|
)}
|
|
393
401
|
</div>
|
|
394
402
|
{hiddenCount > 0 && displayCount && (
|
|
395
|
-
<div
|
|
403
|
+
<div
|
|
404
|
+
className="ff-multiselect-more-chip"
|
|
405
|
+
onClick={handleHiddenChips}
|
|
406
|
+
>
|
|
396
407
|
<Typography
|
|
397
408
|
fontSize={12}
|
|
398
409
|
fontWeight="semi-bold"
|
|
@@ -431,7 +442,7 @@ const MultiSelect = ({
|
|
|
431
442
|
className="error-text"
|
|
432
443
|
/>
|
|
433
444
|
)}
|
|
434
|
-
{displayIcon && variant==='labels' && (
|
|
445
|
+
{displayIcon && variant === 'labels' && (
|
|
435
446
|
<Typography
|
|
436
447
|
onClick={onManageLabelsClick}
|
|
437
448
|
fontSize={8}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { PhoneInputProps } from './types';
|
|
3
|
+
import PhoneInputField from './PhoneInput';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/PhoneInputComponent',
|
|
7
|
+
component: PhoneInputField,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = ({
|
|
11
|
+
value,
|
|
12
|
+
country,
|
|
13
|
+
width,
|
|
14
|
+
onChange,
|
|
15
|
+
placeholder,
|
|
16
|
+
onFocus,
|
|
17
|
+
onBlur,
|
|
18
|
+
isValid,
|
|
19
|
+
}: PhoneInputProps) => {
|
|
20
|
+
const [phone, setPhone] = useState<string>(value || '');
|
|
21
|
+
const [valid, setValid] = useState(true);
|
|
22
|
+
|
|
23
|
+
const handlePhoneChange = (newPhone: string) => {
|
|
24
|
+
setPhone(newPhone);
|
|
25
|
+
const validPhoneNumberLength = country === 'IN' ? 10 : newPhone.length;
|
|
26
|
+
const phoneIsValid = newPhone.length === validPhoneNumberLength;
|
|
27
|
+
setValid(phoneIsValid);
|
|
28
|
+
onChange(newPhone);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<PhoneInputField
|
|
33
|
+
value={phone}
|
|
34
|
+
country={country}
|
|
35
|
+
onChange={handlePhoneChange}
|
|
36
|
+
width={width}
|
|
37
|
+
placeholder={placeholder}
|
|
38
|
+
onFocus={onFocus}
|
|
39
|
+
onBlur={onBlur}
|
|
40
|
+
isValid={valid}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Default story
|
|
46
|
+
export const Default = Template.bind({});
|
|
47
|
+
Default.args = {
|
|
48
|
+
country: 'IN',
|
|
49
|
+
value: '9134567890',
|
|
50
|
+
width: '400px',
|
|
51
|
+
placeholder: 'Enter phone number',
|
|
52
|
+
onChange: () => {},
|
|
53
|
+
onFocus: () => {},
|
|
54
|
+
onBlur: () => {},
|
|
55
|
+
isValid: true,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Story with initial value
|
|
59
|
+
export const WithInitialValue = Template.bind({});
|
|
60
|
+
WithInitialValue.args = {
|
|
61
|
+
country: 'IN',
|
|
62
|
+
value: '9176543210',
|
|
63
|
+
width: '300px',
|
|
64
|
+
onChange: () => {},
|
|
65
|
+
placeholder: 'Enter phone number',
|
|
66
|
+
onFocus: () => {},
|
|
67
|
+
onBlur: () => {},
|
|
68
|
+
isValid: true,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Story with a custom country
|
|
72
|
+
export const WithCustomCountry = Template.bind({});
|
|
73
|
+
WithCustomCountry.args = {
|
|
74
|
+
country: 'IN',
|
|
75
|
+
value: '9176543210',
|
|
76
|
+
width: '300px',
|
|
77
|
+
onChange: () => {},
|
|
78
|
+
placeholder: 'Enter phone number',
|
|
79
|
+
onFocus: () => {},
|
|
80
|
+
onBlur: () => {},
|
|
81
|
+
isValid: true,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Story with empty value
|
|
85
|
+
export const EmptyValue = Template.bind({});
|
|
86
|
+
EmptyValue.args = {
|
|
87
|
+
country: 'IN',
|
|
88
|
+
value: '91',
|
|
89
|
+
width: '500px',
|
|
90
|
+
onChange: () => {},
|
|
91
|
+
placeholder: 'Enter phone number',
|
|
92
|
+
onFocus: () => {},
|
|
93
|
+
onBlur: () => {},
|
|
94
|
+
isValid: false,
|
|
95
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import PhoneInput from 'react-phone-input-2';
|
|
3
|
+
import 'react-phone-input-2/lib/style.css';
|
|
4
|
+
import { PhoneInputProps } from './types';
|
|
5
|
+
import Typography from '../Typography';
|
|
6
|
+
import './PhoneInput.scss';
|
|
7
|
+
|
|
8
|
+
const PhoneInputField: React.FC<PhoneInputProps> = ({
|
|
9
|
+
country,
|
|
10
|
+
value,
|
|
11
|
+
onChange,
|
|
12
|
+
width = '100%',
|
|
13
|
+
placeholder = 'Enter phone number',
|
|
14
|
+
onFocus,
|
|
15
|
+
onBlur,
|
|
16
|
+
}) => {
|
|
17
|
+
const [phone, setPhone] = useState<string>(value);
|
|
18
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
19
|
+
const [error, setError] = useState<string>('');
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (value !== phone) {
|
|
23
|
+
setPhone(value);
|
|
24
|
+
}
|
|
25
|
+
}, [value]);
|
|
26
|
+
|
|
27
|
+
const handlePhoneChange = (phone: string) => {
|
|
28
|
+
const numericPhone = phone.replace(/[^0-9+]/g, '');
|
|
29
|
+
const countryCode = numericPhone.startsWith('+')
|
|
30
|
+
? numericPhone.substring(0, 3)
|
|
31
|
+
: '';
|
|
32
|
+
let phoneNumber = numericPhone.replace(countryCode, '');
|
|
33
|
+
|
|
34
|
+
let validPhoneNumberLength = 10;
|
|
35
|
+
if (country === 'IN') {
|
|
36
|
+
if (phoneNumber.length < validPhoneNumberLength) {
|
|
37
|
+
setError('Phone number should be exactly 10 digits');
|
|
38
|
+
} else {
|
|
39
|
+
setError('');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (phoneNumber.length <= validPhoneNumberLength) {
|
|
44
|
+
setPhone(numericPhone);
|
|
45
|
+
onChange(numericPhone);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {
|
|
50
|
+
setIsFocused(true);
|
|
51
|
+
if (onFocus) onFocus(event);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {
|
|
55
|
+
setIsFocused(false);
|
|
56
|
+
if (onBlur) onBlur(event);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<PhoneInput
|
|
62
|
+
country={country}
|
|
63
|
+
value={phone}
|
|
64
|
+
onChange={handlePhoneChange}
|
|
65
|
+
inputStyle={{
|
|
66
|
+
width,
|
|
67
|
+
height: '32px',
|
|
68
|
+
border: isFocused
|
|
69
|
+
? '1px solid var(--brand-color)'
|
|
70
|
+
: error
|
|
71
|
+
? '1px solid var(--error_light)'
|
|
72
|
+
: '1px solid var(--default-color)',
|
|
73
|
+
borderRadius: '4px',
|
|
74
|
+
fontSize: '14px',
|
|
75
|
+
transition: 'border-color 0.3s ease',
|
|
76
|
+
}}
|
|
77
|
+
placeholder={placeholder}
|
|
78
|
+
onFocus={handleFocus}
|
|
79
|
+
onBlur={handleBlur}
|
|
80
|
+
/>
|
|
81
|
+
{error && !isFocused && (
|
|
82
|
+
<Typography color={'var(--error_light)'} className="error">
|
|
83
|
+
{error}
|
|
84
|
+
</Typography>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default PhoneInputField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './PhoneInput';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PhoneInputProps {
|
|
2
|
+
country: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (phone: string) => void;
|
|
5
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
6
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
7
|
+
width?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
isValid: any;
|
|
10
|
+
}
|
|
@@ -15,15 +15,16 @@ const meta: Meta<typeof PopUpModal> = {
|
|
|
15
15
|
type Story = StoryObj<typeof PopUpModal>;
|
|
16
16
|
|
|
17
17
|
const defaultArgs = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
iconName: "license_warning",
|
|
19
|
+
titleMessage: "Warning!",
|
|
20
|
+
subTitleMessage: "Unsaved Changes.",
|
|
21
|
+
modalMessage: "Your web service data will be lost. Are you sure you want to exit?",
|
|
22
|
+
footerMessage: "How do you want to proceed?",
|
|
23
|
+
firstButtonLabel: "Cancel",
|
|
24
|
+
secondButtonLabel: "Continue",
|
|
25
|
+
buttonVariant: "warning",
|
|
26
|
+
border: '1px solid var(--warning-modal-border-color)',
|
|
27
|
+
colorForTitleMessage: 'var(--status-button-bg-warning)'
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const DefaultModal: Story = {
|
|
@@ -41,12 +42,12 @@ export const ControlledPopUp: Story = {
|
|
|
41
42
|
render: () => {
|
|
42
43
|
const [isOpen, setIsOpen] = useState(false);
|
|
43
44
|
const handleContinue = () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
alert('Continued!');
|
|
46
|
+
setIsOpen(false);
|
|
47
|
+
};
|
|
47
48
|
return (
|
|
48
49
|
<>
|
|
49
|
-
<Button variant="warning" onClick={() => setIsOpen(true)} label='Open PopUp'/>
|
|
50
|
+
<Button variant="warning" onClick={() => setIsOpen(true)} label='Open PopUp' />
|
|
50
51
|
<PopUpModal
|
|
51
52
|
{...defaultArgs}
|
|
52
53
|
isOpen={isOpen}
|
|
@@ -19,6 +19,7 @@ const PopUpModal: FC<PopUpModalProps> = ({
|
|
|
19
19
|
secondButtonLabel = 'Continue',
|
|
20
20
|
buttonVariant = 'warning',
|
|
21
21
|
border = '1px solid var(--warning-modal-border-color)',
|
|
22
|
+
colorForTitleMessage = 'var(--status-button-bg-warning)'
|
|
22
23
|
}) => {
|
|
23
24
|
return (
|
|
24
25
|
<Modal
|
|
@@ -43,7 +44,7 @@ const PopUpModal: FC<PopUpModalProps> = ({
|
|
|
43
44
|
>
|
|
44
45
|
{' '}
|
|
45
46
|
<Typography
|
|
46
|
-
color=
|
|
47
|
+
color={`${colorForTitleMessage}`}
|
|
47
48
|
fontSize={20}
|
|
48
49
|
fontWeight="semi-bold"
|
|
49
50
|
>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export interface PopUpModalProps {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onContinue?: () => void;
|
|
5
|
+
titleMessage: string;
|
|
6
|
+
subTitleMessage?: string;
|
|
7
|
+
iconName: string;
|
|
8
|
+
modalMessage: string;
|
|
9
|
+
footerMessage: string;
|
|
10
|
+
firstButtonLabel?: string;
|
|
11
|
+
secondButtonLabel: string;
|
|
12
|
+
buttonVariant: any;
|
|
13
|
+
border: string;
|
|
14
|
+
colorForTitleMessage?: string;
|
|
15
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
2
|
import Search from './Search';
|
|
3
|
+
import React,{ useState } from 'react';
|
|
4
4
|
const meta: Meta<typeof Search> = {
|
|
5
5
|
title: 'Components/Search',
|
|
6
6
|
component: Search,
|
|
@@ -11,15 +11,34 @@ const meta: Meta<typeof Search> = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
type Story = StoryObj<typeof Search>;
|
|
14
|
-
const defaultArgs = {
|
|
15
|
-
placeholder: 'Search',
|
|
16
|
-
onSearch: (query: string) => alert(`Searching for: ${query}`),
|
|
17
|
-
disabled: false,
|
|
18
|
-
width: 200,
|
|
19
|
-
};
|
|
20
14
|
export const Default: Story = {
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
render: () => {
|
|
16
|
+
const [isExpand, setIsExpand] = useState(false);
|
|
17
|
+
const [searchValue, setSearchValue] = useState('');
|
|
18
|
+
|
|
19
|
+
const handleSearch = (value: string) => {
|
|
20
|
+
alert(`Searching for: ${value}`);
|
|
21
|
+
setSearchValue(value);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const handleClose = () => {
|
|
25
|
+
setIsExpand(false);
|
|
26
|
+
setSearchValue('');
|
|
27
|
+
};
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<Search
|
|
31
|
+
placeholder="Search here..."
|
|
32
|
+
isExpand={isExpand}
|
|
33
|
+
value={searchValue}
|
|
34
|
+
onSearch={handleSearch}
|
|
35
|
+
onExpand={(expand) => setIsExpand(expand)}
|
|
36
|
+
onClose={handleClose}
|
|
37
|
+
disabled={false}
|
|
38
|
+
width={200}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
23
42
|
},
|
|
24
43
|
};
|
|
25
44
|
|