@jsenv/navi 0.29.375 → 0.29.377
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/dev/jsenv_navi.js +53 -9
- package/dist/dev/jsenv_navi.js.map +6 -6
- package/dist/jsenv_navi.js +44 -9
- package/dist/jsenv_navi.js.map +6 -6
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -34174,10 +34174,18 @@ registerNaviCommand("--navi-define", (source, event) => {
|
|
|
34174
34174
|
implementation: () => executeNaviDefine(source, event, target),
|
|
34175
34175
|
};
|
|
34176
34176
|
});
|
|
34177
|
+
// A send whose target is the popup itself: what is around the source IS the
|
|
34178
|
+
// popup's answer, and a picker runs its action with that answer as it closes
|
|
34179
|
+
// (see onRequestClose in picker_custom.jsx) — dispatching the action here too
|
|
34180
|
+
// would run it twice. `isSend` tells this close from a dismissal (the cross,
|
|
34181
|
+
// a press outside, Escape): the person pressed a choice, which a picker may
|
|
34182
|
+
// act on even when the choice is the one it already held.
|
|
34177
34183
|
const executeNaviDefine = (source, event, target) => {
|
|
34178
|
-
|
|
34179
|
-
|
|
34180
|
-
|
|
34184
|
+
return dispatchCustomEvent(target, "navi_request_close", {
|
|
34185
|
+
event,
|
|
34186
|
+
source: resolveCommandProxySource(source),
|
|
34187
|
+
isSend: true,
|
|
34188
|
+
});
|
|
34181
34189
|
};
|
|
34182
34190
|
|
|
34183
34191
|
registerNaviCommand("--navi-scroll", (source, event) => {
|
|
@@ -64673,6 +64681,9 @@ const PickerCustom = props => {
|
|
|
64673
64681
|
// closed on it. A confirm picker is the one saying something (see
|
|
64674
64682
|
// picker_confirm.jsx): its press, deferred until the question is answered.
|
|
64675
64683
|
onConfirm,
|
|
64684
|
+
// A choice pressed inside the popup runs `action` even when it is the one
|
|
64685
|
+
// the picker already held. See the JSDoc.
|
|
64686
|
+
canSendWhileUnchanged,
|
|
64676
64687
|
// The popup's lifecycle, the same pair Dialog and Popover take. Taken on
|
|
64677
64688
|
// the picker and chained into its own openController below: the picker
|
|
64678
64689
|
// hands the popup that controller, and a controlled Dialog/Popover reads
|
|
@@ -64715,6 +64726,7 @@ const PickerCustom = props => {
|
|
|
64715
64726
|
delete pickerProps.defaultOpen;
|
|
64716
64727
|
delete pickerProps.escapeEffect;
|
|
64717
64728
|
delete pickerProps.onConfirm;
|
|
64729
|
+
delete pickerProps.canSendWhileUnchanged;
|
|
64718
64730
|
delete pickerProps.onOpen;
|
|
64719
64731
|
delete pickerProps.onClose;
|
|
64720
64732
|
delete pickerProps.openOn;
|
|
@@ -64814,8 +64826,17 @@ const PickerCustom = props => {
|
|
|
64814
64826
|
// suggestion to accept, and confirming `undefined` cannot mean
|
|
64815
64827
|
// anything. A picker on a defaultValue is untouched by this: it
|
|
64816
64828
|
// shows something, so closing on it still confirms it.
|
|
64817
|
-
//
|
|
64818
|
-
|
|
64829
|
+
//
|
|
64830
|
+
// Unless the close is a choice PRESSED inside the popup (a row's
|
|
64831
|
+
// `--navi-send`, a `--navi-confirm`) on a picker that asked to
|
|
64832
|
+
// send while unchanged: the person picked what was already picked,
|
|
64833
|
+
// and for that picker the same value said again means something.
|
|
64834
|
+
// A press outside, Escape, the cross say nothing and keep skipping.
|
|
64835
|
+
const said = requestCloseEvent.detail.isSend || confirmEventRef.current;
|
|
64836
|
+
if (!(canSendWhileUnchanged && said)) {
|
|
64837
|
+
// No action to run, but still allow the close.
|
|
64838
|
+
return;
|
|
64839
|
+
}
|
|
64819
64840
|
}
|
|
64820
64841
|
dispatchRequestAction(inputEl, {
|
|
64821
64842
|
event: requestCloseEvent,
|
|
@@ -64998,7 +65019,8 @@ const PickerCustom = props => {
|
|
|
64998
65019
|
intent: "read",
|
|
64999
65020
|
allowed: () => {
|
|
65000
65021
|
const closing = requestClose(e, {
|
|
65001
|
-
isCancel: e.detail.isCancel
|
|
65022
|
+
isCancel: e.detail.isCancel,
|
|
65023
|
+
isSend: e.detail.isSend
|
|
65002
65024
|
});
|
|
65003
65025
|
if (!closing) {
|
|
65004
65026
|
e.preventDefault();
|
|
@@ -68626,8 +68648,17 @@ const useListScrollSync = ({
|
|
|
68626
68648
|
// The list is holding itself somewhere; that is what owns the scroll.
|
|
68627
68649
|
return;
|
|
68628
68650
|
}
|
|
68651
|
+
const scrollerEl = getScroller();
|
|
68652
|
+
if (scrollerEl && (horizontal ? scrollerEl.scrollLeft : scrollerEl.scrollTop) === 0) {
|
|
68653
|
+
// A scroller at its start has nothing above the view to keep still, and
|
|
68654
|
+
// rows landing above the first one are what a list read from its start
|
|
68655
|
+
// (a journal newest first, a feed) is there to show: holding the row on
|
|
68656
|
+
// top would scroll past them. The browser's own scroll anchoring makes
|
|
68657
|
+
// the same exception at offset 0.
|
|
68658
|
+
return;
|
|
68659
|
+
}
|
|
68629
68660
|
anchorRef.current = captureScrollAnchor({
|
|
68630
|
-
scrollerEl
|
|
68661
|
+
scrollerEl,
|
|
68631
68662
|
listEl: getListEl(),
|
|
68632
68663
|
items: listRows.visibleItemsSignal.peek(),
|
|
68633
68664
|
horizontal
|
|
@@ -85614,7 +85645,10 @@ const css$8 = /* css */`@layer navi {
|
|
|
85614
85645
|
background-color: var(--x-fill-color);
|
|
85615
85646
|
border-width: var(--border-width);
|
|
85616
85647
|
border-radius: inherit;
|
|
85617
|
-
clip-path: inset(0
|
|
85648
|
+
clip-path: inset(0
|
|
85649
|
+
calc(100% - var(--border-width) - var(--x-fill-ratio, 0) *
|
|
85650
|
+
(100% - var(--border-width) * 2))
|
|
85651
|
+
0 0);
|
|
85618
85652
|
border-style: solid;
|
|
85619
85653
|
border-color: #0000;
|
|
85620
85654
|
position: absolute;
|
|
@@ -85662,7 +85696,8 @@ const css$8 = /* css */`@layer navi {
|
|
|
85662
85696
|
|
|
85663
85697
|
&[data-fill-round] {
|
|
85664
85698
|
& .navi_meter_fill {
|
|
85665
|
-
width: calc(var(--x-fill-ratio) * 100%)
|
|
85699
|
+
width: calc(var(--x-fill-ratio) * (100% - var(--border-width) * 2) +
|
|
85700
|
+
var(--border-width) * 2);
|
|
85666
85701
|
clip-path: unset;
|
|
85667
85702
|
}
|
|
85668
85703
|
}
|