@lumx/react 4.26.0 → 4.26.1-alpha.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/index.d.ts +6 -0
- package/index.js +11 -2
- package/index.js.map +1 -1
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -4322,6 +4322,12 @@ interface RenderOptionContext {
|
|
|
4322
4322
|
isSelected: boolean;
|
|
4323
4323
|
/** Resolved description string (from `getOptionDescription`), if any. Should be forwarded as `description`. */
|
|
4324
4324
|
description?: string | null;
|
|
4325
|
+
/**
|
|
4326
|
+
* Selection state icon to render after the option label
|
|
4327
|
+
* (single selection: check circle when selected, blank radio otherwise; multiple selection: checkbox).
|
|
4328
|
+
* Should be forwarded as `after` (appended after any custom `after` content).
|
|
4329
|
+
*/
|
|
4330
|
+
after?: JSXElement;
|
|
4325
4331
|
}
|
|
4326
4332
|
interface BaseSelectProps<O> {
|
|
4327
4333
|
/** List of option objects. */
|
package/index.js
CHANGED
|
@@ -18897,6 +18897,7 @@ function renderSelectOptions(props, components) {
|
|
|
18897
18897
|
const name = getWithSelector(getOptionName || getOptionId, item) || id;
|
|
18898
18898
|
const description = getOptionDescription && getWithSelector(getOptionDescription, item);
|
|
18899
18899
|
const isSelected = selectedIds?.has(id) ?? false;
|
|
18900
|
+
const after = /*#__PURE__*/jsx(Combobox.SelectionIcon, {});
|
|
18900
18901
|
|
|
18901
18902
|
// Delegate to the consumer's render function when provided.
|
|
18902
18903
|
// The consumer receives core-computed context and is responsible for rendering
|
|
@@ -18907,13 +18908,15 @@ function renderSelectOptions(props, components) {
|
|
|
18907
18908
|
value: id,
|
|
18908
18909
|
name,
|
|
18909
18910
|
isSelected,
|
|
18910
|
-
description
|
|
18911
|
+
description,
|
|
18912
|
+
after
|
|
18911
18913
|
});
|
|
18912
18914
|
}
|
|
18913
18915
|
return /*#__PURE__*/jsx(Combobox.Option, {
|
|
18914
18916
|
value: id,
|
|
18915
18917
|
description: description,
|
|
18916
18918
|
isSelected: isSelected,
|
|
18919
|
+
after: after,
|
|
18917
18920
|
children: name
|
|
18918
18921
|
}, id);
|
|
18919
18922
|
});
|
|
@@ -19045,6 +19048,7 @@ SelectButton$2.className = CLASSNAME$n;
|
|
|
19045
19048
|
* - If the consumer returns a `<Combobox.Option>`, its props/children are merged with the
|
|
19046
19049
|
* core-computed `value` / `isSelected` / `description` / `key`.
|
|
19047
19050
|
* When the consumer's `<Combobox.Option>` has no children, falls back to the option `name`.
|
|
19051
|
+
* The core-computed selection icons are kept: `after` is appended to the custom `after`.
|
|
19048
19052
|
* - If the consumer returns anything else, returns `null` (skips the option).
|
|
19049
19053
|
*
|
|
19050
19054
|
* @param renderOption Consumer-provided render function.
|
|
@@ -19057,7 +19061,8 @@ function wrapRenderOption(renderOption) {
|
|
|
19057
19061
|
value: optionValue,
|
|
19058
19062
|
isSelected,
|
|
19059
19063
|
description,
|
|
19060
|
-
name
|
|
19064
|
+
name,
|
|
19065
|
+
after
|
|
19061
19066
|
}) => {
|
|
19062
19067
|
const node = renderOption(option, index);
|
|
19063
19068
|
if (!isComponentType(ListboxOption)(node)) {
|
|
@@ -19065,6 +19070,7 @@ function wrapRenderOption(renderOption) {
|
|
|
19065
19070
|
}
|
|
19066
19071
|
const {
|
|
19067
19072
|
children = name,
|
|
19073
|
+
after: customAfter,
|
|
19068
19074
|
...customProps
|
|
19069
19075
|
} = node.props;
|
|
19070
19076
|
return /*#__PURE__*/jsx(ListboxOption, {
|
|
@@ -19072,6 +19078,9 @@ function wrapRenderOption(renderOption) {
|
|
|
19072
19078
|
value: optionValue,
|
|
19073
19079
|
isSelected: isSelected,
|
|
19074
19080
|
description: description,
|
|
19081
|
+
after: /*#__PURE__*/jsxs(Fragment, {
|
|
19082
|
+
children: [customAfter, after]
|
|
19083
|
+
}),
|
|
19075
19084
|
children: children
|
|
19076
19085
|
}, optionValue);
|
|
19077
19086
|
};
|