@luizleon/sf.prefeiturasp.vuecomponents 4.1.0 → 4.1.2

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.
@@ -0,0 +1,8 @@
1
+ import { default as Keycloak, KeycloakInitOptions } from '../keycloak';
2
+ interface IAuthService {
3
+ Instance: Keycloak;
4
+ InitAsync: (initOptions?: KeycloakInitOptions) => Promise<boolean>;
5
+ isAuthenticated: boolean;
6
+ userinfo: Record<string, any> | null;
7
+ }
8
+ export { IAuthService };
@@ -0,0 +1,34 @@
1
+ declare class Utilities {
2
+ /**
3
+ * https://www.w3.org/TR/mediaqueries-4/#valdef-media-pointer-coarse
4
+ * The primary input mechanism of the device includes a pointing device of limited accuracy. Examples include touchscreens and motion-detection sensors (like the Kinect peripheral for the Xbox.)
5
+ */
6
+ static get IsTouch(): boolean;
7
+ /**
8
+ * Retorna o valor do z-index mais alto da página, sendo o valor mínimo 100.
9
+ * Sempre busca em:
10
+ * - body > *:not(script):not(style)
11
+ *
12
+ * Para adicionar outros, informe um array com os seletores.
13
+ * @example ['div.mydiv']
14
+ * @param seletores
15
+ */
16
+ static GetMaxZindex(seletores?: string[]): number;
17
+ /**
18
+ * Ajusta a data para o fuso horário do usuário.
19
+ *
20
+ * @param dt Data a ser ajustada
21
+ */
22
+ static AjustarFuso(dt: Date): void;
23
+ /**
24
+ * Aplique uma máscara a uma string.
25
+ * @example Mask("12345678901", "###.###.###-##")
26
+ * @param value
27
+ * @param mask
28
+ * @returns
29
+ */
30
+ static Mask(value: string, mask: string): string;
31
+ static MaskCpf(value: string): string;
32
+ static MaskCnpj(value: string): string;
33
+ }
34
+ export { Utilities };
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
- import { AppResult } from '../types';
2
+ import { AppResult } from '../common/appResult';
3
3
  declare class ApiClient {
4
4
  constructor();
5
5
  private axios;
package/dist/index.d.ts CHANGED
@@ -14,9 +14,10 @@ import { AppResult } from './common/appResult';
14
14
  import { AxiosClient, UseAxiosClient } from './axios/axiosClient';
15
15
  import { default as Keycloak } from './keycloak';
16
16
  import { ApiClient, UseApiClient } from './http-client/apiClient';
17
+ import { Utilities } from './common/utilities';
17
18
  declare function RemovePreloader(): void;
18
19
  declare function ToggleTheme(): void;
19
20
  declare function EnableDarkMode(): void;
20
21
  declare function EnableLightMode(): void;
21
- export { SfLayout, SfIcon, SfContent, SfTabNavigation, SfButton, SfDrawer, SfMessage, SfTooltip, SfNavMenu, StartAuthService, UseAuthService, UseNavMenuService, UseConfirmService, UseAlertService, UseAxiosClient, RemovePreloader, AppResult, AxiosClient, ToggleTheme, EnableDarkMode, EnableLightMode, Keycloak, ApiClient, UseApiClient, };
22
+ export { SfLayout, SfIcon, SfContent, SfTabNavigation, SfButton, SfDrawer, SfMessage, SfTooltip, SfNavMenu, StartAuthService, UseAuthService, UseNavMenuService, UseConfirmService, UseAlertService, UseAxiosClient, RemovePreloader, AppResult, AxiosClient, ToggleTheme, EnableDarkMode, EnableLightMode, Keycloak, ApiClient, UseApiClient, Utilities, };
22
23
  export * from './types';
@@ -1,5 +1,5 @@
1
- import { IAuthService } from '../types';
2
1
  import { KeycloakConfig, KeycloakInitOptions } from '../keycloak';
2
+ import { IAuthService } from '../common/auth';
3
3
  declare const UseAuthService: () => {
4
4
  Instance: {
5
5
  authenticated?: boolean | undefined;
@@ -113,20 +113,9 @@ declare const UseAuthService: () => {
113
113
  loadUserProfile: () => Promise<import('../keycloak').KeycloakProfile>;
114
114
  loadUserInfo: () => Promise<{}>;
115
115
  };
116
- InitAsync: (initOptions?: KeycloakInitOptions | undefined) => Promise<import('../types').User | null>;
116
+ InitAsync: (initOptions?: KeycloakInitOptions | undefined) => Promise<boolean>;
117
117
  isAuthenticated: boolean;
118
- User?: {
119
- name: string;
120
- email: string;
121
- username: string;
122
- roles: string[];
123
- groups: string[];
124
- emailVerified: boolean;
125
- firstName: string;
126
- lastName: string;
127
- sub: string;
128
- IsInRole: (role: string) => boolean;
129
- } | undefined;
118
+ userinfo: Record<string, any> | null;
130
119
  };
131
120
  declare const StartAuthService: (config: KeycloakConfig) => IAuthService;
132
121
  export { StartAuthService, UseAuthService };