Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jenesius-vue-form

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jenesius-vue-form - npm Package Compare versions

Comparing version 3.0.0-rc.5 to 3.0.0

tests/units/form/form-accept-changes.spec.ts

4

dist/types/classes/Form.d.ts

@@ -56,2 +56,6 @@ import EventEmitter from "jenesius-event-emitter";

/**
* @description Метод для принятия изменения и переноса их в pureValues
* */
acceptChanges(name?: string): void;
/**
* @description Метод проецирует цепочку изменений на форму.

@@ -58,0 +62,0 @@ * @param compareResult {CompareItem[]} массив изменений, которые необходимо спроецировать

2

package.json
{
"name": "jenesius-vue-form",
"version": "3.0.0-rc.5",
"version": "3.0.0",
"description": "Heavy form system for Vue.js",

@@ -5,0 +5,0 @@ "type": "module",

@@ -25,3 +25,3 @@ <p align="center"><a href="https://form.jenesius.com/" target="_blank" rel="noopener noreferrer"><img height="100" src="https://form.jenesius.com/images/logo.svg" alt="Vue logo"></a></p>

![Alt Text](./gif-example.gif)
![Alt Text](./readme-example.gif)

@@ -33,6 +33,7 @@ ## Usage

<template>
<form-field name = "login"/>
<form-field name = "password" type = "password"/>
<button @click = "handleLogin">Login</button>
<form-field name = "login"/>
<form-field name = "password" type = "password"/>
<button @click = "handleLogin">Login</button>
</template>
<script setup>

@@ -43,3 +44,3 @@ import {FormField, Form} from "jenesius-vue-form";

function handleLogin() {
console.log(form.values) // { login: "", password: "" }
console.log(form.values) // { login: "", password: "" }
}

@@ -46,0 +47,0 @@ </script>

@@ -132,4 +132,2 @@ import {mount} from "@vue/test-utils";

console.log(input.element.name, input.element.classList)
expect(input.element.disabled).toBe(true)

@@ -136,0 +134,0 @@ })

@@ -196,2 +196,27 @@ import Form from "../../../src/classes/Form";

})
test("Setting the same value should not execute event", () => {
const form = new Form();
const mockOninput = jest.fn(x => x);
form.oninput('age', mockOninput);
form.setValues({age: 1})
form.setValues({age: 3})
form.setValues({age: 3});
form.setValues({age: 3});
expect(mockOninput.mock.results.length).toBe(2)
expect(mockOninput.mock.results[0].value).toBe(1)
expect(mockOninput.mock.results[1].value).toBe(3)
})
test("Setting the same value after change should not execute event", () => {
const form = new Form();
const mockOninput = jest.fn(x => x);
form.oninput('age', mockOninput);
form.change({age: 23})
form.setValues({age: 24})
expect(mockOninput.mock.results.length).toBe(2)
expect(mockOninput.mock.results[0].value).toBe(23)
expect(mockOninput.mock.results[1].value).toBe(24)
})
})

@@ -506,3 +506,15 @@ import Form from "../../../src/classes/Form";

})
test("Setting equal object using setValues after change", () => {
const form = new Form()
form.change({
username: "Jack"
})
form.setValues({
username: "Jack"
})
expect(form.changes).toEqual({})
expect(form.values).toEqual({ username: "Jack" })
})
})

@@ -44,3 +44,2 @@ import Form from "../../../src/classes/Form";

validate() {
console.log(this.index > 0)

@@ -47,0 +46,0 @@ return this.index++ > 0

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc