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

View File

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

View File

@@ -792,6 +792,10 @@
"optional": true, "optional": true,
"defaultValue": "sn-table", "defaultValue": "sn-table",
"type": "string" "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();" "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": { "AppSelections": {
"kind": "class", "kind": "class",
"constructor": { "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": { "Field": {
"kind": "alias", "kind": "alias",
"items": { "items": {

View File

@@ -270,6 +270,7 @@ declare namespace stardust {
keyboardNavigation?: boolean; keyboardNavigation?: boolean;
disableCellPadding?: boolean; disableCellPadding?: boolean;
dataViewType?: string; dataViewType?: string;
navigation?: stardust.Navigation;
} }
interface Galaxy { 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 { class AppSelections {
constructor(); 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; type Field = string | qix.NxDimension | qix.NxMeasure | stardust.LibraryField;
/** /**