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.
- package/README.md +115 -5
- package/fesm2022/bpm-core.mjs +388 -21
- package/fesm2022/bpm-core.mjs.map +1 -1
- package/lib/components/shared-components/action-buttons/action-buttons.component.d.ts +1 -1
- package/lib/components/shared-components/form-field/attachment-section/attachment-section.component.d.ts +3 -0
- package/lib/components/shared-components/form-field/doc-uploader/docs-uploader.component.d.ts +1 -1
- package/lib/components/shared-components/form-field/index.d.ts +1 -0
- package/lib/components/shared-components/form-field/input/input-map-filter/index.d.ts +4 -0
- package/lib/components/shared-components/form-field/input/input-map-filter/input-filters.d.ts +63 -0
- package/lib/components/shared-components/form-field/input/input-map-filter/input-map-filter.directive.d.ts +15 -0
- package/lib/components/shared-components/form-field/input/input-map-filter/input-mappers.d.ts +10 -0
- package/lib/components/shared-components/form-field/input/input-map-filter/types.d.ts +3 -0
- package/lib/components/shared-components/form-field/input/input.component.d.ts +82 -1
- package/lib/components/shared-components/form-field/shared-imports.d.ts +2 -2
- package/lib/i18n/ar.d.ts +0 -1
- package/lib/i18n/en.d.ts +0 -1
- package/lib/testComponent/request-details-section/request-details-section.component.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,10 +3,107 @@
|
|
|
3
3
|
|
|
4
4
|
> Ensure your project is updated to Angular 19 to avoid compatibility issues.
|
|
5
5
|
|
|
6
|
-
## Recently Added Features
|
|
7
|
-
- ###
|
|
6
|
+
## [Recently Added Features](#recently-added-features)
|
|
7
|
+
- ### [Input Mapping and Filtering](#input-mapping-and-filtering)
|
|
8
|
+
The `app-input` component now supports two powerful inputs:
|
|
9
|
+
|
|
10
|
+
- **`[mapFn]`** — A function that modifies the input value **before it's rendered**, allowing for transformations like uppercase conversion, formatting, or character replacement.
|
|
11
|
+
- **`[filterFn]`** — A function that validates or restricts what characters can be typed, pasted, or dropped into the input.
|
|
12
|
+
|
|
13
|
+
**Built-in Utility Classes Provided:**
|
|
14
|
+
>
|
|
15
|
+
> - `InputFilters`:
|
|
16
|
+
> - `InputFilters.arabicOnly`
|
|
17
|
+
> - `InputFilters.englishOnly`
|
|
18
|
+
> - `InputFilters.digitsOnly`
|
|
19
|
+
> - `InputFilters.buildPattern()`
|
|
20
|
+
>
|
|
21
|
+
> - `InputMappers`:
|
|
22
|
+
> - `InputMappers.toUpperCase`
|
|
23
|
+
> - `InputMappers.toLowerCase`
|
|
24
|
+
|
|
25
|
+
**Example 1: Custom filter – Allow only numbers**
|
|
26
|
+
```ts
|
|
27
|
+
numbersOnlyFilter: InputFilterFn = (char, current, next, keyType) => {
|
|
28
|
+
if (keyType !== 'character') return true;
|
|
29
|
+
return /^[0-9]+$/.test(char);
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
```html
|
|
33
|
+
<app-input
|
|
34
|
+
label="Phone Number"
|
|
35
|
+
[filterFn]="numbersOnlyFilter"
|
|
36
|
+
></app-input>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Example 2: Built-in filter – Arabic-only characters**
|
|
40
|
+
```ts
|
|
41
|
+
import { InputFilters } from 'bpm-core';
|
|
42
|
+
|
|
43
|
+
class MyComponent {
|
|
44
|
+
InputFilters = InputFilters;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
```html
|
|
48
|
+
<app-input
|
|
49
|
+
label="الاسم بالعربية"
|
|
50
|
+
[filterFn]="InputFilters.arabicOnly"
|
|
51
|
+
></app-input>
|
|
52
|
+
```
|
|
53
|
+
> 💡 **Hint:** Use `InputFilters.buildPattern()` when you need to **customize exactly which characters are allowed** in an input.
|
|
54
|
+
> You can combine multiple character groups like Arabic letters, digits, symbols, and spaces then generate a custom filter function using `.build()`.
|
|
55
|
+
|
|
56
|
+
**Example 3: Custom filter using `buildPattern()` — Allow English letters, digits, spaces, and symbols**
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { InputFilters } from 'bpm-core';
|
|
60
|
+
|
|
61
|
+
class MyComponent {
|
|
62
|
+
customEnglishFilter = InputFilters.buildPattern()
|
|
63
|
+
.allowEnglishAlphabets()
|
|
64
|
+
.allowDigits()
|
|
65
|
+
.allowSpace()
|
|
66
|
+
.allowSymbols()
|
|
67
|
+
.build();
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
```html
|
|
71
|
+
<app-input
|
|
72
|
+
label="Username"
|
|
73
|
+
[filterFn]="customEnglishFilter"
|
|
74
|
+
></app-input>
|
|
75
|
+
```
|
|
76
|
+
**Example 4: Custom map — Capitalize first letter of each word**
|
|
77
|
+
```ts
|
|
78
|
+
capitalizeWordsMapFn: InputMapFn = (char, current, next) => {
|
|
79
|
+
return next.replace(/\b\w/g, (match) => match.toUpperCase());
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
```html
|
|
83
|
+
<app-input
|
|
84
|
+
label="Full Name"
|
|
85
|
+
[mapFn]="capitalizeWordsMapFn"
|
|
86
|
+
></app-input>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Example 5: Built-in map — Force lowercase:**
|
|
90
|
+
```ts
|
|
91
|
+
import { InputMappers } from 'bpm-core';
|
|
92
|
+
|
|
93
|
+
class MyComponent {
|
|
94
|
+
InputMappers = InputMappers;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
```html
|
|
98
|
+
<app-input
|
|
99
|
+
label="Email"
|
|
100
|
+
[mapFn]="InputMappers.toLowercase"
|
|
101
|
+
></app-input>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- ### [Time Picker](#time-picker)
|
|
8
105
|
To use it, import `TimepickerComponent` in your TypeScript file and add `<app-timepicker>` to your template. For more information, hover over the selector after adding it to your template.
|
|
9
|
-
- ### Summary Section
|
|
106
|
+
- ### [Summary Section](#summary-section)
|
|
10
107
|
This is a stage that appears before the request stage.
|
|
11
108
|
|
|
12
109
|
To enable this feature:
|
|
@@ -63,11 +160,24 @@
|
|
|
63
160
|
```
|
|
64
161
|
</details>
|
|
65
162
|
|
|
66
|
-
## Changes Log
|
|
163
|
+
## [Changes Log](#changes-log)
|
|
164
|
+
|
|
165
|
+
<a id="bpm-core00127-2025-08-06"></a>
|
|
166
|
+
### [bpm-core@0.0.127 — 2025-08-06](#bpm-core00127-2025-08-06)
|
|
167
|
+
- feat(app-input): `app-input` now supports `filterFn` and `mapFn` inputs.
|
|
168
|
+
- feat(validation-errors): Added default error messages for `max` and `min` validators.
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<a id="bpm-core00126-2025-07-30"></a>
|
|
172
|
+
### [bpm-core@0.0.126 — 2025-07-30](#bpm-core00126-2025-07-30)
|
|
173
|
+
- fix(file-uploader): avoid clearing attachments with multiple enabled.
|
|
174
|
+
- fix(file-uploader): activate "maxLength" input to specify maximum number of files
|
|
175
|
+
- fix(attachment-section): resolve _intl console error and translate MatPaginator labels to Arabic.
|
|
67
176
|
|
|
68
177
|
<a id="bpm-core00125-2025-07-23"></a>
|
|
69
178
|
### [bpm-core@0.0.125 — 2025-07-23](#bpm-core00125-2025-07-23)
|
|
70
|
-
-
|
|
179
|
+
- fix: resolve issue with downloading attachments from comments history.
|
|
180
|
+
|
|
71
181
|
<a id="bpm-core00124-2025-07-17"></a>
|
|
72
182
|
### [bpm-core@0.0.124 — 2025-07-17](#bpm-core00124-2025-07-17)
|
|
73
183
|
- Added default placeholders for all inputs.
|