@exmg/exm-form 1.1.37-alpha.31 → 1.2.1-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { LitElement } from 'lit';
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
2
  export type Constructor<T> = new (...args: any[]) => T;
3
- export declare class FormValidateMixinClass extends LitElement {
3
+ export declare abstract class FormValidateMixinClass extends ExmgElement {
4
4
  }
5
- export declare class FormValidateMixinInterface {
5
+ export interface FormValidateMixinInterface {
6
6
  formValid: boolean;
7
7
  getForm(): HTMLFormElement | null;
8
8
  checkFormValidity(): void;
9
9
  }
10
- export declare const ExmFormValidateMixin: <T extends Constructor<LitElement & FormValidateMixinClass>>(superClass: T) => Constructor<FormValidateMixinInterface> & T;
10
+ export declare const ExmFormValidateMixin: <T extends Constructor<ExmgElement & FormValidateMixinClass>>(superClass: T) => Constructor<FormValidateMixinInterface> & T;
@@ -1,8 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
- import { LitElement } from 'lit';
3
- import { async, debounce } from '@exmg/lit-base/index.js';
2
+ import { async, debounce, ExmgElement } from '@exmg/lit-base/index.js';
4
3
  import { state } from 'lit/decorators.js';
5
- export class FormValidateMixinClass extends LitElement {
4
+ export class FormValidateMixinClass extends ExmgElement {
6
5
  }
7
6
  export const ExmFormValidateMixin = (superClass) => {
8
7
  class FormvalidateMixinElement extends superClass {
@@ -33,7 +32,7 @@ export const ExmFormValidateMixin = (superClass) => {
33
32
  }
34
33
  this.formValid = allValid;
35
34
  }
36
- _handleInputChange(e) {
35
+ handleInputChange(e) {
37
36
  const target = e.target;
38
37
  // Only check validation every 200ms max
39
38
  this.debouncer = debounce.Debouncer.debounce(this.debouncer, async.timeOut.after(200), () => {
@@ -47,7 +46,7 @@ export const ExmFormValidateMixin = (superClass) => {
47
46
  if (!form) {
48
47
  return;
49
48
  }
50
- this.boundHandleChange = this._handleInputChange.bind(this);
49
+ this.boundHandleChange = this.handleInputChange.bind(this);
51
50
  form.addEventListener('keyup', this.boundHandleChange, true);
52
51
  form.addEventListener('input', this.boundHandleChange, true);
53
52
  }
@@ -1,5 +1,6 @@
1
1
  export { ExmForm } from './exm-form.js';
2
2
  export { ExmFormValidateMixin, Constructor } from './exm-form-validate-mixin.js';
3
+ export type { FormValidateMixinInterface, FormValidateMixinClass } from './exm-form-validate-mixin.js';
3
4
  export { ExmFormBase } from './exm-form-base.js';
4
5
  export { serializeFormData } from './utils/serializeFormData.js';
5
6
  export { style as formStyles } from './styles/exm-form-css.js';
@@ -1,10 +1,10 @@
1
- import { LitElement } from 'lit';
1
+ import { ExmgElement } from '@exmg/lit-base/index.js';
2
2
  export type Constructor<T> = new (...args: any[]) => T;
3
- export declare class FormValidateMixinClass extends LitElement {
3
+ export declare abstract class FormValidateMixinClass extends ExmgElement {
4
4
  }
5
- export declare class FormValidateMixinInterface {
5
+ export interface FormValidateMixinInterface {
6
6
  formValid: boolean;
7
7
  getForm(): HTMLFormElement | null;
8
8
  checkFormValidity(): void;
9
9
  }
10
- export declare const ExmFormValidateMixin: <T extends Constructor<LitElement & FormValidateMixinClass>>(superClass: T) => Constructor<FormValidateMixinInterface> & T;
10
+ export declare const ExmFormValidateMixin: <T extends Constructor<ExmgElement & FormValidateMixinClass>>(superClass: T) => Constructor<FormValidateMixinInterface> & T;
@@ -1,5 +1,4 @@
1
1
  import { __decorate } from 'tslib';
2
- import 'lit';
3
2
  import { debounce, async } from '@exmg/lit-base/index.js';
4
3
  import { state } from 'lit/decorators.js';
5
4
 
@@ -32,7 +31,7 @@ const ExmFormValidateMixin = (superClass) => {
32
31
  }
33
32
  this.formValid = allValid;
34
33
  }
35
- _handleInputChange(e) {
34
+ handleInputChange(e) {
36
35
  const target = e.target;
37
36
  // Only check validation every 200ms max
38
37
  this.debouncer = debounce.Debouncer.debounce(this.debouncer, async.timeOut.after(200), () => {
@@ -46,7 +45,7 @@ const ExmFormValidateMixin = (superClass) => {
46
45
  if (!form) {
47
46
  return;
48
47
  }
49
- this.boundHandleChange = this._handleInputChange.bind(this);
48
+ this.boundHandleChange = this.handleInputChange.bind(this);
50
49
  form.addEventListener('keyup', this.boundHandleChange, true);
51
50
  form.addEventListener('input', this.boundHandleChange, true);
52
51
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { ExmForm } from './exm-form.js';
2
2
  export { ExmFormValidateMixin, Constructor } from './exm-form-validate-mixin.js';
3
+ export type { FormValidateMixinInterface, FormValidateMixinClass } from './exm-form-validate-mixin.js';
3
4
  export { ExmFormBase } from './exm-form-base.js';
4
5
  export { serializeFormData } from './utils/serializeFormData.js';
5
6
  export { style as formStyles } from './styles/exm-form-css.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exmg/exm-form",
3
- "version": "1.1.37-alpha.31+513140a",
3
+ "version": "1.2.1-alpha.36+c245255",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@exmg/exm-button": "^1.1.37-alpha.31+513140a"
34
+ "@exmg/exm-button": "^1.2.1-alpha.36+c245255"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "lit": "^3.2.1",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "513140a59e3a5a9a0fa572147ba6c0cf9801816e"
44
+ "gitHead": "c245255ad2183458b452f6d5f95cdcbfd78deaf8"
45
45
  }