Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
859e1f1
WIP search bar changes
Oct 25, 2019
9b94d6c
add search bar component, reorganize a bit
michsa Oct 26, 2019
e74e423
TagQueryPopover: move HOCs to export
michsa Oct 28, 2019
cf2d79b
rename criteriaPath to path (for contexturify)
michsa Oct 28, 2019
4591489
fix getTag
michsa Oct 28, 2019
ee21663
try out wrapTag for tag popovers
michsa Oct 28, 2019
447e59d
wrap tag from theme instead
michsa Oct 28, 2019
7bf187a
move TagsQuery stuff into its own folder
michsa Oct 28, 2019
e23b919
add the main popover menu & rename to ActionsMenu
michsa Oct 28, 2019
76dfe8e
TagsInputSearchBar wip
michsa Oct 28, 2019
7931360
add inline-block styling to tags and Expand icon
michsa Oct 21, 2019
50e446a
add isOneLine, clean up TagsInputSearchBar
michsa Oct 28, 2019
caea5d7
remove scrollbar styles on collapsed TagsInput
michsa Oct 28, 2019
1ff9eb9
add expansion stuff to TagsQuery
michsa Oct 28, 2019
a4ecc73
GreyVest theme: add border to TagsQuery instead of TagsInput
michsa Oct 28, 2019
780e75a
move ExpandArrow to its own file, add icon
michsa Oct 28, 2019
a3ea4d8
super clean ExpandableTagsQuery :)
michsa Oct 28, 2019
f2cdbf6
move ExpandableTagsQuery out of TagsQuery directory
michsa Oct 28, 2019
bbd24d0
reverse ExpandableTagsInput tags
michsa Oct 28, 2019
f287248
TagsQuery popover stuff
michsa Oct 28, 2019
a5f49b2
fix tag popovers derendering on change
michsa Oct 28, 2019
fa66cfb
make tag popovers better
michsa Oct 28, 2019
5487eba
remove searchBarLayout story
michsa Oct 28, 2019
e60f07c
fix react key console errors from ErrorList
michsa Oct 29, 2019
7a04bdd
fix TagsQuery overflow icon with minmax grid thing
michsa Oct 29, 2019
bd1e6eb
install react-measure
michsa Oct 29, 2019
754c506
fix search bar click-through handling
michsa Oct 29, 2019
67ef83e
feedback
michsa Oct 29, 2019
d2de5e0
do the measure thing
michsa Oct 29, 2019
192ade3
add Tag to GreyVest theme
michsa Oct 29, 2019
10dc4d3
update changelog
michsa Oct 29, 2019
0be344c
Merge branch 'master' into feature/345_SearchBarStyling
michsa Oct 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.5.0
* ExampleTypes: Add an expanding/collapsing TagsQuerySearchBar component

# 2.4.1
* Adds the latest version of Moment to the dependencies

Expand Down
21 changes: 18 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contexture-react",
"version": "2.4.1",
"version": "2.5.0",
"description": "React components for building contexture interfaces",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -124,6 +124,7 @@
"react-date-picker": "^7.2.0",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-measure": "^2.3.0",
"react-outside-click-handler": "^1.2.3",
"recompose": "^0.30.0"
},
Expand Down
42 changes: 42 additions & 0 deletions src/exampleTypes/ExpandableTagsQuery/ExpandArrow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import F from 'futil-js'
import _ from 'lodash/fp'
import { observer } from 'mobx-react'
import { Flex } from '../../greyVest'
import { withTheme } from '../../utils/theme'

let ExpandArrow = ({ collapse, tagsLength, style, theme: { Icon } }) =>
!!(F.view(collapse) && tagsLength) && (
<div className="expand-arrow" onClick={F.off(collapse)} style={style}>
<div
style={{
height: 0,
cursor: 'pointer',
textAlign: 'center',
}}
title="Expand to see all tags"
>
<Flex
style={{
display: 'inline-flex',
backgroundColor: 'white',
borderRadius: 4,
padding: '5px 12px',
boxShadow: '0 1px 4px 0 rgba(39, 44, 65, 0.1)',
color: '#9b9b9b',
fontWeight: 400,
}}
alignItems="center"
justifyContent="center"
>
View all {tagsLength} tags
<Icon icon="Expand" style={{ fontSize: 16, marginLeft: 6 }} />
</Flex>
</div>
</div>
)

export default _.flow(
observer,
withTheme
)(ExpandArrow)
30 changes: 30 additions & 0 deletions src/exampleTypes/ExpandableTagsQuery/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react'
import _ from 'lodash/fp'
import F from 'futil-js'
import { withContentRect } from 'react-measure'
import { contexturify } from '../../utils/hoc'
import TagsQuery from '../TagsQuery'
import ExpandArrow from './ExpandArrow'

let collapsedStyle = {
maxHeight: 40,
overflowY: 'auto',
}

let ExpandableTagsQuery = ({ measureRef, contentRect, collapse, ...props }) => (
<>
<div style={F.view(collapse) ? collapsedStyle : {}}>
<div ref={measureRef}>
<TagsQuery {...props} />
</div>
</div>
{F.view(collapse) && contentRect.entry.height > 70 && (
<ExpandArrow collapse={collapse} tagsLength={props.node.tags.length} />
)}
</>
)

export default _.flow(
contexturify,
withContentRect()
)(ExpandableTagsQuery)
142 changes: 0 additions & 142 deletions src/exampleTypes/TagsQuery.js

This file was deleted.

59 changes: 59 additions & 0 deletions src/exampleTypes/TagsQuery/ActionsMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from 'react'
import _ from 'lodash/fp'
import F from 'futil-js'
import { observer } from 'mobx-react'
import TagsJoinPicker from '../TagsJoinPicker'
import { withTheme } from '../../utils/theme'
import { Flex } from '../../greyVest'
import { copyTags } from './utils'

let ActionsMenu = ({ node, tree, open, theme: { Button, Checkbox } }) => (
<Flex
style={{ minWidth: 240, padding: 10 }}
className="tags-query-actions-menu"
column
justifyContent="stretch"
alignItems="stretch"
>
{!!_.get('tags.length', node) && (
<>
<Button
onClick={() => {
copyTags(node)
F.off(open)()
}}
>
Copy Keywords
Comment thread
michsa marked this conversation as resolved.
</Button>
<Button
style={{ margin: '10px 0' }}
onClick={() => {
tree.mutate(node.path, {
tags: [],
})
F.off(open)()
}}
>
Clear Keywords
Comment thread
daedalus28 marked this conversation as resolved.
</Button>
<div className="line-separator" />
</>
)}
<label className="labeled-checkbox" style={{ margin: '10px 0' }}>
<Checkbox
htmlId="stemming"
checked={!node.exact}
onChange={e => tree.mutate(node.path, { exact: !e.target.checked })}
/>
<span>Include word variations</span>
</label>
<div>
<TagsJoinPicker node={node} tree={tree} />
</div>
</Flex>
)

export default _.flow(
observer,
withTheme
)(ActionsMenu)
Loading