1.0.46 • Published 10 months ago

@kingteza/crud-component v1.0.46

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@kingteza/crud-component

React CRUD component library built with Ant Design and TypeScript.

Installation

npm install @kingteza/crud-component

Prerequisites

This library has the following peer dependencies that need to be installed:

npm install antd@^5.22.6 react@^18.3.1 react-dom@^18.3.1 react-router-dom@^7.0.0

Setup

1. Initialize translations

The library uses i18next for internationalization. You need to set it up before using the components:

import { setupI18n } from '@kingteza/crud-component';

// Basic setup with default English translations
setupI18n();

// Or with custom options
setupI18n({
  language: 'en', // default language
  translations: {
    en: {
      'crud-component': {
        // your custom translations
      }
    }
  },
  i18nInstance: existingI18nInstance // optional: use your existing i18n instance
});

2. Usage

import { CrudComponent } from '@kingteza/crud-component';
import { Button } from '@kingteza/crud-component/common';

function App() {
  return (
    <CrudComponent
      fields={[
        { type: "text", name: "name", label: "Name", required: true },
        { type: "select", name: "status", label: "Status", options: [
          { value: "active", label: "Active" },
          { value: "inactive", label: "Inactive" }
        ]}
      ]}
      data={[]}
      onSave={(data) => console.log(data)}
    />
  );
}

3. Available Imports

The library provides several entry points for importing components:

// Main CRUD component
import { CrudComponent } from '@kingteza/crud-component';

// Common components
import { Button, Select, DatePicker } from '@kingteza/crud-component/common';

// Utility functions
import { DateUtil } from '@kingteza/crud-component/util';

Documentation

For detailed documentation of components and their props, please visit our GitHub repository.

License

MIT

1.0.46

10 months ago

1.0.45

10 months ago

1.0.44

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.40

10 months ago

1.0.39

10 months ago

1.0.38

10 months ago

1.0.37

10 months ago

1.0.36

10 months ago

1.0.35

10 months ago

1.0.34

10 months ago

1.0.33

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.9

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago