-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maxime Rainville
committed
Sep 10, 2023
1 parent
94c787a
commit 2af595b
Showing
19 changed files
with
388 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.any-field-box { | ||
.form-control.any-field-box { | ||
display: flex; | ||
height: 54px; | ||
background: white; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable */ | ||
import i18n from 'i18n'; | ||
import React, { Fragment } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { SortableHandle } from 'react-sortable-hoc'; | ||
import classnames from 'classnames'; | ||
|
||
const AnyPickerTitleHandle = SortableHandle(({ className }) => ( | ||
<span | ||
className={classnames('any-picker-title__handle font-icon-drag-handle', className)} | ||
aria-label='Reorder element' /> | ||
)); | ||
|
||
AnyPickerTitleHandle.propTypes = { | ||
className: PropTypes.string, | ||
}; | ||
|
||
AnyPickerTitleHandle.defaultProps = { }; | ||
|
||
export default AnyPickerTitleHandle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import AnyPickerMenu from '../AnyPicker/AnyPickerMenu'; | ||
import AnyPickerTitle from '../AnyPicker/AnyPickerTitle'; | ||
import AnyFieldBox from '../AnyFieldBox/AnyFieldBox'; | ||
import { SortableContainer, SortableElement } from 'react-sortable-hoc'; | ||
|
||
|
||
const SortablePicker = SortableElement((props) => ( | ||
<AnyPickerTitle {...props} sortable /> | ||
)); | ||
|
||
const ManyAnyList = SortableContainer(({ | ||
dataobjects, onEdit, onClear, sortable | ||
}) => { | ||
const Picker = sortable ? SortablePicker : AnyPickerTitle; | ||
return ( | ||
<AnyFieldBox className="multi-any-picker__list"> | ||
{ dataobjects.map(({ ID, ...dataobject }, index) => ( | ||
<Picker | ||
{...dataobject} | ||
className="multi-any-picker__dataobject" | ||
key={`${ID} ${dataobject.description}`} | ||
index={index} | ||
onClear={(event) => onClear(event, ID)} | ||
onClick={() => onEdit(ID)} | ||
/> | ||
)) } | ||
</AnyFieldBox> | ||
); | ||
}); | ||
|
||
|
||
ManyAnyList.propTypes = { | ||
...AnyPickerMenu.propTypes, | ||
dataobjects: PropTypes.arrayOf(PropTypes.shape(AnyPickerTitle.propTypes)), | ||
onEdit: PropTypes.func, | ||
onClear: PropTypes.func, | ||
sortable: PropTypes.func | ||
}; | ||
|
||
|
||
export { ManyAnyList as Component }; | ||
|
||
export default ManyAnyList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.