Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor button styling adjustments #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions es/components/browse/components/FacetList/FacetOfFacets.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ export var FacetOfFacets = /*#__PURE__*/function (_React$PureComponent) {
return /*#__PURE__*/React.createElement("div", {
className: "facet" + (facetOpen || anySelections ? ' open' : ' closed'),
"data-group": title
}, /*#__PURE__*/React.createElement("h5", {
className: "facet-title",
}, /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn facet-title",
onClick: this.handleOpenToggleClick
}, /*#__PURE__*/React.createElement("span", {
className: "expand-toggle col-auto px-0"
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-" + (anySelections ? "dot-circle far" : facetOpen ? "minus fas" : "plus fas")
})), /*#__PURE__*/React.createElement("div", {
className: "col px-0 line-height-1"
className: "col px-0 text-left"
}, /*#__PURE__*/React.createElement("span", {
"data-tip": tooltip,
"data-place": "right"
Expand Down
61 changes: 40 additions & 21 deletions es/components/browse/components/FacetList/FacetTermsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,16 @@ export var FacetTermsList = /*#__PURE__*/function (_React$PureComponent2) {
return /*#__PURE__*/React.createElement("div", {
className: "facet" + (facetOpen || allTermsSelected ? ' open' : ' closed'),
"data-field": facet.field
}, /*#__PURE__*/React.createElement("h5", {
className: "facet-title",
}, /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn facet-title",
onClick: this.handleOpenToggleClick
}, /*#__PURE__*/React.createElement("span", {
className: "expand-toggle col-auto px-0"
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-" + (allTermsSelected ? "dot-circle far" : (facetOpen ? "minus" : "plus") + " fas")
})), /*#__PURE__*/React.createElement("div", {
className: "col px-0 line-height-1"
className: "col px-0 text-left"
}, /*#__PURE__*/React.createElement("span", {
"data-tip": facetSchemaDescription || fieldSchemaDescription,
"data-html": true,
Expand Down Expand Up @@ -618,20 +619,6 @@ var ListOfTerms = /*#__PURE__*/React.memo(function (props) {
}

if (Array.isArray(collapsibleTerms)) {
var expandButtonTitle;

if (expanded) {
expandButtonTitle = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-minus fas"
}), " Collapse");
} else {
expandButtonTitle = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-plus fas"
}), " View ", collapsibleTermsCount, " More", /*#__PURE__*/React.createElement("span", {
className: "pull-right"
}, collapsibleTermsItemCount));
}

return /*#__PURE__*/React.createElement("div", commonProps, /*#__PURE__*/React.createElement(PartialList, {
className: "mb-0 active-terms-pl",
open: facetOpen,
Expand All @@ -643,10 +630,12 @@ var ListOfTerms = /*#__PURE__*/React.memo(function (props) {
collapsible: collapsibleTerms
}), /*#__PURE__*/React.createElement("div", {
className: "pt-08 pb-0"
}, /*#__PURE__*/React.createElement("div", {
className: "view-more-button",
onClick: onToggleExpanded
}, expandButtonTitle)))
}, /*#__PURE__*/React.createElement(ViewMoreExpandButton, {
expanded: expanded,
collapsibleTermsCount: collapsibleTermsCount,
collapsibleTermsItemCount: collapsibleTermsItemCount,
onToggle: onToggleExpanded
})))
}));
} else {
return /*#__PURE__*/React.createElement("div", commonProps, /*#__PURE__*/React.createElement(PartialList, {
Expand All @@ -657,6 +646,36 @@ var ListOfTerms = /*#__PURE__*/React.memo(function (props) {
}));
}
});
export function ViewMoreExpandButton(props) {
var _props$expanded = props.expanded,
expanded = _props$expanded === void 0 ? false : _props$expanded,
onToggle = props.onToggle,
collapsibleTermsCount = props.collapsibleTermsCount,
collapsibleTermsItemCount = props.collapsibleTermsItemCount;
var expandButtonTitle;

if (expanded) {
expandButtonTitle = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-minus fas mr-06"
}), /*#__PURE__*/React.createElement("span", {
className: "flex-grow-1 text-left"
}, "Collapse"));
} else {
expandButtonTitle = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-plus fas mr-06"
}), /*#__PURE__*/React.createElement("span", {
className: "flex-grow-1 text-left"
}, "View ", collapsibleTermsCount, " More"), /*#__PURE__*/React.createElement("span", {
className: "pull-right"
}, collapsibleTermsItemCount));
}

return /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn view-more-button d-flex align-items-center",
onClick: onToggle
}, expandButtonTitle);
}
export var CountIndicator = /*#__PURE__*/React.memo(function (props) {
var _props$count = props.count,
count = _props$count === void 0 ? 1 : _props$count,
Expand Down
33 changes: 11 additions & 22 deletions es/components/browse/components/FacetList/RangeFacet.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { PartialList } from './../../../ui/PartialList';
import { decorateNumberWithCommas } from './../../../util/value-transforms';
import { getSchemaProperty } from './../../../util/schema-transforms';
import { patchedConsoleInstance as console } from './../../../util/patched-console';
import { segmentComponentsByStatus } from './FacetTermsList';
import { segmentComponentsByStatus, ViewMoreExpandButton } from './FacetTermsList';
import { ExtendedDescriptionPopoverIcon } from './ExtendedDescriptionPopoverIcon';

function getRangeStatus(range, toVal, fromVal) {
Expand Down Expand Up @@ -457,15 +457,16 @@ export var RangeFacet = /*#__PURE__*/function (_React$PureComponent) {
return /*#__PURE__*/React.createElement("div", {
className: "facet range-facet" + (facetOpen ? ' open' : ' closed'),
"data-field": facet.field
}, /*#__PURE__*/React.createElement("h5", {
className: "facet-title",
}, /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn facet-title",
onClick: this.handleOpenToggleClick
}, /*#__PURE__*/React.createElement("span", {
className: "expand-toggle col-auto px-0"
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-" + (facetOpen ? "minus fas" : "plus fas")
})), /*#__PURE__*/React.createElement("div", {
className: "col px-0 line-height-1"
className: "col px-0 text-left"
}, /*#__PURE__*/React.createElement("span", {
"data-tip": facetSchemaDescription || fieldSchemaDescription,
"data-place": "right"
Expand Down Expand Up @@ -784,20 +785,6 @@ var ListOfRanges = /*#__PURE__*/React.memo(function (props) {
};

if (Array.isArray(collapsibleTerms) && collapsibleTerms.length > 0) {
var expandButtonTitle;

if (expanded) {
expandButtonTitle = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-minus fas"
}), " Collapse");
} else {
expandButtonTitle = /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-plus fas"
}), " View ", collapsibleTermsCount, " More", /*#__PURE__*/React.createElement("span", {
className: "pull-right"
}, collapsibleTermsItemCount));
}

return /*#__PURE__*/React.createElement("div", commonProps, /*#__PURE__*/React.createElement(PartialList, {
className: "mb-0 active-terms-pl",
open: facetOpen,
Expand All @@ -809,10 +796,12 @@ var ListOfRanges = /*#__PURE__*/React.memo(function (props) {
collapsible: collapsibleTerms
}), /*#__PURE__*/React.createElement("div", {
className: "pt-08 pb-0"
}, /*#__PURE__*/React.createElement("div", {
className: "view-more-button",
onClick: onToggleExpanded
}, expandButtonTitle)))
}, /*#__PURE__*/React.createElement(ViewMoreExpandButton, {
expanded: expanded,
collapsibleTermsCount: collapsibleTermsCount,
collapsibleTermsItemCount: collapsibleTermsItemCount,
onToggle: onToggleExpanded
})))
}));
} else {
return /*#__PURE__*/React.createElement("div", commonProps, /*#__PURE__*/React.createElement(PartialList, {
Expand Down
4 changes: 2 additions & 2 deletions es/components/browse/components/FacetList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,14 +981,14 @@ export var FacetListHeader = /*#__PURE__*/React.memo(function (props) {
"aria-label": "Properties Controls"
}, anyFacetsOpen ? /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn btn-outline-light",
className: "btn btn-outline-light fixed-height",
onClick: onCollapseFacets,
"data-tip": "Collapse all facets below"
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-minus fas"
})) : null, showClearFiltersButton && typeof onClearFilters === "function" ? /*#__PURE__*/React.createElement("button", {
type: "button",
className: "btn btn-outline-light",
className: "btn btn-outline-light fixed-height",
onClick: onClearFilters,
"data-tip": "Clear all filters"
}, /*#__PURE__*/React.createElement("i", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export var AboveSearchViewTableControls = /*#__PURE__*/React.memo(function (prop

if (addAction && typeof addAction.href === 'string') {
addButton = /*#__PURE__*/React.createElement("a", {
className: "btn btn-primary btn-xs" + (total ? " ml-1" : ""),
className: "btn btn-primary btn-xs d-flex align-items-center" + (total ? " ml-1" : ""),
href: addAction.href,
"data-skiprequest": "true"
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-plus fas mr-03 fas"
}), "Create New \xA0");
}), /*#__PURE__*/React.createElement("span", null, "Create New\xA0"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,45 @@ export var ConfigureVisibleColumnsButton = /*#__PURE__*/React.memo(function (_re
var open = _ref.open,
onClick = _ref.onClick,
className = _ref.className;
var cls = (className ? " " + className : "") + (open ? " active" : "");
return /*#__PURE__*/React.createElement("button", {
type: "button",
key: "toggle-visible-columns",
"data-tip": "Configure visible columns",
"data-event-off": "click",
active: open.toString(),
active: !!open,
onClick: onClick,
className: (className || "") + (open ? " active" : "")
className: cls
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-table fas"
}), /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-angle-down ml-03 fas"
}));
});
ConfigureVisibleColumnsButton.defaultProps = {
"className": "btn btn-outline-primary"
"className": "btn btn-outline-primary fixed-height"
};
export var MultiColumnSortButton = /*#__PURE__*/React.memo(function (_ref2) {
var open = _ref2.open,
onClick = _ref2.onClick,
className = _ref2.className;
var cls = (className ? " " + className : "") + (open ? " active" : "");
return /*#__PURE__*/React.createElement("button", {
type: "button",
key: "toggle-visible-columns",
"data-tip": "Sort multiple columns",
"data-event-off": "click",
active: open.toString(),
active: !!open,
onClick: onClick,
className: (className || "") + (open ? " active" : "")
className: cls
}, /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-sort fas"
}), /*#__PURE__*/React.createElement("i", {
className: "icon icon-fw icon-angle-down ml-03 fas"
}));
});
MultiColumnSortButton.defaultProps = {
"className": "btn btn-outline-primary"
"className": "btn btn-outline-primary fixed-height"
};
/** Toggles between regular & full screen views */

Expand Down
29 changes: 23 additions & 6 deletions scss/facet-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,17 @@ $facetlist-term-block-height: default !default;
}
}

h5.facet-title {
button.facet-title {
margin: 0 0 3px;
font-weight: 500;
line-height: inherit;
height: 40px;
border: none;
background: transparent;
width: 100%;
padding: 0;
display: flex;
align-items: center;
@include font-size($facetlist-facet-font-size);

> i.icon-info-circle {
Expand All @@ -281,19 +287,19 @@ $facetlist-term-block-height: default !default;
&:not(.static) {
transition: padding-bottom .35s ease, background-color .35s ease;
background-color: transparent;
h5.facet-title {
button.facet-title {

margin : 0;
border-top: 1px solid transparent;
//border-bottom: 1px solid transparent;
border-bottom: 1px solid #f8f8f8;

cursor: pointer;
display: flex;
align-items: center;

> span.expand-toggle > i.icon {
font-size: 0.7rem;
margin-right: 7px;
transition: color .35s ease-out;
}

.closed-terms-count {
Expand Down Expand Up @@ -349,7 +355,14 @@ $facetlist-term-block-height: default !default;
}
}

&:hover {
&:hover, &:focus {
box-shadow: none; // Unset default .btn focus styling

> span.expand-toggle > i.icon {
color: #000;
text-shadow: 0 0;
}

.closed-terms-count {

&.show {
Expand Down Expand Up @@ -616,14 +629,18 @@ $facetlist-term-block-height: default !default;
padding: 2px 6px 1px;
line-height: 20px;
border-radius: 2px;
background: transparent;
width: 100%;
font-weight: 400;

&:hover {
border-color: #000;
}

i.icon {
font-size: 0.8rem;
position: relative;
left: -2px;
line-height: inherit;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/browse/components/FacetList/FacetOfFacets.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export class FacetOfFacets extends React.PureComponent {

return (
<div className={"facet" + (facetOpen || anySelections ? ' open' : ' closed')} data-group={title}>
<h5 className="facet-title" onClick={this.handleOpenToggleClick}>
<button type="button" className="btn facet-title" onClick={this.handleOpenToggleClick}>
<span className="expand-toggle col-auto px-0">
<i className={"icon icon-fw icon-" + (anySelections ? "dot-circle far" : (facetOpen ? "minus fas" : "plus fas"))}/>
</span>
<div className="col px-0 line-height-1">
<div className="col px-0 text-left">
<span data-tip={tooltip} data-place="right">{ title }</span>
</div>
<Fade in={!facetOpen && !anySelections}>
Expand All @@ -68,7 +68,7 @@ export class FacetOfFacets extends React.PureComponent {
<i className="icon fas icon-layer-group" />
</span>
</Fade>
</h5>
</button>
<Collapse in={facetOpen || anySelections}>
<div className="facet-group-list-container">
{ extendedFacets }
Expand Down
Loading