dolfo-angular 1.196.0 → 1.198.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -680,6 +680,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
680
680
  type: Output
681
681
  }] } });
682
682
 
683
+ class IconWrapperComponent {
684
+ name;
685
+ iconComponent = inject(ICON_COMPONENT);
686
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IconWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
687
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: IconWrapperComponent, isStandalone: false, selector: "dolfo-icon", inputs: { name: "name" }, ngImport: i0, template: `<ng-container [ngComponentOutlet]="iconComponent" [ngComponentOutletInputs]="{ name }"></ng-container>`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
688
+ }
689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IconWrapperComponent, decorators: [{
690
+ type: Component,
691
+ args: [{
692
+ selector: "dolfo-icon",
693
+ standalone: false,
694
+ template: `<ng-container [ngComponentOutlet]="iconComponent" [ngComponentOutletInputs]="{ name }"></ng-container>`,
695
+ changeDetection: ChangeDetectionStrategy.OnPush
696
+ }]
697
+ }], propDecorators: { name: [{
698
+ type: Input,
699
+ args: [{ required: true }]
700
+ }] } });
701
+
683
702
  class ComboboxComponent extends BaseFormInput {
684
703
  cdr;
685
704
  combo;
@@ -690,6 +709,7 @@ class ComboboxComponent extends BaseFormInput {
690
709
  onBlur = new EventEmitter();
691
710
  opened = signal(false, ...(ngDevMode ? [{ debugName: "opened" }] : []));
692
711
  currentFocus = signal(null, ...(ngDevMode ? [{ debugName: "currentFocus" }] : []));
712
+ comboLabel = signal("", ...(ngDevMode ? [{ debugName: "comboLabel" }] : []));
693
713
  constructor(cdr) {
694
714
  super();
695
715
  this.cdr = cdr;
@@ -699,6 +719,11 @@ class ComboboxComponent extends BaseFormInput {
699
719
  else if (!this.opened() && !condition)
700
720
  this.opened.set(true);
701
721
  }));
722
+ this.addSubscription(this.input.valueChanges.subscribe(value => this.comboLabel.set(this.extractLabel(value))));
723
+ }
724
+ ngOnChanges(changes) {
725
+ if (changes.options && !isDeepEqual(changes.options.previousValue, changes.options.currentValue))
726
+ this.input.setValue(null);
702
727
  }
703
728
  ngAfterViewInit() {
704
729
  super.ngAfterViewInit();
@@ -726,12 +751,11 @@ class ComboboxComponent extends BaseFormInput {
726
751
  }
727
752
  }));
728
753
  }
729
- extractLabel = () => {
730
- const { value } = this.input;
754
+ extractLabel = (value) => {
731
755
  if (value == null || value?.length === 0)
732
756
  return this.placeHolder || " ";
733
757
  if (!this.multiple)
734
- return this.options.find(opt => isDeepEqual(opt.value, value)).label;
758
+ return this.options.find(opt => isDeepEqual(opt.value, value))?.label;
735
759
  return this.options.filter(opt => value.some(o => isDeepEqual(opt.value, o))).map(opt => opt.label).join(", ");
736
760
  };
737
761
  focus = (e) => {
@@ -764,15 +788,23 @@ class ComboboxComponent extends BaseFormInput {
764
788
  return isDeepEqual(value, opt.value);
765
789
  return value.some(o => isDeepEqual(opt.value, o));
766
790
  };
791
+ get hasValue() {
792
+ return this.multiple ? this.input.value != null && this.input.value.length > 0 : this.input.value != null;
793
+ }
767
794
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ComboboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
768
795
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: ComboboxComponent, isStandalone: false, selector: "dolfo-combobox", inputs: { options: "options", placeHolder: "placeHolder", multiple: ["multiple", "multiple", booleanAttribute] }, outputs: { onFocus: "onFocus", onBlur: "onBlur" }, providers: [
769
796
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ComboboxComponent), multi: true },
770
797
  { provide: NG_VALIDATORS, useExisting: forwardRef(() => ComboboxComponent), multi: true },
771
798
  { provide: BaseFormInput, useExisting: ComboboxComponent }
772
- ], viewQueries: [{ propertyName: "combo", first: true, predicate: ["combo"], descendants: true }], usesInheritance: true, ngImport: i0, template: `<dolfo-input-container>
773
- <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event)" [class.disabled]="input.disabled">
799
+ ], viewQueries: [{ propertyName: "combo", first: true, predicate: ["combo"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<dolfo-input-container>
800
+ <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event); opened.set(false)" [class.disabled]="input.disabled">
774
801
  <div class="combobox-label">
775
- <span>{{ extractLabel() | translate }}</span>
802
+ @if(hasValue && !input.disabled){
803
+ <dolfo-icon [dolfoTooltip]="'form.resetValue' | translate" name="cross" (click)="input.setValue(null); $event.stopPropagation()"></dolfo-icon>
804
+ }@else {
805
+ <dolfo-icon name="circle-down" class="combo-icon"></dolfo-icon>
806
+ }
807
+ <span>{{ comboLabel() | translate }}</span>
776
808
  </div>
777
809
 
778
810
  <div class="combobox-options" [class.opened]="opened()">
@@ -785,16 +817,21 @@ class ComboboxComponent extends BaseFormInput {
785
817
 
786
818
  <input type="hidden" [formControl]="input" />
787
819
  </div>
788
- </dolfo-input-container>`, isInline: true, dependencies: [{ kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: InputContainerComponent, selector: "dolfo-input-container" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
820
+ </dolfo-input-container>`, isInline: true, dependencies: [{ kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: TooltipDirective, selector: "[dolfoTooltip]", inputs: ["dolfoTooltip", "direction"] }, { kind: "component", type: IconWrapperComponent, selector: "dolfo-icon", inputs: ["name"] }, { kind: "component", type: InputContainerComponent, selector: "dolfo-input-container" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
789
821
  }
790
822
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ComboboxComponent, decorators: [{
791
823
  type: Component,
792
824
  args: [{
793
825
  selector: "dolfo-combobox",
794
826
  template: `<dolfo-input-container>
795
- <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event)" [class.disabled]="input.disabled">
827
+ <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event); opened.set(false)" [class.disabled]="input.disabled">
796
828
  <div class="combobox-label">
797
- <span>{{ extractLabel() | translate }}</span>
829
+ @if(hasValue && !input.disabled){
830
+ <dolfo-icon [dolfoTooltip]="'form.resetValue' | translate" name="cross" (click)="input.setValue(null); $event.stopPropagation()"></dolfo-icon>
831
+ }@else {
832
+ <dolfo-icon name="circle-down" class="combo-icon"></dolfo-icon>
833
+ }
834
+ <span>{{ comboLabel() | translate }}</span>
798
835
  </div>
799
836
 
800
837
  <div class="combobox-options" [class.opened]="opened()">
@@ -937,25 +974,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
937
974
  args: [BaseFormInput]
938
975
  }] } });
939
976
 
940
- class IconWrapperComponent {
941
- name;
942
- iconComponent = inject(ICON_COMPONENT);
943
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IconWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
944
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: IconWrapperComponent, isStandalone: false, selector: "dolfo-icon", inputs: { name: "name" }, ngImport: i0, template: `<ng-container [ngComponentOutlet]="iconComponent" [ngComponentOutletInputs]="{ name }"></ng-container>`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
945
- }
946
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: IconWrapperComponent, decorators: [{
947
- type: Component,
948
- args: [{
949
- selector: "dolfo-icon",
950
- standalone: false,
951
- template: `<ng-container [ngComponentOutlet]="iconComponent" [ngComponentOutletInputs]="{ name }"></ng-container>`,
952
- changeDetection: ChangeDetectionStrategy.OnPush
953
- }]
954
- }], propDecorators: { name: [{
955
- type: Input,
956
- args: [{ required: true }]
957
- }] } });
958
-
959
977
  const CONTEXT_MENU_DESTROY_TOKEN = new InjectionToken("CONTEXT_MENU_DESTROY_TOKEN");
960
978
  class ContextMenuComponent extends Subscriptable {
961
979
  x;
@@ -2075,6 +2093,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2075
2093
  }]
2076
2094
  }] });
2077
2095
 
2096
+ class LoaderComponent {
2097
+ langKey = "loading";
2098
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2099
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: LoaderComponent, isStandalone: false, selector: "dolfo-loader", inputs: { langKey: "langKey" }, ngImport: i0, template: `<div class="loading">
2100
+ <dolfo-icon name="spinner5"></dolfo-icon>
2101
+ {{ langKey | translate }}
2102
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "dolfo-icon", inputs: ["name"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2103
+ }
2104
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
2105
+ type: Component,
2106
+ args: [{
2107
+ selector: "dolfo-loader",
2108
+ standalone: false,
2109
+ template: `<div class="loading">
2110
+ <dolfo-icon name="spinner5"></dolfo-icon>
2111
+ {{ langKey | translate }}
2112
+ </div>`,
2113
+ changeDetection: ChangeDetectionStrategy.OnPush
2114
+ }]
2115
+ }], propDecorators: { langKey: [{
2116
+ type: Input
2117
+ }] } });
2118
+
2119
+ class LayoutModule {
2120
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2121
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, declarations: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent], imports: [CommonModule, DirectivesModule, TranslatePipe], exports: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent] });
2122
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, imports: [CommonModule, DirectivesModule] });
2123
+ }
2124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, decorators: [{
2125
+ type: NgModule,
2126
+ args: [{
2127
+ declarations: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent],
2128
+ imports: [CommonModule, DirectivesModule, TranslatePipe],
2129
+ exports: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent]
2130
+ }]
2131
+ }] });
2132
+
2078
2133
  class InputCheckboxComponent extends BaseFormInput {
2079
2134
  toggleCheck = () => this.input.setValue(!this.input.value);
2080
2135
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: InputCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -2111,55 +2166,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2111
2166
 
2112
2167
  class FormModule {
2113
2168
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2114
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: FormModule, declarations: [InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent], imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule], exports: [ReactiveFormsModule, InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent] });
2115
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, imports: [CommonModule, ReactiveFormsModule, DirectivesModule, ReactiveFormsModule] });
2169
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: FormModule, declarations: [InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent], imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule, LayoutModule], exports: [ReactiveFormsModule, InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent] });
2170
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, imports: [CommonModule, ReactiveFormsModule, DirectivesModule, LayoutModule, ReactiveFormsModule] });
2116
2171
  }
2117
2172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, decorators: [{
2118
2173
  type: NgModule,
2119
2174
  args: [{
2120
2175
  declarations: [InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent],
2121
- imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule],
2176
+ imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule, LayoutModule],
2122
2177
  exports: [ReactiveFormsModule, InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent]
2123
2178
  }]
2124
2179
  }] });
2125
2180
 
2126
- class LoaderComponent {
2127
- langKey = "loading";
2128
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2129
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", type: LoaderComponent, isStandalone: false, selector: "dolfo-loader", inputs: { langKey: "langKey" }, ngImport: i0, template: `<div class="loading">
2130
- <dolfo-icon name="spinner5"></dolfo-icon>
2131
- {{ langKey | translate }}
2132
- </div>`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "dolfo-icon", inputs: ["name"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2133
- }
2134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
2135
- type: Component,
2136
- args: [{
2137
- selector: "dolfo-loader",
2138
- standalone: false,
2139
- template: `<div class="loading">
2140
- <dolfo-icon name="spinner5"></dolfo-icon>
2141
- {{ langKey | translate }}
2142
- </div>`,
2143
- changeDetection: ChangeDetectionStrategy.OnPush
2144
- }]
2145
- }], propDecorators: { langKey: [{
2146
- type: Input
2147
- }] } });
2148
-
2149
- class LayoutModule {
2150
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2151
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, declarations: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent], imports: [CommonModule, DirectivesModule, TranslatePipe], exports: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent] });
2152
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, imports: [CommonModule, DirectivesModule] });
2153
- }
2154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, decorators: [{
2155
- type: NgModule,
2156
- args: [{
2157
- declarations: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent],
2158
- imports: [CommonModule, DirectivesModule, TranslatePipe],
2159
- exports: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent]
2160
- }]
2161
- }] });
2162
-
2163
2181
  class DialogLayoutModule {
2164
2182
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DialogLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2165
2183
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: DialogLayoutModule, declarations: [DialogComponent, DialogContentComponent, DialogHeaderComponent, DialogFooterComponent, DialogLayoutComponent], imports: [CommonModule, DirectivesModule, LayoutModule, ReactiveFormsModule, TranslatePipe, FormModule], exports: [DialogComponent, DialogContentComponent, DialogHeaderComponent, DialogFooterComponent, DialogLayoutComponent] });