@jsenv/navi 0.26.35 → 0.26.37
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/jsenv_navi.js +44 -5
- package/dist/jsenv_navi.js.map +13 -11
- package/package.json +2 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -6565,6 +6565,12 @@ const POSITION_PROPS = {
|
|
|
6565
6565
|
right: (value) => {
|
|
6566
6566
|
return { right: value === true ? 0 : value };
|
|
6567
6567
|
},
|
|
6568
|
+
inset: (v) => {
|
|
6569
|
+
if (v === true) {
|
|
6570
|
+
return { inset: 0, width: "auto", height: "auto" };
|
|
6571
|
+
}
|
|
6572
|
+
return { inset: v };
|
|
6573
|
+
},
|
|
6568
6574
|
|
|
6569
6575
|
transform: PASS_THROUGH,
|
|
6570
6576
|
translateX: (value) => {
|
|
@@ -20888,6 +20894,9 @@ const css$D = /* css */`
|
|
|
20888
20894
|
&[data-skeleton] {
|
|
20889
20895
|
border-radius: 0.2em;
|
|
20890
20896
|
}
|
|
20897
|
+
&[data-capitalize] {
|
|
20898
|
+
display: inline-block; /* We need inline-block to match the pseudo element */
|
|
20899
|
+
}
|
|
20891
20900
|
}
|
|
20892
20901
|
}
|
|
20893
20902
|
|
|
@@ -22146,6 +22155,7 @@ const debugUIGroup = (...args) => {
|
|
|
22146
22155
|
const UIStateControllerContext = createContext();
|
|
22147
22156
|
const UIStateContext = createContext();
|
|
22148
22157
|
const ParentUIStateControllerContext = createContext();
|
|
22158
|
+
const SelectTriggerContentRegistryContext = createContext(null);
|
|
22149
22159
|
|
|
22150
22160
|
const FieldNameContext = createContext();
|
|
22151
22161
|
const ReadOnlyContext = createContext();
|
|
@@ -27112,6 +27122,7 @@ installImportMetaCssBuild(import.meta);const ListItemTrackerContext = createCont
|
|
|
27112
27122
|
const GroupItemTrackerContext = createContext(null);
|
|
27113
27123
|
const PendingScrollRefContext = createContext(null);
|
|
27114
27124
|
const ListIdContext = createContext();
|
|
27125
|
+
const InsideRealListItemContext = createContext(false);
|
|
27115
27126
|
|
|
27116
27127
|
// Provided by ListInteractive to give descendants (e.g. Suggestion) access
|
|
27117
27128
|
// to hover/keyboard-pointed/selection state.
|
|
@@ -28718,6 +28729,15 @@ const ListItemReal = ({
|
|
|
28718
28729
|
const mousePointedId = useContext(ListMousePointedIdContext);
|
|
28719
28730
|
const keyboardPointedId = useContext(ListKeyboardPointedIdContext);
|
|
28720
28731
|
const pendingScrollRef = useContext(PendingScrollRefContext);
|
|
28732
|
+
const registerTriggerContent = useContext(SelectTriggerContentRegistryContext);
|
|
28733
|
+
useLayoutEffect(() => {
|
|
28734
|
+
if (!registerTriggerContent) {
|
|
28735
|
+
return;
|
|
28736
|
+
}
|
|
28737
|
+
if (selected) {
|
|
28738
|
+
registerTriggerContent(children);
|
|
28739
|
+
}
|
|
28740
|
+
}, [selected, children, registerTriggerContent]);
|
|
28721
28741
|
const isPointedByMouse = id === mousePointedId;
|
|
28722
28742
|
const isPointedByKeyboard = id === keyboardPointedId;
|
|
28723
28743
|
const isPointedByProxy = Boolean(pointed);
|
|
@@ -28878,7 +28898,10 @@ const ListItemReal = ({
|
|
|
28878
28898
|
":-navi-selected": selected,
|
|
28879
28899
|
...rest.basePseudoState
|
|
28880
28900
|
},
|
|
28881
|
-
children:
|
|
28901
|
+
children: jsx(InsideRealListItemContext.Provider, {
|
|
28902
|
+
value: true,
|
|
28903
|
+
children: children
|
|
28904
|
+
})
|
|
28882
28905
|
});
|
|
28883
28906
|
};
|
|
28884
28907
|
const LIST_ITEM_STYLE_CSS_VARS = {
|
|
@@ -29284,12 +29307,17 @@ const InputTextual = props => {
|
|
|
29284
29307
|
};
|
|
29285
29308
|
const InputTextualDispatcher = props => {
|
|
29286
29309
|
const listIdFromContext = useContext(ListIdContext);
|
|
29310
|
+
const isInsideRealListItem = useContext(InsideRealListItemContext);
|
|
29287
29311
|
if (props.action) {
|
|
29288
29312
|
return jsx(InputTextualWithAction, {
|
|
29289
29313
|
...props
|
|
29290
29314
|
});
|
|
29291
29315
|
}
|
|
29292
|
-
if (listIdFromContext
|
|
29316
|
+
if (listIdFromContext &&
|
|
29317
|
+
// When inside a ListItem the input is not considered as controlling the list
|
|
29318
|
+
// (A list item may contain an input)
|
|
29319
|
+
// Note that you can still have an input controlling list in a ListItemHeader or Footer
|
|
29320
|
+
!isInsideRealListItem) {
|
|
29293
29321
|
return jsx(InputControllingList, {
|
|
29294
29322
|
listId: listIdFromContext,
|
|
29295
29323
|
...props
|
|
@@ -31405,6 +31433,7 @@ const SelectUI = props => {
|
|
|
31405
31433
|
useAutoFocus(ref, autoFocus, {
|
|
31406
31434
|
preventScroll: autoFocusPreventScroll
|
|
31407
31435
|
});
|
|
31436
|
+
const [triggerContent, setTriggerContent] = useState(null);
|
|
31408
31437
|
return jsxs(Box, {
|
|
31409
31438
|
as: "button",
|
|
31410
31439
|
type: "button",
|
|
@@ -31439,13 +31468,20 @@ const SelectUI = props => {
|
|
|
31439
31468
|
value: placeholder,
|
|
31440
31469
|
children: [jsx(SelectValueContext.Provider, {
|
|
31441
31470
|
value: value,
|
|
31442
|
-
children:
|
|
31443
|
-
|
|
31471
|
+
children: jsx(SelectTriggerContentContext.Provider, {
|
|
31472
|
+
value: triggerContent,
|
|
31473
|
+
children: trigger
|
|
31474
|
+
})
|
|
31475
|
+
}), jsx(SelectTriggerContentRegistryContext.Provider, {
|
|
31476
|
+
value: setTriggerContent,
|
|
31477
|
+
children: children
|
|
31478
|
+
})]
|
|
31444
31479
|
})]
|
|
31445
31480
|
});
|
|
31446
31481
|
};
|
|
31447
31482
|
const SelectPlaceholderContext = createContext();
|
|
31448
31483
|
const SelectValueContext = createContext(null);
|
|
31484
|
+
const SelectTriggerContentContext = createContext(null);
|
|
31449
31485
|
const SelectStyleCSSVars = {
|
|
31450
31486
|
"outlineWidth": "--select-outline-width",
|
|
31451
31487
|
"borderWidth": "--select-border-width",
|
|
@@ -31490,8 +31526,10 @@ const SelectPseudoElements = ["::-navi-loader"];
|
|
|
31490
31526
|
const SelectTrigger = () => {
|
|
31491
31527
|
const placeholder = useContext(SelectPlaceholderContext);
|
|
31492
31528
|
const value = useContext(SelectValueContext);
|
|
31529
|
+
const triggerContent = useContext(SelectTriggerContentContext);
|
|
31493
31530
|
const hasValue = value !== null && value !== undefined && value !== "";
|
|
31494
31531
|
const isPlaceholder = !hasValue;
|
|
31532
|
+
const contentDisplayed = triggerContent || value;
|
|
31495
31533
|
return jsxs(Box, {
|
|
31496
31534
|
flex: true,
|
|
31497
31535
|
spacing: "s",
|
|
@@ -31504,7 +31542,7 @@ const SelectTrigger = () => {
|
|
|
31504
31542
|
}), jsx("span", {
|
|
31505
31543
|
className: "navi_select_trigger_value",
|
|
31506
31544
|
hidden: isPlaceholder,
|
|
31507
|
-
children:
|
|
31545
|
+
children: contentDisplayed
|
|
31508
31546
|
})]
|
|
31509
31547
|
}), jsx(Icon, {
|
|
31510
31548
|
className: "navi_select_trigger_icon",
|
|
@@ -31668,6 +31706,7 @@ const SelectWithPopover = props => {
|
|
|
31668
31706
|
}
|
|
31669
31707
|
// mousedown inside popover should not bubble to the select (would re-open it if that mousedown closes it)
|
|
31670
31708
|
e.stopPropagation();
|
|
31709
|
+
debugPopup(formatEventSideEffect(e, `popover mouseDown stopPropagation`));
|
|
31671
31710
|
},
|
|
31672
31711
|
onnavi_popover_open: e => {
|
|
31673
31712
|
onOpen();
|