@jsenv/navi 0.29.159 → 0.29.160
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 +27 -4
- package/dist/jsenv_navi.js.map +4 -4
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -5686,6 +5686,15 @@ const CONTROL_PROP_SET = new Set([
|
|
|
5686
5686
|
|
|
5687
5687
|
"charGuard",
|
|
5688
5688
|
"maxLengthGuard",
|
|
5689
|
+
|
|
5690
|
+
// This control answers for itself: it registers into no group, no form and no
|
|
5691
|
+
// picker around it (see useUIStateController). It belongs here rather than
|
|
5692
|
+
// being deleted off `props` where it is read: props is the vnode's own object
|
|
5693
|
+
// and Preact hands the SAME one back on a re-render the component triggers
|
|
5694
|
+
// itself, so a prop deleted on the first render is simply gone on the second
|
|
5695
|
+
// — and the control, no longer standalone, walked into the group it had
|
|
5696
|
+
// stepped out of.
|
|
5697
|
+
"standalone",
|
|
5689
5698
|
]);
|
|
5690
5699
|
|
|
5691
5700
|
/**
|
|
@@ -30621,13 +30630,28 @@ const triggerNaviCommand = (
|
|
|
30621
30630
|
return false;
|
|
30622
30631
|
}
|
|
30623
30632
|
const { target, implementation } = execute;
|
|
30624
|
-
|
|
30633
|
+
// The event is how the target takes part in what it was asked to do (a popup
|
|
30634
|
+
// closing on --navi-close also has its own things to do); the command itself
|
|
30635
|
+
// is the implementation, and it must not depend on someone listening. Nobody
|
|
30636
|
+
// does when the target has left the document — a trigger whose own action
|
|
30637
|
+
// took it away, which is the shape of "delete this, then leave the page it
|
|
30638
|
+
// was on" (see runWhenActionSucceeded in rules/control_action.js): the
|
|
30639
|
+
// command is decided while the trigger is there and runs once the action has
|
|
30640
|
+
// succeeded, by which time the row it stood in is gone. So the command runs
|
|
30641
|
+
// here rather than being lost in silence.
|
|
30642
|
+
const detail = {
|
|
30625
30643
|
command,
|
|
30626
30644
|
event,
|
|
30627
30645
|
source: element,
|
|
30628
30646
|
implementation,
|
|
30629
30647
|
value,
|
|
30630
|
-
|
|
30648
|
+
answered: false,
|
|
30649
|
+
};
|
|
30650
|
+
const dispatched = dispatchCustomEvent(target, "navi_command", detail);
|
|
30651
|
+
if (!detail.answered) {
|
|
30652
|
+
implementation();
|
|
30653
|
+
}
|
|
30654
|
+
return dispatched;
|
|
30631
30655
|
};
|
|
30632
30656
|
|
|
30633
30657
|
// Returns the target explicitly declared via HTML attributes (commandfor / navi-command-target),
|
|
@@ -30758,6 +30782,7 @@ const onNaviCommand = (e, { debugCommand = () => {} } = {}) => {
|
|
|
30758
30782
|
console.warn(`navi_command event is missing detail.implementation`, e);
|
|
30759
30783
|
return false;
|
|
30760
30784
|
}
|
|
30785
|
+
e.detail.answered = true;
|
|
30761
30786
|
const commandTarget = e.currentTarget;
|
|
30762
30787
|
debugCommand(
|
|
30763
30788
|
event,
|
|
@@ -35078,7 +35103,6 @@ const useControlProps = (props, {
|
|
|
35078
35103
|
const {
|
|
35079
35104
|
standalone
|
|
35080
35105
|
} = props;
|
|
35081
|
-
delete props.standalone;
|
|
35082
35106
|
const idDefault = useId();
|
|
35083
35107
|
const controlId = useContext(ControlIdContext);
|
|
35084
35108
|
props.id = props.id || controlId || idDefault;
|
|
@@ -36097,7 +36121,6 @@ const useControlgroupProps = (props, {
|
|
|
36097
36121
|
action,
|
|
36098
36122
|
standalone
|
|
36099
36123
|
} = props;
|
|
36100
|
-
delete props.standalone;
|
|
36101
36124
|
const uiGroupStateController = useUIGroupStateController(props, controlType, {
|
|
36102
36125
|
stateType,
|
|
36103
36126
|
childControlFilter,
|