@jsenv/navi 0.16.10 → 0.16.11

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.
@@ -7786,7 +7786,6 @@ const createRoutePattern = (pattern) => {
7786
7786
 
7787
7787
  // Try each child pattern object to find the most specific match
7788
7788
  for (const childPatternObj of childPatternObjs) {
7789
-
7790
7789
  const childRouteCandidate = evaluateChildRoute(
7791
7790
  childPatternObj,
7792
7791
  params,
@@ -7960,7 +7959,18 @@ const createRoutePattern = (pattern) => {
7960
7959
  const { paramName, signal, options } = connection;
7961
7960
  const defaultValue = options.defaultValue;
7962
7961
 
7963
- if (signal?.value !== undefined) {
7962
+ // Check if parameter was explicitly provided by user
7963
+ const hasExplicitParam = paramName in params;
7964
+ const explicitValue = params[paramName];
7965
+
7966
+ if (hasExplicitParam) {
7967
+ // User explicitly provided this parameter - use their value
7968
+ childParams[paramName] = explicitValue;
7969
+ if (explicitValue !== undefined && explicitValue !== defaultValue) {
7970
+ hasActiveParams = true;
7971
+ }
7972
+ } else if (signal?.value !== undefined) {
7973
+ // No explicit override - use signal value
7964
7974
  childParams[paramName] = signal.value;
7965
7975
  if (signal.value !== defaultValue) {
7966
7976
  hasActiveParams = true;
@@ -7982,11 +7992,15 @@ const createRoutePattern = (pattern) => {
7982
7992
  },
7983
7993
  );
7984
7994
 
7985
- const hasProvidedParams = Object.keys(params).length > 0;
7995
+ // Count only non-undefined provided parameters
7996
+ const nonUndefinedParams = Object.entries(params).filter(
7997
+ ([, value]) => value !== undefined,
7998
+ );
7999
+ const hasProvidedParams = nonUndefinedParams.length > 0;
7986
8000
 
7987
8001
  // Use child route if:
7988
8002
  // 1. Child has active non-default parameters, OR
7989
- // 2. User provided params AND child can be built completely
8003
+ // 2. User provided non-undefined params AND child can be built completely
7990
8004
  const shouldUse =
7991
8005
  hasActiveParams || (hasProvidedParams && canBuildChildCompletely);
7992
8006
 
@@ -8005,10 +8019,22 @@ const createRoutePattern = (pattern) => {
8005
8019
  const baseParams = {};
8006
8020
  for (const connection of childPatternObj.connections) {
8007
8021
  const { paramName, signal, options } = connection;
8008
- if (
8022
+
8023
+ // Check if parameter was explicitly provided by user
8024
+ const hasExplicitParam = paramName in params;
8025
+ const explicitValue = params[paramName];
8026
+
8027
+ if (hasExplicitParam) {
8028
+ // User explicitly provided this parameter - use their value (even if undefined)
8029
+ if (explicitValue !== undefined) {
8030
+ baseParams[paramName] = explicitValue;
8031
+ }
8032
+ // If explicitly undefined, don't include it (which means don't use child route)
8033
+ } else if (
8009
8034
  signal?.value !== undefined &&
8010
8035
  signal.value !== options.defaultValue
8011
8036
  ) {
8037
+ // No explicit override - use signal value if non-default
8012
8038
  baseParams[paramName] = signal.value;
8013
8039
  }
8014
8040
  }
@@ -8770,7 +8796,6 @@ const buildHierarchicalQueryParams = (
8770
8796
 
8771
8797
  for (const ancestorPatternObj of ancestorPatterns) {
8772
8798
  if (ancestorPatternObj.pattern?.queryParams) {
8773
-
8774
8799
  for (const queryParam of ancestorPatternObj.pattern.queryParams) {
8775
8800
  const paramName = queryParam.name;
8776
8801
  if (
@@ -19148,12 +19173,12 @@ const TabRoute = ({
19148
19173
  routeParams,
19149
19174
  children,
19150
19175
  padding = 2,
19151
- paddingX,
19152
- paddingY,
19153
- paddingLeft,
19154
- paddingRight,
19155
- paddingTop,
19156
- paddingBottom,
19176
+ paddingX = padding,
19177
+ paddingY = padding,
19178
+ paddingLeft = paddingX,
19179
+ paddingRight = paddingX,
19180
+ paddingTop = paddingY,
19181
+ paddingBottom = paddingY,
19157
19182
  alignX,
19158
19183
  alignY,
19159
19184
  ...props