1.0.46 • Published 1 year ago

@kingteza/crud-component v1.0.46

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago