1.5.0 • Published 2 years ago

@sms77.io/counter v1.5.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

npm.io

SMS Counter by Sms77

Counts the SMS character usage for a textarea or text input.

Installation

For Browsers

<script src='https://unpkg.com/@sms77.io/counter/dist/index.js'></script>

For NodeJS

Yarn yarn add @sms77.io/counter

NPM npm install @sms77.io/counter

import '@sms77.io/counter'

Usage

<textarea data-sms77-sms></textarea>
<input data-sms77-sms/>

For advanced usage see the examples.

Options

Set the window object before loading the library.

window.SMS77IO_COUNTER_OPTIONS = {
    initEvent: string = 'DOMContentLoaded', // the DOM event for init
    position: InsertPosition = 'afterend', // where to add the counter stats span relative to the input
    selector: string = '*[data-sms77-sms]', // the inputs selector
    standalone: boolean = false, // stop attaching input listeners
    stats: boolean = false, // whether to output stats or not - also accepts HTMLElement or CSS selector
}

Support

Need help? Feel free to contact us.

MIT

1.5.0

2 years ago

1.4.0-rc1

4 years ago

1.4.0

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago