@sapphire-ion/framework 1.0.35 → 1.0.37

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.
@@ -1,7 +1,7 @@
1
1
  import { AfterViewInit, ElementRef, InputSignal, ModelSignal, Signal, TemplateRef, WritableSignal } from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
- import { InfiniteScrollCustomEvent, IonContent, IonModal } from '@ionic/angular';
4
- import { InputSelectConfiguration } from './input.select.configuration';
3
+ import { ActionSheetButton, AlertInput, InfiniteScrollCustomEvent, IonActionSheet, IonAlert, IonContent, IonModal } from '@ionic/angular';
4
+ import { InputSelectConfiguration, SelectInterfaces } from './input.select.configuration';
5
5
  import { SIonPopoverComponent } from '../../popover/sion-popover/sion-popover.component';
6
6
  import { CustomInput } from '../custom-input';
7
7
  import { PlaceholderTemplateContext } from './directives/sion-placeholder-template.directive';
@@ -9,6 +9,7 @@ import { OptionTemplateContext } from './directives/sion-option-template.directi
9
9
  import { LabelTemplateContext } from './directives/sion-label-template.directive';
10
10
  import * as i0 from "@angular/core";
11
11
  export declare class InputSelectComponent<T = any> extends CustomInput<T | T[]> implements AfterViewInit {
12
+ SelectInterfaces: typeof SelectInterfaces;
12
13
  /** Items disponíveis no select */
13
14
  items: ModelSignal<any[]>;
14
15
  /** Configuração do select */
@@ -19,6 +20,8 @@ export declare class InputSelectComponent<T = any> extends CustomInput<T | T[]>
19
20
  SetCurrentItemLabel(): void;
20
21
  lstOptionsItemValue: Signal<ItemValue<any>[]>;
21
22
  lstOptions: ItemValue<any>[];
23
+ lstOptionsAlert: AlertInput[];
24
+ lstOptionsActionSheet: ActionSheetButton[];
22
25
  infiniteScrollPage: WritableSignal<number>;
23
26
  AddPage(event: InfiniteScrollCustomEvent): void;
24
27
  UpdateLstOptions(search: string): void;
@@ -51,6 +54,8 @@ export declare class InputSelectComponent<T = any> extends CustomInput<T | T[]>
51
54
  selectContent: ElementRef<HTMLDivElement>;
52
55
  popover: SIonPopoverComponent;
53
56
  modal: IonModal;
57
+ alert: IonAlert;
58
+ actionSheet: IonActionSheet;
54
59
  floatingVisible: boolean;
55
60
  ionContent: IonContent;
56
61
  Present(event: Event): Promise<void>;
@@ -9,6 +9,16 @@ export type DefaultModelOptions = {
9
9
  value: string;
10
10
  label: string;
11
11
  };
12
+ export declare enum SelectInterfaces {
13
+ /** Interface padrão do select
14
+ * Popover quando web, Modal quando mobile
15
+ */
16
+ Dynamic = 0,
17
+ Popover = 0,
18
+ Modal = 1,
19
+ Alert = 2,
20
+ ActionSheet = 3
21
+ }
12
22
  export declare class InputSelectConfiguration {
13
23
  /** Valor que será setado no formControl */
14
24
  bindValue: string | ((obj: any) => any);
@@ -45,6 +55,7 @@ export declare class InputSelectConfiguration {
45
55
  useInfiniteScroll?: boolean;
46
56
  placeholder?: string;
47
57
  noItensFoundText?: string;
58
+ interface?: SelectInterfaces;
48
59
  }): InputSelectConfiguration;
49
60
  placeholder: string;
50
61
  noItensFoundText: string;
@@ -58,6 +69,8 @@ export declare class InputSelectConfiguration {
58
69
  };
59
70
  vFiltros: ViewFiltros | null;
60
71
  useInfiniteScroll: boolean;
72
+ /** Interface do select */
73
+ interface: SelectInterfaces;
61
74
  constructor(
62
75
  /** Valor que será setado no formControl */
63
76
  bindValue?: string | ((obj: any) => any),
@@ -23,8 +23,9 @@ import * as i21 from "@maskito/angular";
23
23
  import * as i22 from "../popover/sion-popover.module";
24
24
  import * as i23 from "../loading/loading.component";
25
25
  import * as i24 from "../../directives/ng-var.directive";
26
+ import * as i25 from "@angular/cdk/overlay";
26
27
  export declare class InputsModule {
27
28
  static ɵfac: i0.ɵɵFactoryDeclaration<InputsModule, never>;
28
- static ɵmod: i0.ɵɵNgModuleDeclaration<InputsModule, [typeof i1.InputBoolComponent, typeof i2.InputCepComponent, typeof i3.InputColorComponent, typeof i4.InputCpfCnpjComponent, typeof i5.InputDateComponent, typeof i6.InputDecimalComponent, typeof i7.InputFileComponent, typeof i8.InputIconComponent, typeof i9.InputSelectComponent, typeof i10.SIonLabelTemplateDirective, typeof i11.SIonOptionTemplateDirective, typeof i12.SIonPlaceholderTemplateDirective, typeof i13.InputStringComponent, typeof i14.InputTelefoneComponent, typeof i15.InputTextareaComponent, typeof i16.DownloadButtonComponent], [typeof i17.IonicModule, typeof i18.CommonModule, typeof i19.ReactiveFormsModule, typeof i19.FormsModule, typeof i20.ImageComponent, typeof i21.MaskitoDirective, typeof i22.SIonPopoverModule, typeof i23.LoadingComponent, typeof i24.NgVarDirective], [typeof i1.InputBoolComponent, typeof i2.InputCepComponent, typeof i3.InputColorComponent, typeof i4.InputCpfCnpjComponent, typeof i5.InputDateComponent, typeof i6.InputDecimalComponent, typeof i7.InputFileComponent, typeof i8.InputIconComponent, typeof i9.InputSelectComponent, typeof i10.SIonLabelTemplateDirective, typeof i11.SIonOptionTemplateDirective, typeof i12.SIonPlaceholderTemplateDirective, typeof i13.InputStringComponent, typeof i14.InputTelefoneComponent, typeof i15.InputTextareaComponent, typeof i16.DownloadButtonComponent]>;
29
+ static ɵmod: i0.ɵɵNgModuleDeclaration<InputsModule, [typeof i1.InputBoolComponent, typeof i2.InputCepComponent, typeof i3.InputColorComponent, typeof i4.InputCpfCnpjComponent, typeof i5.InputDateComponent, typeof i6.InputDecimalComponent, typeof i7.InputFileComponent, typeof i8.InputIconComponent, typeof i9.InputSelectComponent, typeof i10.SIonLabelTemplateDirective, typeof i11.SIonOptionTemplateDirective, typeof i12.SIonPlaceholderTemplateDirective, typeof i13.InputStringComponent, typeof i14.InputTelefoneComponent, typeof i15.InputTextareaComponent, typeof i16.DownloadButtonComponent], [typeof i17.IonicModule, typeof i18.CommonModule, typeof i19.ReactiveFormsModule, typeof i19.FormsModule, typeof i20.ImageComponent, typeof i21.MaskitoDirective, typeof i22.SIonPopoverModule, typeof i23.LoadingComponent, typeof i24.NgVarDirective, typeof i25.OverlayModule], [typeof i1.InputBoolComponent, typeof i2.InputCepComponent, typeof i3.InputColorComponent, typeof i4.InputCpfCnpjComponent, typeof i5.InputDateComponent, typeof i6.InputDecimalComponent, typeof i7.InputFileComponent, typeof i8.InputIconComponent, typeof i9.InputSelectComponent, typeof i10.SIonLabelTemplateDirective, typeof i11.SIonOptionTemplateDirective, typeof i12.SIonPlaceholderTemplateDirective, typeof i13.InputStringComponent, typeof i14.InputTelefoneComponent, typeof i15.InputTextareaComponent, typeof i16.DownloadButtonComponent]>;
29
30
  static ɵinj: i0.ɵɵInjectorDeclaration<InputsModule>;
30
31
  }
@@ -1,9 +1,8 @@
1
- import { ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, TemplateRef, ViewContainerRef, ViewRef } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, ViewRef } from '@angular/core';
2
2
  import { ComputePositionReturn, Placement } from '@floating-ui/dom';
3
3
  import * as i0 from "@angular/core";
4
4
  type Fill = 'solid' | 'outline' | 'blur' | 'clear';
5
- export declare class SIonPopoverComponent implements OnInit, OnDestroy {
6
- private viewContainerRef;
5
+ export declare class SIonPopoverComponent implements AfterViewInit, OnDestroy {
7
6
  private ngZone;
8
7
  fill: Fill;
9
8
  arrow: boolean;
@@ -16,17 +15,13 @@ export declare class SIonPopoverComponent implements OnInit, OnDestroy {
16
15
  onWillDismiss: EventEmitter<void>;
17
16
  onDidDismiss: EventEmitter<void>;
18
17
  anchor: HTMLElement | undefined;
19
- constructor(viewContainerRef: ViewContainerRef, ngZone: NgZone);
20
- popoverTemplate: TemplateRef<any>;
18
+ constructor(ngZone: NgZone);
21
19
  contentContainer: ElementRef<HTMLDivElement>;
22
- arrowElement: ElementRef<HTMLElement>;
23
- ngOnInit(): void;
20
+ ngAfterViewInit(): void;
24
21
  documentClickListener: (event: MouseEvent) => void;
25
22
  viewRef?: ViewRef;
26
23
  private _embeddedView?;
27
- CreateEmbeddedView(): void;
28
24
  private _instance?;
29
- CreateInstance(): void;
30
25
  get arrowEl(): HTMLElement | undefined;
31
26
  private cleanupAutoUpdate?;
32
27
  state: POPOVER_STATE;
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./sion-popover/sion-popover.component";
3
3
  import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/cdk/overlay";
4
5
  export declare class SIonPopoverModule {
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<SIonPopoverModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<SIonPopoverModule, [typeof i1.SIonPopoverComponent], [typeof i2.CommonModule], [typeof i1.SIonPopoverComponent]>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SIonPopoverModule, [typeof i1.SIonPopoverComponent], [typeof i2.CommonModule, typeof i3.OverlayModule], [typeof i1.SIonPopoverComponent]>;
7
8
  static ɵinj: i0.ɵɵInjectorDeclaration<SIonPopoverModule>;
8
9
  }
@@ -1,9 +1,12 @@
1
1
  import { InjectionToken, ModuleWithProviders } from '@angular/core';
2
2
  import { Environment } from './classes/environment';
3
+ import { ModalFocusTrapService } from './services/modal-focus-trap.service';
3
4
  import * as i0 from "@angular/core";
4
5
  import * as i1 from "@angular/common";
5
6
  export declare const EnvironmentInjectionToken: InjectionToken<Environment>;
6
7
  export declare class SapphireIonFrameworkModule {
8
+ private mis;
9
+ constructor(mis: ModalFocusTrapService);
7
10
  static forRoot(config: Environment): ModuleWithProviders<SapphireIonFrameworkModule>;
8
11
  static ɵfac: i0.ɵɵFactoryDeclaration<SapphireIonFrameworkModule, never>;
9
12
  static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireIonFrameworkModule, never, [typeof i1.CommonModule], never>;
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Corrige o focus trap em modais do Ionic, permite que o foco não fique preso dentro do modal.
4
+ * Utilizado para concertar interatividade com popovers e outros elementos que podem ser interativos fora do modal.
5
+ */
6
+ export declare class ModalFocusTrapService {
7
+ constructor();
8
+ private initGlobalFocusTrapDisable;
9
+ private setupModalObserver;
10
+ private disableFocusTrap;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalFocusTrapService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModalFocusTrapService>;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire-ion/framework",
3
- "version": "1.0.35",
3
+ "version": "1.0.37",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^18.2.8",
@@ -1,7 +1,7 @@
1
1
  .popover-wrapper {
2
- @apply absolute z-50 rounded-xl;
2
+ @apply z-50 rounded-xl;
3
3
  width: max-content;
4
- position: absolute;
4
+ position: fixed;
5
5
  will-change: left, top, bottom, right, auto, opacity, filter;
6
6
  opacity: 0;
7
7
  transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out, filter 0.15s ease-in-out;
@@ -11,6 +11,8 @@
11
11
 
12
12
  filter: grayscale(0.9);
13
13
  transform: scale(0.95);
14
+ pointer-events: auto !important;
15
+ z-index: 10001 !important; // Ensure it's above the modal
14
16
  }
15
17
  .popover-arrow{
16
18
  @apply rounded-sm;
@@ -24,5 +26,5 @@
24
26
  opacity: 1;
25
27
  }
26
28
  .popover-wrapper:not(.show) {
27
- pointer-events: none;
29
+ pointer-events: none !important;
28
30
  }
@@ -467,4 +467,5 @@ text-tooltip{
467
467
  hsl(from var(--color-primary , var(--ion-color-primary)) h s l / var(--step-1-opacity, 0.7)),
468
468
  hsl(from var(--color-primary , var(--ion-color-primary)) h s l / var(--step-2-opacity, 0.3))),
469
469
  hsl(from var(--color-secondary, var(--ion-color-light)) h s l / var(--step-3-opacity, 0.2));
470
- }
470
+ }
471
+
@@ -5,4 +5,4 @@ ion-modal{
5
5
  }
6
6
  overflow: hidden;
7
7
  }
8
- }
8
+ }