diff --git a/apis/nucleus/src/__tests__/nucleus.spec.js b/apis/nucleus/src/__tests__/nucleus.spec.js index e9fa374d5..2e51d3198 100644 --- a/apis/nucleus/src/__tests__/nucleus.spec.js +++ b/apis/nucleus/src/__tests__/nucleus.spec.js @@ -93,6 +93,7 @@ describe('nucleus', () => { context: { constraints: {}, deviceType: 'auto', + disableCellPadding: false, keyboardNavigation: false, language: 'en-US', theme: 'light', diff --git a/apis/nucleus/src/components/Cell.jsx b/apis/nucleus/src/components/Cell.jsx index f0ab2e64e..1f2d81812 100644 --- a/apis/nucleus/src/components/Cell.jsx +++ b/apis/nucleus/src/components/Cell.jsx @@ -276,6 +276,7 @@ const Cell = forwardRef( ({ halo, model, initialSnOptions, initialSnPlugins, initialError, onMount, currentId }, ref) => { const { app, types } = halo; const { nebbie } = halo.public; + const { disableCellPadding = false } = halo.context || {}; const { translator, language, keyboardNavigation } = useContext(InstanceContext); const theme = useTheme(); @@ -493,7 +494,7 @@ const Cell = forwardRef( position: 'relative', width: '100%', height: '100%', - padding: theme.spacing(1), + ...(!disableCellPadding ? { padding: theme.spacing(1) } : {}), ...(state.longRunningQuery ? { opacity: '0.3' } : {}), }} > diff --git a/apis/nucleus/src/index.js b/apis/nucleus/src/index.js index 9e3f74209..ed7b68dda 100644 --- a/apis/nucleus/src/index.js +++ b/apis/nucleus/src/index.js @@ -14,6 +14,7 @@ import { create as typesFn } from './sn/types'; /** * @interface Context + * @property {boolean=} disableCellPadding * @property {boolean=} keyboardNavigation * @property {object=} constraints * @property {boolean=} constraints.active @@ -29,6 +30,7 @@ const DEFAULT_CONTEXT = /** @lends Context */ { deviceType: 'auto', constraints: {}, keyboardNavigation: false, + disableCellPadding: false, }; /** diff --git a/apis/stardust/api-spec/spec.json b/apis/stardust/api-spec/spec.json index aa84b9719..4486d70d7 100644 --- a/apis/stardust/api-spec/spec.json +++ b/apis/stardust/api-spec/spec.json @@ -517,6 +517,10 @@ "Context": { "kind": "interface", "entries": { + "disableCellPadding": { + "optional": true, + "type": "boolean" + }, "keyboardNavigation": { "optional": true, "type": "boolean" @@ -1146,6 +1150,33 @@ } } }, + "Plugin": { + "description": "An object literal containing meta information about the plugin and a function containing the plugin implementation.", + "stability": "experimental", + "availability": { + "since": "1.2.0" + }, + "kind": "interface", + "entries": { + "info": { + "description": "Object that can hold various meta info about the plugin", + "kind": "object", + "entries": { + "name": { + "description": "The name of the plugin", + "type": "string" + } + } + }, + "fn": { + "description": "The implementation of the plugin. Input and return value is up to the plugin implementation to decide based on its purpose.", + "type": "function" + } + }, + "examples": [ + "const plugin = {\n info: {\n name: \"example-plugin\",\n type: \"meta-type\",\n },\n fn: () => {\n // Plugin implementation goes here\n }\n};" + ] + }, "Field": { "kind": "alias", "items": { @@ -1255,33 +1286,6 @@ } } }, - "Plugin": { - "description": "An object literal containing meta information about the plugin and a function containing the plugin implementation.", - "stability": "experimental", - "availability": { - "since": "1.2.0" - }, - "kind": "interface", - "entries": { - "info": { - "description": "Object that can hold various meta info about the plugin", - "kind": "object", - "entries": { - "name": { - "description": "The name of the plugin", - "type": "string" - } - } - }, - "fn": { - "description": "The implementation of the plugin. Input and return value is up to the plugin implementation to decide based on its purpose.", - "type": "function" - } - }, - "examples": [ - "const plugin = {\n info: {\n name: \"example-plugin\",\n type: \"meta-type\",\n },\n fn: () => {\n // Plugin implementation goes here\n }\n};" - ] - }, "LoadType": { "kind": "interface", "params": [ diff --git a/apis/stardust/types/index.d.ts b/apis/stardust/types/index.d.ts index d6aaa5f7b..4a4b92dfc 100644 --- a/apis/stardust/types/index.d.ts +++ b/apis/stardust/types/index.d.ts @@ -171,6 +171,7 @@ export function useKeyboard(): stardust.Keyboard; declare namespace stardust { interface Context { + disableCellPadding?: boolean; keyboardNavigation?: boolean; constraints?: { active?: boolean; @@ -363,6 +364,16 @@ declare namespace stardust { } + /** + * An object literal containing meta information about the plugin and a function containing the plugin implementation. + */ + interface Plugin { + info: { + name: string; + }; + fn: ()=>void; + } + type Field = string | EngineAPI.INxDimension | EngineAPI.INxMeasure | stardust.LibraryField; /** @@ -396,16 +407,6 @@ declare namespace stardust { type: "dimension" | "measure"; } - /** - * An object literal containing meta information about the plugin and a function containing the plugin implementation. - */ - interface Plugin { - info: { - name: string; - }; - fn: ()=>void; - } - interface LoadType { (type: { name: string;