react-core-ts 1.9.18 → 2.0.1
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.
- package/dist/AutoCompleteWithTabFilter.d.ts +4 -0
- package/dist/AutoCompleteWithTabFilter.js +743 -0
- package/dist/AutoCompleteWithTabFilter.js.map +1 -0
- package/dist/AutoCompleteWithTreeStructure.js +3 -3
- package/dist/AutoCompleteWithTreeStructure.js.map +1 -1
- package/dist/ReactTextField.js +1 -1
- package/dist/ReactTextField.js.map +1 -1
- package/dist/commontypes.d.ts +13 -1
- package/dist/dropdownFilterTabs.d.ts +7 -0
- package/dist/dropdownFilterTabs.js +647 -0
- package/dist/dropdownFilterTabs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/components/selectedautocomplete.css +11 -0
- package/dist/styles/styles/components/autocomplete.css +717 -0
- package/dist/styles/styles/components/selectedautocomplete.css +179 -0
- package/dist/styles/styles/components/tooltip.css +497 -0
- package/dist/styles/styles/components/treedropdown.css +97 -0
- package/dist/styles/styles/global.css +8 -0
- package/dist/utilities/icons.d.ts +1 -0
- package/dist/utilities/icons.js +6 -1
- package/dist/utilities/icons.js.map +1 -1
- package/docs/App.tsx +109 -8
- package/package.json +1 -1
- package/src/AutoCompleteWithTabFilter.tsx +1244 -0
- package/src/AutoCompleteWithTreeStructure.tsx +4 -8
- package/src/ReactTextField.tsx +12 -4
- package/src/commontypes.ts +14 -1
- package/src/dropdownFilterTabs.tsx +1002 -0
- package/src/index.tsx +1 -0
- package/src/styles/components/selectedautocomplete.css +11 -0
- package/src/utilities/icons.tsx +10 -0
|
@@ -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';
|
|
@@ -73,6 +66,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
|
|
|
73
66
|
inputType = 'text',
|
|
74
67
|
onFocusTreeDropdown,
|
|
75
68
|
filterCondition,
|
|
69
|
+
singleSelectIcon,
|
|
76
70
|
},
|
|
77
71
|
ref
|
|
78
72
|
) => {
|
|
@@ -454,6 +448,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
|
|
|
454
448
|
updateNode={updateNode}
|
|
455
449
|
desc={desc}
|
|
456
450
|
descId={descId}
|
|
451
|
+
singleSelectIcon={singleSelectIcon}
|
|
457
452
|
toggleExpand={toggleExpand}
|
|
458
453
|
>
|
|
459
454
|
{node.expanded &&
|
|
@@ -769,6 +764,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
|
|
|
769
764
|
hasDisableSelection={hasDisableSelection?.(suggestion)}
|
|
770
765
|
updateNode={updateNode}
|
|
771
766
|
desc={desc}
|
|
767
|
+
singleSelectIcon={singleSelectIcon}
|
|
772
768
|
descId={descId}
|
|
773
769
|
toggleExpand={toggleExpand}
|
|
774
770
|
>
|
package/src/ReactTextField.tsx
CHANGED
|
@@ -60,7 +60,7 @@ const TextField: React.FC<TextFieldProps> = ({
|
|
|
60
60
|
const intervalRef = useRef<any>(null);
|
|
61
61
|
const clickTimeoutRef = useRef<any>(null);
|
|
62
62
|
const [isHolding, setIsHolding] = useState<boolean>(false);
|
|
63
|
-
const searchBtnRef = useRef<
|
|
63
|
+
const searchBtnRef = useRef<HTMLButtonElement>(null);
|
|
64
64
|
const onLabelClick = () => {
|
|
65
65
|
if (!isDisabled) {
|
|
66
66
|
inputRef?.current?.focus();
|
|
@@ -357,9 +357,17 @@ const TextField: React.FC<TextFieldProps> = ({
|
|
|
357
357
|
)}
|
|
358
358
|
</div>
|
|
359
359
|
{enableSearch && (
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
<button
|
|
361
|
+
disabled={disabled ?? readOnly}
|
|
362
|
+
onClick={() => onSearchClick?.(inputRef.current?.value || value || '')}
|
|
363
|
+
className={`${generateClassName("search")}`}
|
|
364
|
+
data-testid="tools-drop-arrow"
|
|
365
|
+
type="button"
|
|
366
|
+
id="search-btn-textfield"
|
|
367
|
+
ref={searchBtnRef}
|
|
368
|
+
>
|
|
369
|
+
<CustomIcons name="search" type="medium" />
|
|
370
|
+
</button>
|
|
363
371
|
)}
|
|
364
372
|
{(adorement ||
|
|
365
373
|
(showInfo && infoTitle) ||
|
package/src/commontypes.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FieldErrors, UseFormRegister } from 'react-hook-form';
|
|
2
2
|
|
|
3
3
|
export type ValueProps = {
|
|
4
|
-
[key: string]: string;
|
|
4
|
+
[key: string]: string | number | any;
|
|
5
5
|
};
|
|
6
6
|
export type TabPops = {
|
|
7
7
|
id: number | string;
|
|
@@ -85,6 +85,19 @@ export interface AutoSuggestionInputProps {
|
|
|
85
85
|
matchFromStart?: boolean // match data's from the starting position
|
|
86
86
|
autoDropdown?: boolean; // enable all items list items
|
|
87
87
|
enableSelectAll?: boolean // enable select all option
|
|
88
|
+
|
|
89
|
+
tabName?: string;
|
|
90
|
+
tabDesc?: string;
|
|
91
|
+
tabDescId?: string;
|
|
92
|
+
tabSelectedItems?: any[];
|
|
93
|
+
getTabData?: (key?: string) => Promise<any>;
|
|
94
|
+
tabData?: any[];
|
|
95
|
+
enableToolsTab?: boolean;
|
|
96
|
+
toolTabs?: TabPops[];
|
|
97
|
+
toolTabClearSwitch?: boolean;
|
|
98
|
+
onToolTabChange?: (value?: ValueProps | ValueProps[]) => void;
|
|
99
|
+
autoRefreshMainDropdown?: boolean;
|
|
100
|
+
singleSelectIcon?: any;
|
|
88
101
|
}
|
|
89
102
|
export interface IconsProps {
|
|
90
103
|
name: any;
|