npm

@dipcode/dj-plugins
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

Plugins - Javascript module

Module with common and usefull plugins to be used along with @dipcode/dj-core.

Exported plugins usage examples

Django Messages

const querySelector: string = '[data-django-messages-plugin]';
const messagesPlugin: DjangoMessagesPlugin = new DjangoMessagesPlugin(querySelector);

Infinite Scroll

const querySelector: string = '[data-infinite-scroll]';
const infiniteScrollPlugin: InfiniteScrollPlugin = new InfiniteScrollPlugin(querySelector);

Live Results

const querySelector: string = '[data-live-results]';
const liveResultsPlugin: LiveResultsPlugin = new LiveResultsPlugin(querySelector);

Back to Top

const querySelector: string = '[data-back-to-top]';
const backtoTopPlugin: BackToTopPlugin = new BackToTopPlugin(querySelector);

Forms / Form Validation

const querySelector: string = '[data-form-validation]';
const formValidationPlugin: FormValidationPlugin = new FormValidationPlugin(querySelector);

Forms / Formset Plugin

const querySelector: string = '[data-formset]';
const formSetPlugin: FormSetPlugin = new FormSetPlugin(querySelector);

Forms / Submit on Form Change

const querySelector: string = '[data-submit-form-on-change]';
const submitOnFormChangePlugin: SubmitOnFormChangePlugin = new SubmitOnFormChangePlugin(querySelector);

Integrations / Autosize Textarea

const querySelector: string = 'textarea';
const autosizeTextAreaPlugin: AutosizeTextAreaPlugin = new AutosizeTextAreaPlugin(querySelector);

Integrations / Google Recaptcha

const querySelector: string = '.g-recaptcha';
const recaptchaPlugin: RecaptchaPlugin = new RecaptchaPlugin(querySelector, {
  publicKey: settings.get('RECAPTCHA_PUBLIC_KEY'),
  language: settings.get('LANGUAGE'),
});

Package Sidebar

Install

npm i @dipcode/dj-plugins

Weekly Downloads

3

Version

0.4.1

License

MIT

Unpacked Size

43.4 kB

Total Files

29

Last publish

Collaborators

  • tiagoloureiro
  • sfrtux