1.0.7 • Published 3 years ago

@orcden/od-richtext v1.0.7

Weekly downloads
27
License
MIT
Repository
bitbucket
Last release
3 years ago

A wrapper around quill to be used in shadow DOM projects and components

<od-richtext> is similar to an input textarea however it comes with a variety of styling options to format he users input. The component outputs semantic HTML and styling to go with it.

Installation

  • Install with npm
npm i @orcden/od-richtext

Usage

import '@orcden/od-richtext';
<od-richtext></od-richtext>

Attributes

AttributeTypeDefaultDescription
activeBooleantrueControls if the field is active and allowing input or disabled and in read-only mode

Properties

PropertyTypeDefaultDescription
activeBooleantrueControls if the field is active and allowing input or disabled and in read-only mode
quillQuillQuillGet Only. A passthrough for the Quill instance. can be used for extending functionality
editiorQuillQuillGet Only. A passthrough for the Quill instance. can be used for extending functionality
lengthNumber0Get Only. Returns the current length of the users input
hasFocusBooleanfalseGet Only. Returns True/False if the field is currently in the users focus
styleTagHTMLElementHTMLElementGet Only. Returns the componentized styles used for formatting the text
stylesStringStringGet Only. Returns the styles as a string that are being used for formatting the text
valueStringStringGet Only. Returns the pure HTML representation of the input
contentsDeltaDeltaCan be used for setting or getting the contents of the Quill instance as a Delta
textStringStringCan be used for setting or getting the text contents of the Quill instance

Functions

NameParametersDescription
getLengthNoneGets the current length of the users input
hasFocusNoneReturns True/False if the field is currently in the users focus
focusNoneSets the focus of the user to the editor
blurNoneRemoves focus from the editor
getHTMLNoneReturns the pure html associated with the input
getContentsNoneReturns the contents of the field in a Quill Delta
setContentsDeltaSets the contents of the field with a given Quill Delta
getTextNoneReturns the text of the field without formatting
setTextStringSets the text content of the field. For index insert use the editor passthrough
dangerouslySetHTMLValueStringSets the HTML content of the field. Explicitly stated as dangerous, value property not available so use this if you need it

Styling

  • CSS variables are available to alter the default styling provided
Shadow PartsDescription
buttonThe html button used inside the component

Development

Run development server and show demo

npm run demo

Run linter

npm run lint

Fix linter errors

npm run fix

Run tests

npm run test

Build for production

npm run build
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.1

4 years ago

1.0.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.5

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.3.0

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago