react-core-ts 1.3.5 → 1.3.6
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/AutoCompleteWithSelectedList.js +9 -6
- package/dist/AutoCompleteWithSelectedList.js.map +1 -1
- package/dist/AutoCompleteWithTreeStructure.js +1 -1
- package/dist/AutoCompleteWithTreeStructure.js.map +1 -1
- package/dist/ExpandableAutoComplete.js +10 -2
- package/dist/ExpandableAutoComplete.js.map +1 -1
- package/dist/ReactAutoComplete.d.ts +1 -0
- package/dist/ReactAutoComplete.js +6 -6
- package/dist/ReactAutoComplete.js.map +1 -1
- package/dist/styles/components/autocomplete.css +4 -3
- package/package.json +1 -1
- package/src/AutoCompleteWithSelectedList.tsx +11 -6
- package/src/AutoCompleteWithTreeStructure.tsx +1 -1
- package/src/ExpandableAutoComplete.tsx +16 -1
- package/src/ReactAutoComplete.tsx +7 -6
- package/src/styles/components/autocomplete.css +4 -3
- package/dist/styles/styles/components/autocomplete.css +0 -620
- package/dist/styles/styles/components/selectedautocomplete.css +0 -130
- package/dist/styles/styles/components/tooltip.css +0 -496
- package/dist/styles/styles/components/treedropdown.css +0 -63
- package/dist/styles/styles/global.css +0 -8
|
@@ -262,7 +262,7 @@ const ExpandableAutoComplete = forwardRef<
|
|
|
262
262
|
window.addEventListener("scroll", handleClickOutside as any);
|
|
263
263
|
|
|
264
264
|
const scrollableDivs = document.querySelectorAll(
|
|
265
|
-
'div[style*="overflow"], .overflow-auto
|
|
265
|
+
'div[style*="overflow"], .overflow-auto, .overflow-y-auto, .overflow-x-auto'
|
|
266
266
|
);
|
|
267
267
|
scrollableDivs.forEach((div) =>
|
|
268
268
|
div.addEventListener("scroll", handleClickOutside as any)
|
|
@@ -340,6 +340,12 @@ const ExpandableAutoComplete = forwardRef<
|
|
|
340
340
|
if (dropOpen) setDropOpen(false);
|
|
341
341
|
};
|
|
342
342
|
|
|
343
|
+
const handleClearSelected = () => {
|
|
344
|
+
setSelectedItems([]);
|
|
345
|
+
if (isMultiple) onChange([]);
|
|
346
|
+
else onChange({ [descId]: '', [desc]: '' });
|
|
347
|
+
};
|
|
348
|
+
|
|
343
349
|
return (
|
|
344
350
|
<div className={fullWidth ? "fullWidth" : "autoWidth"} ref={dropdownRef}>
|
|
345
351
|
{label && (
|
|
@@ -446,6 +452,15 @@ const ExpandableAutoComplete = forwardRef<
|
|
|
446
452
|
/>
|
|
447
453
|
</div>
|
|
448
454
|
|
|
455
|
+
{selectedItems?.length > 1 && (
|
|
456
|
+
<div
|
|
457
|
+
className={`qbs-clear-link qbs-text-right qbs-cursor-pointer qbs-text-xs absolute right-2 bottom-1`}
|
|
458
|
+
onClick={handleClearSelected}
|
|
459
|
+
>
|
|
460
|
+
Clear all
|
|
461
|
+
</div>
|
|
462
|
+
)}
|
|
463
|
+
|
|
449
464
|
{/* Icons for Clearing Input or Toggling Dropdown */}
|
|
450
465
|
|
|
451
466
|
<InputActions
|
|
@@ -16,6 +16,7 @@ type valueProps = {
|
|
|
16
16
|
param2?: string | number | null;
|
|
17
17
|
param3?: string | number | null;
|
|
18
18
|
param4?: string | number | null;
|
|
19
|
+
from?: number
|
|
19
20
|
};
|
|
20
21
|
interface AutoSuggestionInputProps {
|
|
21
22
|
id?: string;
|
|
@@ -148,7 +149,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
148
149
|
handleValChange(value);
|
|
149
150
|
if (!value) {
|
|
150
151
|
setInputValue('');
|
|
151
|
-
onChange({ id: undefined, name: '' });
|
|
152
|
+
onChange({ id: undefined, name: '', from: 2 });
|
|
152
153
|
}
|
|
153
154
|
};
|
|
154
155
|
|
|
@@ -156,7 +157,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
156
157
|
debounce(
|
|
157
158
|
(value: string) => {
|
|
158
159
|
setDropOpen(true);
|
|
159
|
-
onChange({ id: undefined, name: '' });
|
|
160
|
+
onChange({ id: undefined, name: '', from: 1 });
|
|
160
161
|
if (value.trim() === '' && type === 'auto_complete') {
|
|
161
162
|
setSuggestions([]);
|
|
162
163
|
if (autoFilter) {
|
|
@@ -327,7 +328,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
327
328
|
const mainElement = document.querySelector('main');
|
|
328
329
|
mainElement?.addEventListener('scroll', handleScroll);
|
|
329
330
|
|
|
330
|
-
const gridElements = document.querySelectorAll('.k-grid-content, .overflow-auto');
|
|
331
|
+
const gridElements = document.querySelectorAll('.k-grid-content, .overflow-auto, .overflow-y-auto, .overflow-x-auto');
|
|
331
332
|
gridElements.forEach((gridElement: any) => {
|
|
332
333
|
gridElement.addEventListener('scroll', handleScroll);
|
|
333
334
|
});
|
|
@@ -349,7 +350,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
349
350
|
const handleClear = () => {
|
|
350
351
|
setDropOpen(false);
|
|
351
352
|
setInputValue('');
|
|
352
|
-
onChange({ id: undefined, name: '' });
|
|
353
|
+
onChange({ id: undefined, name: '', from: 3 });
|
|
353
354
|
onLabelClick();
|
|
354
355
|
};
|
|
355
356
|
|
|
@@ -517,7 +518,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
517
518
|
return (
|
|
518
519
|
(filteredData?.length > 0 || showNoResults) && (
|
|
519
520
|
<ul
|
|
520
|
-
className=" absolute h-auto max-h-40
|
|
521
|
+
className=" absolute h-auto max-h-40 overflow-auto w-full bg-white shadow-gray-300 shadow-md border border-grey-light py-1.5 z-50 mt-9"
|
|
521
522
|
style={dropPosition}
|
|
522
523
|
>
|
|
523
524
|
{filteredData?.length > 0 ? (
|
|
@@ -528,7 +529,7 @@ const ModernAutoComplete: React.FC<AutoSuggestionInputProps> = ({
|
|
|
528
529
|
value?.id === suggestion?.id
|
|
529
530
|
? 'bg-blue-navy text-white'
|
|
530
531
|
: 'hover:bg-table-hover'
|
|
531
|
-
} cursor-pointer p-1 text-xxs ps-3.5`}
|
|
532
|
+
} cursor-pointer p-1 text-xxs ps-3.5 pl-[10px]`}
|
|
532
533
|
key={suggestion?.id}
|
|
533
534
|
data-testid={suggestion.name}
|
|
534
535
|
onClick={() => handleSuggestionClick(suggestion)}
|
|
@@ -218,7 +218,8 @@ body * {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
.qbs-dropdown-selected-container .qbs-clear-link
|
|
221
|
+
.qbs-dropdown-selected-container .qbs-clear-link,
|
|
222
|
+
.qbs-expandable-container .qbs-clear-link {
|
|
222
223
|
color: #e76458;
|
|
223
224
|
}
|
|
224
225
|
|
|
@@ -235,7 +236,7 @@ body * {
|
|
|
235
236
|
overflow: hidden;
|
|
236
237
|
}
|
|
237
238
|
.qbs-expandable-container .qbs-textfield-expandable::after {
|
|
238
|
-
content: attr(data-value)
|
|
239
|
+
content: attr(data-value) " ";
|
|
239
240
|
visibility: hidden;
|
|
240
241
|
white-space: pre;
|
|
241
242
|
grid-area: 1 / 2;
|
|
@@ -597,7 +598,7 @@ span.dropdown-search-icon {
|
|
|
597
598
|
|
|
598
599
|
.qbs-table-tooltip .tooltiptext::after,
|
|
599
600
|
.tooltiptext::after {
|
|
600
|
-
content:
|
|
601
|
+
content: "";
|
|
601
602
|
position: absolute;
|
|
602
603
|
border-width: 5px;
|
|
603
604
|
border-style: solid;
|