![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@govuk-frederic/array-object-table
Advanced tools
Renders a table from an an array of objects, providing they have properties which match provided the keys. Also supports transforms of undefined values.
import ArrayObjectTable from '@govuk-frederic/array-object-table';
Simple
const fields = [
{ key: 'one', heading: 'One' },
{ key: 'two', heading: 'Two' },
];
const array = [
{ one: 'test', two: 'test' },
{ one: 'test' },
{},
];
const title = ['Heading'];
<ArrayObjectTable fields={fields} array={array} title={title}/>;
With skipEmptyRows
const fields = [
{ key: 'one', heading: 'One' },
{ key: 'two', heading: 'Two' },
];
const array = [
{},
{},
];
const title = ['Heading'];
<ArrayObjectTable fields={fields} array={array} title={title} skipEmptyRows/>
With skipEmptyRows and hideWithNoValues
const fields = [
{ key: 'one', heading: 'One' },
{ key: 'two', heading: 'Two' },
];
const array = [
{},
{},
];
const title = ['Heading'];
<ArrayObjectTable fields={fields} array={array} title={title} skipEmptyRows hideWithNoValues/>;
With object transform and default transform
const fields = [
{ key: 'one', heading: 'One' },
{ key: 'two', heading: 'Two', transform: value => value ? value.toLowerCase() : '' },
{ key: 'three', heading: 'Three' },
{ key: 'three', heading: 'Four', transform: value => value ? value.toLowerCase() : '*' },
];
const array = [
{one: 'One', two: 'Two'},
];
const title = ['Heading'];
const defaultTransform = value => (value || '-');
<ArrayObjectTable fields={fields} array={array} title={title} skipEmptyRows hideWithNoValues defaultTransform={defaultTransform}/>
Prop | Required | Default | Type | Description |
---|---|---|---|---|
array | true | `````` | arrayOf[object Object] | |
defaultTransform | value => (value ? value : '-') | func | ||
fields | true | `````` | arrayOf[object Object] | |
hideWithNoValues | false | bool | ||
skipEmptyRows | false | bool | ||
title | null | node |
FAQs
Renders a table from an an array of objects, providing they have properties which match provided the keys. Also supports transforms of undefined values.
We found that @govuk-frederic/array-object-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.