@lucca-front/ng
Advanced tools
Comparing version 0.0.22 to 0.0.23
# Change log | ||
## 0.0.22 [release](https://github.com/LuccaSA/lucca-front/releases/tag/0.0.22) | ||
## 0.0.23 [release](https://github.com/LuccaSA/lucca-front/releases/tag/0.0.23) | ||
### Bug fixes |
@@ -15,2 +15,3 @@ "use strict"; | ||
const suffix_1 = require("./wrappers/suffix"); | ||
const icon_1 = require("./wrappers/icon"); | ||
const error_1 = require("./wrappers/error"); | ||
@@ -29,2 +30,3 @@ const button_1 = require("./wrappers/button"); | ||
suffix_1.LuFormlyWrapperSuffix, | ||
icon_1.LuFormlyWrapperIcon, | ||
error_1.LuFormlyWrapperError, | ||
@@ -68,2 +70,3 @@ title_1.LuFormlyWrapperTitle, | ||
{ name: 'suffix', component: suffix_1.LuFormlyWrapperSuffix }, | ||
{ name: 'icon', component: icon_1.LuFormlyWrapperIcon }, | ||
{ name: 'error', component: error_1.LuFormlyWrapperError }, | ||
@@ -78,2 +81,3 @@ { name: 'button', component: button_1.LuFormlyWrapperButton }, | ||
{ class: suffix_1.TemplateSuffix, method: 'run' }, | ||
{ class: icon_1.TemplateIcon, method: 'run' }, | ||
], | ||
@@ -80,0 +84,0 @@ }; |
@@ -15,2 +15,3 @@ import { OnInit } from '@angular/core'; | ||
filterOptions(name: string): any[]; | ||
setToOption(value: any): void; | ||
} |
@@ -16,8 +16,7 @@ "use strict"; | ||
ngOnInit() { | ||
this.formControl.valueChanges.subscribe(value => { | ||
this.setToOption(value); | ||
}); | ||
const value = this.formControl.value; | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
// replace formValue with the option value with the same id | ||
const option = this._options.find(o => o.id === value.id); | ||
this.formControl.setValue(option); | ||
} | ||
this.setToOption(value); | ||
this.filteredOptions = this.formControl.valueChanges | ||
@@ -31,2 +30,9 @@ .startWith(null) | ||
} | ||
setToOption(value) { | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
// replace formValue with the option value with the same id | ||
const option = this._options.find(o => o.id === value.id); | ||
this.formControl.setValue(option); | ||
} | ||
} | ||
}; | ||
@@ -33,0 +39,0 @@ LuFormlyFieldAutocomplete = __decorate([ |
@@ -8,2 +8,3 @@ import { OnInit } from '@angular/core'; | ||
ngOnInit(): void; | ||
setToOption(value: any): void; | ||
} |
@@ -16,3 +16,9 @@ "use strict"; | ||
ngOnInit() { | ||
this.formControl.valueChanges.subscribe(value => { | ||
this.setToOption(value); | ||
}); | ||
const value = this.formControl.value; | ||
this.setToOption(value); | ||
} | ||
setToOption(value) { | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
@@ -19,0 +25,0 @@ // replace formValue with the option value with the same id |
@@ -20,4 +20,4 @@ "use strict"; | ||
selector: 'lu-formly-wrapper-suffix', | ||
styles: [":host { display: inherit; flex: 1 1 auto; }"], | ||
template: "<ng-container #fieldComponent></ng-container> <i class=\"input-suffix lucca-icon\">{{ to.suffix }}</i>", | ||
styles: [":host { display: inherit; flex: 1 1 auto; } :host .input-suffix { pointer-events: none; }"], | ||
template: "<ng-container #fieldComponent></ng-container> <span class=\"input-suffix\">{{ to.suffix }}</span>", | ||
}) | ||
@@ -30,9 +30,5 @@ ], LuFormlyWrapperSuffix); | ||
fc.templateManipulators.postWrapper.push((field) => { | ||
if (field && field.type === 'date') { | ||
field.templateOptions.suffix = 'calendar'; | ||
if (field && field.templateOptions && field.templateOptions.suffix && !field.templateOptions.icon) { | ||
return 'suffix'; | ||
} | ||
if (field && field.templateOptions && field.templateOptions.suffix) { | ||
return 'suffix'; | ||
} | ||
}); | ||
@@ -39,0 +35,0 @@ } |
{ | ||
"name": "@lucca-front/ng", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "a library of usefull components for angular web app", | ||
@@ -85,3 +85,3 @@ "repository": { | ||
"peerDependencies": { | ||
"@lucca-front/scss": "0.0.22", | ||
"@lucca-front/scss": "0.0.23", | ||
"ng-formly": "^1.0.0-rc.12", | ||
@@ -88,0 +88,0 @@ "moment": "^2.18.1" |
@@ -14,2 +14,3 @@ import { ConfigOption } from 'ng-formly'; | ||
import { LuFormlyWrapperSuffix, TemplateSuffix } from './wrappers/suffix'; | ||
import { LuFormlyWrapperIcon, TemplateIcon } from './wrappers/icon'; | ||
import { LuFormlyWrapperError, TemplateError, LuFormlyErrorMessage } from './wrappers/error'; | ||
@@ -32,2 +33,3 @@ import { LuFormlyWrapperButton, TemplateButton } from './wrappers/button'; | ||
LuFormlyWrapperSuffix, | ||
LuFormlyWrapperIcon, | ||
LuFormlyWrapperError, | ||
@@ -72,2 +74,3 @@ LuFormlyWrapperTitle, | ||
{ name: 'suffix', component: LuFormlyWrapperSuffix }, | ||
{ name: 'icon', component: LuFormlyWrapperIcon }, | ||
{ name: 'error', component: LuFormlyWrapperError }, | ||
@@ -78,9 +81,10 @@ { name: 'button', component: LuFormlyWrapperButton }, | ||
{ class: TemplateTitle, method: 'run' }, // for form group only | ||
{ class: TemplateButton, method: 'run' }, // fifth | ||
{ class: TemplateError, method: 'run' }, // fourth | ||
{ class: TemplateHelper, method: 'run' }, // third | ||
{ class: TemplateSuffix, method: 'run' }, // second | ||
{ class: TemplateButton, method: 'run' }, // sixth | ||
{ class: TemplateError, method: 'run' }, // fifth | ||
{ class: TemplateHelper, method: 'run' }, // fourth | ||
{ class: TemplateSuffix, method: 'run' }, // third | ||
{ class: TemplateIcon, method: 'run' }, // second | ||
// { class: TemplateLabel, method: 'run' }, // first | ||
], | ||
} as ConfigOption; |
@@ -16,8 +16,7 @@ import { Component, OnInit } from '@angular/core'; | ||
ngOnInit () { | ||
this.formControl.valueChanges.subscribe(value => { | ||
this.setToOption(value); | ||
}); | ||
const value = this.formControl.value; | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
// replace formValue with the option value with the same id | ||
const option = this._options.find(o => o.id === value.id); | ||
this.formControl.setValue(option); | ||
} | ||
this.setToOption(value); | ||
this.filteredOptions = this.formControl.valueChanges | ||
@@ -32,2 +31,9 @@ .startWith(null) | ||
} | ||
setToOption(value) { | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
// replace formValue with the option value with the same id | ||
const option = this._options.find(o => o.id === value.id); | ||
this.formControl.setValue(option); | ||
} | ||
} | ||
} |
@@ -15,3 +15,9 @@ import { Component, OnInit } from '@angular/core'; | ||
ngOnInit () { | ||
this.formControl.valueChanges.subscribe(value => { | ||
this.setToOption(value); | ||
}); | ||
const value = this.formControl.value; | ||
this.setToOption(value); | ||
} | ||
setToOption(value) { | ||
if (!!value && !this._options.includes(value) && this._options.map(o => o.id).includes(value.id)) { | ||
@@ -18,0 +24,0 @@ // replace formValue with the option value with the same id |
@@ -7,3 +7,3 @@ import { Component, ViewChild, ViewContainerRef } from '@angular/core'; | ||
selector: 'lu-formly-wrapper-suffix', | ||
styleUrls: ['flex-layout.scss'], | ||
styleUrls: ['flex-layout.scss', 'suffixes.common.scss'], | ||
templateUrl: './suffix.html', | ||
@@ -18,11 +18,7 @@ }) | ||
fc.templateManipulators.postWrapper.push((field: FormlyFieldConfig) => { | ||
if (field && field.type === 'date') { | ||
field.templateOptions.suffix = 'calendar'; | ||
if (field && field.templateOptions && field.templateOptions.suffix && !field.templateOptions.icon) { | ||
return 'suffix'; | ||
} | ||
if (field && field.templateOptions && field.templateOptions.suffix) { | ||
return 'suffix'; | ||
} | ||
}); | ||
} | ||
} |
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
238370
224
3508