diff --git a/src/assets/xdce-module-widget-fideuram/styles/_widget-fideuram_ui.styles.scss b/src/assets/xdce-module-widget-fideuram/styles/_widget-fideuram_ui.styles.scss index 5094276..4365cda 100644 --- a/src/assets/xdce-module-widget-fideuram/styles/_widget-fideuram_ui.styles.scss +++ b/src/assets/xdce-module-widget-fideuram/styles/_widget-fideuram_ui.styles.scss @@ -10,7 +10,8 @@ $btn-map: ( secondary-bg-color: map-get($white-palette, 100), secondary-border-color: map-get($orange-palette, 100), secondary-color: map-get($orange-palette, 100), - secondary-bg-color-h: map-get($gray-palette, 100), + secondary-bg-color-h: map-get($orange-palette, 100), + secondary-color-h: map-get($white-palette, 100), ); $checkbox-map: ( @@ -82,10 +83,10 @@ body { @include isp-button-colors("secondary", map-get($btn-map, "secondary-bg-color"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color"), - map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color"), - map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color"), + map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color-h"), + map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color-h"), map-get($btn-map, "secondary-bg-color"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color"), - map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color"), ); + map-get($btn-map, "secondary-bg-color-h"), map-get($btn-map, "secondary-border-color"), map-get($btn-map, "secondary-color-h"), ); } nbp-button { @@ -254,7 +255,7 @@ body { nbp-modal .isp-corporate-mode-wrapper { .isp-modal-close { - color: map-get($blue-palette, 100); + color: map-get($orange-palette, 100); } .isp-modal-container { diff --git a/src/assets/xdce-module-widget-fideuram/styles/style.scss b/src/assets/xdce-module-widget-fideuram/styles/style.scss index 2944af7..0d35f87 100644 --- a/src/assets/xdce-module-widget-fideuram/styles/style.scss +++ b/src/assets/xdce-module-widget-fideuram/styles/style.scss @@ -43,6 +43,7 @@ body { outline: none !important; -o-transition: all 0.1s; transition: all 0.1s; + border-radius: 0.20rem !important; } } @@ -221,6 +222,15 @@ body { .isp-modal-close { padding: 14px; + + .isp-font-comuni-chiudi::before { + content: $fa-var-times; + font: 14px / 1 FontAwesome !important; + } + span { + position: relative; + z-index: 1000; + } } .cursor-pointer { @@ -229,6 +239,7 @@ body { .isp-modal-content { padding: unset; + max-height: 94vh !important; &>div:nth-child(2) { &>* { @@ -1180,6 +1191,10 @@ body { } } +rpl-calendar-noa11y.isp-corporate-mode-wrapper.invisible { + position: fixed; +} + .ag-theme-balham { .ag-header-cell::after, diff --git a/src/index.ts b/src/index.ts index 08f543a..e1ee4e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,7 @@ export { DATE_STRING_FORMAT, formatDate, formatNumber, setSpinnerMessage, clearS NbpModule, AgGridModule, FormsModule, + ReactiveFormsModule, ], declarations: [ NbpBreadCrumbsComponent, diff --git a/src/widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic-page.html b/src/widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic-page.html deleted file mode 100644 index e8d104d..0000000 --- a/src/widgetfideuram/components/nbp-fid-calendar-generic/nbp-fid-calendar-generic-page.html +++ /dev/null @@ -1,583 +0,0 @@ - - - - - - - - Datepicker Multi-Livello - - - - -
- - -
-
- - - - - - \ No newline at end of file diff --git a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.html b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.html index 5480ab7..ac1eea2 100644 --- a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.html +++ b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.html @@ -1,9 +1,18 @@ - + + [value]="op.strValue" + [ngValue]="op.value" + [selected]="op.selected" + >{{op.label}} diff --git a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.scss b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.scss index 5b1acc1..78604c9 100644 --- a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.scss +++ b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.scss @@ -1,24 +1,35 @@ .nbp-fid-combo { - border: 1px solid; - border-color: #DDE6E9; // map-get($gray-palette, 100); - // background: url("data:image/svg+xml,") no-repeat; - // background: #fff url("data:image/svg+xml;utf8,") no-repeat; - // background: #fff url("data:image/svg+xml;utf8,") no-repeat; - // background-position: calc(100% - 0.75em) center !important; - - background: #fff; - // -moz-appearance:none !important; - // -webkit-appearance: none !important; - // appearance: none !important; - min-width: 2em; - padding-top: 1px; - padding-bottom: 1px; - padding-left: 1px; - padding-right: 1em !important; + // border: 1px solid; + // border-color: #DDE6E9; // map-get($gray-palette, 100); + // background: #fff; + // min-width: 2em; + // padding-top: 1px; + // padding-bottom: 1px; + // padding-left: 1px; + // padding-right: 1em !important; + // width: 100%; + display: block; width: 100%; + padding: 1px; + height: 22px; + font-size: 12px; + line-height: 1.52857143; + color: #3a3f51; + background-color: #ffffff; + background-image: none; + border: 1px solid #dde6e9; + border-radius: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: 0 0 0 #000 !important; + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; &:focus, &:active { + outline: 0 !important; + box-shadow: 0 0 0 #000 !important; border-color: #66AFE9; // map-get($blue-palette, 100); } } diff --git a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.ts b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.ts index ba58f16..b30619d 100644 --- a/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.ts +++ b/src/widgetfideuram/components/nbp-fid-combo/nbp-fid-combo.component.ts @@ -1,20 +1,57 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output, OnInit, forwardRef, ChangeDetectionStrategy } from '@angular/core'; import { NbpBaseComponent, NbpStyle, NbpDataSource } from '@isp/xdce-widget'; +import {ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, } from '@angular/forms'; + +// +// auto incremental index for noname combo instance +let comboIndex = 111; + @Component({ selector: 'nbp-fid-combo', templateUrl: './nbp-fid-combo.component.html', - styleUrls: ['./nbp-fid-combo.component.scss'] + styleUrls: ['./nbp-fid-combo.component.scss'], + providers: [ + { + provide: NG_VALUE_ACCESSOR, + useExisting: forwardRef(() => NbpFidComboComponent), + multi: true + } + ] }) -export class NbpFidComboComponent extends NbpBaseComponent { - constructor(){ +export class NbpFidComboComponent + extends NbpBaseComponent + implements ControlValueAccessor { + + constructor() { super() } + @Input() name: string; + + onChange: any = () => { }; + onTouch: any = () => {}; + + compareFn(c1: any, c2: any): boolean { + return c1 && c2 ? c1.value === c2.value : c1 === c2; + } + + registerOnChange(fn: any): void { + this.onChange = fn; + } + + registerOnTouched(fn: any): void { + this.onTouch = fn; + } + + writeValue(input: string) { + this.value = input; + } + @Input() nbpViewField : string = null; @Input() nbpKeyField : string = null; @@ -24,16 +61,23 @@ export class NbpFidComboComponent extends NbpBaseComponent { private _model: any; @Input() - set ngModel(value: any) { + set value(value: any) { this._model = value; - if (this._nbpShowEmptyValue && this._model !== null && !this.nbpViewField) { - this._emptyValue = this._model; - this._emptyLabel = this._model; - } + if (this._model === undefined) + this._model = null; + + // FUTURE handle a model value that is not present in options + // as "empty" value + // if (this._nbpShowEmptyValue && this._model !== null && !this.nbpViewField) { + // this._emptyValue = this._model; + // this._emptyLabel = this._model; + // } + + this._selectOnModel(); } @Output() ngModelChange = new EventEmitter(); - get ngModel(): any { + get value(): any { return this._model; } @@ -76,7 +120,10 @@ export class NbpFidComboComponent extends NbpBaseComponent { } ngOnInit(): void { - this._readOptions(); + if (!this.name) { + this.name = "combo_" + (comboIndex++); + } + this._readOptions(null); } optStrValue(opt: any) { @@ -121,11 +168,26 @@ export class NbpFidComboComponent extends NbpBaseComponent { } - selected(op : any) { - return this.optValue(op) === this.ngModel; + _selectOnModel() { + const arr = this._options; + for (let a of arr) { + a.selected = false; + } + const val = this.value; + if (val === null || val === undefined) + return; + + for (let a of arr) { + const v = a.value; + const sv = a.strValue; + if (sv === val) { + a.selected = true; + break; + } + } } - onChange(event: Event) { + onValueChange(event: Event) { if (this._disabled) return; @@ -142,7 +204,9 @@ export class NbpFidComboComponent extends NbpBaseComponent { } } - this.ngModel = sel; - this.ngModelChange.emit(this.ngModel); + this.value = sel; + this.ngModelChange.emit(this.value); + if (this.onChange) + this.onChange(this.value); } } \ No newline at end of file