@sapphire-caitlyn/schema-kit-ng 0.0.4 → 0.0.6

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.
Files changed (37) hide show
  1. package/README.md +2 -0
  2. package/docs/inputs/date/input-date/README.md +37 -0
  3. package/docs/inputs/date/input-date-span/README.md +36 -0
  4. package/docs/inputs/date/input-date-time/README.md +32 -0
  5. package/docs/inputs/date/input-date-time-span/README.md +32 -0
  6. package/docs/inputs/date/input-time/README.md +28 -0
  7. package/docs/inputs/date/input-time-span/README.md +29 -0
  8. package/docs/inputs/input-base/README.md +42 -0
  9. package/docs/inputs/input-bool/README.md +30 -0
  10. package/docs/inputs/input-color/README.md +24 -0
  11. package/docs/inputs/input-color/color-picker/README.md +25 -0
  12. package/docs/inputs/input-cpf-cnpj/README.md +34 -0
  13. package/docs/inputs/input-file/README.md +33 -0
  14. package/docs/inputs/input-icon/README.md +28 -0
  15. package/docs/inputs/input-json/README.md +36 -0
  16. package/docs/inputs/input-mask/README.md +39 -0
  17. package/docs/inputs/input-number/README.md +44 -0
  18. package/docs/inputs/input-phone/README.md +25 -0
  19. package/docs/inputs/input-select/README.md +42 -0
  20. package/docs/inputs/input-string/README.md +32 -0
  21. package/docs/inputs/input-text-area/README.md +27 -0
  22. package/docs/schema-table/README.md +444 -0
  23. package/docs/schema-view/README.md +439 -0
  24. package/docs/ui/blurry-text-reveal/README.md +49 -0
  25. package/docs/ui/breadcrumbs/README.md +62 -0
  26. package/docs/ui/file-preview/README.md +60 -0
  27. package/docs/ui/infinte-scroll/README.md +10 -0
  28. package/docs/ui/loading/README.md +62 -0
  29. package/docs/ui/save-button/README.md +68 -0
  30. package/docs/ui/schema-dialog/README.md +154 -0
  31. package/docs/ui/suspended-slider/README.md +95 -0
  32. package/docs/ui/tree-drag-drop/README.md +202 -0
  33. package/fesm2022/sapphire-caitlyn-schema-kit-ng-helm.mjs.map +1 -1
  34. package/fesm2022/sapphire-caitlyn-schema-kit-ng.mjs +106 -103
  35. package/fesm2022/sapphire-caitlyn-schema-kit-ng.mjs.map +1 -1
  36. package/package.json +1 -1
  37. package/types/sapphire-caitlyn-schema-kit-ng.d.ts +93 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire-caitlyn/schema-kit-ng",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^22.0.0",
6
6
  "@angular/common": "^22.2.0",
@@ -9,7 +9,7 @@ import { DateTime } from "luxon";
9
9
  import { ActivatedRoute, Router } from "@angular/router";
10
10
  import * as i1 from "@angular/common";
11
11
  import { CdkDragDrop, CdkDragMove } from "@angular/cdk/drag-drop";
12
- import { HlmDialog } from "@sapphire-caitlyn/schema-kit-ng/helm";
12
+ import { ButtonVariants, HlmDialog } from "@sapphire-caitlyn/schema-kit-ng/helm";
13
13
  export declare enum FieldType {
14
14
  UUID = "UUID",
15
15
  Bool = "Bool",
@@ -35,39 +35,41 @@ export declare enum FieldType {
35
35
  Icon = "Icon"
36
36
  }
37
37
  export declare const lstDateTypes: FieldType[];
38
+ /**
39
+ * Provê o ambiente da aplicação (lido de `window[environmentKey]`) como signals,
40
+ * permitindo a configuração e recuperação de variáveis de ambiente.
41
+ */
38
42
  export declare class EnvironmentService<Environment> {
39
- private environment;
43
+ private readonly _environment;
44
+ /**
45
+ * Ambiente da aplicação. Lança um erro ao ser lido se `window[environmentKey]` não estiver definido.
46
+ */
47
+ readonly environment: Signal<Environment>;
48
+ private readonly apiUrlGetter;
40
49
  /**
41
- * Construtor do serviço EnvironmentService.
42
- * Inicializa o ambiente a partir da variável global `window.environment`.
43
- * Lança um erro se o ambiente não estiver definido.
50
+ * URL da API. Recalcula quando o ambiente ou o getter registrado mudam.
44
51
  */
52
+ readonly apiUrl: Signal<string>;
45
53
  constructor();
46
54
  /**
47
- * @param env Define o ambiente da aplicação.
55
+ * Altera uma chave do ambiente. Gera um novo objeto para notificar quem depende do signal.
48
56
  */
49
57
  set<K extends keyof Environment>(key: K, value: Environment[K]): void;
50
58
  /**
51
- * Retorna o ambiente da aplicação.
52
- * Lança um erro se o ambiente não estiver definido.
53
- * @returns O ambiente da aplicação.
59
+ * Retorna uma chave do ambiente. Dentro de `computed`/`effect`/template, vira dependência.
54
60
  */
55
61
  get<K extends keyof Environment>(key: K): Environment[K];
56
62
  /**
57
- * Retorna a URL de um recurso.
63
+ * Retorna a URL de um recurso da API.
58
64
  * @param path O caminho do recurso.
59
- * @returns A URL do recurso.
60
65
  */
61
66
  resource(path: string): string;
62
- getEnvironment(): Environment;
63
67
  /**
64
- * Retorna a URL da API.
65
- * @returns A URL da API.
68
+ * Retorna o ambiente da aplicação. Equivale a ler o signal `environment`.
66
69
  */
67
- apiUrl(): string;
68
- private apiUrlGetter;
70
+ getEnvironment(): Environment;
69
71
  /**
70
- * Registra uma função que retorna a URL da API.
72
+ * Registra a função que retorna a URL da API.
71
73
  * @param getter A função que retorna a URL da API.
72
74
  */
73
75
  registerApiUrlGetter(getter: () => string): void;
@@ -1047,6 +1049,7 @@ export interface SchemaKitModuleInputOptions<Environment = any> {
1047
1049
  * Factory that returns the perfil checker. Runs in an injection context, so `inject()` is allowed.
1048
1050
  */
1049
1051
  perfilCheckerFactory?: () => PerfilCheckerFn;
1052
+ environmentKey: string;
1050
1053
  }
1051
1054
  export interface SchemaKitModuleOptions<Environment = any> extends Required<Omit<SchemaKitModuleInputOptions<Environment>, 'perfilCheckerFactory'>> {}
1052
1055
  export declare class SchemaTableActionsDirective<T = any> {
@@ -1799,6 +1802,79 @@ export declare class IdService {
1799
1802
  static ɵfac: i0.ɵɵFactoryDeclaration<IdService, never>;
1800
1803
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1801
1804
  }
1805
+ interface AlertButton {
1806
+ id: string;
1807
+ label: string;
1808
+ variant?: ButtonVariants['variant'];
1809
+ handler?: () => void | Promise<void>;
1810
+ }
1811
+ declare class AlertComponent {
1812
+ icon: import("@angular/core").InputSignal<string | undefined>;
1813
+ description: import("@angular/core").InputSignal<string | undefined>;
1814
+ buttons: import("@angular/core").InputSignal<AlertButton[]>;
1815
+ title: import("@angular/core").InputSignal<string | undefined>;
1816
+ size: import("@angular/core").InputSignal<"default" | "sm">;
1817
+ private dialogRef;
1818
+ /** Opens the alert and resolves with the id of the clicked button (undefined if dismissed). */
1819
+ present(): Promise<string | undefined>;
1820
+ onClick(button: AlertButton): Promise<void>;
1821
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
1822
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "alert", never, {
1823
+ "icon": {
1824
+ "alias": "icon";
1825
+ "required": false;
1826
+ "isSignal": true;
1827
+ };
1828
+ "description": {
1829
+ "alias": "description";
1830
+ "required": false;
1831
+ "isSignal": true;
1832
+ };
1833
+ "buttons": {
1834
+ "alias": "buttons";
1835
+ "required": false;
1836
+ "isSignal": true;
1837
+ };
1838
+ "title": {
1839
+ "alias": "title";
1840
+ "required": false;
1841
+ "isSignal": true;
1842
+ };
1843
+ "size": {
1844
+ "alias": "size";
1845
+ "required": false;
1846
+ "isSignal": true;
1847
+ };
1848
+ }, {}, never, never, true, never>;
1849
+ }
1850
+ export declare class AlertService {
1851
+ private appRef;
1852
+ private injector;
1853
+ /** Shows the alert and resolves with the id of the clicked button (undefined if dismissed). */
1854
+ present(options: {
1855
+ titulo: string;
1856
+ mensagem: string;
1857
+ icon?: string;
1858
+ size?: 'sm' | 'default';
1859
+ buttons: AlertButton[];
1860
+ }): Promise<string | undefined>;
1861
+ alert(options: {
1862
+ icon?: string;
1863
+ titulo: string;
1864
+ mensagem: string;
1865
+ variant?: ButtonVariants['variant'];
1866
+ }): Promise<void>;
1867
+ confirm(options: {
1868
+ icon?: string;
1869
+ titulo: string;
1870
+ mensagem: string;
1871
+ confirmar?: string;
1872
+ cancelar?: string;
1873
+ variant?: ButtonVariants['variant'];
1874
+ }): Promise<boolean>;
1875
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertService, never>;
1876
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
1877
+ }
1802
1878
  /** Opções para `cnpj.generate()`. */
1803
1879
  export interface GenerateOptions {
1804
1880
  /** Retorna o CNPJ com máscara `XX.XXX.XXX/XXXX-YY` quando `true`. */