dolfo-angular 1.196.0 → 1.197.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,21 @@ 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>
799
+ ], viewQueries: [{ propertyName: "combo", first: true, predicate: ["combo"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `<dolfo-input-container>
773
800
  <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event)" [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
+ }
805
+ <span>{{ comboLabel() | translate }}</span>
776
806
  </div>
777
807
 
778
808
  <div class="combobox-options" [class.opened]="opened()">
@@ -785,7 +815,7 @@ class ComboboxComponent extends BaseFormInput {
785
815
 
786
816
  <input type="hidden" [formControl]="input" />
787
817
  </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 });
818
+ </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
819
  }
790
820
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ComboboxComponent, decorators: [{
791
821
  type: Component,
@@ -794,7 +824,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
794
824
  template: `<dolfo-input-container>
795
825
  <div class="combobox" [class.opened]="opened()" #combo tabindex="0" (focus)="focus($event)" (blur)="onBlur.emit($event)" [class.disabled]="input.disabled">
796
826
  <div class="combobox-label">
797
- <span>{{ extractLabel() | translate }}</span>
827
+ @if(hasValue && !input.disabled){
828
+ <dolfo-icon [dolfoTooltip]="'form.resetValue' | translate" name="cross" (click)="input.setValue(null); $event.stopPropagation()"></dolfo-icon>
829
+ }
830
+ <span>{{ comboLabel() | translate }}</span>
798
831
  </div>
799
832
 
800
833
  <div class="combobox-options" [class.opened]="opened()">
@@ -937,25 +970,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
937
970
  args: [BaseFormInput]
938
971
  }] } });
939
972
 
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
973
  const CONTEXT_MENU_DESTROY_TOKEN = new InjectionToken("CONTEXT_MENU_DESTROY_TOKEN");
960
974
  class ContextMenuComponent extends Subscriptable {
961
975
  x;
@@ -2075,6 +2089,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2075
2089
  }]
2076
2090
  }] });
2077
2091
 
2092
+ class LoaderComponent {
2093
+ langKey = "loading";
2094
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2095
+ 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">
2096
+ <dolfo-icon name="spinner5"></dolfo-icon>
2097
+ {{ langKey | translate }}
2098
+ </div>`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "dolfo-icon", inputs: ["name"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2099
+ }
2100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
2101
+ type: Component,
2102
+ args: [{
2103
+ selector: "dolfo-loader",
2104
+ standalone: false,
2105
+ template: `<div class="loading">
2106
+ <dolfo-icon name="spinner5"></dolfo-icon>
2107
+ {{ langKey | translate }}
2108
+ </div>`,
2109
+ changeDetection: ChangeDetectionStrategy.OnPush
2110
+ }]
2111
+ }], propDecorators: { langKey: [{
2112
+ type: Input
2113
+ }] } });
2114
+
2115
+ class LayoutModule {
2116
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2117
+ 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] });
2118
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, imports: [CommonModule, DirectivesModule] });
2119
+ }
2120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: LayoutModule, decorators: [{
2121
+ type: NgModule,
2122
+ args: [{
2123
+ declarations: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent],
2124
+ imports: [CommonModule, DirectivesModule, TranslatePipe],
2125
+ exports: [ButtonComponent, ContextMenuComponent, IconWrapperComponent, LoaderComponent, NotificationComponent, TooltipComponent, IconComponent, PopoverComponent]
2126
+ }]
2127
+ }] });
2128
+
2078
2129
  class InputCheckboxComponent extends BaseFormInput {
2079
2130
  toggleCheck = () => this.input.setValue(!this.input.value);
2080
2131
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: InputCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -2111,55 +2162,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2111
2162
 
2112
2163
  class FormModule {
2113
2164
  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] });
2165
+ 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] });
2166
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, imports: [CommonModule, ReactiveFormsModule, DirectivesModule, LayoutModule, ReactiveFormsModule] });
2116
2167
  }
2117
2168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: FormModule, decorators: [{
2118
2169
  type: NgModule,
2119
2170
  args: [{
2120
2171
  declarations: [InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent],
2121
- imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule],
2172
+ imports: [CommonModule, ReactiveFormsModule, TranslatePipe, DirectivesModule, LayoutModule],
2122
2173
  exports: [ReactiveFormsModule, InputTextComponent, InputContainerComponent, ComboboxComponent, DatepickerComponent, AutocompleteComponent, InputRadioComponent, InputCheckboxComponent]
2123
2174
  }]
2124
2175
  }] });
2125
2176
 
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
2177
  class DialogLayoutModule {
2164
2178
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DialogLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2165
2179
  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] });