Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.38 KB

dile-form-change-detect-mixin.rocket.md

File metadata and controls

45 lines (31 loc) · 1.38 KB
/* START - Rocket auto generated - do not touch */
export const sourceRelativeFilePath = 'mixins/dile-form-change-detect-mixin.rocket.md';
import { layout } from '../recursive.data.js';
export { layout };
/* END - Rocket auto generated - do not touch */

export const title = 'DileFormChangeDetectMixin';
import { html, css, LitElement } from 'lit'; 
import "@dile/dile-menu-hamburger/dile-menu-hamburger.js";
import "@dile/dile-selector/dile-selector.js";
import "@dile/dile-selector/dile-selector-item.js";

DileFormChangeDetectMixin

This mixin detects changes in a form and emmit a dile-form-changed event when it occurs.

To detect changes the form elements should emmit a element-changed event. for this reason, this mixins only works with custom elements that have this custom event implemented.

You could use the DileEmmitChangeMixin to send the element-changed custom event easily.

Also, for this mixin do its work depends on the DileFormMixin, so you need to implement both mixins.

Installation

npm i @dile/dile-form-mixin

Usage

import { DileFormChangeDetectMixin, DileFormMixin } from '@dile/dile-form-mixin';

export class FctCrudFilters extends 
  DileFormChangeDetectMixin(DileFormMixin(LitElement)) {

    // Code of your component...
    
}