@felte/element
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,3 +0,2 @@ | ||
import { F as FelteField } from './FelteField-e043a382.js'; | ||
import './domUtils-41299fe4.js'; | ||
import { F as FelteField } from './FelteField-571a0eb7.js'; | ||
@@ -4,0 +3,0 @@ if (!customElements.get('felte-field')) { |
@@ -1,4 +0,3 @@ | ||
import { F as FelteForm } from './FelteForm-055d16ad.js'; | ||
export { a as FelteSubmitError } from './FelteForm-055d16ad.js'; | ||
import './domUtils-41299fe4.js'; | ||
export { FelteSubmitError } from '@felte/core'; | ||
import { F as FelteForm } from './FelteForm-3808b38e.js'; | ||
@@ -5,0 +4,0 @@ if (!customElements.get('felte-form')) { |
@@ -1,4 +0,4 @@ | ||
export { F as FelteField } from './FelteField-e043a382.js'; | ||
export { F as FelteForm, a as FelteSubmitError } from './FelteForm-055d16ad.js'; | ||
import './domUtils-41299fe4.js'; | ||
export { F as FelteField } from './FelteField-571a0eb7.js'; | ||
export { F as FelteForm } from './FelteForm-3808b38e.js'; | ||
export { FelteSubmitError } from '@felte/core'; | ||
@@ -5,0 +5,0 @@ function prepareForm(id, config) { |
@@ -1,2 +0,2 @@ | ||
import{F as e}from"./FelteField-e043a382.js";import"./domUtils-41299fe4.js";customElements.get("felte-field")||(customElements.define("felte-field",e),window.HTMLFelteFieldElement=e); | ||
import{F as e}from"./FelteField-571a0eb7.js";customElements.get("felte-field")||(customElements.define("felte-field",e),window.HTMLFelteFieldElement=e); | ||
//# sourceMappingURL=felte-field.js.map |
@@ -1,2 +0,2 @@ | ||
import{F as e}from"./FelteForm-055d16ad.js";export{a as FelteSubmitError}from"./FelteForm-055d16ad.js";import"./domUtils-41299fe4.js";customElements.get("felte-form")||(customElements.define("felte-form",e),window.HTMLFelteFormElement=e); | ||
export{FelteSubmitError}from"@felte/core";import{F as e}from"./FelteForm-3808b38e.js";customElements.get("felte-form")||(customElements.define("felte-form",e),window.HTMLFelteFormElement=e); | ||
//# sourceMappingURL=felte-form.js.map |
@@ -1,2 +0,2 @@ | ||
export{F as FelteField}from"./FelteField-e043a382.js";export{F as FelteForm,a as FelteSubmitError}from"./FelteForm-055d16ad.js";import"./domUtils-41299fe4.js";function e(e,t){return document.addEventListener("felteconnect",(function o(n){const r=n.composedPath()[0];r.id===e&&(r.configuration=t,document.removeEventListener("felteconnect",o))})),new Promise((t=>{document.addEventListener("felteready",(function o(n){const r=n.composedPath()[0];r.id===e&&(t(r),document.removeEventListener("felteready",o))}))}))}export{e as prepareForm}; | ||
export{F as FelteField}from"./FelteField-571a0eb7.js";export{F as FelteForm}from"./FelteForm-3808b38e.js";export{FelteSubmitError}from"@felte/core";function e(e,t){return document.addEventListener("felteconnect",(function o(n){const r=n.composedPath()[0];r.id===e&&(r.configuration=t,document.removeEventListener("felteconnect",o))})),new Promise((t=>{document.addEventListener("felteready",(function o(n){const r=n.composedPath()[0];r.id===e&&(t(r),document.removeEventListener("felteready",o))}))}))}export{e as prepareForm}; | ||
//# sourceMappingURL=index.js.map |
import { FieldValue } from '@felte/core'; | ||
import { FelteField } from "./FelteField-e043a382"; | ||
import { FelteField } from "./FelteField-571a0eb7"; | ||
declare global { | ||
@@ -4,0 +4,0 @@ interface HTMLElementTagNameMap { |
import { Obj } from '@felte/core'; | ||
import { FelteForm } from "./FelteForm-055d16ad"; | ||
import { FelteForm } from "./FelteForm-3808b38e"; | ||
declare global { | ||
@@ -4,0 +4,0 @@ interface HTMLElementTagNameMap { |
import { FormConfig, Obj } from "@felte/core"; | ||
declare function prepareForm<Data extends Obj = any>(id: string, config: FormConfig<Data>): Promise<HTMLFelteFormElement>; | ||
export * from "./FelteField-e043a382"; | ||
export * from "./FelteForm-055d16ad"; | ||
export * from "./FelteField-571a0eb7"; | ||
export * from "./FelteForm-3808b38e"; | ||
export { FelteSubmitError } from "@felte/core"; | ||
@@ -6,0 +6,0 @@ export type { FelteSubmitEvent, FelteErrorEvent, FelteSuccessEvent } from "@felte/core"; |
{ | ||
"name": "@felte/element", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "An extensible form library that can be used as a custom element", | ||
@@ -31,3 +31,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@felte/core": "1.2.3" | ||
"@felte/core": "1.2.4" | ||
}, | ||
@@ -50,3 +50,3 @@ "publishConfig": { | ||
}, | ||
"readme": "# Felte: A form library for vanilla JS (custom element)\n\n[![Tests](https://github.com/pablo-abc/felte/workflows/Tests/badge.svg)](https://github.com/pablo-abc/felte/actions/workflows/test.yml)\n[![Bundle size](https://img.shields.io/bundlephobia/min/@felte/element)](https://bundlephobia.com/result?p=@felte/element)\n[![NPM Version](https://img.shields.io/npm/v/@felte/element)](https://www.npmjs.com/package/@felte/element)\n[![NPM Downloads](https://img.shields.io/npm/dw/@felte/element)](https://www.npmjs.com/package/@felte/element)\n[![codecov](https://codecov.io/gh/pablo-abc/felte/branch/main/graph/badge.svg?token=T73OJZ50LC)](https://codecov.io/gh/pablo-abc/felte)\n\nFelte is an extensible form library originally bult for Svelte. This package aims to provide Felte's functionality using a custom element. Felte, on its most simple form, only requires you to provide a `<form>` element to it in order to work.\n\n> **WARNING**: This package is under development, things might break on updates and documentation is almost non-existent besides this README.\n\n## Features\n\n- Single action to make your form reactive.\n- Use HTML5 native elements to create your form. (Only the `name` attribute is necessary).\n- Provides stores and helper functions to handle more complex use cases.\n- No assumptions on your validation strategy. Use any validation library you want or write your own strategy.\n- Handles addition and removal of form controls during runtime.\n- Official solutions for error reporting using `reporter` packages.\n- Well tested. Currently at [99% code coverage](https://app.codecov.io/gh/pablo-abc/felte) and constantly working on improving test quality.\n- Supports validation with [yup](/packages/validator-yup/README.md), [zod](/packages/validator-zod/README.md) and [superstruct](/packages/validator-superstruct/README.md).\n- Easily [extend its functionality](https://felte.dev/docs/element/extending-felte).\n\n## Simple usage example\n\nUsing Svelte as an example:\n\n```html\n<script type=\"module\">\n import { prepareForm } from '@felte/element';\n\n // Needs to run _before_ `<felte-form>` connects.\n // Make sure to call it at the top leve of the module.\n prepareForm('signin', {\n onSubmit: async (values) => {\n /* call to an api */\n },\n });\n</script>\n\n<felte-form id=\"signin\">\n <form>\n <input type=\"text\" name=\"email\" />\n <input type=\"password\" name=\"password\" />\n <input type=\"submit\" value=\"Sign in\" />\n </form>\n</felte-form>\n```\n\n## Installation\n\n```sh\nnpm install --save @felte/element\n\n# Or if you use yarn\n\nyarn add @felte/element\n```\n\n## Usage\n\nTo learn more about how to use `felte` to handle your forms, check the [official documentation](https://felte.dev/docs/element/getting-started).\n\n## Framework compatibility\n\nThis package should work nicely with any framework. Specially if you're using the `prepareForm` method of creating your form. It also works really nice with frameworks that set attributes as properties or frameworks that provide syntax to set values to properties of elements instead of attributes.\n" | ||
"readme": "# Felte: A form library for vanilla JS (custom element)\n\n[![Tests](https://github.com/pablo-abc/felte/workflows/Tests/badge.svg)](https://github.com/pablo-abc/felte/actions/workflows/test.yml)\n[![Bundle size](https://img.shields.io/bundlephobia/min/@felte/element)](https://bundlephobia.com/result?p=@felte/element)\n[![NPM Version](https://img.shields.io/npm/v/@felte/element)](https://www.npmjs.com/package/@felte/element)\n[![NPM Downloads](https://img.shields.io/npm/dw/@felte/element)](https://www.npmjs.com/package/@felte/element)\n[![codecov](https://codecov.io/gh/pablo-abc/felte/branch/main/graph/badge.svg?token=T73OJZ50LC)](https://codecov.io/gh/pablo-abc/felte)\n\nFelte is an extensible form library originally bult for Svelte. This package aims to provide Felte's functionality using a custom element. Felte, on its most simple form, only requires you to provide a `<form>` element to it in order to work.\n\n> **WARNING**: This package is under development, things might break on updates and documentation is almost non-existent besides this README.\n\n## Features\n\n- Single action to make your form reactive.\n- Use HTML5 native elements to create your form. (Only the `name` attribute is necessary).\n- Provides stores and helper functions to handle more complex use cases.\n- No assumptions on your validation strategy. Use any validation library you want or write your own strategy.\n- Handles addition and removal of form controls during runtime.\n- Official solutions for error reporting using `reporter` packages.\n- Well tested. Currently at [99% code coverage](https://app.codecov.io/gh/pablo-abc/felte) and constantly working on improving test quality.\n- Supports validation with [yup](/packages/validator-yup/README.md), [zod](/packages/validator-zod/README.md) and [superstruct](/packages/validator-superstruct/README.md).\n- Easily [extend its functionality](https://felte.dev/docs/element/extending-felte).\n\n## Simple usage example\n\nUsing Svelte as an example:\n\n```html\n<script type=\"module\">\n import '@felte/element/felte-form';\n\n const felteForm = document.querySelector('felte-form');\n felteForm.configuration = {\n onSubmit: async (values) => {\n /* call to an api */\n },\n };\n</script>\n\n<felte-form>\n <form>\n <input type=\"text\" name=\"email\" />\n <input type=\"password\" name=\"password\" />\n <input type=\"submit\" value=\"Sign in\" />\n </form>\n</felte-form>\n```\n\n## Installation\n\n```sh\nnpm install --save @felte/element\n\n# Or if you use yarn\n\nyarn add @felte/element\n```\n\n## Usage\n\nTo learn more about how to use `felte` to handle your forms, check the [official documentation](https://felte.dev/docs/element/getting-started).\n\n## Framework compatibility\n\nThis package should work nicely with any framework. Specially if you're using the `prepareForm` method of creating your form. It also works really nice with frameworks that set attributes as properties or frameworks that provide syntax to set values to properties of elements instead of attributes.\n" | ||
} |
@@ -31,14 +31,13 @@ # Felte: A form library for vanilla JS (custom element) | ||
<script type="module"> | ||
import { prepareForm } from '@felte/element'; | ||
import '@felte/element/felte-form'; | ||
// Needs to run _before_ `<felte-form>` connects. | ||
// Make sure to call it at the top leve of the module. | ||
prepareForm('signin', { | ||
const felteForm = document.querySelector('felte-form'); | ||
felteForm.configuration = { | ||
onSubmit: async (values) => { | ||
/* call to an api */ | ||
}, | ||
}); | ||
}; | ||
</script> | ||
<felte-form id="signin"> | ||
<felte-form> | ||
<form> | ||
@@ -45,0 +44,0 @@ <input type="text" name="email" /> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
101257
31
667
67
+ Added@felte/core@1.2.4(transitive)
- Removed@felte/core@1.2.3(transitive)
Updated@felte/core@1.2.4