-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/TextArea_FC
- Loading branch information
Showing
68 changed files
with
3,276 additions
and
2,804 deletions.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
app/src/docs/_examples/pickerInput/PickerTogglerTagDemo.example.tsx
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,55 @@ | ||
import React, { useState } from 'react'; | ||
import { DataQueryFilter, useLazyDataSource, useUuiContext } from '@epam/uui-core'; | ||
import { FlexCell, PickerInput, PickerTogglerTag, PickerTogglerTagProps, Tooltip } from '@epam/uui'; | ||
import { Location } from '@epam/uui-docs'; | ||
|
||
export default function PickerTogglerTagDemoExample() { | ||
const svc = useUuiContext(); | ||
const [value, onValueChange] = useState<string[]>(['225284', '2747351', '3119841', '3119746']); | ||
|
||
const dataSource = useLazyDataSource<Location, string, DataQueryFilter<Location>>( | ||
{ | ||
api: (request, ctx) => { | ||
const { search } = request; | ||
// and since parentId is meaningful value, it is required to exclude it from the filter. | ||
const filter = search ? {} : { parentId: ctx?.parentId }; | ||
return svc.api.demo.locations({ ...request, search, filter }); | ||
}, | ||
getId: (i) => i.id, | ||
getParentId: (i) => i.parentId, | ||
getChildCount: (l) => l.childCount, | ||
}, | ||
[], | ||
); | ||
|
||
const renderTag = (props: PickerTogglerTagProps<Location, string>) => { | ||
if (props.isCollapsed) { | ||
// rendering '+ N items selected' Tag | ||
return ( | ||
<PickerTogglerTag { ...props } key="selected" /> | ||
); | ||
} else { | ||
// rendering all other Tags with Tooltip | ||
return ( | ||
<Tooltip key={ props.rowProps?.id } content={ `${props.rowProps?.value?.tz}/${props.caption}` }> | ||
<PickerTogglerTag { ...props } /> | ||
</Tooltip> | ||
); | ||
} | ||
}; | ||
|
||
return ( | ||
<FlexCell width={ 300 }> | ||
<PickerInput | ||
dataSource={ dataSource } | ||
value={ value } | ||
onValueChange={ onValueChange } | ||
entityName="location" | ||
selectionMode="multi" | ||
valueType="id" | ||
maxItems={ 2 } | ||
renderTag={ (props) => renderTag(props) } | ||
/> | ||
</FlexCell> | ||
); | ||
} |
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
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
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 |
---|---|---|
@@ -1,21 +1,11 @@ | ||
{ | ||
"object": "value", | ||
"document": { | ||
"object": "document", | ||
[ | ||
{ | ||
"data": {}, | ||
"nodes": [ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"object": "block", | ||
"type": "paragraph", | ||
"data": {}, | ||
"nodes": [ | ||
{ | ||
"object": "text", | ||
"text": "An adaptive panel component is used to layout items inside some adaptive panel. It measures the item's width and tries to fit them inside a container. If some items can't fit, they will be hidden according to their priorities. Hidden items can then be shown inside a drop-down menu, or other container.", | ||
"marks": [] | ||
} | ||
] | ||
"text": "An adaptive panel component adjusts the set of its children according to its width. It measures each item's width and tries to fit as many items as possible. If some items can't fit, they will be hidden according to their priorities. Hidden items can then be collapsed to a drop-down menu, or other container." | ||
} | ||
] | ||
} | ||
} | ||
] |
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.