fix: handle outside navigation (#1747)

This commit is contained in:
Jingjing Xie
2025-05-22 08:36:02 +02:00
committed by GitHub
parent 518b70bbc7
commit 2805fdd518
4 changed files with 37 additions and 29 deletions

View File

@@ -353,6 +353,7 @@ const Cell = forwardRef(
keyboardNavigation,
externalFocusManagement,
disableCellPadding = false,
navigation: navigationApi,
} = useContext(InstanceContext);
const [internalEmitter] = useState(emitter || createEmitter);
const theme = useTheme();
@@ -461,7 +462,7 @@ const Cell = forwardRef(
focusHandler: focusHandler.current,
emitter: internalEmitter,
onMount,
navigation,
navigation: navigation ?? navigationApi,
});
};

View File

@@ -157,6 +157,8 @@ const DEFAULT_CONTEXT = /** @lends Context */ {
* @type {string=}
* */
dataViewType: 'sn-table',
/** @type {Navigation=} */
navigation: {},
};
DEFAULT_CONFIG.context = DEFAULT_CONTEXT;

View File

@@ -792,6 +792,10 @@
"optional": true,
"defaultValue": "sn-table",
"type": "string"
},
"navigation": {
"optional": true,
"type": "#/definitions/Navigation"
}
}
},
@@ -1481,6 +1485,26 @@
"const viz = await embed(app).render({\n element,\n type: 'barchart'\n});\nviz.destroy();"
]
},
"Flags": {
"kind": "interface",
"entries": {
"isEnabled": {
"description": "Checks whether the specified flag is enabled.",
"kind": "function",
"params": [
{
"name": "flag",
"description": "The value flag to check.",
"type": "string"
}
],
"returns": {
"description": "True if the specified flag is enabled, false otherwise.",
"type": "boolean"
}
}
}
},
"AppSelections": {
"kind": "class",
"constructor": {
@@ -1718,26 +1742,6 @@
}
}
},
"Flags": {
"kind": "interface",
"entries": {
"isEnabled": {
"description": "Checks whether the specified flag is enabled.",
"kind": "function",
"params": [
{
"name": "flag",
"description": "The value flag to check.",
"type": "string"
}
],
"returns": {
"description": "True if the specified flag is enabled, false otherwise.",
"type": "boolean"
}
}
}
},
"Field": {
"kind": "alias",
"items": {

View File

@@ -270,6 +270,7 @@ declare namespace stardust {
keyboardNavigation?: boolean;
disableCellPadding?: boolean;
dataViewType?: string;
navigation?: stardust.Navigation;
}
interface Galaxy {
@@ -477,6 +478,14 @@ declare namespace stardust {
}
interface Flags {
/**
* Checks whether the specified flag is enabled.
* @param flag The value flag to check.
*/
isEnabled(flag: string): boolean;
}
class AppSelections {
constructor();
@@ -551,14 +560,6 @@ declare namespace stardust {
}
interface Flags {
/**
* Checks whether the specified flag is enabled.
* @param flag The value flag to check.
*/
isEnabled(flag: string): boolean;
}
type Field = string | qix.NxDimension | qix.NxMeasure | stardust.LibraryField;
/**