@react-ag-components/my-printer

0.3.16 • Public • Published

my-printer

React my-printer component for external web apps

Usage

Install

npm i @react-ag-components/my-printer --save

Use in your project

import ContactPerson from '@react-ag-components/my-printer'
let commodities = [
  {value: "D",label: "Dairy (Just For Testing)"},
  {value: "F",label: "Fish (Just For Testing)"},
  {value: "H",label: "Hort (For Testing Only)"},
  {value: "X",label: "All Other Goods"}
]

let activeCommodities = ["X"]
<Commodities
  ref="commodities"
  commodities={this.state.commodities}
  activeCommodities={this.state.activeCommodities}
  onlyShowCommodities={true}
  standAlonePage={false}
  myPrinterMsg={this.updateMsg}
/>

updateMsg = status => {
  this.setState((prevState, props) => ({
    [status.type]: status.msg
  }));
  if (status.msg !== "") {
    window.scroll(0, 0);
  }
};


Properties

prop Type Note
commodities object data.commodities
activeCommodities object data.activeCommodities
onlyShowCommodities state so we can use it for Export Commodities
standAlonePage boolean Has own Save button
myPrinterMsg object update parent page state

Contributing

Get the repository

git clone https://github.com/alphillips/my-printer-component.git

Update dependencies

npm install

Run the project

npm start

Deploy to npm

Build

npm run build -- --copy-files

Publish

npm publish --access public

/@react-ag-components/my-printer/

    Package Sidebar

    Install

    npm i @react-ag-components/my-printer

    Weekly Downloads

    0

    Version

    0.3.16

    License

    MIT

    Unpacked Size

    22.5 kB

    Total Files

    10

    Last publish

    Collaborators

    • ajithmjose
    • alphillips
    • zapjelly