New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-offline-table

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-offline-table

An offline react table with the ability to sort and filter

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

react-offline-table

An offline react table with the ability to sort and filter

NPM JavaScript Style Guide

Example

https://firzok.github.io/react-offline-table/

Install

npm install --save react-offline-table

Usage

import React, { Component } from 'react'

import { headerFields, employeeData, EmployeeStatus, pages, colors } from './static_lists';

import OfflineTable from 'react-offline-table';

import moment from 'moment';

import { faEye, faEdit } from '@fortawesome/free-regular-svg-icons';

export default class App extends Component {

    viewEmployee(selectedEmployeeID) {
        console.log("View Employee")
        console.log(selectedEmployeeID)
    }

    editEmployee(selectedEmployeeID) {
        console.log("Edit Employee")
        console.log(selectedEmployeeID)
    }

    changeStatus(newStatus, employee) {
        console.log("Status changed")
    }

    render() {

        var _data = []

        for (var i = 0; i < employeeData.length; i++) {
            var row = [];

            // Column 1
            // const actions = [
            //     { icon: "fas fa-eye text-success-600 cursor-pointer mr-2", callBack: this.viewEmployee.bind(this, employeeData[i].emp_id) },
            //     { icon: "fas fa-edit text-info-600 cursor-pointer", callBack: this.editEmployee.bind(this, employeeData[i].emp_id) }
            // ]
            const actions = [
                { icon: faEye, className: "text-success-600 cursor-pointer mr-2", callBack: this.viewEmployee.bind(this, employeeData[i].emp_id) },
                { icon: faEdit, className: "text-success-600 cursor-pointer mr-2", callBack: this.editEmployee.bind(this, employeeData[i].emp_id) }
            ]
            row.push(actions)

            // Column 2
            row.push({ text: "Change Status", selected: employeeData[i].status, options: EmployeeStatus, onClick: this.changeStatus, onClickArg: employeeData[i] })

            // Column 3
            row.push(employeeData[i].emp_id ? employeeData[i].emp_id : "N/A");

            // Column 4
            const avatar = { topText: employeeData[i].name, bottomText: employeeData[i].played_by, picture: employeeData[i].profile_picture };
            row.push(avatar)

            // Column 5
            row.push((employeeData[i].dob === "" || employeeData[i].dob === null) ? 'N/A' : moment(employeeData[i].dob).format("YYYY-MM-DD"));

            // Column 6
            if (employeeData[i].status === "Support") {
                row.push({ class: "badge badge-info text-capitalize", data: "Support" });
            }
            else if (employeeData[i].status === "Main") {
                row.push({ class: "badge badge-success text-capitalize", data: "Main" });
            }
            else if (employeeData[i].status === "Villain") {
                row.push({ class: "badge badge-danger text-capitalize", data: "Villain" });
            }
            _data.push(row);
        }




        return (
            <div>
                <OfflineTable
                    headerFields={ headerFields }
                    headerText={ "Offline React Table" }
                    data={ _data }
                    showSno={ false }
                    enableFilter={ true }
                    pages={ pages }
                    colors={ colors }
                />
            </div>
        )
    }
}



License

MIT © firzok

FAQs

Package last updated on 04 Apr 2020

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