@aurorajs.dev/core-front 1.0.1 → 1.0.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.
package/dist/index.d.mts CHANGED
@@ -1,3 +1,7 @@
1
+ import { KeyValue } from '@angular/common';
2
+ import { PipeTransform } from '@angular/core';
3
+ import { Operator } from '@aurorajs.dev/core-common';
4
+
1
5
  /**
2
6
  * Method decorator that blurs the currently focused DOM element
3
7
  * before executing the decorated method.
@@ -17,4 +21,45 @@
17
21
  */
18
22
  declare function BlurActiveElement(): MethodDecorator;
19
23
 
20
- export { BlurActiveElement };
24
+ /**
25
+ * Converts a TypeScript string enum into a sorted `KeyValue<string, string>[]`
26
+ * array, using a custom priority order.
27
+ *
28
+ * Enum keys present in the `order` array are sorted by their position;
29
+ * keys **not** included are appended at the end in their original declaration order.
30
+ *
31
+ * This pipe is **pure** — Angular only re-evaluates it when the input
32
+ * reference changes.
33
+ *
34
+ * @example
35
+ * ```html
36
+ * <!-- basic usage with custom order -->
37
+ * <mat-select formControlName="type">
38
+ * @for (type of MyEnum | enumOrder: myOrder; track type.key) {
39
+ * <mat-option [value]="type.key">{{ type.value }}</mat-option>
40
+ * }
41
+ * </mat-select>
42
+ * ```
43
+ *
44
+ * ```typescript
45
+ * // in the component
46
+ * myOrder: string[] = [
47
+ * MyEnum.FIRST,
48
+ * MyEnum.SECOND,
49
+ * MyEnum.THIRD,
50
+ * ];
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```html
55
+ * <!-- without order array — keeps original enum declaration order -->
56
+ * @for (type of MyEnum | enumOrder; track type.key) { ... }
57
+ * ```
58
+ */
59
+ declare class EnumOrderPipe implements PipeTransform {
60
+ transform(enumObj: Record<string, string>, order?: string[]): KeyValue<string, string>[];
61
+ }
62
+
63
+ type ContactOperator = Operator.and | Operator.or;
64
+
65
+ export { BlurActiveElement, type ContactOperator, EnumOrderPipe };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import { KeyValue } from '@angular/common';
2
+ import { PipeTransform } from '@angular/core';
3
+ import { Operator } from '@aurorajs.dev/core-common';
4
+
1
5
  /**
2
6
  * Method decorator that blurs the currently focused DOM element
3
7
  * before executing the decorated method.
@@ -17,4 +21,45 @@
17
21
  */
18
22
  declare function BlurActiveElement(): MethodDecorator;
19
23
 
20
- export { BlurActiveElement };
24
+ /**
25
+ * Converts a TypeScript string enum into a sorted `KeyValue<string, string>[]`
26
+ * array, using a custom priority order.
27
+ *
28
+ * Enum keys present in the `order` array are sorted by their position;
29
+ * keys **not** included are appended at the end in their original declaration order.
30
+ *
31
+ * This pipe is **pure** — Angular only re-evaluates it when the input
32
+ * reference changes.
33
+ *
34
+ * @example
35
+ * ```html
36
+ * <!-- basic usage with custom order -->
37
+ * <mat-select formControlName="type">
38
+ * @for (type of MyEnum | enumOrder: myOrder; track type.key) {
39
+ * <mat-option [value]="type.key">{{ type.value }}</mat-option>
40
+ * }
41
+ * </mat-select>
42
+ * ```
43
+ *
44
+ * ```typescript
45
+ * // in the component
46
+ * myOrder: string[] = [
47
+ * MyEnum.FIRST,
48
+ * MyEnum.SECOND,
49
+ * MyEnum.THIRD,
50
+ * ];
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```html
55
+ * <!-- without order array — keeps original enum declaration order -->
56
+ * @for (type of MyEnum | enumOrder; track type.key) { ... }
57
+ * ```
58
+ */
59
+ declare class EnumOrderPipe implements PipeTransform {
60
+ transform(enumObj: Record<string, string>, order?: string[]): KeyValue<string, string>[];
61
+ }
62
+
63
+ type ContactOperator = Operator.and | Operator.or;
64
+
65
+ export { BlurActiveElement, type ContactOperator, EnumOrderPipe };