bpm-core 0.0.125 → 0.0.127

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.
@@ -36,7 +36,7 @@ export declare class ActionButtonsComponent implements AfterViewInit {
36
36
  onSubmit(action: string): void;
37
37
  submitForm(action: string, section: Section): void;
38
38
  success(response: any): void;
39
- buttonShape(item: any): "" | "outline";
39
+ buttonShape(item: any): "outline" | "";
40
40
  buttonColor(item: any): "" | "red";
41
41
  static ɵfac: i0.ɵɵFactoryDeclaration<ActionButtonsComponent, never>;
42
42
  static ɵcmp: i0.ɵɵComponentDeclaration<ActionButtonsComponent, "lib-action-buttons", never, { "lovOptions": { "alias": "lovOptions"; "required": false; }; "lovType": { "alias": "lovType"; "required": false; }; "fieldsForm": { "alias": "fieldsForm"; "required": false; }; "form": { "alias": "form"; "required": false; }; "section": { "alias": "section"; "required": false; }; "sections": { "alias": "sections"; "required": false; }; "showApprovalCycle": { "alias": "showApprovalCycle"; "required": false; }; "customCall": { "alias": "customCall"; "required": false; }; }, { "resetFormEmit": "resetFormEmit"; "customCallEmit": "customCallEmit"; }, never, never, true, never>;
@@ -4,7 +4,10 @@ import { ControlValueAccessorDirective } from "../control-value-accessor.directi
4
4
  import { MatDialog } from "@angular/material/dialog";
5
5
  import { MatPaginator } from "@angular/material/paginator";
6
6
  import { MatTableDataSource } from "@angular/material/table";
7
+ import { MatPaginatorIntl } from '@angular/material/paginator';
8
+ import { CoreI18nService } from '../../../../services/i18n.service';
7
9
  import * as i0 from "@angular/core";
10
+ export declare function getPaginatorIntl(i18nService: CoreI18nService): MatPaginatorIntl;
8
11
  export declare class AttachmentSectionComponent extends ControlValueAccessorDirective<any> implements AfterViewInit {
9
12
  className: string;
10
13
  downloadActionClicked: EventEmitter<any>;
@@ -123,7 +123,7 @@ export declare class DocsUploaderComponent<Type> extends ControlValueAccessorDir
123
123
  private deleteFileContents;
124
124
  private reset;
125
125
  static ɵfac: i0.ɵɵFactoryDeclaration<DocsUploaderComponent<any>, never>;
126
- static ɵcmp: i0.ɵɵComponentDeclaration<DocsUploaderComponent<any>, "app-file-uploader", never, { "useCrop": { "alias": "useCrop"; "required": false; }; "formKey": { "alias": "formKey"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "downloadLink": { "alias": "downloadLink"; "required": false; }; "showActions": { "alias": "showActions"; "required": false; }; "styleHeight": { "alias": "styleHeight"; "required": false; }; "fileInputHeight": { "alias": "fileInputHeight"; "required": false; }; "styleWidth": { "alias": "styleWidth"; "required": false; }; "hints": { "alias": "hints"; "required": false; }; "allowedExtensions": { "alias": "allowedExtensions"; "required": false; }; "callApi": { "alias": "callApi"; "required": false; }; "display": { "alias": "display"; "required": false; }; "attachType": { "alias": "attachType"; "required": false; }; "error": { "alias": "error"; "required": false; }; "displayedFiles": { "alias": "displayedFiles"; "required": false; }; "getDataFromTemplate": { "alias": "getDataFromTemplate"; "required": false; }; "allowFileContentsWithMultiAttachments": { "alias": "allowFileContentsWithMultiAttachments"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "allAttachments": { "alias": "allAttachments"; "required": false; }; "signType": { "alias": "signType"; "required": false; }; "customDownload": { "alias": "customDownload"; "required": false; }; "showSignButton": { "alias": "showSignButton"; "required": false; }; "printType": { "alias": "printType"; "required": false; }; "showPrintButton": { "alias": "showPrintButton"; "required": false; }; "downloadType": { "alias": "downloadType"; "required": false; }; "showDownloadButton": { "alias": "showDownloadButton"; "required": false; }; "preventFileContents": { "alias": "preventFileContents"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; }, { "selectedTemplateAttachment": "selectedTemplateAttachment"; "addSignatureClicked": "addSignatureClicked"; "printActionClicked": "printActionClicked"; "emitedValue": "emitedValue"; "downloadActionClicked": "downloadActionClicked"; }, never, never, true, never>;
126
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocsUploaderComponent<any>, "app-file-uploader", never, { "useCrop": { "alias": "useCrop"; "required": false; }; "formKey": { "alias": "formKey"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "downloadLink": { "alias": "downloadLink"; "required": false; }; "showActions": { "alias": "showActions"; "required": false; }; "styleHeight": { "alias": "styleHeight"; "required": false; }; "fileInputHeight": { "alias": "fileInputHeight"; "required": false; }; "styleWidth": { "alias": "styleWidth"; "required": false; }; "hints": { "alias": "hints"; "required": false; }; "allowedExtensions": { "alias": "allowedExtensions"; "required": false; }; "callApi": { "alias": "callApi"; "required": false; }; "display": { "alias": "display"; "required": false; }; "attachType": { "alias": "attachType"; "required": false; }; "error": { "alias": "error"; "required": false; }; "displayedFiles": { "alias": "displayedFiles"; "required": false; }; "getDataFromTemplate": { "alias": "getDataFromTemplate"; "required": false; }; "allowFileContentsWithMultiAttachments": { "alias": "allowFileContentsWithMultiAttachments"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "allAttachments": { "alias": "allAttachments"; "required": false; }; "signType": { "alias": "signType"; "required": false; }; "customDownload": { "alias": "customDownload"; "required": false; }; "showSignButton": { "alias": "showSignButton"; "required": false; }; "printType": { "alias": "printType"; "required": false; }; "showPrintButton": { "alias": "showPrintButton"; "required": false; }; "downloadType": { "alias": "downloadType"; "required": false; }; "showDownloadButton": { "alias": "showDownloadButton"; "required": false; }; "preventFileContents": { "alias": "preventFileContents"; "required": false; }; "maxSize": { "alias": "maxSize"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; }, { "selectedTemplateAttachment": "selectedTemplateAttachment"; "addSignatureClicked": "addSignatureClicked"; "printActionClicked": "printActionClicked"; "emitedValue": "emitedValue"; "downloadActionClicked": "downloadActionClicked"; }, never, never, true, never>;
127
127
  }
128
128
  declare class FileInfo {
129
129
  fileName: string;
@@ -6,6 +6,7 @@ export * from './date-range-picker/date-range-picker.component';
6
6
  export * from './form-label/form-label.component';
7
7
  export * from './info-item/info-item.component';
8
8
  export * from './input/input.component';
9
+ export * from './input/input-map-filter';
9
10
  export * from './input-number/input-number.component';
10
11
  export * from './input-email/input-email.component';
11
12
  export * from './input-mask/input-mask.component';
@@ -0,0 +1,4 @@
1
+ export * from './input-filters';
2
+ export * from './input-map-filter.directive';
3
+ export * from './input-mappers';
4
+ export * from './types';
@@ -0,0 +1,63 @@
1
+ import { InputFilterFn, InputKeyType } from "./types";
2
+ export declare class InputFilters {
3
+ /**
4
+ * A filter that allows only Arabic characters (letters, punctuation) and Arabic-Indic digits (٠–٩),
5
+ * as well as basic common symbols and spaces.
6
+ *
7
+ * @returns `true` if the character should be allowed; otherwise, `false`
8
+ */
9
+ static arabicOnly(char: string, current: string, next: string, keyType: InputKeyType, event: KeyboardEvent | ClipboardEvent | DragEvent): boolean;
10
+ /**
11
+ * A filter that allows only English letters (A–Z, a–z), digits (0–9), common symbols, and space.
12
+ *
13
+ * @returns `true` if the character should be allowed; otherwise, `false`
14
+ */
15
+ static englishOnly(char: string, current: string, next: string, keyType: InputKeyType, event: KeyboardEvent | ClipboardEvent | DragEvent): boolean;
16
+ /**
17
+ * A filter that allows only digits (0–9).
18
+ *
19
+ * @returns `true` if the character is a digit; otherwise, `false`
20
+ */
21
+ static digitsOnly(char: string, current: string, next: string, keyType: InputKeyType, event: KeyboardEvent | ClipboardEvent | DragEvent): boolean;
22
+ /**
23
+ * Creates a new `PatternBuilder` instance for building a custom input filter.
24
+ *
25
+ * The builder allows chaining methods like `.allowArabicAlphabets()`, `.allowDigits()`, `.allowSpace()`, etc.
26
+ * Once configured, call `.build()` to generate the `InputFilterFn`.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * this.filterFn = InputFilters.buildPattern()
31
+ * .allowArabicAlphabets()
32
+ * .allowArabicDigits()
33
+ * .allowSpace()
34
+ * .build();
35
+ * ```
36
+ *
37
+ * @returns An instance of `PatternBuilder` for building a custom filter
38
+ */
39
+ static buildPattern(): PatternBuilder;
40
+ }
41
+ declare class PatternBuilder {
42
+ private patternParts;
43
+ /**
44
+ * Allow Arabic letters and Arabic symbols (e.g., Tatweel, diacritics, Arabic punctuation).
45
+ */
46
+ allowArabicAlphabets(): this;
47
+ /**
48
+ * Allow Arabic-Indic digits: ٠١٢٣٤٥٦٧٨٩
49
+ */
50
+ allowArabicDigits(): this;
51
+ /**
52
+ * Allow English letters A–Z (uppercase/lowercase).
53
+ */
54
+ allowEnglishAlphabets(): this;
55
+ allowDigits(): this;
56
+ allowSpace(): this;
57
+ allowSymbols(): this;
58
+ /**
59
+ * Builds and returns the filter function.
60
+ */
61
+ build(): InputFilterFn;
62
+ }
63
+ export {};
@@ -0,0 +1,15 @@
1
+ import { NgControl } from "@angular/forms";
2
+ import type { InputFilterFn, InputMapFn } from "./types";
3
+ import * as i0 from "@angular/core";
4
+ export declare class InputMapFilterDirective {
5
+ private ngControl;
6
+ mapFn: InputMapFn;
7
+ filterFn: InputFilterFn;
8
+ constructor(ngControl: NgControl);
9
+ handleKeydown(event: KeyboardEvent): boolean;
10
+ handlePaste(event: ClipboardEvent): void;
11
+ handleDrop(event: DragEvent): void;
12
+ private updateValue;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputMapFilterDirective, [{ optional: true; self: true; }]>;
14
+ static ɵdir: i0.ɵɵDirectiveDeclaration<InputMapFilterDirective, "[inputMapFilter]", never, { "mapFn": { "alias": "mapFn"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; }, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,10 @@
1
+ export declare class InputMappers {
2
+ /**
3
+ * A mapping function that transforms all input to UPPERCASE.
4
+ */
5
+ static toUpperCase(char: string, currentValue: string, nextValue: string): string;
6
+ /**
7
+ * A mapping function that transforms all input to lowercase.
8
+ */
9
+ static toLowerCase(char: string, currentValue: string, nextValue: string): string;
10
+ }
@@ -0,0 +1,3 @@
1
+ export type InputKeyType = 'character' | 'backspace' | 'delete' | 'modifier' | 'non-printable' | 'null';
2
+ export type InputMapFn = (char: string, currentValue: string, nextValue: string) => string;
3
+ export type InputFilterFn = (char: string, currentValue: string, nextValue: string, keyType: InputKeyType, event: KeyboardEvent | ClipboardEvent | DragEvent) => boolean;
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter, DestroyRef } from '@angular/core';
2
2
  import { ControlValueAccessorDirective } from '../control-value-accessor.directive';
3
+ import type { InputMapFn, InputFilterFn } from './input-map-filter/types';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class InputComponent<Type> extends ControlValueAccessorDirective<Type> {
5
6
  floatLabel: any;
@@ -7,8 +8,88 @@ export declare class InputComponent<Type> extends ControlValueAccessorDirective<
7
8
  iconPrefixName: string;
8
9
  iconSuffixName: string;
9
10
  emitedChangedValue1: EventEmitter<any>;
11
+ /**
12
+ * A mapping function that modifies the input value during typing, pasting, or dropping text.
13
+ * You can use it to modify the full input value **before it appears** (e.g., for auto-capitalization,
14
+ * formatting, or custom replacements).
15
+ *
16
+ * This function is called:
17
+ * - On each **key press**, to determine how the input value should change when a character is typed.
18
+ * - On **paste**, to transform the pasted content before it’s applied.
19
+ * - On **drop**, to transform the dropped text before it’s applied.
20
+ *
21
+ * **Built-in mappers are available via the `InputMappers` utility class:**
22
+ *
23
+ * - `InputMappers.toUpperCase` — Transforms all input to UPPERCASE.
24
+ * - `InputMappers.toLowerCase` — Transforms all input to lowercase.
25
+ *
26
+ * @param char - The character(s) being inserted. This is:
27
+ * - A single character (e.g., `'a'`) during typing.
28
+ * - The full pasted string during paste events.
29
+ * - The full dropped string during drop events.
30
+ * @param currentValue - The current value of the input **before** the change is applied.
31
+ * @param nextValue - The simulated value of the input **after** the character, paste, or drop is inserted, but before transformation.
32
+ *
33
+ * @returns The final string to use as the new input value.
34
+ *
35
+ * @example
36
+ * // Use a built-in mapper to force UPPERCASE input:
37
+ * this.mapFn = InputMappers.toUpperCase;
38
+ *
39
+ * @example
40
+ * // Custom mapper: Capitalize the first letter of each word
41
+ * this.mapFn = (char, current, next) =>
42
+ * typeof next === 'string' ? next.replace(/\b\w/g, c => c.toUpperCase()) : next;
43
+ */
44
+ mapFn: InputMapFn;
45
+ /**
46
+ * A filtering function that determines whether a character or string should be allowed into the input.
47
+ *
48
+ * This function is called during:
49
+ * - **Typing**: When a key is pressed to decide if the character should be accepted.
50
+ * - **Paste**: When text is pasted to decide if the entire pasted string should be accepted.
51
+ * - **Drop**: When text is dropped into the input to decide if it should be allowed.
52
+ *
53
+ * You can use it to reject unwanted characters (e.g. numbers, symbols) or block input entirely based
54
+ * on the current or predicted value.
55
+ *
56
+ * **Built-in filters are available via the `InputFilters` utility class:**
57
+ *
58
+ * - `InputFilters.arabicOnly` — Allows Arabic letters and digits, as well as common symbols.
59
+ * - `InputFilters.englishOnly` — Allows English letters and digits, as well as common symbols.
60
+ * - `InputFilters.digitsOnly` — Allows digits only (`0–9`), no letters or symbols.
61
+ * - You can also use `InputFilters.buildPattern()` to define a custom filter.
62
+ *
63
+ * @param char - The character(s) being inserted:
64
+ * - A single typed character (e.g., `'a'`) during key presses
65
+ * - The full pasted or dropped string during paste/drop
66
+ * @param currentValue - The current value of the input before the character or string is applied.
67
+ * @param nextValue - The simulated next value if the character or string were applied.
68
+ * @param keyType - The kind of input interaction:
69
+ * - `'character'` for printable characters
70
+ * - `'backspace'` or `'delete'` for those keys
71
+ * - `'modifier'` for Ctrl/Alt/Meta combinations
72
+ * - `'non-printable'` for arrows, tab, escape, etc.
73
+ * - `'null'` for paste/drop (non-keyboard text input)
74
+ * @param event - The originating event triggering the input change. This can be a
75
+ * `KeyboardEvent` (for typing), `ClipboardEvent` (for paste), or `DragEvent` (for drop).
76
+ *
77
+ * @returns `true` to allow the input, or `false` to block it.
78
+ *
79
+ *
80
+ * @example
81
+ * // Use a built-in filter to restrict to digits only
82
+ * this.filterFn = InputFilters.digitsOnly;
83
+ *
84
+ * @example
85
+ * // Custom filter: Allow only letters (no numbers or symbols)
86
+ * this.filterFn = (char, current, next, keyType, event) => {
87
+ * return keyType !== 'character' || /^[a-zA-Z]+$/.test(char);
88
+ * };
89
+ */
90
+ filterFn: InputFilterFn;
10
91
  destroyRef: DestroyRef;
11
92
  ngOnInit(): void;
12
93
  static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent<any>, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent<any>, "app-input", never, { "floatLabel": { "alias": "floatLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "iconPrefixName": { "alias": "iconPrefixName"; "required": false; }; "iconSuffixName": { "alias": "iconSuffixName"; "required": false; }; "emitedChangedValue1": { "alias": "emitedChangedValue1"; "required": false; }; }, {}, never, never, true, never>;
94
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent<any>, "app-input", never, { "floatLabel": { "alias": "floatLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "iconPrefixName": { "alias": "iconPrefixName"; "required": false; }; "iconSuffixName": { "alias": "iconSuffixName"; "required": false; }; "emitedChangedValue1": { "alias": "emitedChangedValue1"; "required": false; }; "mapFn": { "alias": "mapFn"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; }, {}, never, never, true, never>;
14
95
  }
@@ -10,6 +10,6 @@ import { ArOnlyDirective } from "../../../directives/ar.directive";
10
10
  import { NgClass } from "@angular/common";
11
11
  import { TranslatePipe } from "../../../pipes/translate.pipe";
12
12
  export declare const MatDatePickerImports: (typeof MatDatepickerInput | typeof MatDatepickerToggle | typeof MatDatepickerModule)[];
13
- export declare const MatFormImports: (typeof MatInput | typeof MatFormFieldModule | typeof MatFormField)[];
14
- export declare const Shareds: (typeof NgClass | typeof ReactiveFormsModule | typeof TranslatePipe | typeof FormLabelComponent | typeof ValidationErrorsComponent | typeof InfoItemComponent)[];
13
+ export declare const MatFormImports: (typeof MatFormFieldModule | typeof MatFormField | typeof MatInput)[];
14
+ export declare const Shareds: (typeof NgClass | typeof ValidationErrorsComponent | typeof ReactiveFormsModule | typeof FormLabelComponent | typeof InfoItemComponent | typeof TranslatePipe)[];
15
15
  export declare const TextLanguageDirectives: (typeof EnOnlyDirective | typeof ArOnlyDirective)[];
package/lib/i18n/ar.d.ts CHANGED
@@ -175,7 +175,6 @@ declare const _default: {
175
175
  year: string;
176
176
  status: string;
177
177
  downloadAll: string;
178
- itemsPerPage: string;
179
178
  startDate: string;
180
179
  endDate: string;
181
180
  textArea: string;
package/lib/i18n/en.d.ts CHANGED
@@ -179,7 +179,6 @@ declare const _default: {
179
179
  year: string;
180
180
  status: string;
181
181
  downloadAll: string;
182
- itemsPerPage: string;
183
182
  startDate: string;
184
183
  endDate: string;
185
184
  textArea: string;
@@ -2,6 +2,7 @@ import { DestroyRef, OnInit } from '@angular/core';
2
2
  import { Form, Section } from "../../interfaces";
3
3
  import { ActionStateService, CoreI18nService } from "../../services";
4
4
  import { FormBuilder, FormGroup, ValidatorFn } from "@angular/forms";
5
+ import { InputMappers } from '../../components/shared-components/form-field/input/input-map-filter/input-mappers';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class RequestDetailsSectionComponent implements OnInit {
7
8
  i18n: CoreI18nService;
@@ -67,6 +68,8 @@ export declare class RequestDetailsSectionComponent implements OnInit {
67
68
  customCallSubmit(action: string): void;
68
69
  resetForm(): void;
69
70
  pageChanged(event: any): void;
71
+ mapFn: typeof InputMappers.toLowerCase;
72
+ arOnly: import("../../components/shared-components").InputFilterFn;
70
73
  static ɵfac: i0.ɵɵFactoryDeclaration<RequestDetailsSectionComponent, never>;
71
74
  static ɵcmp: i0.ɵɵComponentDeclaration<RequestDetailsSectionComponent, "app-request-details-section", never, { "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "section": { "alias": "section"; "required": false; }; "form": { "alias": "form"; "required": false; }; "lov": { "alias": "lov"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
72
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpm-core",
3
- "version": "0.0.125",
3
+ "version": "0.0.127",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0",