@lumx/react 4.9.0-next.3 → 4.9.0-next.5
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 +3 -1
- package/index.js +32 -7
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -4245,11 +4245,13 @@ interface UserBlockProps$1 extends HasClassName, HasTheme {
|
|
|
4245
4245
|
* Called when the mouse enters the component.
|
|
4246
4246
|
*/
|
|
4247
4247
|
handleMouseEnter?(): void;
|
|
4248
|
+
mouseEnterProp?: string;
|
|
4248
4249
|
/**
|
|
4249
4250
|
* Mouse leave event handler.
|
|
4250
4251
|
* Called when the mouse leaves the component.
|
|
4251
4252
|
*/
|
|
4252
4253
|
handleMouseLeave?(): void;
|
|
4254
|
+
mouseLeaveProp?: string;
|
|
4253
4255
|
/**
|
|
4254
4256
|
* Additional custom fields to display below the standard fields.
|
|
4255
4257
|
* Only visible when size is not 'xs' or 's'.
|
|
@@ -4282,7 +4284,7 @@ interface UserBlockProps$1 extends HasClassName, HasTheme {
|
|
|
4282
4284
|
*/
|
|
4283
4285
|
Avatar: (props: any) => any;
|
|
4284
4286
|
}
|
|
4285
|
-
type UserBlockPropsToOverride = 'Avatar' | 'Text' | 'linkProps' | 'avatarProps';
|
|
4287
|
+
type UserBlockPropsToOverride = 'Avatar' | 'Text' | 'linkProps' | 'avatarProps' | 'mouseLeaveProp' | 'mouseEnterProp';
|
|
4286
4288
|
|
|
4287
4289
|
/**
|
|
4288
4290
|
* Defines the props of the component.
|
package/index.js
CHANGED
|
@@ -10889,6 +10889,26 @@ function createActiveItemState(callbacks, signal, initialItem) {
|
|
|
10889
10889
|
};
|
|
10890
10890
|
}
|
|
10891
10891
|
|
|
10892
|
+
/**
|
|
10893
|
+
* Create a TreeWalker that iterates over elements matching a CSS selector
|
|
10894
|
+
* within a container.
|
|
10895
|
+
*
|
|
10896
|
+
* Uses `NodeFilter.SHOW_ELEMENT` and accepts nodes that match the given
|
|
10897
|
+
* selector, skipping everything else. The returned walker can be used with
|
|
10898
|
+
* `nextNode()` / `previousNode()` for lazy, sequential DOM traversal.
|
|
10899
|
+
*
|
|
10900
|
+
* @param container The root element to walk within.
|
|
10901
|
+
* @param selector CSS selector that items must match.
|
|
10902
|
+
* @returns A TreeWalker scoped to the container and filtered by the selector.
|
|
10903
|
+
*/
|
|
10904
|
+
function createSelectorTreeWalker(container, selector) {
|
|
10905
|
+
return document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
10906
|
+
acceptNode(node) {
|
|
10907
|
+
return node.matches(selector) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
10908
|
+
}
|
|
10909
|
+
});
|
|
10910
|
+
}
|
|
10911
|
+
|
|
10892
10912
|
/**
|
|
10893
10913
|
* Create a focus navigation controller for a 1D list.
|
|
10894
10914
|
*
|
|
@@ -10918,11 +10938,7 @@ function createListFocusNavigation(options, callbacks, signal) {
|
|
|
10918
10938
|
*/
|
|
10919
10939
|
function createItemWalker(enabledOnly = true) {
|
|
10920
10940
|
const selector = enabledOnly ? enabledItemSelector : itemSelector;
|
|
10921
|
-
return
|
|
10922
|
-
acceptNode(node) {
|
|
10923
|
-
return node.matches(selector) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
10924
|
-
}
|
|
10925
|
-
});
|
|
10941
|
+
return createSelectorTreeWalker(container, selector);
|
|
10926
10942
|
}
|
|
10927
10943
|
|
|
10928
10944
|
/** Find the first enabled item in the container. */
|
|
@@ -16354,6 +16370,8 @@ const UserBlock$1 = props => {
|
|
|
16354
16370
|
linkAs,
|
|
16355
16371
|
ref,
|
|
16356
16372
|
multipleActions,
|
|
16373
|
+
mouseEnterProp = 'onMouseEnter',
|
|
16374
|
+
mouseLeaveProp = 'onMouseLeave',
|
|
16357
16375
|
name,
|
|
16358
16376
|
nameProps,
|
|
16359
16377
|
handleClick,
|
|
@@ -16391,17 +16409,24 @@ const UserBlock$1 = props => {
|
|
|
16391
16409
|
children: field
|
|
16392
16410
|
}, idx))
|
|
16393
16411
|
});
|
|
16412
|
+
const eventHandlers = {
|
|
16413
|
+
...(handleMouseEnter && {
|
|
16414
|
+
[mouseEnterProp]: handleMouseEnter
|
|
16415
|
+
}),
|
|
16416
|
+
...(handleMouseLeave && {
|
|
16417
|
+
[mouseLeaveProp]: handleMouseLeave
|
|
16418
|
+
})
|
|
16419
|
+
};
|
|
16394
16420
|
return /*#__PURE__*/jsxs("div", {
|
|
16395
16421
|
ref: ref,
|
|
16396
16422
|
...forwardedProps,
|
|
16423
|
+
...eventHandlers,
|
|
16397
16424
|
className: classnames(className, block({
|
|
16398
16425
|
[`orientation-${orientation}`]: Boolean(orientation),
|
|
16399
16426
|
[`size-${componentSize}`]: Boolean(componentSize),
|
|
16400
16427
|
[`theme-${theme}`]: Boolean(theme),
|
|
16401
16428
|
'is-clickable': isClickable
|
|
16402
16429
|
})),
|
|
16403
|
-
onMouseLeave: handleMouseLeave,
|
|
16404
|
-
onMouseEnter: handleMouseEnter,
|
|
16405
16430
|
children: [avatarProps && /*#__PURE__*/jsx(Avatar, {
|
|
16406
16431
|
linkAs: linkAs,
|
|
16407
16432
|
linkProps: linkProps,
|