1.0.8 • Published 3 years ago

carelynx-attachments-uploader v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

carelynx-attachments-uploader

Allows the user to upload attachments

NPM JavaScript Style Guide

Install

npm install --save carelynx-attachments-uploader

Usage

import React, { Component } from 'react';
import AttachmentComponent from 'carelynx-attachments-uploader';

const App = () => {
  return <AttachmentComponent />;
};

Props

Special props:

proptypedescriptionrequired
onSubmitAttachmentfuncCallback when a valid Attachment is uploaded by the user. The component returns the uploaded file as an object.true
onUpdateAttachmentfuncCallback when an Attachment is updated by the user. The component returns the updated file as an object.true
onArchiveAttachmentfuncCallback when an Attachment is archived by the user. The component returns the archived file as an object.true
attachmentsarrayAn array of uploaded attachments that will be displayed in the Attachments table of the Component.true
showbooleanBy default the attachment component will be collapsed. If you want the default as expanded, the show prop value should be sent as trueoptional

Example for attachment object

{
    base64_encoded_file: "base64 string",
    description: "Attachment description entered by the user",
    filename: "sample.pdf",
    type: "application/pdf"
}

Prop examples

attachments

{
    base64_encoded_file: {base64 string}, 
    description: "Attachment description entered by the user",
    filename: "sample.pdf",
    type: "application/pdf",
    url: {image url}
}

NOTE: The object needs to have either `base64_encoded_file` or the `url` property for the attachment to be displayed in the Attachment table

License

MIT © Carelynx Developers

1.0.8

3 years ago

1.0.7

3 years ago

1.0.2

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2-rc.0

3 years ago

1.0.1

3 years ago