@jsenv/navi 0.15.4 → 0.15.6
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 +156 -114
- package/dist/jsenv_navi.js.map +29 -28
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -7640,9 +7640,9 @@ if (typeof window === "undefined") {
|
|
|
7640
7640
|
const setBaseUrl = (value) => {
|
|
7641
7641
|
baseUrl = new URL(value, window.location).href;
|
|
7642
7642
|
};
|
|
7643
|
-
// Controls what happens to actions when their route
|
|
7644
|
-
// 'abort' - Cancel the action immediately when route
|
|
7645
|
-
// 'keep-loading' - Allow action to continue running after route
|
|
7643
|
+
// Controls what happens to actions when their route stops matching:
|
|
7644
|
+
// 'abort' - Cancel the action immediately when route stops matching
|
|
7645
|
+
// 'keep-loading' - Allow action to continue running after route stops matching
|
|
7646
7646
|
//
|
|
7647
7647
|
// The 'keep-loading' strategy could act like preloading, keeping data ready for potential return.
|
|
7648
7648
|
// However, since route reactivation triggers action reload anyway, the old data won't be used
|
|
@@ -7669,13 +7669,31 @@ const updateRoutes = (
|
|
|
7669
7669
|
|
|
7670
7670
|
// Get previous state
|
|
7671
7671
|
const previousState = routePreviousStateMap.get(route) || {
|
|
7672
|
-
|
|
7672
|
+
matching: false,
|
|
7673
|
+
exactMatching: false,
|
|
7673
7674
|
params: null,
|
|
7674
7675
|
};
|
|
7675
|
-
const
|
|
7676
|
+
const oldMatching = previousState.matching;
|
|
7677
|
+
const oldExactMatching = previousState.exactMatching;
|
|
7676
7678
|
const oldParams = previousState.params;
|
|
7677
7679
|
const extractedParams = routePattern.applyOn(url);
|
|
7678
|
-
const
|
|
7680
|
+
const newMatching = Boolean(extractedParams);
|
|
7681
|
+
|
|
7682
|
+
// Calculate exact matching - true when matching but no wildcards have content
|
|
7683
|
+
let newExactMatching = false;
|
|
7684
|
+
if (newMatching && extractedParams) {
|
|
7685
|
+
// Check if any wildcard parameters (numeric keys) have meaningful content
|
|
7686
|
+
const hasWildcardContent = Object.keys(extractedParams).some((key) => {
|
|
7687
|
+
const keyAsNumber = parseInt(key, 10);
|
|
7688
|
+
if (!isNaN(keyAsNumber)) {
|
|
7689
|
+
// This is a wildcard parameter (numeric key)
|
|
7690
|
+
const value = extractedParams[key];
|
|
7691
|
+
return value && value.trim() !== "";
|
|
7692
|
+
}
|
|
7693
|
+
return false;
|
|
7694
|
+
});
|
|
7695
|
+
newExactMatching = !hasWildcardContent;
|
|
7696
|
+
}
|
|
7679
7697
|
let newParams;
|
|
7680
7698
|
if (extractedParams) {
|
|
7681
7699
|
if (compareTwoJsValues(oldParams, extractedParams)) {
|
|
@@ -7691,37 +7709,42 @@ const updateRoutes = (
|
|
|
7691
7709
|
const routeMatchInfo = {
|
|
7692
7710
|
route,
|
|
7693
7711
|
routePrivateProperties,
|
|
7694
|
-
|
|
7695
|
-
|
|
7712
|
+
oldMatching,
|
|
7713
|
+
newMatching,
|
|
7714
|
+
oldExactMatching,
|
|
7715
|
+
newExactMatching,
|
|
7696
7716
|
oldParams,
|
|
7697
7717
|
newParams,
|
|
7698
7718
|
};
|
|
7699
7719
|
routeMatchInfoSet.add(routeMatchInfo);
|
|
7700
7720
|
// Store current state for next comparison
|
|
7701
7721
|
routePreviousStateMap.set(route, {
|
|
7702
|
-
|
|
7722
|
+
matching: newMatching,
|
|
7723
|
+
exactMatching: newExactMatching,
|
|
7703
7724
|
params: newParams,
|
|
7704
7725
|
});
|
|
7705
7726
|
}
|
|
7706
7727
|
|
|
7707
7728
|
// Apply all signal updates in a batch
|
|
7708
|
-
const
|
|
7729
|
+
const matchingRouteSet = new Set();
|
|
7709
7730
|
batch(() => {
|
|
7710
7731
|
for (const {
|
|
7711
7732
|
route,
|
|
7712
7733
|
routePrivateProperties,
|
|
7713
|
-
|
|
7734
|
+
newMatching,
|
|
7735
|
+
newExactMatching,
|
|
7714
7736
|
newParams,
|
|
7715
7737
|
} of routeMatchInfoSet) {
|
|
7716
7738
|
const { updateStatus } = routePrivateProperties;
|
|
7717
7739
|
const visited = isVisited(route.url);
|
|
7718
7740
|
updateStatus({
|
|
7719
|
-
|
|
7741
|
+
matching: newMatching,
|
|
7742
|
+
exactMatching: newExactMatching,
|
|
7720
7743
|
params: newParams,
|
|
7721
7744
|
visited,
|
|
7722
7745
|
});
|
|
7723
|
-
if (
|
|
7724
|
-
|
|
7746
|
+
if (newMatching) {
|
|
7747
|
+
matchingRouteSet.add(route);
|
|
7725
7748
|
}
|
|
7726
7749
|
}
|
|
7727
7750
|
});
|
|
@@ -7773,8 +7796,8 @@ const updateRoutes = (
|
|
|
7773
7796
|
for (const {
|
|
7774
7797
|
route,
|
|
7775
7798
|
routePrivateProperties,
|
|
7776
|
-
|
|
7777
|
-
|
|
7799
|
+
newMatching,
|
|
7800
|
+
oldMatching,
|
|
7778
7801
|
newParams,
|
|
7779
7802
|
oldParams,
|
|
7780
7803
|
} of routeMatchInfoSet) {
|
|
@@ -7783,25 +7806,25 @@ const updateRoutes = (
|
|
|
7783
7806
|
continue;
|
|
7784
7807
|
}
|
|
7785
7808
|
|
|
7786
|
-
const
|
|
7787
|
-
const
|
|
7788
|
-
const
|
|
7789
|
-
|
|
7809
|
+
const becomesMatching = newMatching && !oldMatching;
|
|
7810
|
+
const becomesNotMatching = !newMatching && oldMatching;
|
|
7811
|
+
const paramsChangedWhileMatching =
|
|
7812
|
+
newMatching && oldMatching && newParams !== oldParams;
|
|
7790
7813
|
|
|
7791
|
-
// Handle actions for routes that become
|
|
7792
|
-
if (
|
|
7814
|
+
// Handle actions for routes that become matching
|
|
7815
|
+
if (becomesMatching) {
|
|
7793
7816
|
shouldLoad(route);
|
|
7794
7817
|
continue;
|
|
7795
7818
|
}
|
|
7796
7819
|
|
|
7797
|
-
// Handle actions for routes that become
|
|
7798
|
-
if (
|
|
7820
|
+
// Handle actions for routes that become not matching - abort them
|
|
7821
|
+
if (becomesNotMatching && ROUTE_DEACTIVATION_STRATEGY === "abort") {
|
|
7799
7822
|
shouldAbort(route);
|
|
7800
7823
|
continue;
|
|
7801
7824
|
}
|
|
7802
7825
|
|
|
7803
|
-
// Handle parameter changes while route stays
|
|
7804
|
-
if (
|
|
7826
|
+
// Handle parameter changes while route stays matching
|
|
7827
|
+
if (paramsChangedWhileMatching) {
|
|
7805
7828
|
shouldReload(route);
|
|
7806
7829
|
}
|
|
7807
7830
|
}
|
|
@@ -7811,7 +7834,7 @@ const updateRoutes = (
|
|
|
7811
7834
|
reloadSet: toReloadSet,
|
|
7812
7835
|
abortSignalMap,
|
|
7813
7836
|
routeLoadRequestedMap,
|
|
7814
|
-
|
|
7837
|
+
matchingRouteSet,
|
|
7815
7838
|
};
|
|
7816
7839
|
};
|
|
7817
7840
|
|
|
@@ -7833,7 +7856,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
7833
7856
|
const route = {
|
|
7834
7857
|
urlPattern: urlPatternInput,
|
|
7835
7858
|
isRoute: true,
|
|
7836
|
-
|
|
7859
|
+
matching: false,
|
|
7860
|
+
exactMatching: false,
|
|
7837
7861
|
params: null,
|
|
7838
7862
|
buildUrl: null,
|
|
7839
7863
|
bindAction: null,
|
|
@@ -7851,18 +7875,24 @@ const createRoute = (urlPatternInput) => {
|
|
|
7851
7875
|
|
|
7852
7876
|
const routePrivateProperties = {
|
|
7853
7877
|
routePattern: null,
|
|
7854
|
-
|
|
7878
|
+
matchingSignal: null,
|
|
7879
|
+
exactMatchingSignal: null,
|
|
7855
7880
|
paramsSignal: null,
|
|
7856
7881
|
visitedSignal: null,
|
|
7857
7882
|
relativeUrlSignal: null,
|
|
7858
7883
|
urlSignal: null,
|
|
7859
|
-
updateStatus: ({
|
|
7884
|
+
updateStatus: ({ matching, exactMatching, params, visited }) => {
|
|
7860
7885
|
let someChange = false;
|
|
7861
|
-
|
|
7886
|
+
matchingSignal.value = matching;
|
|
7887
|
+
exactMatchingSignal.value = exactMatching;
|
|
7862
7888
|
paramsSignal.value = params;
|
|
7863
7889
|
visitedSignal.value = visited;
|
|
7864
|
-
if (route.
|
|
7865
|
-
route.
|
|
7890
|
+
if (route.matching !== matching) {
|
|
7891
|
+
route.matching = matching;
|
|
7892
|
+
someChange = true;
|
|
7893
|
+
}
|
|
7894
|
+
if (route.exactMatching !== exactMatching) {
|
|
7895
|
+
route.exactMatching = exactMatching;
|
|
7866
7896
|
someChange = true;
|
|
7867
7897
|
}
|
|
7868
7898
|
if (route.params !== params) {
|
|
@@ -7874,7 +7904,7 @@ const createRoute = (urlPatternInput) => {
|
|
|
7874
7904
|
someChange = true;
|
|
7875
7905
|
}
|
|
7876
7906
|
if (someChange) {
|
|
7877
|
-
publishStatus({
|
|
7907
|
+
publishStatus({ matching, exactMatching, params, visited });
|
|
7878
7908
|
}
|
|
7879
7909
|
},
|
|
7880
7910
|
};
|
|
@@ -7948,7 +7978,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
7948
7978
|
};
|
|
7949
7979
|
route.buildUrl = buildUrl;
|
|
7950
7980
|
|
|
7951
|
-
const
|
|
7981
|
+
const matchingSignal = signal(false);
|
|
7982
|
+
const exactMatchingSignal = signal(false);
|
|
7952
7983
|
const paramsSignal = signal(null);
|
|
7953
7984
|
const visitedSignal = signal(false);
|
|
7954
7985
|
const relativeUrlSignal = computed(() => {
|
|
@@ -8054,7 +8085,8 @@ const createRoute = (urlPatternInput) => {
|
|
|
8054
8085
|
route.bindAction = bindAction;
|
|
8055
8086
|
|
|
8056
8087
|
{
|
|
8057
|
-
routePrivateProperties.
|
|
8088
|
+
routePrivateProperties.matchingSignal = matchingSignal;
|
|
8089
|
+
routePrivateProperties.exactMatchingSignal = exactMatchingSignal;
|
|
8058
8090
|
routePrivateProperties.paramsSignal = paramsSignal;
|
|
8059
8091
|
routePrivateProperties.visitedSignal = visitedSignal;
|
|
8060
8092
|
routePrivateProperties.relativeUrlSignal = relativeUrlSignal;
|
|
@@ -8072,17 +8104,24 @@ const useRouteStatus = (route) => {
|
|
|
8072
8104
|
throw new Error(`Cannot find route private properties for ${route}`);
|
|
8073
8105
|
}
|
|
8074
8106
|
|
|
8075
|
-
const {
|
|
8076
|
-
|
|
8107
|
+
const {
|
|
8108
|
+
urlSignal,
|
|
8109
|
+
matchingSignal,
|
|
8110
|
+
exactMatchingSignal,
|
|
8111
|
+
paramsSignal,
|
|
8112
|
+
visitedSignal,
|
|
8113
|
+
} = routePrivateProperties;
|
|
8077
8114
|
|
|
8078
8115
|
const url = urlSignal.value;
|
|
8079
|
-
const
|
|
8116
|
+
const matching = matchingSignal.value;
|
|
8117
|
+
const exactMatching = exactMatchingSignal.value;
|
|
8080
8118
|
const params = paramsSignal.value;
|
|
8081
8119
|
const visited = visitedSignal.value;
|
|
8082
8120
|
|
|
8083
8121
|
return {
|
|
8084
8122
|
url,
|
|
8085
|
-
|
|
8123
|
+
matching,
|
|
8124
|
+
exactMatching,
|
|
8086
8125
|
params,
|
|
8087
8126
|
visited,
|
|
8088
8127
|
};
|
|
@@ -8836,7 +8875,7 @@ const Routes = ({
|
|
|
8836
8875
|
element = RootElement,
|
|
8837
8876
|
children
|
|
8838
8877
|
}) => {
|
|
8839
|
-
const routeInfo =
|
|
8878
|
+
const routeInfo = useMatchingRouteInfo();
|
|
8840
8879
|
const route = routeInfo?.route;
|
|
8841
8880
|
return jsx(Route, {
|
|
8842
8881
|
route: route,
|
|
@@ -8844,7 +8883,7 @@ const Routes = ({
|
|
|
8844
8883
|
children: children
|
|
8845
8884
|
});
|
|
8846
8885
|
};
|
|
8847
|
-
const
|
|
8886
|
+
const useMatchingRouteInfo = () => useContext(RouteInfoContext);
|
|
8848
8887
|
const Route = ({
|
|
8849
8888
|
element,
|
|
8850
8889
|
route,
|
|
@@ -8855,43 +8894,43 @@ const Route = ({
|
|
|
8855
8894
|
}) => {
|
|
8856
8895
|
const forceRender = useForceRender();
|
|
8857
8896
|
const hasDiscoveredRef = useRef(false);
|
|
8858
|
-
const
|
|
8897
|
+
const matchingInfoRef = useRef(null);
|
|
8859
8898
|
if (!hasDiscoveredRef.current) {
|
|
8860
|
-
return jsx(
|
|
8899
|
+
return jsx(MatchingRouteManager, {
|
|
8861
8900
|
element: element,
|
|
8862
8901
|
route: route,
|
|
8863
8902
|
index: index,
|
|
8864
8903
|
fallback: fallback,
|
|
8865
8904
|
meta: meta,
|
|
8866
|
-
|
|
8905
|
+
onMatchingInfoChange: matchingInfo => {
|
|
8867
8906
|
hasDiscoveredRef.current = true;
|
|
8868
|
-
|
|
8907
|
+
matchingInfoRef.current = matchingInfo;
|
|
8869
8908
|
forceRender();
|
|
8870
8909
|
},
|
|
8871
8910
|
children: children
|
|
8872
8911
|
});
|
|
8873
8912
|
}
|
|
8874
|
-
const
|
|
8875
|
-
if (!
|
|
8913
|
+
const matchingInfo = matchingInfoRef.current;
|
|
8914
|
+
if (!matchingInfo) {
|
|
8876
8915
|
return null;
|
|
8877
8916
|
}
|
|
8878
8917
|
const {
|
|
8879
|
-
|
|
8880
|
-
} =
|
|
8881
|
-
return jsx(
|
|
8918
|
+
MatchingElement
|
|
8919
|
+
} = matchingInfo;
|
|
8920
|
+
return jsx(MatchingElement, {});
|
|
8882
8921
|
};
|
|
8883
8922
|
const RegisterChildRouteContext = createContext(null);
|
|
8884
8923
|
|
|
8885
8924
|
/* This component is ensure to be rendered once
|
|
8886
8925
|
So no need to cleanup things or whatever we know and ensure that
|
|
8887
|
-
it's executed once for the
|
|
8888
|
-
const
|
|
8926
|
+
it's executed once for the entire app lifecycle */
|
|
8927
|
+
const MatchingRouteManager = ({
|
|
8889
8928
|
element,
|
|
8890
8929
|
route,
|
|
8891
8930
|
index,
|
|
8892
8931
|
fallback,
|
|
8893
8932
|
meta,
|
|
8894
|
-
|
|
8933
|
+
onMatchingInfoChange,
|
|
8895
8934
|
children
|
|
8896
8935
|
}) => {
|
|
8897
8936
|
if (route && fallback) {
|
|
@@ -8935,7 +8974,7 @@ const ActiveRouteManager = ({
|
|
|
8935
8974
|
indexCandidate,
|
|
8936
8975
|
fallbackCandidate,
|
|
8937
8976
|
candidateSet,
|
|
8938
|
-
|
|
8977
|
+
onMatchingInfoChange,
|
|
8939
8978
|
registerChildRouteFromContext
|
|
8940
8979
|
});
|
|
8941
8980
|
}, []);
|
|
@@ -8953,7 +8992,7 @@ const initRouteObserver = ({
|
|
|
8953
8992
|
indexCandidate,
|
|
8954
8993
|
fallbackCandidate,
|
|
8955
8994
|
candidateSet,
|
|
8956
|
-
|
|
8995
|
+
onMatchingInfoChange,
|
|
8957
8996
|
registerChildRouteFromContext
|
|
8958
8997
|
}) => {
|
|
8959
8998
|
if (!fallbackCandidate && indexCandidate && indexCandidate.fallback !== false) {
|
|
@@ -8973,15 +9012,15 @@ const initRouteObserver = ({
|
|
|
8973
9012
|
const compositeRoute = {
|
|
8974
9013
|
urlPattern: `composite(${candidateElementIds})`,
|
|
8975
9014
|
isComposite: true,
|
|
8976
|
-
|
|
9015
|
+
matching: false,
|
|
8977
9016
|
subscribeStatus: subscribeCompositeStatus,
|
|
8978
9017
|
toString: () => `composite(${candidateSet.size} candidates)`,
|
|
8979
9018
|
routeFromProps: route,
|
|
8980
9019
|
elementFromProps: element
|
|
8981
9020
|
};
|
|
8982
|
-
const
|
|
9021
|
+
const findMatchingChildInfo = () => {
|
|
8983
9022
|
for (const candidate of candidateSet) {
|
|
8984
|
-
if (candidate.route?.
|
|
9023
|
+
if (candidate.route?.matching) {
|
|
8985
9024
|
return candidate;
|
|
8986
9025
|
}
|
|
8987
9026
|
}
|
|
@@ -9001,16 +9040,16 @@ const initRouteObserver = ({
|
|
|
9001
9040
|
}
|
|
9002
9041
|
return null;
|
|
9003
9042
|
};
|
|
9004
|
-
const
|
|
9005
|
-
if (!route.
|
|
9043
|
+
const getMatchingInfo = route ? () => {
|
|
9044
|
+
if (!route.matching) {
|
|
9006
9045
|
// we have a route and it does not match no need to go further
|
|
9007
9046
|
return null;
|
|
9008
9047
|
}
|
|
9009
|
-
// we have a route and it is
|
|
9010
|
-
// we search the first
|
|
9011
|
-
const
|
|
9012
|
-
if (
|
|
9013
|
-
return
|
|
9048
|
+
// we have a route and it is matching
|
|
9049
|
+
// we search the first matching child to put it in the slot
|
|
9050
|
+
const matchingChildInfo = findMatchingChildInfo();
|
|
9051
|
+
if (matchingChildInfo) {
|
|
9052
|
+
return matchingChildInfo;
|
|
9014
9053
|
}
|
|
9015
9054
|
return {
|
|
9016
9055
|
route,
|
|
@@ -9018,19 +9057,19 @@ const initRouteObserver = ({
|
|
|
9018
9057
|
meta
|
|
9019
9058
|
};
|
|
9020
9059
|
} : () => {
|
|
9021
|
-
// we don't have a route, do we have
|
|
9022
|
-
const
|
|
9023
|
-
if (
|
|
9024
|
-
return
|
|
9060
|
+
// we don't have a route, do we have a matching child?
|
|
9061
|
+
const matchingChildInfo = findMatchingChildInfo();
|
|
9062
|
+
if (matchingChildInfo) {
|
|
9063
|
+
return matchingChildInfo;
|
|
9025
9064
|
}
|
|
9026
9065
|
return null;
|
|
9027
9066
|
};
|
|
9028
|
-
const
|
|
9029
|
-
const
|
|
9030
|
-
const
|
|
9031
|
-
const
|
|
9032
|
-
useUITransitionContentId(
|
|
9033
|
-
const
|
|
9067
|
+
const matchingRouteInfoSignal = signal();
|
|
9068
|
+
const SlotMatchingElementSignal = signal();
|
|
9069
|
+
const MatchingElement = () => {
|
|
9070
|
+
const matchingRouteInfo = matchingRouteInfoSignal.value;
|
|
9071
|
+
useUITransitionContentId(matchingRouteInfo ? matchingRouteInfo.route.urlPattern : fallback ? "fallback" : undefined);
|
|
9072
|
+
const SlotMatchingElement = SlotMatchingElementSignal.value;
|
|
9034
9073
|
if (typeof element === "function") {
|
|
9035
9074
|
const Element = element;
|
|
9036
9075
|
element = jsx(Element, {});
|
|
@@ -9038,42 +9077,42 @@ const initRouteObserver = ({
|
|
|
9038
9077
|
// ensure we re-render on document url change (useful when navigating from /users/list to /users)
|
|
9039
9078
|
// so that we re-replace urls back to /users/list when /users/list is an index
|
|
9040
9079
|
useDocumentUrl();
|
|
9041
|
-
if (
|
|
9042
|
-
const routeUrl =
|
|
9080
|
+
if (matchingRouteInfo && matchingRouteInfo.index && !matchingRouteInfo.route.matching) {
|
|
9081
|
+
const routeUrl = matchingRouteInfo.route.routeFromProps.buildUrl();
|
|
9043
9082
|
replaceUrl(routeUrl);
|
|
9044
9083
|
}
|
|
9045
9084
|
return jsx(RouteInfoContext.Provider, {
|
|
9046
|
-
value:
|
|
9085
|
+
value: matchingRouteInfo,
|
|
9047
9086
|
children: jsx(SlotContext.Provider, {
|
|
9048
|
-
value:
|
|
9087
|
+
value: SlotMatchingElement,
|
|
9049
9088
|
children: element
|
|
9050
9089
|
})
|
|
9051
9090
|
});
|
|
9052
9091
|
};
|
|
9053
|
-
|
|
9054
|
-
const
|
|
9055
|
-
const
|
|
9056
|
-
if (
|
|
9057
|
-
compositeRoute.
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
route:
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
index:
|
|
9065
|
-
fallback:
|
|
9066
|
-
meta:
|
|
9092
|
+
MatchingElement.underlyingElementId = candidateSet.size === 0 ? `${getElementSignature(element)} without slot` : `[${getElementSignature(element)} with slot one of ${candidateElementIds}]`;
|
|
9093
|
+
const updateMatchingInfo = () => {
|
|
9094
|
+
const newMatchingInfo = getMatchingInfo();
|
|
9095
|
+
if (newMatchingInfo) {
|
|
9096
|
+
compositeRoute.matching = true;
|
|
9097
|
+
matchingRouteInfoSignal.value = newMatchingInfo;
|
|
9098
|
+
SlotMatchingElementSignal.value = newMatchingInfo.element;
|
|
9099
|
+
onMatchingInfoChange({
|
|
9100
|
+
route: newMatchingInfo.route,
|
|
9101
|
+
MatchingElement,
|
|
9102
|
+
SlotMatchingElement: newMatchingInfo.element,
|
|
9103
|
+
index: newMatchingInfo.index,
|
|
9104
|
+
fallback: newMatchingInfo.fallback,
|
|
9105
|
+
meta: newMatchingInfo.meta
|
|
9067
9106
|
});
|
|
9068
9107
|
} else {
|
|
9069
|
-
compositeRoute.
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9108
|
+
compositeRoute.matching = false;
|
|
9109
|
+
matchingRouteInfoSignal.value = null;
|
|
9110
|
+
SlotMatchingElementSignal.value = null;
|
|
9111
|
+
onMatchingInfoChange(null);
|
|
9073
9112
|
}
|
|
9074
9113
|
};
|
|
9075
9114
|
const onChange = () => {
|
|
9076
|
-
|
|
9115
|
+
updateMatchingInfo();
|
|
9077
9116
|
publishCompositeStatus();
|
|
9078
9117
|
};
|
|
9079
9118
|
if (route) {
|
|
@@ -9085,13 +9124,13 @@ const initRouteObserver = ({
|
|
|
9085
9124
|
if (registerChildRouteFromContext) {
|
|
9086
9125
|
registerChildRouteFromContext({
|
|
9087
9126
|
route: compositeRoute,
|
|
9088
|
-
element:
|
|
9127
|
+
element: MatchingElement,
|
|
9089
9128
|
index,
|
|
9090
9129
|
fallback,
|
|
9091
9130
|
meta
|
|
9092
9131
|
});
|
|
9093
9132
|
}
|
|
9094
|
-
|
|
9133
|
+
updateMatchingInfo();
|
|
9095
9134
|
return () => {
|
|
9096
9135
|
teardown();
|
|
9097
9136
|
};
|
|
@@ -11401,10 +11440,9 @@ import.meta.css = /* css */ `
|
|
|
11401
11440
|
|
|
11402
11441
|
.navi_callout_message {
|
|
11403
11442
|
position: relative;
|
|
11404
|
-
display:
|
|
11443
|
+
display: block;
|
|
11405
11444
|
box-sizing: border-box;
|
|
11406
11445
|
box-decoration-break: clone;
|
|
11407
|
-
min-width: 0;
|
|
11408
11446
|
align-self: center;
|
|
11409
11447
|
word-break: break-word;
|
|
11410
11448
|
overflow-wrap: anywhere;
|
|
@@ -13044,11 +13082,13 @@ const TYPE_NUMBER_CONSTRAINT = {
|
|
|
13044
13082
|
if (field.type !== "number") {
|
|
13045
13083
|
return null;
|
|
13046
13084
|
}
|
|
13047
|
-
if (field.
|
|
13085
|
+
if (field.validity.valueMissing) {
|
|
13086
|
+
// let required handle that
|
|
13048
13087
|
return null;
|
|
13049
13088
|
}
|
|
13050
|
-
const
|
|
13051
|
-
|
|
13089
|
+
const valueAsNumber = field.valueAsNumber;
|
|
13090
|
+
const valueAsNumberIsNaN = isNaN(valueAsNumber);
|
|
13091
|
+
if (valueAsNumberIsNaN) {
|
|
13052
13092
|
return generateFieldInvalidMessage(`{field} doit être un nombre.`, {
|
|
13053
13093
|
field,
|
|
13054
13094
|
});
|
|
@@ -13132,7 +13172,7 @@ const MAX_CONSTRAINT = {
|
|
|
13132
13172
|
}
|
|
13133
13173
|
if (valueAsNumber > maxNumber) {
|
|
13134
13174
|
return generateFieldInvalidMessage(
|
|
13135
|
-
`{field} être <strong>${maxAttribute}</strong> ou
|
|
13175
|
+
`{field} doit être <strong>${maxAttribute}</strong> ou moins.`,
|
|
13136
13176
|
{ field },
|
|
13137
13177
|
);
|
|
13138
13178
|
}
|
|
@@ -17237,13 +17277,12 @@ const RouteLink = ({
|
|
|
17237
17277
|
}
|
|
17238
17278
|
const routeStatus = useRouteStatus(route);
|
|
17239
17279
|
const url = route.buildUrl(routeParams);
|
|
17240
|
-
const active = routeStatus.active;
|
|
17241
17280
|
const paramsAreMatching = route.matchesParams(routeParams);
|
|
17242
17281
|
return jsx(Link, {
|
|
17243
17282
|
...rest,
|
|
17244
17283
|
href: url,
|
|
17245
17284
|
pseudoState: {
|
|
17246
|
-
":-navi-href-current":
|
|
17285
|
+
":-navi-href-current": paramsAreMatching ? routeStatus.matching : routeStatus.exactMatching
|
|
17247
17286
|
},
|
|
17248
17287
|
children: children || route.buildRelativeUrl(routeParams)
|
|
17249
17288
|
});
|
|
@@ -17561,10 +17600,10 @@ const TabRoute = ({
|
|
|
17561
17600
|
...props
|
|
17562
17601
|
}) => {
|
|
17563
17602
|
const {
|
|
17564
|
-
|
|
17603
|
+
matching
|
|
17565
17604
|
} = useRouteStatus(route);
|
|
17566
17605
|
const paramsAreMatching = route.matchesParams(routeParams);
|
|
17567
|
-
const selected =
|
|
17606
|
+
const selected = matching && paramsAreMatching;
|
|
17568
17607
|
return jsx(TabBasic, {
|
|
17569
17608
|
selected: selected,
|
|
17570
17609
|
...props,
|
|
@@ -19700,6 +19739,9 @@ const InputTextualBasic = props => {
|
|
|
19700
19739
|
let inputValue;
|
|
19701
19740
|
if (type === "number") {
|
|
19702
19741
|
inputValue = e.target.valueAsNumber;
|
|
19742
|
+
if (isNaN(inputValue)) {
|
|
19743
|
+
inputValue = e.target.value;
|
|
19744
|
+
}
|
|
19703
19745
|
} else if (type === "datetime-local") {
|
|
19704
19746
|
inputValue = convertToUTCTimezone(e.target.value);
|
|
19705
19747
|
} else {
|
|
@@ -20170,8 +20212,8 @@ const FormBasic = props => {
|
|
|
20170
20212
|
const defaultRef = useRef();
|
|
20171
20213
|
const ref = props.ref || defaultRef;
|
|
20172
20214
|
|
|
20173
|
-
//
|
|
20174
|
-
// - receive "
|
|
20215
|
+
// instantiate validation via useConstraints hook:
|
|
20216
|
+
// - receive "actionrequested" custom event ensure submit is prevented
|
|
20175
20217
|
// (and also execute action without validation if form.submit() is ever called)
|
|
20176
20218
|
const remainingProps = useConstraints(ref, rest);
|
|
20177
20219
|
const innerReadOnly = readOnly || loading;
|
|
@@ -25452,5 +25494,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
25452
25494
|
})
|
|
25453
25495
|
});
|
|
25454
25496
|
|
|
25455
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, Address, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus,
|
|
25497
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useCalloutClose, useCellsAndColumns, useConstraintValidityState, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useMatchingRouteInfo, useNavState$1 as useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
25456
25498
|
//# sourceMappingURL=jsenv_navi.js.map
|