jenesius-vue-form
Advanced tools
Comparing version 2.0.16 to 2.0.17
@@ -145,3 +145,4 @@ import EventEmitter from "jenesius-event-emitter"; | ||
name?: string; | ||
parent?: boolean; | ||
} | ||
export {}; |
/*! | ||
* jenesius-vue-form v2.0.16 | ||
* jenesius-vue-form v2.0.17 | ||
* (c) 2022 Jenesius | ||
@@ -310,5 +310,7 @@ * @license MIT | ||
__classPrivateFieldSet(this, _Form_debug, Boolean(params.debug), "f"); | ||
this.parentForm = vue.inject(Form.PROVIDE_NAME, undefined); | ||
if (this.parentForm) | ||
this.parentForm.depend(this); | ||
if (params.parent !== false) { | ||
this.parentForm = vue.inject(Form.PROVIDE_NAME, undefined); | ||
if (this.parentForm) | ||
this.parentForm.depend(this); | ||
} | ||
vue.provide(Form.PROVIDE_NAME, this); | ||
@@ -639,3 +641,4 @@ } | ||
if (dep.validate) { | ||
acc = acc && !!dep.validate(); | ||
const result = dep.validate(); | ||
acc = acc && !!result; | ||
} | ||
@@ -885,3 +888,3 @@ return acc; | ||
var css_248z$a = "\n.widget-input-text[data-v-4dc31c1e]{\r\n height: 35px;\r\n border-radius: 4px;\r\n border: 1px solid #c8c8c8;\r\n outline: none;\r\n padding: 0 4px;\r\n color: #1c1c1c;\n}\n.widget-input-text[data-v-4dc31c1e]:focus{\r\n border-color: #b2b2b2;\n}\n.widget-input-text[data-v-4dc31c1e]:disabled{\r\n background-color: #e9e9e9;\n}\r\n"; | ||
var css_248z$a = "\n.widget-input-text[data-v-4dc31c1e]{\r\n height: 35px;\r\n border-radius: 4px;\r\n border: 1px solid #c8c8c8;\r\n outline: none;\r\n padding: 0 4px;\r\n color: #1c1c1c;\n}\n.widget-input-text[data-v-4dc31c1e]:focus{\r\n border-color: #b2b2b2;\n}\n.widget-input-text[data-v-4dc31c1e]:disabled{\r\n background-color: #e9e9e9;\n}\n.input-text_error[data-v-4dc31c1e]{\r\n\t border: 1px solid #fa5c5c;\n}\r\n"; | ||
styleInject(css_248z$a); | ||
@@ -895,3 +898,4 @@ | ||
modelValue: { type: null, required: true }, | ||
disabled: { type: Boolean, required: false } | ||
disabled: { type: Boolean, required: false }, | ||
errors: { type: Array, required: true } | ||
}, | ||
@@ -904,3 +908,5 @@ emits: ["update:modelValue"], | ||
vue.createElementVNode("input", { | ||
class: "widget-input-text", | ||
class: vue.normalizeClass(["widget-input-text", { | ||
"input-text_error": __props.errors.length !== 0 | ||
}]), | ||
type: "text", | ||
@@ -910,3 +916,3 @@ value: __props.modelValue, | ||
disabled: __props.disabled | ||
}, null, 40, _hoisted_1$8) | ||
}, null, 42, _hoisted_1$8) | ||
]), | ||
@@ -1413,3 +1419,4 @@ _: 1 | ||
validation: { type: Array, required: false, default: () => [] }, | ||
options: { type: [Array, Object], required: false } | ||
options: { type: [Array, Object], required: false }, | ||
required: { type: Boolean, required: false } | ||
}, | ||
@@ -1420,3 +1427,9 @@ setup(__props) { | ||
const componentItem = vue.computed(() => inputsStore[props.type] || inputsStore.text); | ||
const { state, input } = useInputState(props.name, props.validation); | ||
const extendValidation = vue.computed(() => { | ||
const arr = [...props.validation || []]; | ||
if (props.required) | ||
arr.push((v) => !!v || "Please fill in this field"); | ||
return arr; | ||
}); | ||
const { state, input } = useInputState(props.name, extendValidation.value); | ||
vue.watch(() => props.modelValue, (a, b) => { | ||
@@ -1423,0 +1436,0 @@ if (a === b) |
{ | ||
"name": "jenesius-vue-form", | ||
"version": "2.0.16", | ||
"version": "2.0.17", | ||
"description": "Heavy form system for Vue.js", | ||
@@ -8,2 +8,12 @@ "author": "Jenesius", | ||
"email": "lokargenia@gmail.com", | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"webuild": "vue-cli-service build", | ||
"lint": "vue-cli-service lint", | ||
"build": "rollup -c rollup.config.js", | ||
"full": "rollup -c rollup.config.js && npm publish", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"docs:serve": "vitepress serve docs" | ||
}, | ||
"keywords": [ | ||
@@ -15,2 +25,3 @@ "vue", | ||
], | ||
"files": [ | ||
@@ -33,12 +44,3 @@ "dist/jenesius-vue-modal.cjs.js", | ||
"url": "https://github.com/Jenesius/vue-form/issues", | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"webuild": "vue-cli-service build", | ||
"lint": "vue-cli-service lint", | ||
"build": "rollup -c rollup.config.js", | ||
"full": "rollup -c rollup.config.js && npm publish", | ||
"docs:dev": "vitepress dev docs", | ||
"docs:build": "vitepress build docs", | ||
"docs:serve": "vitepress serve docs" | ||
}, | ||
"peerDependencies": { | ||
@@ -45,0 +47,0 @@ "jenesius-event-emitter": "^1.0.4", |
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
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
91856
2011