Sha256: 577cd1700ae877a25d05ae743e2e82a7fea0b28548be8e529f50a5a95186ca9a

Contents?: true

Size: 1.69 KB

Versions: 101

Compression:

Stored size: 1.69 KB

Contents

import React from "react"
import { AdvancedTable, Pill, Body, Flex, Detail, Caption } from "playbook-ui"
import MOCK_DATA from "./advanced_table_mock_data.json"

const AdvancedTableCustomCell = (props) => {
  const columnDefinitions = [
    {
      accessor: "year",
      label: "Year",
      cellAccessors: ["quarter", "month", "day"],

    },
    {
      accessor: "newEnrollments",
      label: "New Enrollments",
      customRenderer: (row, value) => (
        <Pill text={value} 
            variant="success"    
        />
      ), 
    },
    {
      accessor: "scheduledMeetings",
      label: "Scheduled Meetings",
      customRenderer: (row, value) => <Body><a href="#">{value}</a></Body>, 
    },
    {
      accessor: "attendanceRate",
      label: "Attendance Rate",
      customRenderer: (row, value) => (
        <Flex alignItems="end" 
            orientation="column"
        >
          <Detail bold 
              color="default" 
              text={value} 
          />
          <Caption size="xs">{row.original.graduatedStudents}</Caption>
        </Flex>
      ),
    },
    {
      accessor: "completedClasses",
      label: "Completed Classes",
    },
    {
      accessor: "classCompletionRate",
      label: "Class Completion Rate",
    },
    {
      accessor: "graduatedStudents",
      label: "Graduated Students",
    },
  ]

  return (
    <div>
      <AdvancedTable
          columnDefinitions={columnDefinitions}
          enableToggleExpansion="all"
          responsive="none"
          tableData={MOCK_DATA}
          {...props}
      >
        <AdvancedTable.Header enableSorting />
        <AdvancedTable.Body />
      </AdvancedTable>
    </div>
  )
}

export default AdvancedTableCustomCell

Version data entries

101 entries across 101 versions & 2 rubygems

Version Path
playbook_ui_docs-14.6.0.pre.alpha.PBNTR5554217 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.alpha.PBNTR5554217 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.7.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.7.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4216 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.5.0.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4216 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.25 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.rc.25 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.24 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.rc.24 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.23 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.rc.23 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.22 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.rc.22 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.21 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.6.0.pre.rc.21 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4175 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui-14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4175 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx
playbook_ui_docs-14.6.0.pre.rc.20 app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx