pixel-react-excel-sheet 1.0.10 → 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 +3372 -747
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3377 -746
- 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 +3 -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/RowIndicator.tsx +1 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +25 -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
|
@@ -5,6 +5,8 @@ interface ModalDimensions {
|
|
|
5
5
|
borderRadius?: number;
|
|
6
6
|
zIndex?: number;
|
|
7
7
|
boxShadow?: string;
|
|
8
|
+
left?: number;
|
|
9
|
+
top?: number;
|
|
8
10
|
}
|
|
9
11
|
export interface MiniEditModalProps {
|
|
10
12
|
/**
|
|
@@ -94,6 +96,11 @@ export interface MiniEditModalProps {
|
|
|
94
96
|
boxShadow?: string;
|
|
95
97
|
};
|
|
96
98
|
arrowZIndex?: number;
|
|
99
|
+
arrowProperties?: {
|
|
100
|
+
left?: number;
|
|
101
|
+
top?: number;
|
|
102
|
+
size?: number;
|
|
103
|
+
};
|
|
97
104
|
overlay?: {
|
|
98
105
|
isOverlay?: boolean;
|
|
99
106
|
zIndexOverlay?: number;
|
|
@@ -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;
|
|
@@ -87,7 +87,7 @@ export const Default3: Story = {
|
|
|
87
87
|
};
|
|
88
88
|
export const EmailGroup: Story = {
|
|
89
89
|
render: () => {
|
|
90
|
-
const [options,setOptions] = useState([
|
|
90
|
+
const [options, setOptions] = useState([
|
|
91
91
|
{
|
|
92
92
|
label: 'Sample1@gmail.com',
|
|
93
93
|
value: 'sample1@gmail.com',
|
|
@@ -109,9 +109,9 @@ export const EmailGroup: Story = {
|
|
|
109
109
|
) => {
|
|
110
110
|
setSelectedOptions(options);
|
|
111
111
|
};
|
|
112
|
-
const onEnter=(newOption:string)=>{
|
|
113
|
-
setOptions(prev=>[...prev,{label:newOption,value:newOption}])
|
|
114
|
-
setSelectedOptions(prev=>[...prev,{label:newOption,value:newOption}])
|
|
112
|
+
const onEnter = (newOption: string) => {
|
|
113
|
+
setOptions(prev => [...prev, { label: newOption, value: newOption }])
|
|
114
|
+
setSelectedOptions(prev => [...prev, { label: newOption, value: newOption }])
|
|
115
115
|
}
|
|
116
116
|
return (
|
|
117
117
|
<MultiSelect
|
|
@@ -153,8 +153,21 @@ export const Controlled: Story = {
|
|
|
153
153
|
{ label: 'Kiwi', value: 'kiwi' },
|
|
154
154
|
{ label: 'Mango', value: 'mango' },
|
|
155
155
|
{ label: 'Orange', value: 'orange' },
|
|
156
|
-
{ label: '
|
|
156
|
+
{ label: 'Plum', value: 'plum' },
|
|
157
|
+
{ label: 'Berry', value: 'berry' },
|
|
158
|
+
{ label: 'Watermelon', value: 'watermelon' },
|
|
159
|
+
{ label: 'Guava', value: 'guava' },
|
|
160
|
+
{ label: 'Pineapple', value: 'pineapple' },
|
|
157
161
|
{ label: 'Strawberry', value: 'strawberry' },
|
|
162
|
+
{ label: 'Pear', value: 'pear' },
|
|
163
|
+
{ label: 'Peach', value: 'peach' },
|
|
164
|
+
{ label: 'Lemon', value: 'lemon' },
|
|
165
|
+
{ label: 'Papaya', value: 'papaya' },
|
|
166
|
+
{ label: 'Apricot', value: 'apricot' },
|
|
167
|
+
{ label: 'Raspberry', value: 'raspberry' },
|
|
168
|
+
{ label: 'Pomegranate', value: 'pomegranate' },
|
|
169
|
+
{ label: 'Cantaloupe', value: 'cantaloupe' },
|
|
170
|
+
{ label: 'Lychee', value: 'lychee' }
|
|
158
171
|
]);
|
|
159
172
|
}, []);
|
|
160
173
|
return (
|
|
@@ -162,6 +175,7 @@ export const Controlled: Story = {
|
|
|
162
175
|
label={'Fruits'}
|
|
163
176
|
required
|
|
164
177
|
options={options}
|
|
178
|
+
displayCount
|
|
165
179
|
selectedOptions={selectedOptions}
|
|
166
180
|
onChange={onChange}
|
|
167
181
|
/>
|
|
@@ -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"
|
|
@@ -59,26 +58,26 @@ const MultiSelect = ({
|
|
|
59
58
|
options = [],
|
|
60
59
|
type = 'text',
|
|
61
60
|
selectedOptions = [],
|
|
62
|
-
onChange = () => {},
|
|
61
|
+
onChange = () => { },
|
|
63
62
|
acceptNewOption = false,
|
|
64
63
|
zIndex = 100,
|
|
65
64
|
label = '',
|
|
66
|
-
onSearch = () => {},
|
|
65
|
+
onSearch = () => { },
|
|
67
66
|
required = false,
|
|
68
67
|
disabled = false,
|
|
69
68
|
errorMessage = 'Fill this field',
|
|
70
|
-
displayCount = false,
|
|
69
|
+
displayCount: initialDisplayCount = false,
|
|
71
70
|
placeholderForSearching = 'Search',
|
|
72
71
|
variant = 'default',
|
|
73
|
-
onLabelPlusIconClick = () => {},
|
|
74
|
-
onManageLabelsClick = () => {},
|
|
72
|
+
onLabelPlusIconClick = () => { },
|
|
73
|
+
onManageLabelsClick = () => { },
|
|
75
74
|
className = '',
|
|
76
75
|
highlightedMachine = '',
|
|
77
|
-
onSelectButtonClick = () => {},
|
|
76
|
+
onSelectButtonClick = () => { },
|
|
78
77
|
labelAccessor = '',
|
|
79
78
|
valueAccessor = labelAccessor,
|
|
80
79
|
withSelectButton = variant === 'machines' ? true : false,
|
|
81
|
-
onEnter=()=>{}
|
|
80
|
+
onEnter = () => { },
|
|
82
81
|
}: MultiSelectProps) => {
|
|
83
82
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
84
83
|
const [allOptions, setAllOptions] = useState(options);
|
|
@@ -88,6 +87,8 @@ const MultiSelect = ({
|
|
|
88
87
|
useState<boolean>(false);
|
|
89
88
|
const [inputError, setInputError] = useState<string>('');
|
|
90
89
|
const [displayIcon, setDisplayIcon] = useState<boolean>(false);
|
|
90
|
+
const [displayCount, setDisplayCount] =
|
|
91
|
+
useState<boolean>(initialDisplayCount);
|
|
91
92
|
|
|
92
93
|
const [dropdownPosition, setDropdownPosition] = useState<{
|
|
93
94
|
top: number;
|
|
@@ -109,7 +110,7 @@ const MultiSelect = ({
|
|
|
109
110
|
|
|
110
111
|
let isFieldSkipped = isSelectFocusedOnce && selectedOptions.length === 0;
|
|
111
112
|
|
|
112
|
-
const maxVisibleChips =
|
|
113
|
+
const maxVisibleChips = 12;
|
|
113
114
|
const hiddenCount = selectedOptions.length - maxVisibleChips;
|
|
114
115
|
|
|
115
116
|
const handleClick = () => {
|
|
@@ -132,7 +133,7 @@ const MultiSelect = ({
|
|
|
132
133
|
inputRef.current?.focus();
|
|
133
134
|
const updatedOptions = allOptions.map((option) =>
|
|
134
135
|
getValue(option, valueAccessor) ===
|
|
135
|
-
|
|
136
|
+
getValue(selectedOption, valueAccessor)
|
|
136
137
|
? { ...option, isChecked }
|
|
137
138
|
: option
|
|
138
139
|
);
|
|
@@ -169,7 +170,7 @@ const MultiSelect = ({
|
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
|
|
173
|
+
onEnter?.(searchedKeyword);
|
|
173
174
|
setSearchedKeyword('');
|
|
174
175
|
setIsOpen(false);
|
|
175
176
|
}
|
|
@@ -209,10 +210,16 @@ const MultiSelect = ({
|
|
|
209
210
|
setDisplayIcon(false);
|
|
210
211
|
}
|
|
211
212
|
};
|
|
213
|
+
|
|
214
|
+
const handleHiddenChips = () => {
|
|
215
|
+
setIsOpen(false);
|
|
216
|
+
setDisplayCount(false);
|
|
217
|
+
};
|
|
212
218
|
useEffect(() => {
|
|
213
219
|
const rect = dropdownWrapper.current?.getBoundingClientRect();
|
|
214
220
|
setDropdownPosition((prev) => ({ ...prev, width: rect?.width as number }));
|
|
215
221
|
}, [displayIcon]);
|
|
222
|
+
|
|
216
223
|
useEffect(() => {
|
|
217
224
|
if (isOpen) {
|
|
218
225
|
calculatePosition();
|
|
@@ -250,14 +257,14 @@ const MultiSelect = ({
|
|
|
250
257
|
}, [isOpen]);
|
|
251
258
|
useEffect(() => {
|
|
252
259
|
if (!checkEmpty(options?.length)) {
|
|
253
|
-
let initializeOptions=options;
|
|
254
|
-
if(!checkEmpty(selectedOptions?.length)){
|
|
255
|
-
|
|
260
|
+
let initializeOptions = options;
|
|
261
|
+
if (!checkEmpty(selectedOptions?.length)) {
|
|
262
|
+
initializeOptions = options.map((option) => ({
|
|
256
263
|
...option,
|
|
257
264
|
isChecked: selectedOptions.some(
|
|
258
265
|
(selectedOption) =>
|
|
259
266
|
getValue(selectedOption, valueAccessor) ===
|
|
260
|
-
|
|
267
|
+
getValue(option, valueAccessor)
|
|
261
268
|
),
|
|
262
269
|
}));
|
|
263
270
|
}
|
|
@@ -392,7 +399,10 @@ const MultiSelect = ({
|
|
|
392
399
|
)}
|
|
393
400
|
</div>
|
|
394
401
|
{hiddenCount > 0 && displayCount && (
|
|
395
|
-
<div
|
|
402
|
+
<div
|
|
403
|
+
className="ff-multiselect-more-chip"
|
|
404
|
+
onClick={handleHiddenChips}
|
|
405
|
+
>
|
|
396
406
|
<Typography
|
|
397
407
|
fontSize={12}
|
|
398
408
|
fontWeight="semi-bold"
|
|
@@ -431,7 +441,7 @@ const MultiSelect = ({
|
|
|
431
441
|
className="error-text"
|
|
432
442
|
/>
|
|
433
443
|
)}
|
|
434
|
-
{displayIcon && variant==='labels' && (
|
|
444
|
+
{displayIcon && variant === 'labels' && (
|
|
435
445
|
<Typography
|
|
436
446
|
onClick={onManageLabelsClick}
|
|
437
447
|
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(--select-license-header-text-color)'
|
|
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
|
+
}
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
.ff-select-input-icon {
|
|
55
|
+
margin-left: 6px;
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
.ff-select-inputField {
|
|
55
59
|
@extend .fontSm;
|
|
56
60
|
width: calc(100% - 8px);
|
|
@@ -66,6 +70,15 @@
|
|
|
66
70
|
cursor: not-allowed;
|
|
67
71
|
color: var(--ff-select-border-color);
|
|
68
72
|
}
|
|
73
|
+
|
|
74
|
+
&__readonly {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__icon {
|
|
79
|
+
width: calc(100% - 36px);
|
|
80
|
+
padding: 4;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
.ff-select-arrows-wrapper {
|
|
@@ -95,12 +108,17 @@
|
|
|
95
108
|
transition: 0.18s ease all;
|
|
96
109
|
border-radius: 4px;
|
|
97
110
|
|
|
111
|
+
&__icon {
|
|
112
|
+
left: 24px;
|
|
113
|
+
}
|
|
114
|
+
|
|
98
115
|
&__active {
|
|
99
116
|
transform: translateY(-16px);
|
|
100
117
|
transition: 0.18s ease all;
|
|
101
118
|
background-color: var(--ff-select-background-color);
|
|
102
119
|
padding: 0 2px;
|
|
103
120
|
z-index: 100000;
|
|
121
|
+
left: 8px;
|
|
104
122
|
}
|
|
105
123
|
}
|
|
106
124
|
|
|
@@ -120,6 +138,7 @@
|
|
|
120
138
|
padding: 0 2px;
|
|
121
139
|
line-height: 18px;
|
|
122
140
|
z-index: 100000;
|
|
141
|
+
left: 8px;
|
|
123
142
|
}
|
|
124
143
|
|
|
125
144
|
.ff-select-arrows-wrapper {
|
|
@@ -174,6 +193,7 @@
|
|
|
174
193
|
background-color: var(--ff-select-background-color);
|
|
175
194
|
padding: 0 2px;
|
|
176
195
|
line-height: 18px;
|
|
196
|
+
left: 8px;
|
|
177
197
|
}
|
|
178
198
|
}
|
|
179
199
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
1
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
4
|
import Select from './Select';
|
|
3
|
-
import { useState } from 'react';
|
|
4
5
|
import { Option } from './types';
|
|
5
6
|
import RadioGroup from '../RadioGroup';
|
|
6
7
|
|
|
@@ -303,4 +304,52 @@ export const updateOptionFromOutside: Story = {
|
|
|
303
304
|
},
|
|
304
305
|
};
|
|
305
306
|
|
|
307
|
+
export const IconOptionSelection: Story = {
|
|
308
|
+
render: () => {
|
|
309
|
+
const optionsList = [
|
|
310
|
+
{
|
|
311
|
+
label: 'fire-flink-LIC4900-onPrem',
|
|
312
|
+
value: 'fire-flink-LIC4900-onPrem',
|
|
313
|
+
iconName: 'local',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
label: 'fire-flink-LIC3179',
|
|
317
|
+
value: 'fire-flink-LIC3179',
|
|
318
|
+
iconName: 'chrome_icon',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
label: 'fire-flink-LIC4937',
|
|
322
|
+
value: 'fire-flink-LIC4937',
|
|
323
|
+
iconName: 'mac_icon',
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
label: 'fire-flink-LIC4999',
|
|
327
|
+
value: 'fire-flink-LIC4999',
|
|
328
|
+
iconName: 'web_icon',
|
|
329
|
+
},
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
const [selectedOption, setSelectedOption] = useState<Option>({
|
|
333
|
+
label: 'fire-flink-LIC3179',
|
|
334
|
+
value: 'fire-flink-LIC3179',
|
|
335
|
+
iconName: 'local',
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const handleChange = (option: Option) => {
|
|
339
|
+
setSelectedOption(option);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
return (
|
|
343
|
+
<Select
|
|
344
|
+
label="Option"
|
|
345
|
+
optionsList={optionsList}
|
|
346
|
+
selectedOption={selectedOption}
|
|
347
|
+
onChange={handleChange}
|
|
348
|
+
showIcon={true}
|
|
349
|
+
width={200}
|
|
350
|
+
/>
|
|
351
|
+
);
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
|
|
306
355
|
export default meta;
|