Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uxf/data-grid

Package Overview
Dependencies
Maintainers
0
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uxf/data-grid

UXF DataGrid

  • 11.34.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
364
increased by17.42%
Maintainers
0
Weekly downloads
 
Created
Source

DataGrid

Installation / Upgrade

yarn add @uxf/core @uxf/ui @uxf/data-grid

// or

yarn upgrade @uxf/core@latest @uxf/ui@latest @uxf/data-grid@latest

CSS dependencies

@import url("tailwindcss/components.css");
@import url("@uxf/ui/button/button.css");
@import url("@uxf/ui/button-list/button-list.css");
@import url("@uxf/ui/calendar/calendar.css");
@import url("@uxf/ui/checkbox/checkbox.css");
@import url("@uxf/ui/chip/chip.css");
@import url("@uxf/ui/dialog/dialog.css");
@import url("@uxf/ui/dropdown/dropdown.css");
@import url("@uxf/ui/icon/icon.css");
@import url("@uxf/ui/label/label.css");
@import url("@uxf/ui/form-component/form-component.css");
@import url("@uxf/ui/input/input-basic.css");
@import url("@uxf/ui/input/input.css");
@import url("@uxf/ui/_input-with-popover/input-with-popover.css");
@import url("@uxf/ui/combobox/combobox.css");
@import url("@uxf/ui/modal-header/modal-header.css");
@import url("@uxf/ui/multi-select/multi-select.css");
@import url("@uxf/ui/multi-combobox/multi-combobox.css");
@import url("@uxf/ui/pagination/pagination.css");
@import url("@uxf/ui/select/select.css");
@import url("@uxf/ui/toggle/toggle.css");

/* must be after component css files */
@import url("@uxf/data-grid/styles.css");

State and actions of data-grid

import { useDataGridControl } from "@uxf/data-grid/use-data-grid-control";

const { state, actions } = useDataGridControl({
    schema ,
    initialState: "Request or string (base64 encoded request)",
    userConfig: {
        columns: {
            id: { isHidden: true },
        }
    },
    isDebug: true,
});

Supported FilterHandlers

  • bool - Select (yes / no / null)
  • checkbox, boolean - Checkbox (is sent only if checkbox is checked)
  • date
  • datetime
  • entityMultiSelect
  • entitySelect
  • interval
  • multiSelect
  • select
  • string, text

Examples

DataGrid

import { useDataGridControl } from "@uxf/data-grid/use-data-grid-control";
import { useDataGridFetching } from "@uxf/data-grid/use-data-grid-fetching";

function BasicExample() {
    const { state, actions } = useDataGridControl({ schema });
    const { isLoading, error, data, onReload } = useDataGridFetching(loader, schema, "grid-name", state);

    return (
        <DataGrid
            onReload={onReload}
            state={state}
            actions={actions}
            data={data}
            isLoading={isLoading}
            error={error}
            schema={schema}
        />
    );
}

FrontendConfig

import { useDataGridControl } from "@uxf/data-grid/use-data-grid-control";
import { mergeSchemaWithConfig } from "@uxf/data-grid";

const schema = mergeSchemaWithConfig(
    dataGridSchema_ExampleGrid,
    {
        columns: {
            id: { width: 100, isHidden: true },
        },
        filters: {
            id: { placeholder: "Hledejte podle ID..." }
        },
        perPage: 100,
    }
);

function Example_1(props) {
    const { state, actions } = useDataGridControl({
        schema,
        initialUserConfig: props.userConfig,
    })

    return <Table schema={schema}/>
}

Keywords

FAQs

Package last updated on 30 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc