@connectif/ui-components 5.3.0 → 5.4.0
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.4.0] - 2026-02-20
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Fixed a bug in the `Select` component when options had no label.
|
|
8
|
+
- Added scroll to the selected category in `CategorizedPicker`.
|
|
9
|
+
- Removed the background color in the `CategorizedPicker` component when it was focused.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Extended the `CategorizedPicker` component options to include an optional `onOpen` method that is triggered when the picker opens.
|
|
14
|
+
|
|
3
15
|
## [5.3.0] - 2026-02-18
|
|
4
16
|
|
|
5
17
|
### Added
|
|
@@ -8,7 +8,8 @@ export type CategorizedPickerProps<T extends CategorizedPickerBaseOption> = {
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
sx?: SxProps;
|
|
10
10
|
dataTestId?: string;
|
|
11
|
+
onOpen?: () => void;
|
|
11
12
|
onChange: (value: T, groupDataId?: string) => void;
|
|
12
13
|
};
|
|
13
|
-
declare const CategorizedPicker: <T extends CategorizedPickerBaseOption>({ value, options, categories, placeholder, disabled, sx, dataTestId, onChange }: CategorizedPickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const CategorizedPicker: <T extends CategorizedPickerBaseOption>({ value, options, categories, placeholder, disabled, sx, dataTestId, onOpen, onChange }: CategorizedPickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default CategorizedPicker;
|
package/dist/index.js
CHANGED
|
@@ -21597,7 +21597,7 @@ var Select = function Select2({
|
|
|
21597
21597
|
return /* @__PURE__ */ jsx115(
|
|
21598
21598
|
SelectOption,
|
|
21599
21599
|
{
|
|
21600
|
-
label: label ??
|
|
21600
|
+
label: label ?? optionValue?.toString() ?? "",
|
|
21601
21601
|
value: optionValue,
|
|
21602
21602
|
id: optionValue,
|
|
21603
21603
|
colors: !menuColors?.selectedColor ? {
|
|
@@ -22381,9 +22381,13 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22381
22381
|
disabled = false,
|
|
22382
22382
|
sx,
|
|
22383
22383
|
dataTestId,
|
|
22384
|
+
onOpen,
|
|
22384
22385
|
onChange
|
|
22385
22386
|
}) {
|
|
22386
22387
|
const { t } = useTranslation();
|
|
22388
|
+
const categoryRefs = React66.useRef(
|
|
22389
|
+
{}
|
|
22390
|
+
);
|
|
22387
22391
|
const anchorRef = React66.useRef(null);
|
|
22388
22392
|
const [open, setOpen] = React66.useState(false);
|
|
22389
22393
|
const [search, setSearch] = React66.useState("");
|
|
@@ -22414,7 +22418,8 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22414
22418
|
setOpen(true);
|
|
22415
22419
|
setSearch("");
|
|
22416
22420
|
setSelectedCategory(getDefaultSelectedCategory());
|
|
22417
|
-
|
|
22421
|
+
onOpen?.();
|
|
22422
|
+
}, [getDefaultSelectedCategory, onOpen]);
|
|
22418
22423
|
const closePopover = React66.useCallback(() => {
|
|
22419
22424
|
setOpen(false);
|
|
22420
22425
|
}, []);
|
|
@@ -22471,6 +22476,9 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22471
22476
|
height: "34px",
|
|
22472
22477
|
lineHeight: "34px"
|
|
22473
22478
|
},
|
|
22479
|
+
"&.MuiInputBase-root.Mui-focused": {
|
|
22480
|
+
background: white
|
|
22481
|
+
},
|
|
22474
22482
|
...sx
|
|
22475
22483
|
},
|
|
22476
22484
|
value: value?.name || "",
|
|
@@ -22507,6 +22515,19 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22507
22515
|
vertical: "top",
|
|
22508
22516
|
horizontal: "left"
|
|
22509
22517
|
},
|
|
22518
|
+
slotProps: {
|
|
22519
|
+
transition: {
|
|
22520
|
+
onEntered: () => {
|
|
22521
|
+
if (!selectedCategory) {
|
|
22522
|
+
return;
|
|
22523
|
+
}
|
|
22524
|
+
const el = categoryRefs.current[selectedCategory.name];
|
|
22525
|
+
el?.scrollIntoView({
|
|
22526
|
+
behavior: "smooth"
|
|
22527
|
+
});
|
|
22528
|
+
}
|
|
22529
|
+
}
|
|
22530
|
+
},
|
|
22510
22531
|
transformOrigin: {
|
|
22511
22532
|
vertical: "top",
|
|
22512
22533
|
horizontal: "left"
|
|
@@ -22555,6 +22576,9 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22555
22576
|
children: /* @__PURE__ */ jsx126(Stack11, { children: filteredCategories.map((category, idx) => /* @__PURE__ */ jsx126(
|
|
22556
22577
|
ListItemButton_default,
|
|
22557
22578
|
{
|
|
22579
|
+
ref: (el) => {
|
|
22580
|
+
categoryRefs.current[category.name] = el;
|
|
22581
|
+
},
|
|
22558
22582
|
selected: selectedCategory === category,
|
|
22559
22583
|
onClick: () => {
|
|
22560
22584
|
setSelectedCategory(category);
|