@bento-core/query-bar 1.0.1-ccdihub.13 → 1.0.1-ccdihub.14
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.
|
@@ -14,14 +14,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
const QueryUrl = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
classes,
|
|
17
|
-
rootPath,
|
|
18
17
|
queryUrlCharacterLimit = 70
|
|
19
18
|
} = _ref;
|
|
20
19
|
const [display, setDisplay] = (0, _react.useState)(false);
|
|
21
20
|
const toggleDisplay = () => setDisplay(prevDisplay => !prevDisplay);
|
|
22
21
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
23
22
|
const toggleOpen = () => setOpen(prevOpen => !prevOpen);
|
|
24
|
-
const url =
|
|
23
|
+
const url = window.location.href;
|
|
25
24
|
const copyUrl = async () => {
|
|
26
25
|
toggleOpen();
|
|
27
26
|
await navigator.clipboard.writeText(url);
|
|
@@ -41,7 +41,6 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
41
41
|
const resetFacetSection = functions && typeof functions.resetFacetSection === 'function' ? functions.resetFacetSection : _config.default.functions.resetFacetSection;
|
|
42
42
|
const resetFacetCheckbox = functions && typeof functions.resetFacetCheckbox === 'function' ? functions.resetFacetCheckbox : _config.default.functions.resetFacetCheckbox;
|
|
43
43
|
const resetFacetSlider = functions && typeof functions.resetFacetSlider === 'function' ? functions.resetFacetSlider : _config.default.functions.resetFacetSlider;
|
|
44
|
-
const queryURLRootPath = config && typeof config.rootPath === 'string' ? config.rootPath : _config.default.config.rootPath;
|
|
45
44
|
const viewQueryURL = config && typeof config.viewQueryURL === 'boolean' ? config.viewQueryURL : _config.default.config.viewQueryURL;
|
|
46
45
|
const queryUrlCharacterLimit = config && typeof config.queryUrlCharacterLimit === 'number' ? config.queryUrlCharacterLimit : _config.default.config.queryUrlCharacterLimit;
|
|
47
46
|
return {
|
|
@@ -124,11 +123,10 @@ const QueryBarGenerator = function QueryBarGenerator() {
|
|
|
124
123
|
classes: classes,
|
|
125
124
|
onSectionClick: filter.type === CHECKBOX ? resetFacetSection : resetFacetSlider,
|
|
126
125
|
onItemClick: filter.type === CHECKBOX ? resetFacetCheckbox : resetFacetSlider
|
|
127
|
-
}))), viewQueryURL &&
|
|
126
|
+
}))), viewQueryURL && /*#__PURE__*/_react.default.createElement(_QueryUrl.default, {
|
|
128
127
|
classes: classes,
|
|
129
128
|
localFind: localFind,
|
|
130
129
|
filterItems: mappedInputs,
|
|
131
|
-
rootPath: queryURLRootPath,
|
|
132
130
|
queryUrlCharacterLimit: queryUrlCharacterLimit
|
|
133
131
|
}));
|
|
134
132
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/query-bar",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.14",
|
|
4
4
|
"description": "This package provides the Query Bar component that displays the current Facet Search and Local Find filters on the Dashboard/Explore page. It also provides the direct ability to reset all or some of the filters with the click of a button. It is designed to be implemented directly with the:",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,6 @@ import CopyIcon from '../assets/CopyIcon.svg';
|
|
|
14
14
|
|
|
15
15
|
const QueryUrl = ({
|
|
16
16
|
classes,
|
|
17
|
-
rootPath,
|
|
18
17
|
queryUrlCharacterLimit = 70,
|
|
19
18
|
}) => {
|
|
20
19
|
const [display, setDisplay] = useState(false);
|
|
@@ -23,7 +22,7 @@ const QueryUrl = ({
|
|
|
23
22
|
const [open, setOpen] = useState(false);
|
|
24
23
|
const toggleOpen = () => setOpen((prevOpen) => !prevOpen);
|
|
25
24
|
|
|
26
|
-
const url =
|
|
25
|
+
const url = window.location.href;
|
|
27
26
|
|
|
28
27
|
const copyUrl = async () => {
|
|
29
28
|
toggleOpen();
|
|
@@ -39,7 +38,7 @@ const QueryUrl = ({
|
|
|
39
38
|
onClick={toggleDisplay}
|
|
40
39
|
className={classes.viewLinkToggleBtn}
|
|
41
40
|
>
|
|
42
|
-
{
|
|
41
|
+
{(display) ? 'Hide Query URL' : 'Show Query URL'}
|
|
43
42
|
</Button>
|
|
44
43
|
{
|
|
45
44
|
(display) && (
|
|
@@ -49,10 +49,6 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
49
49
|
? functions.resetFacetSlider
|
|
50
50
|
: DEFAULT_CONFIG.functions.resetFacetSlider;
|
|
51
51
|
|
|
52
|
-
const queryURLRootPath = config && typeof config.rootPath === 'string'
|
|
53
|
-
? config.rootPath
|
|
54
|
-
: DEFAULT_CONFIG.config.rootPath;
|
|
55
|
-
|
|
56
52
|
const viewQueryURL = config && typeof config.viewQueryURL === 'boolean'
|
|
57
53
|
? config.viewQueryURL
|
|
58
54
|
: DEFAULT_CONFIG.config.viewQueryURL;
|
|
@@ -192,12 +188,11 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
|
|
|
192
188
|
))}
|
|
193
189
|
</span>
|
|
194
190
|
{
|
|
195
|
-
|
|
191
|
+
viewQueryURL && (
|
|
196
192
|
<QueryUrl
|
|
197
193
|
classes={classes}
|
|
198
194
|
localFind={localFind}
|
|
199
195
|
filterItems={mappedInputs}
|
|
200
|
-
rootPath={queryURLRootPath}
|
|
201
196
|
queryUrlCharacterLimit={queryUrlCharacterLimit}
|
|
202
197
|
/>
|
|
203
198
|
)
|