caplink-saas-ui-shared-component-library 1.105.2 → 1.107.0

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.
@@ -1,19 +1 @@
1
- /**
2
- * Mask validation module
3
- * Validates string values against digit-based mask patterns
4
- */
5
- /**
6
- * Validates if a value matches a digit-based mask pattern
7
- * Mask format: '0' represents a digit placeholder, '|' separates alternative masks
8
- *
9
- * @param value - Value to validate
10
- * @param maskData - Mask pattern(s) separated by '|' for alternatives
11
- * @returns True if value matches any of the masks
12
- *
13
- * @example
14
- * validateMask('12345', '00000') // true (5 digits)
15
- * validateMask('123', '00000|000') // true (matches second mask)
16
- * validateMask('12-345', '00000') // true (non-digits ignored)
17
- * validateMask('12', '00000') // false (not enough digits)
18
- */
19
- export declare function validateMask(value: unknown, maskData: string): boolean;
1
+ export { validateMask } from '../../lib/validate-mask';
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Custom IMask placeholders, merged by IMask with its defaults (`0`, `a`, `*`):
3
+ * - `X`: a letter or digit, uppercased
4
+ * - `x`: a letter or digit, kept as typed
5
+ * When `sensible`, `0` and `a` are also overridden to accept `*`.
6
+ */
7
+ export declare function buildMaskDefinitions(sensible?: boolean): {
8
+ X: {
9
+ mask: RegExp;
10
+ prepareChar: (char: string) => string;
11
+ };
12
+ x: {
13
+ mask: RegExp;
14
+ };
15
+ '0'?: RegExp | undefined;
16
+ a?: RegExp | undefined;
17
+ };
18
+ /**
19
+ * Builds the IMask dynamic masks for a string column.
20
+ * `maskData` holds alternative patterns separated by '|'.
21
+ */
22
+ export declare function buildStringMasks(maskData?: string | null, sensible?: boolean): {
23
+ mask: RegExp;
24
+ }[] | ({
25
+ mask: string;
26
+ lazy: boolean;
27
+ definitions: {
28
+ X: {
29
+ mask: RegExp;
30
+ prepareChar: (char: string) => string;
31
+ };
32
+ x: {
33
+ mask: RegExp;
34
+ };
35
+ '0'?: RegExp | undefined;
36
+ a?: RegExp | undefined;
37
+ };
38
+ } | {
39
+ mask: string;
40
+ })[];
@@ -1 +1,10 @@
1
- export declare function validateMask(value: unknown, maskData: string): boolean;
1
+ /**
2
+ * Validates if a value fills one of the mask patterns
3
+ * Mask format: '0' is a digit slot, 'X'/'x' an alphanumeric slot, '|' separates alternative masks
4
+ *
5
+ * @example
6
+ * validateMask('123', '00000|000') // true (matches second mask)
7
+ * validateMask('12.ABC.345/01DE-35', 'XX.XXX.XXX/XXXX-00') // true
8
+ * validateMask('**345', '00000', true) // true (sensible value)
9
+ */
10
+ export declare function validateMask(value: unknown, maskData: string, sensible?: boolean): boolean;
@@ -107,6 +107,8 @@ export type ColumnSettings = {
107
107
  string?: {
108
108
  maskData?: string;
109
109
  maskVisible?: boolean;
110
+ /** Value arrives masked by the backend with `*` and must be rendered as is */
111
+ sensible?: boolean;
110
112
  charLimit?: number;
111
113
  };
112
114
  };