Module with common and usefull plugins to be used along with @dipcode/dj-core
.
const querySelector: string = '[data-django-messages-plugin]';
const messagesPlugin: DjangoMessagesPlugin = new DjangoMessagesPlugin(querySelector);
const querySelector: string = '[data-infinite-scroll]';
const infiniteScrollPlugin: InfiniteScrollPlugin = new InfiniteScrollPlugin(querySelector);
const querySelector: string = '[data-live-results]';
const liveResultsPlugin: LiveResultsPlugin = new LiveResultsPlugin(querySelector);
const querySelector: string = '[data-back-to-top]';
const backtoTopPlugin: BackToTopPlugin = new BackToTopPlugin(querySelector);
const querySelector: string = '[data-form-validation]';
const formValidationPlugin: FormValidationPlugin = new FormValidationPlugin(querySelector);
const querySelector: string = '[data-formset]';
const formSetPlugin: FormSetPlugin = new FormSetPlugin(querySelector);
const querySelector: string = '[data-submit-form-on-change]';
const submitOnFormChangePlugin: SubmitOnFormChangePlugin = new SubmitOnFormChangePlugin(querySelector);
const querySelector: string = 'textarea';
const autosizeTextAreaPlugin: AutosizeTextAreaPlugin = new AutosizeTextAreaPlugin(querySelector);
const querySelector: string = '.g-recaptcha';
const recaptchaPlugin: RecaptchaPlugin = new RecaptchaPlugin(querySelector, {
publicKey: settings.get('RECAPTCHA_PUBLIC_KEY'),
language: settings.get('LANGUAGE'),
});