react-core-ts 1.3.78 → 1.3.80

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,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.Search = exports.Spinner = exports.Close = exports.DropArrow = void 0;
15
15
  var jsx_runtime_1 = require("react/jsx-runtime");
16
16
  var DropArrow = function (_a) {
17
- var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.stroke, stroke = _c === void 0 ? 1.5 : _c;
18
- return ((0, jsx_runtime_1.jsx)("svg", __assign({ id: "drop-arrow-icon", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", style: { width: 20, height: 20 }, className: className, name: "toggle" }, { children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) })));
17
+ var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.stroke, stroke = _c === void 0 ? 1.5 : _c, _d = _a.uniqueId, uniqueId = _d === void 0 ? 'drop-arrow-icon' : _d;
18
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ id: uniqueId, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", style: { width: 20, height: 20 }, className: className, name: "toggle" }, { children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) })));
19
19
  };
20
20
  exports.DropArrow = DropArrow;
21
21
  var Close = function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/utilities/icons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEO,IAAM,SAAS,GAAkB,UAAC,EAAgC;QAA9B,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EAAE,cAAY,EA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KAAA,EAAE,cAAY,EAAZ,MAAM,mBAAG,GAAG,KAAA;IAClE,OAAO,CACL,yCAAK,IAAI,EAAC,QAAQ,gBAChB,yCACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,gBAElC,iCACE,CAAC,EAAC,gNAAgN,EAClN,MAAM,EAAC,SAAS,EAChB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,MAAM,UAoBjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-core-ts",
3
- "version": "1.3.78",
3
+ "version": "1.3.80",
4
4
  "description": "React Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,12 +1,4 @@
1
- import Tooltip from './utilities/tooltip';
2
- import React, {
3
- forwardRef,
4
- useCallback,
5
- useEffect,
6
- useImperativeHandle,
7
- useRef,
8
- useState,
9
- } from 'react';
1
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
10
2
 
11
3
  import { AutoSuggestionInputProps } from './commontypes';
12
4
  import { useSuggestions } from './utilities/autosuggestions';
@@ -14,6 +6,7 @@ import { debounce } from './utilities/debounce';
14
6
  import { deepEqual } from './utilities/deepEqual';
15
7
  import { filterSuggestions } from './utilities/filterSuggestions';
16
8
  import { Close, DropArrow, Search, Spinner } from './utilities/icons';
9
+ import Tooltip from './utilities/tooltip';
17
10
 
18
11
  type ValueProps = {
19
12
  [key: string]: string;
@@ -1,11 +1,4 @@
1
- import React, {
2
- forwardRef,
3
- useCallback,
4
- useEffect,
5
- useImperativeHandle,
6
- useRef,
7
- useState,
8
- } from 'react';
1
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
9
2
  import ReactDOM from 'react-dom';
10
3
 
11
4
  import { AutoSuggestionInputProps, TabPops, ValueProps } from './commontypes';
@@ -297,7 +290,7 @@ const AutoCompleteWithSelectedList = forwardRef<
297
290
  dropRef.current &&
298
291
  event.target instanceof Node &&
299
292
  !dropRef.current.contains(event.target) &&
300
- event.target?.id !== 'drop-arrow-icon'
293
+ event.target?.id !== 'drop-arrow-selected-list-icon'
301
294
  ) {
302
295
  setTimeout(() => {
303
296
  setDropOpen(false);
@@ -619,6 +612,7 @@ const AutoCompleteWithSelectedList = forwardRef<
619
612
  expandable={expandable}
620
613
  handleClear={handleClear}
621
614
  countOnly={countOnly}
615
+ uniqueDropArrowId='drop-arrow-selected-list-icon'
622
616
  viewMode={viewMode}
623
617
  />
624
618
  {/* Displaying Loading Spinner */}
@@ -756,7 +750,10 @@ const AutoCompleteWithSelectedList = forwardRef<
756
750
  handleCollapseArrowClick();
757
751
  }}
758
752
  >
759
- <DropArrow className={`icon-button-rotate`} />
753
+ <DropArrow
754
+ className={`icon-button-rotate`}
755
+ uniqueDropArrowId="drop-arrow-selected-list-icon"
756
+ />
760
757
  </div>
761
758
  </div>
762
759
  )}
@@ -72,6 +72,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
72
72
  hasDisableSelection,
73
73
  inputType = 'text',
74
74
  onFocusTreeDropdown,
75
+ filterCondition,
75
76
  },
76
77
  ref
77
78
  ) => {
@@ -243,7 +244,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
243
244
  dropRef.current &&
244
245
  event.target instanceof Node &&
245
246
  !dropRef.current.contains(event.target) &&
246
- event.target?.id !== 'drop-arrow-icon'
247
+ event.target?.id !== 'drop-arrow-tree-list-icon'
247
248
  ) {
248
249
  setTimeout(() => {
249
250
  setDropOpen(false);
@@ -478,8 +479,22 @@ const AutoCompleteWithTreeStructure = forwardRef<
478
479
  }
479
480
  port.children?.forEach(searchRecursive);
480
481
  };
481
-
482
- dropDownData.forEach(searchRecursive);
482
+ if (
483
+ filterCondition &&
484
+ filterCondition.filterKey &&
485
+ filterCondition.filterValue
486
+ ) {
487
+ // Apply filtering only when condition is met
488
+ dropDownData
489
+ .filter(
490
+ (port) =>
491
+ port[filterCondition?.filterKey] === filterCondition.filterValue
492
+ ) // Modify this condition as needed
493
+ .forEach(searchRecursive);
494
+ } else {
495
+ // Default behavior (filter entire array)
496
+ dropDownData.forEach(searchRecursive);
497
+ }
483
498
  result;
484
499
  setFilteredData(result);
485
500
  };
@@ -680,6 +695,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
680
695
  error={errorFlag}
681
696
  expandable={expandable}
682
697
  handleClear={handleClear}
698
+ uniqueDropArrowId="drop-arrow-tree-list-icon"
683
699
  />
684
700
  {/* Displaying Loading Spinner */}
685
701
 
@@ -1,11 +1,4 @@
1
- import React, {
2
- forwardRef,
3
- useCallback,
4
- useEffect,
5
- useImperativeHandle,
6
- useRef,
7
- useState,
8
- } from 'react';
1
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
9
2
  import ReactDOM from 'react-dom';
10
3
 
11
4
  import { AutoSuggestionInputProps } from './commontypes';
@@ -249,7 +242,7 @@ const ExpandableAutoComplete = forwardRef<
249
242
  dropRef.current &&
250
243
  event.target instanceof Node &&
251
244
  !dropRef.current.contains(event.target) &&
252
- event.target?.id !== 'drop-arrow-icon'
245
+ event.target?.id !== 'drop-arrow-expanded-list-icon'
253
246
  ) {
254
247
  setTimeout(() => {
255
248
  setDropOpen(false);
@@ -472,6 +465,7 @@ const ExpandableAutoComplete = forwardRef<
472
465
  readOnly={readOnly}
473
466
  expandable={expandable}
474
467
  handleClear={handleClear}
468
+ uniqueDropArrowId='drop-arrow-expanded-list-icon'
475
469
  />
476
470
  {/* Displaying Loading Spinner */}
477
471
 
@@ -748,9 +748,9 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
748
748
  ref={dropBtnRef}
749
749
  >
750
750
  {!dropOpen ? (
751
- <DropArrow />
751
+ <DropArrow uniqueDropArrowId="drop-arrow-icon" />
752
752
  ) : (
753
- <DropArrow className="rotate-180" />
753
+ <DropArrow className="rotate-180" uniqueDropArrowId="drop-arrow-icon" />
754
754
  )}
755
755
  </button>
756
756
  )}
@@ -73,6 +73,10 @@ export interface AutoSuggestionInputProps {
73
73
  e: React.FocusEvent<HTMLTextAreaElement, Element>
74
74
  ) => void;
75
75
  inputType?: 'text' | 'textarea';
76
+ filterCondition?: {
77
+ filterKey?: any;
78
+ filterValue?: any;
79
+ };
76
80
  }
77
81
  export interface IconsProps {
78
82
  name: any;
@@ -15,6 +15,7 @@ type ValueProps = {
15
15
  handleClear: () => void;
16
16
  error?: boolean;
17
17
  viewMode?: boolean;
18
+ uniqueDropArrowId?: string;
18
19
  };
19
20
  const InputActions: React.FC<ValueProps> = ({
20
21
  inputValue,
@@ -29,13 +30,14 @@ const InputActions: React.FC<ValueProps> = ({
29
30
  countOnly,
30
31
  error,
31
32
  viewMode,
33
+ uniqueDropArrowId,
32
34
  }) => {
33
35
  return (
34
36
  <div
35
37
  className={`${
36
38
  error
37
- ? "qbs-autocomplete-witherror-close-icon"
38
- : "qbs-autocomplete-close-icon"
39
+ ? 'qbs-autocomplete-witherror-close-icon'
40
+ : 'qbs-autocomplete-close-icon'
39
41
  } `}
40
42
  >
41
43
  {(inputValue || searchValue) &&
@@ -60,7 +62,10 @@ const InputActions: React.FC<ValueProps> = ({
60
62
  aria-label="toggle"
61
63
  name="toggle"
62
64
  >
63
- <DropArrow className={`icon-button-rotate`} />
65
+ <DropArrow
66
+ className={`icon-button-rotate`}
67
+ uniqueId={uniqueDropArrowId}
68
+ />
64
69
  </button>
65
70
  ) : (
66
71
  <button
@@ -71,7 +76,7 @@ const InputActions: React.FC<ValueProps> = ({
71
76
  aria-label="toggle"
72
77
  name="toggle"
73
78
  >
74
- <DropArrow />
79
+ <DropArrow uniqueId={uniqueDropArrowId} />
75
80
  </button>
76
81
  )}
77
82
  </div>
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
- export const DropArrow: React.FC<any> = ({ className = '', stroke = 1.5 }) => {
3
+ export const DropArrow: React.FC<any> = ({ className = '', stroke = 1.5 ,uniqueId = 'drop-arrow-icon' }) => {
4
4
  return (
5
5
  <svg
6
- id="drop-arrow-icon"
6
+ id={uniqueId}
7
7
  xmlns="http://www.w3.org/2000/svg"
8
8
  fill="none"
9
9
  viewBox="0 0 24 24"