@bento-core/query-bar 1.0.0-c3dc.4 → 1.0.0-c3dc.5

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.
@@ -21,7 +21,8 @@ const QueryUrl = _ref => {
21
21
  classes,
22
22
  filterItems,
23
23
  localFind = {},
24
- rootPath
24
+ rootPath,
25
+ queryUrlCharacterLimit = 70
25
26
  } = _ref;
26
27
  const [display, setDisplay] = (0, _react.useState)(false);
27
28
  const toggleDisplay = () => setDisplay(prevDisplay => !prevDisplay);
@@ -51,7 +52,7 @@ const QueryUrl = _ref => {
51
52
  }, display ? 'Hide Query URL' : 'Show Query URL'), display && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
52
53
  type: "button",
53
54
  className: (0, _clsx.default)(classes.viewLink)
54
- }, url), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
55
+ }, url.length > queryUrlCharacterLimit ? "".concat(url.substring(0, queryUrlCharacterLimit), "...") : url), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
55
56
  arrow: true,
56
57
  title: "Copy to Clipboard"
57
58
  }, /*#__PURE__*/_react.default.createElement(_core.IconButton, {
@@ -37,6 +37,7 @@ const QueryBarGenerator = function QueryBarGenerator() {
37
37
  const maxItems = config && typeof config.maxItems === 'number' ? config.maxItems : _config.default.config.maxItems;
38
38
  const queryURLRootPath = config && typeof config.rootPath === 'string' ? config.rootPath : _config.default.config.rootPath;
39
39
  const viewQueryURL = config && typeof config.viewQueryURL === 'boolean' ? config.viewQueryURL : _config.default.config.viewQueryURL;
40
+ const queryUrlCharacterLimit = config && typeof config.queryUrlCharacterLimit === 'number' ? config.queryUrlCharacterLimit : _config.default.config.queryUrlCharacterLimit;
40
41
  const clearAll = functions && typeof functions.clearAll === 'function' ? functions.clearAll : _config.default.functions.clearAll;
41
42
  const clearUpload = functions && typeof functions.clearUpload === 'function' ? functions.clearUpload : _config.default.functions.clearUpload;
42
43
  const clearAutocomplete = functions && typeof functions.clearAutocomplete === 'function' ? functions.clearAutocomplete : _config.default.functions.clearAutocomplete;
@@ -128,7 +129,8 @@ const QueryBarGenerator = function QueryBarGenerator() {
128
129
  classes: classes,
129
130
  localFind: localFind,
130
131
  filterItems: mappedInputs,
131
- rootPath: queryURLRootPath
132
+ rootPath: queryURLRootPath,
133
+ queryUrlCharacterLimit: queryUrlCharacterLimit
132
134
  }));
133
135
  })
134
136
  };
@@ -24,6 +24,11 @@ var _default = {
24
24
  * @var {boolean}
25
25
  */
26
26
  viewQueryURL: false,
27
+ /**
28
+ * display copy url button
29
+ * @var {boolean}
30
+ */
31
+ queryUrlCharacterLimit: 70,
27
32
  /* Component Helper Functions */
28
33
  functions: {
29
34
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/query-bar",
3
- "version": "1.0.0-c3dc.4",
3
+ "version": "1.0.0-c3dc.5",
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": {
@@ -17,6 +17,7 @@ const QueryUrl = ({
17
17
  filterItems,
18
18
  localFind = {},
19
19
  rootPath,
20
+ queryUrlCharacterLimit = 70,
20
21
  }) => {
21
22
  const [display, setDisplay] = useState(false);
22
23
  const toggleDisplay = () => setDisplay((prevDisplay) => !prevDisplay);
@@ -59,7 +60,7 @@ const QueryUrl = ({
59
60
  type="button"
60
61
  className={clsx(classes.viewLink)}
61
62
  >
62
- {url}
63
+ {url.length > queryUrlCharacterLimit ? `${url.substring(0, queryUrlCharacterLimit)}...` : url}
63
64
  </div>
64
65
  <Tooltip
65
66
  arrow
@@ -29,6 +29,10 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
29
29
  ? config.viewQueryURL
30
30
  : DEFAULT_CONFIG.config.viewQueryURL;
31
31
 
32
+ const queryUrlCharacterLimit = config && typeof config.queryUrlCharacterLimit === 'number'
33
+ ? config.queryUrlCharacterLimit
34
+ : DEFAULT_CONFIG.config.queryUrlCharacterLimit;
35
+
32
36
  const clearAll = functions && typeof functions.clearAll === 'function'
33
37
  ? functions.clearAll
34
38
  : DEFAULT_CONFIG.functions.clearAll;
@@ -195,6 +199,7 @@ export const QueryBarGenerator = (uiConfig = DEFAULT_CONFIG) => {
195
199
  localFind={localFind}
196
200
  filterItems={mappedInputs}
197
201
  rootPath={queryURLRootPath}
202
+ queryUrlCharacterLimit={queryUrlCharacterLimit}
198
203
  />
199
204
  )
200
205
  }
@@ -19,6 +19,11 @@ export default {
19
19
  * @var {boolean}
20
20
  */
21
21
  viewQueryURL: false,
22
+ /**
23
+ * display copy url button
24
+ * @var {boolean}
25
+ */
26
+ queryUrlCharacterLimit: 70,
22
27
 
23
28
  /* Component Helper Functions */
24
29
  functions: {