1
0
mirror of synced 2024-11-22 13:26:06 +03:00
This commit is contained in:
1on 2020-11-13 12:28:12 +03:00
parent d4ca4d80df
commit 8ca723af00
4 changed files with 18 additions and 4 deletions

View File

@ -1319,9 +1319,10 @@ let FormularioInput = class FormularioInput extends Vue {
} }
get model() { get model() {
const model = this.hasModel ? 'value' : 'proxy'; const model = this.hasModel ? 'value' : 'proxy';
return this[model] !== undefined ? this[model] : ''; return this.modelGetConverter(this[model]);
} }
set model(value) { set model(value) {
value = this.modelSetConverter(value, this.proxy);
if (!shallowEqualObjects(value, this.proxy)) { if (!shallowEqualObjects(value, this.proxy)) {
this.proxy = value; this.proxy = value;
} }
@ -1502,6 +1503,12 @@ __decorate([
__decorate([ __decorate([
Prop({ default: false }) Prop({ default: false })
], FormularioInput.prototype, "errorsDisabled", void 0); ], FormularioInput.prototype, "errorsDisabled", void 0);
__decorate([
Prop({ default: () => (value) => value })
], FormularioInput.prototype, "modelGetConverter", void 0);
__decorate([
Prop({ default: () => (value) => value })
], FormularioInput.prototype, "modelSetConverter", void 0);
__decorate([ __decorate([
Watch('proxy') Watch('proxy')
], FormularioInput.prototype, "onProxyChanged", null); ], FormularioInput.prototype, "onProxyChanged", null);

File diff suppressed because one or more lines are too long

View File

@ -1324,9 +1324,10 @@
} }
get model() { get model() {
const model = this.hasModel ? 'value' : 'proxy'; const model = this.hasModel ? 'value' : 'proxy';
return this[model] !== undefined ? this[model] : ''; return this.modelGetConverter(this[model]);
} }
set model(value) { set model(value) {
value = this.modelSetConverter(value, this.proxy);
if (!shallowEqualObjects(value, this.proxy)) { if (!shallowEqualObjects(value, this.proxy)) {
this.proxy = value; this.proxy = value;
} }
@ -1507,6 +1508,12 @@
__decorate([ __decorate([
vuePropertyDecorator.Prop({ default: false }) vuePropertyDecorator.Prop({ default: false })
], FormularioInput.prototype, "errorsDisabled", void 0); ], FormularioInput.prototype, "errorsDisabled", void 0);
__decorate([
vuePropertyDecorator.Prop({ default: () => (value) => value })
], FormularioInput.prototype, "modelGetConverter", void 0);
__decorate([
vuePropertyDecorator.Prop({ default: () => (value) => value })
], FormularioInput.prototype, "modelSetConverter", void 0);
__decorate([ __decorate([
vuePropertyDecorator.Watch('proxy') vuePropertyDecorator.Watch('proxy')
], FormularioInput.prototype, "onProxyChanged", null); ], FormularioInput.prototype, "onProxyChanged", null);

View File

@ -1,6 +1,6 @@
{ {
"name": "@retailcrm/vue-formulario", "name": "@retailcrm/vue-formulario",
"version": "0.4.1", "version": "0.4.2",
"author": "RetailDriverLLC <integration@retailcrm.ru>", "author": "RetailDriverLLC <integration@retailcrm.ru>",
"scripts": { "scripts": {
"build": "npm run build:esm & npm run build:umd & npm run build:iife & wait && echo \"Build complete:\nesm: $(gzip -c dist/formulario.esm.js | wc -c)b gzip\numd: $(gzip -c dist/formulario.umd.js | wc -c)b gzip\nmin: $(gzip -c dist/formulario.min.js | wc -c)b gzip\"", "build": "npm run build:esm & npm run build:umd & npm run build:iife & wait && echo \"Build complete:\nesm: $(gzip -c dist/formulario.esm.js | wc -c)b gzip\numd: $(gzip -c dist/formulario.umd.js | wc -c)b gzip\nmin: $(gzip -c dist/formulario.min.js | wc -c)b gzip\"",