@tectra-ng/utils 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/README.md +41 -2
- package/auto-focus/README.md +19 -0
- package/breakpoint/README.md +23 -0
- package/clipboard/README.md +37 -0
- package/clock/README.md +21 -0
- package/currency/README.md +17 -0
- package/date/README.md +46 -0
- package/debounce-input/README.md +31 -0
- package/drag-scroll/README.md +25 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs +100 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs +54 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs +225 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clock.mjs +59 -0
- package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-currency.mjs +63 -0
- package/fesm2022/tectra-ng-utils-currency.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-date.mjs +200 -0
- package/fesm2022/tectra-ng-utils-date.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs +156 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs +199 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-file.mjs +78 -0
- package/fesm2022/tectra-ng-utils-file.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs +238 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter.mjs +88 -0
- package/fesm2022/tectra-ng-utils-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs +70 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs +162 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs +117 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-http.mjs +189 -0
- package/fesm2022/tectra-ng-utils-http.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs +297 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-plural.mjs +98 -0
- package/fesm2022/tectra-ng-utils-plural.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-polling.mjs +109 -0
- package/fesm2022/tectra-ng-utils-polling.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-random.mjs +20 -0
- package/fesm2022/tectra-ng-utils-random.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs +87 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs +136 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-selection.mjs +52 -0
- package/fesm2022/tectra-ng-utils-selection.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs +92 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stream.mjs +30 -0
- package/fesm2022/tectra-ng-utils-stream.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs +350 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-text.mjs +173 -0
- package/fesm2022/tectra-ng-utils-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-title.mjs +99 -0
- package/fesm2022/tectra-ng-utils-title.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-validators.mjs +232 -0
- package/fesm2022/tectra-ng-utils-validators.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils.mjs +4 -0
- package/fesm2022/tectra-ng-utils.mjs.map +1 -0
- package/file/README.md +19 -0
- package/filter/README.md +22 -0
- package/filter-state/README.md +36 -0
- package/form-changes/README.md +26 -0
- package/form-validation/README.md +40 -0
- package/go-back/README.md +28 -0
- package/http/README.md +34 -0
- package/in-view/README.md +34 -0
- package/package.json +181 -3
- package/plural/README.md +21 -0
- package/polling/README.md +34 -0
- package/random/README.md +10 -0
- package/relative-time/README.md +29 -0
- package/scroll-end/README.md +25 -0
- package/selection/README.md +24 -0
- package/stop-propagation/README.md +15 -0
- package/stream/README.md +14 -0
- package/style-class/README.md +34 -0
- package/text/README.md +25 -0
- package/title/README.md +26 -0
- package/types/tectra-ng-utils-auto-focus.d.ts +22 -0
- package/types/tectra-ng-utils-auto-focus.d.ts.map +1 -0
- package/types/tectra-ng-utils-breakpoint.d.ts +15 -0
- package/types/tectra-ng-utils-breakpoint.d.ts.map +1 -0
- package/types/tectra-ng-utils-clipboard.d.ts +48 -0
- package/types/tectra-ng-utils-clipboard.d.ts.map +1 -0
- package/types/tectra-ng-utils-clock.d.ts +18 -0
- package/types/tectra-ng-utils-clock.d.ts.map +1 -0
- package/types/tectra-ng-utils-currency.d.ts +11 -0
- package/types/tectra-ng-utils-currency.d.ts.map +1 -0
- package/types/tectra-ng-utils-date.d.ts +65 -0
- package/types/tectra-ng-utils-date.d.ts.map +1 -0
- package/types/tectra-ng-utils-debounce-input.d.ts +38 -0
- package/types/tectra-ng-utils-debounce-input.d.ts.map +1 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts +41 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts.map +1 -0
- package/types/tectra-ng-utils-file.d.ts +18 -0
- package/types/tectra-ng-utils-file.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter-state.d.ts +55 -0
- package/types/tectra-ng-utils-filter-state.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter.d.ts +21 -0
- package/types/tectra-ng-utils-filter.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-changes.d.ts +22 -0
- package/types/tectra-ng-utils-form-changes.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-validation.d.ts +45 -0
- package/types/tectra-ng-utils-form-validation.d.ts.map +1 -0
- package/types/tectra-ng-utils-go-back.d.ts +25 -0
- package/types/tectra-ng-utils-go-back.d.ts.map +1 -0
- package/types/tectra-ng-utils-http.d.ts +47 -0
- package/types/tectra-ng-utils-http.d.ts.map +1 -0
- package/types/tectra-ng-utils-in-view.d.ts +80 -0
- package/types/tectra-ng-utils-in-view.d.ts.map +1 -0
- package/types/tectra-ng-utils-plural.d.ts +21 -0
- package/types/tectra-ng-utils-plural.d.ts.map +1 -0
- package/types/tectra-ng-utils-polling.d.ts +61 -0
- package/types/tectra-ng-utils-polling.d.ts.map +1 -0
- package/types/tectra-ng-utils-random.d.ts +4 -0
- package/types/tectra-ng-utils-random.d.ts.map +1 -0
- package/types/tectra-ng-utils-relative-time.d.ts +22 -0
- package/types/tectra-ng-utils-relative-time.d.ts.map +1 -0
- package/types/tectra-ng-utils-scroll-end.d.ts +38 -0
- package/types/tectra-ng-utils-scroll-end.d.ts.map +1 -0
- package/types/tectra-ng-utils-selection.d.ts +21 -0
- package/types/tectra-ng-utils-selection.d.ts.map +1 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts +22 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts.map +1 -0
- package/types/tectra-ng-utils-stream.d.ts +3 -0
- package/types/tectra-ng-utils-stream.d.ts.map +1 -0
- package/types/tectra-ng-utils-style-class.d.ts +91 -0
- package/types/tectra-ng-utils-style-class.d.ts.map +1 -0
- package/types/tectra-ng-utils-text.d.ts +26 -0
- package/types/tectra-ng-utils-text.d.ts.map +1 -0
- package/types/tectra-ng-utils-title.d.ts +31 -0
- package/types/tectra-ng-utils-title.d.ts.map +1 -0
- package/types/tectra-ng-utils-validators.d.ts +67 -0
- package/types/tectra-ng-utils-validators.d.ts.map +1 -0
- package/types/tectra-ng-utils.d.ts +2 -0
- package/types/tectra-ng-utils.d.ts.map +1 -0
- package/validators/README.md +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-relative-time.d.ts","names":[],"sources":["../../../../packages/utils/relative-time/src/relative-time.types.ts","../../../../packages/utils/relative-time/src/relative-time.ts"],"mappings":";;;YAAY;iBAEK;EACf;EACA,MAAM;EACN,cAAc;EACd;EACA;EACA;;wBCAc,aAAa,OAAO,aAAa,UAAS;qBAkC7C,8BAA8B;mBACxB;UACT;UACA;EAER,UAAU,OAAO,aAAa,UAAS;SAL5B,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TxScrollEnd {
|
|
3
|
+
private readonly host;
|
|
4
|
+
private reportedHeight;
|
|
5
|
+
readonly offset: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
6
|
+
readonly maxLimit: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
7
|
+
readonly currentCount: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
8
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
9
|
+
readonly scrolledToBottom: import("@angular/core").OutputEmitterRef<void>;
|
|
10
|
+
check(): void;
|
|
11
|
+
reset(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxScrollEnd, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TxScrollEnd, "[txScrollEnd]", ["txScrollEnd"], {
|
|
14
|
+
"offset": {
|
|
15
|
+
"alias": "offset";
|
|
16
|
+
"required": false;
|
|
17
|
+
"isSignal": true;
|
|
18
|
+
};
|
|
19
|
+
"maxLimit": {
|
|
20
|
+
"alias": "maxLimit";
|
|
21
|
+
"required": false;
|
|
22
|
+
"isSignal": true;
|
|
23
|
+
};
|
|
24
|
+
"currentCount": {
|
|
25
|
+
"alias": "currentCount";
|
|
26
|
+
"required": false;
|
|
27
|
+
"isSignal": true;
|
|
28
|
+
};
|
|
29
|
+
"disabled": {
|
|
30
|
+
"alias": "disabled";
|
|
31
|
+
"required": false;
|
|
32
|
+
"isSignal": true;
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
"scrolledToBottom": "scrolledToBottom";
|
|
36
|
+
}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=tectra-ng-utils-scroll-end.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-scroll-end.d.ts","names":[],"sources":["../../../../packages/utils/scroll-end/src/scroll-end.directive.ts"],"mappings":";qBAOa;mBACM;UACT;WAEC,gCAAM;WACN,kCAAQ;WACR,sCAAY;WACZ,kCAAQ;WAER,0CAAgB;EAEzB;EAUA;SArBW,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAW;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Signal } from "@angular/core";
|
|
2
|
+
export declare class TxSelection<T> {
|
|
3
|
+
private readonly getKey;
|
|
4
|
+
private readonly selected;
|
|
5
|
+
readonly selectedIds: Signal<ReadonlySet<string>>;
|
|
6
|
+
readonly count: Signal<number>;
|
|
7
|
+
constructor(getKey: (item: T) => string);
|
|
8
|
+
select(predicate: (item: T) => boolean, items: readonly T[], isChecked: boolean): void;
|
|
9
|
+
toggleOne(idOrItem: string | T, isChecked?: boolean): void;
|
|
10
|
+
toggleAll(items: readonly T[], isChecked?: boolean): void;
|
|
11
|
+
isSelected(idOrItem: string | T): boolean;
|
|
12
|
+
areAllSelected(items: readonly T[]): boolean;
|
|
13
|
+
areAllSelectedWithPredicate(items: readonly T[], predicate: (item: T) => boolean): boolean;
|
|
14
|
+
isPartial(items: readonly T[]): boolean;
|
|
15
|
+
selectedItems(items: readonly T[]): T[];
|
|
16
|
+
setSelected(ids: readonly string[]): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
private keyOf;
|
|
19
|
+
private change;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tectra-ng-utils-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-selection.d.ts","names":[],"sources":["../../../../packages/utils/selection/src/selection.ts"],"mappings":";qBAEa,YAAY;mBAMM;mBALZ;WAER,aAAa,OAAO;WACpB,OAAK;EAEe,YAAA,SAAS,MAAM;EAE5C,OAAO,YAAY,MAAM,eAAe,gBAAgB,KAAK;EAI7D,UAAU,mBAAmB,GAAG;EAIhC,UAAU,gBAAgB,KAAK;EAI/B,WAAW,mBAAmB;EAI9B,eAAe,gBAAgB;EAI/B,4BAA4B,gBAAgB,KAAK,YAAY,MAAM;EAInE,UAAU,gBAAgB;EAK1B,cAAc,gBAAgB,MAAM;EAIpC,YAAY;EAIZ;UAIQ;UAIA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TxStopPropagation {
|
|
3
|
+
private readonly element;
|
|
4
|
+
private readonly renderer;
|
|
5
|
+
readonly events: import("@angular/core").InputSignalWithTransform<readonly string[], unknown>;
|
|
6
|
+
readonly preventDefault: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
7
|
+
constructor();
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxStopPropagation, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TxStopPropagation, "[txStopPropagation]", never, {
|
|
10
|
+
"events": {
|
|
11
|
+
"alias": "txStopPropagation";
|
|
12
|
+
"required": false;
|
|
13
|
+
"isSignal": true;
|
|
14
|
+
};
|
|
15
|
+
"preventDefault": {
|
|
16
|
+
"alias": "preventDefault";
|
|
17
|
+
"required": false;
|
|
18
|
+
"isSignal": true;
|
|
19
|
+
};
|
|
20
|
+
}, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=tectra-ng-utils-stop-propagation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-stop-propagation.d.ts","names":[],"sources":["../../../../packages/utils/stop-propagation/src/stop-propagation.directive.ts"],"mappings":";qBAUa;mBACM;mBACA;WAER,gCAAM;WACN,wCAAc;;SALZ,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAiB;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-stream.d.ts","names":[],"sources":["../../../../packages/utils/stream/src/stream.ts"],"mappings":"AAAA,wBAAuB,WAAW,UAAU,WAAW;wBA0BjC,eAAe,UAAU,UAAU,UAAU,eAAe,wBAAwB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TxStyleClass {
|
|
3
|
+
private readonly host;
|
|
4
|
+
private readonly renderer;
|
|
5
|
+
private readonly document;
|
|
6
|
+
private readonly listeners;
|
|
7
|
+
private animating;
|
|
8
|
+
private endTimer;
|
|
9
|
+
readonly selector: import("@angular/core").InputSignalWithTransform<string, unknown>;
|
|
10
|
+
readonly enterFromClass: import("@angular/core").InputSignal<string | undefined>;
|
|
11
|
+
readonly enterActiveClass: import("@angular/core").InputSignal<string | undefined>;
|
|
12
|
+
readonly enterToClass: import("@angular/core").InputSignal<string | undefined>;
|
|
13
|
+
readonly leaveFromClass: import("@angular/core").InputSignal<string | undefined>;
|
|
14
|
+
readonly leaveActiveClass: import("@angular/core").InputSignal<string | undefined>;
|
|
15
|
+
readonly leaveToClass: import("@angular/core").InputSignal<string | undefined>;
|
|
16
|
+
readonly toggleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
17
|
+
readonly hideOnOutsideClick: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
|
+
readonly hideOnEscape: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
19
|
+
readonly hideOnResize: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
20
|
+
readonly expanded: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
+
constructor();
|
|
22
|
+
target(): HTMLElement | null;
|
|
23
|
+
toggle(): void;
|
|
24
|
+
enter(target?: HTMLElement | null): void;
|
|
25
|
+
leave(target?: HTMLElement | null): void;
|
|
26
|
+
private animate;
|
|
27
|
+
private duration;
|
|
28
|
+
private swap;
|
|
29
|
+
private isHidden;
|
|
30
|
+
private bind;
|
|
31
|
+
private unbind;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxStyleClass, never>;
|
|
33
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TxStyleClass, "[txStyleClass]", ["txStyleClass"], {
|
|
34
|
+
"selector": {
|
|
35
|
+
"alias": "txStyleClass";
|
|
36
|
+
"required": false;
|
|
37
|
+
"isSignal": true;
|
|
38
|
+
};
|
|
39
|
+
"enterFromClass": {
|
|
40
|
+
"alias": "enterFromClass";
|
|
41
|
+
"required": false;
|
|
42
|
+
"isSignal": true;
|
|
43
|
+
};
|
|
44
|
+
"enterActiveClass": {
|
|
45
|
+
"alias": "enterActiveClass";
|
|
46
|
+
"required": false;
|
|
47
|
+
"isSignal": true;
|
|
48
|
+
};
|
|
49
|
+
"enterToClass": {
|
|
50
|
+
"alias": "enterToClass";
|
|
51
|
+
"required": false;
|
|
52
|
+
"isSignal": true;
|
|
53
|
+
};
|
|
54
|
+
"leaveFromClass": {
|
|
55
|
+
"alias": "leaveFromClass";
|
|
56
|
+
"required": false;
|
|
57
|
+
"isSignal": true;
|
|
58
|
+
};
|
|
59
|
+
"leaveActiveClass": {
|
|
60
|
+
"alias": "leaveActiveClass";
|
|
61
|
+
"required": false;
|
|
62
|
+
"isSignal": true;
|
|
63
|
+
};
|
|
64
|
+
"leaveToClass": {
|
|
65
|
+
"alias": "leaveToClass";
|
|
66
|
+
"required": false;
|
|
67
|
+
"isSignal": true;
|
|
68
|
+
};
|
|
69
|
+
"toggleClass": {
|
|
70
|
+
"alias": "toggleClass";
|
|
71
|
+
"required": false;
|
|
72
|
+
"isSignal": true;
|
|
73
|
+
};
|
|
74
|
+
"hideOnOutsideClick": {
|
|
75
|
+
"alias": "hideOnOutsideClick";
|
|
76
|
+
"required": false;
|
|
77
|
+
"isSignal": true;
|
|
78
|
+
};
|
|
79
|
+
"hideOnEscape": {
|
|
80
|
+
"alias": "hideOnEscape";
|
|
81
|
+
"required": false;
|
|
82
|
+
"isSignal": true;
|
|
83
|
+
};
|
|
84
|
+
"hideOnResize": {
|
|
85
|
+
"alias": "hideOnResize";
|
|
86
|
+
"required": false;
|
|
87
|
+
"isSignal": true;
|
|
88
|
+
};
|
|
89
|
+
}, {}, never, never, true, never>;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=tectra-ng-utils-style-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-style-class.d.ts","names":[],"sources":["../../../../packages/utils/style-class/src/style-class.directive.ts"],"mappings":";qBAiBa;mBACM;mBACA;mBACA;mBACA;UACT;UACA;WAEC,kCAAQ;WACR,wCAAc;WACd,0CAAgB;WAChB,sCAAY;WACZ,wCAAc;WACd,0CAAgB;WAChB,sCAAY;WACZ,qCAAW;WACX,4CAAkB;WAClB,sCAAY;WACZ,sCAAY;WAEZ,kCAAQ;;EASjB,UAAU;EAgBV;EAiBA,MAAM,SAAM;EAUZ,MAAM,SAAM;UAeJ;UAwBA;UAMA;UAKA;UAWA;UA2BA;SAhKG,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAY;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { PipeTransform } from "@angular/core";
|
|
3
|
+
export type TxTruncatePosition = 'end' | 'middle';
|
|
4
|
+
export declare function truncate(value: string | null | undefined, limit?: number, trail?: string, position?: TxTruncatePosition, empty?: string): string;
|
|
5
|
+
export declare function capitalize(value: string | null | undefined): string;
|
|
6
|
+
export declare function normalizeKeyword(value: string | null | undefined): string;
|
|
7
|
+
export declare function withHttpPrefix(link: string | null | undefined, protocol?: 'https' | 'http'): string;
|
|
8
|
+
export declare function transliterate(value: string): string;
|
|
9
|
+
export declare function slugify(value: string, separator?: string): string;
|
|
10
|
+
export declare function escapeHtml(value: string): string;
|
|
11
|
+
export declare class TxTruncatePipe implements PipeTransform {
|
|
12
|
+
transform(value: string | null | undefined, limit?: number, trail?: string, position?: TxTruncatePosition): string;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxTruncatePipe, never>;
|
|
14
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TxTruncatePipe, "txTruncate", true>;
|
|
15
|
+
}
|
|
16
|
+
export declare class TxCapitalizePipe implements PipeTransform {
|
|
17
|
+
transform(value: string | null | undefined): string;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxCapitalizePipe, never>;
|
|
19
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TxCapitalizePipe, "txCapitalize", true>;
|
|
20
|
+
}
|
|
21
|
+
export declare class TxHttpPrefixPipe implements PipeTransform {
|
|
22
|
+
transform(link: string | null | undefined, protocol?: 'https' | 'http'): string;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxHttpPrefixPipe, never>;
|
|
24
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TxHttpPrefixPipe, "txHttpPrefix", true>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=tectra-ng-utils-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-text.d.ts","names":[],"sources":["../../../../packages/utils/text/src/text.ts"],"mappings":";;YAEY;wBAMI,SAAS,kCAAkC,gBAAY,gBAAe,WAAU,oBAA4B;wBAgB5G,WAAW;wBAIX,iBAAiB;wBAIjB,eAAe,iCAAiC;wBAQhD,cAAc;wBAad,QAAQ,eAAe;wBASvB,WAAW;qBAKd,0BAA0B;EACrC,UAAU,kCAAkC,gBAAY,gBAAe,WAAU;SADtE,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA;;qBAOA,4BAA4B;EACvC,UAAU;SADC,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA;;qBAOA,4BAA4B;EACvC,UAAU,iCAAiC;SADhC,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InjectionToken, Provider } from "@angular/core";
|
|
3
|
+
import { RouterStateSnapshot, TitleStrategy } from "@angular/router";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
export interface TxTitleConfig {
|
|
6
|
+
appName: string;
|
|
7
|
+
separator?: string;
|
|
8
|
+
translate?: (page: string) => string | Observable<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare const TX_TITLE_CONFIG: InjectionToken<TxTitleConfig>;
|
|
11
|
+
export declare class TxTitle {
|
|
12
|
+
private readonly title;
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly page$;
|
|
15
|
+
private readonly prefix$;
|
|
16
|
+
private touched;
|
|
17
|
+
constructor();
|
|
18
|
+
setPage(page: string | undefined): void;
|
|
19
|
+
setPrefix(prefix: string): void;
|
|
20
|
+
private translate;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxTitle, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
23
|
+
}
|
|
24
|
+
export declare class TxTitleStrategy extends TitleStrategy {
|
|
25
|
+
private readonly txTitle;
|
|
26
|
+
updateTitle(snapshot: RouterStateSnapshot): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TxTitleStrategy, never>;
|
|
28
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
29
|
+
}
|
|
30
|
+
export declare function provideTxTitle(config: TxTitleConfig): Provider[];
|
|
31
|
+
//# sourceMappingURL=tectra-ng-utils-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-title.d.ts","names":[],"sources":["../../../../packages/utils/title/src/title.ts"],"mappings":";;;;iBAMiB;EACf;EACA;EACA,aAAa,0BAA0B;;qBAG5B,iBAAe,eAAA;qBAGf;mBACM;mBACA;mBACA;mBACA;UACT;;EAeR,QAAQ;EAKR,UAAU;UAKF;SA9BG,MAAA,GAAA,qBAAA;;;qBAwCA,wBAAwB;mBAClB;EAER,YAAY,UAAU;SAHpB,MAAA,GAAA,qBAAA;;;wBAQG,eAAe,QAAQ,gBAAgB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ValidatorFn } from "@angular/forms";
|
|
2
|
+
export interface TxUrlValidatorOptions {
|
|
3
|
+
https?: boolean;
|
|
4
|
+
host?: string | RegExp;
|
|
5
|
+
}
|
|
6
|
+
export interface TxStrongPasswordOptions {
|
|
7
|
+
minLength?: number;
|
|
8
|
+
upper?: boolean;
|
|
9
|
+
lower?: boolean;
|
|
10
|
+
digit?: boolean;
|
|
11
|
+
symbol?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TxIpValidatorOptions {
|
|
14
|
+
cidr?: boolean;
|
|
15
|
+
ipv6?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface TxDuplicateValidatorOptions {
|
|
18
|
+
message?: string | (() => string);
|
|
19
|
+
caseSensitive?: boolean;
|
|
20
|
+
trim?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface TxCssSelectorValidatorOptions {
|
|
23
|
+
allowClass?: boolean;
|
|
24
|
+
allowId?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const TX_DOMAIN_PATTERN = "^\\s*([a-zA-Z\\u0400-\\u04FF0-9]{1,63}(-+[a-zA-Z\\u0400-\\u04FF0-9]{1,63})*\\.)+(xn--[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,57}[a-zA-Z0-9])?|[a-zA-Z\\u0400-\\u04FF]{2,63})\\.?\\s*$";
|
|
27
|
+
export declare function parsePrice(value: unknown): number | null;
|
|
28
|
+
declare function numericCode(length?: number): ValidatorFn;
|
|
29
|
+
declare function isoDate(): ValidatorFn;
|
|
30
|
+
declare function futureDate(): ValidatorFn;
|
|
31
|
+
declare function url(options?: TxUrlValidatorOptions): ValidatorFn;
|
|
32
|
+
declare function strongPassword(options?: TxStrongPasswordOptions): ValidatorFn;
|
|
33
|
+
declare function matchFields(field: string, confirmField: string, errorKey?: string): ValidatorFn;
|
|
34
|
+
declare function distinctFields(first: string, second: string): ValidatorFn;
|
|
35
|
+
declare function ip(options?: TxIpValidatorOptions): ValidatorFn;
|
|
36
|
+
declare function domain(): ValidatorFn;
|
|
37
|
+
declare function duplicate(taken: readonly string[] | (() => readonly string[]), options?: TxDuplicateValidatorOptions): ValidatorFn;
|
|
38
|
+
declare function time24(): ValidatorFn;
|
|
39
|
+
declare function noUnsafeChars(): ValidatorFn;
|
|
40
|
+
declare function jsonObject(): ValidatorFn;
|
|
41
|
+
declare function exactValue(expected: string, message?: string): ValidatorFn;
|
|
42
|
+
declare function cssSelector(options?: TxCssSelectorValidatorOptions): ValidatorFn;
|
|
43
|
+
declare function requiredWhen(field: string, isRequired?: (value: unknown) => boolean): ValidatorFn;
|
|
44
|
+
declare function arraySumMax(field: string, max: number): ValidatorFn;
|
|
45
|
+
declare function price(): ValidatorFn;
|
|
46
|
+
export declare const TxValidators: {
|
|
47
|
+
readonly numericCode: typeof numericCode;
|
|
48
|
+
readonly isoDate: typeof isoDate;
|
|
49
|
+
readonly futureDate: typeof futureDate;
|
|
50
|
+
readonly url: typeof url;
|
|
51
|
+
readonly strongPassword: typeof strongPassword;
|
|
52
|
+
readonly matchFields: typeof matchFields;
|
|
53
|
+
readonly distinctFields: typeof distinctFields;
|
|
54
|
+
readonly ip: typeof ip;
|
|
55
|
+
readonly domain: typeof domain;
|
|
56
|
+
readonly duplicate: typeof duplicate;
|
|
57
|
+
readonly time24: typeof time24;
|
|
58
|
+
readonly noUnsafeChars: typeof noUnsafeChars;
|
|
59
|
+
readonly jsonObject: typeof jsonObject;
|
|
60
|
+
readonly exactValue: typeof exactValue;
|
|
61
|
+
readonly cssSelector: typeof cssSelector;
|
|
62
|
+
readonly requiredWhen: typeof requiredWhen;
|
|
63
|
+
readonly arraySumMax: typeof arraySumMax;
|
|
64
|
+
readonly price: typeof price;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=tectra-ng-utils-validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-validators.d.ts","names":[],"sources":["../../../../packages/utils/validators/src/validators.types.ts","../../../../packages/utils/validators/src/validators.ts"],"mappings":";iBAAiB;EACf;EACA,gBAAgB;;iBAGD;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;;iBAGe;EACf;EACA;EACA;;iBAGe;EACf;EACA;;qBCvBW;wBA8BG,WAAW;iBAUlB,YAAY,kBAAa;iBAKzB,WAAW;iBAiBX,cAAc;iBAgBd,IAAI,UAAS,wBAA6B;iBAkB1C,eAAe,UAAS,0BAA+B;iBAmBvD,YAAY,eAAe,sBAAsB,oBAAwB;iBAkBzE,eAAe,eAAe,iBAAiB;iBAW/C,GAAG,UAAS,uBAA4B;iBAWxC,UAAU;iBAIV,UAAU,sDAAsD,UAAS,8BAAmC;iBAkB5G,UAAU;iBAIV,iBAAiB;iBAgBjB,cAAc;iBAed,WAAW,kBAAkB,mBAAmB;iBAUhD,YAAY,UAAS,gCAAqC;iBAc1D,aAAa,eAAe,cAAa,6BAAuC;iBAUhF,YAAY,eAAe,cAAc;iBAUzC,SAAS;qBAaL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils.d.ts","names":[],"sources":["../../../../packages/utils/index.ts"],"mappings":"AAAA,qBAAa"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Validators
|
|
2
|
+
|
|
3
|
+
Form validators apps write again and again, next to Angular's `Validators`. Every one lets an empty value through (pair it with `Validators.required`), and every error key has a translated text in `tx-field-error` / `tx-field`, so a field shows a message with no extra setup.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
readonly form = new FormGroup(
|
|
7
|
+
{
|
|
8
|
+
website: new FormControl('', TxValidators.url()),
|
|
9
|
+
password: new FormControl('', [Validators.required, TxValidators.strongPassword()]),
|
|
10
|
+
confirm: new FormControl(''),
|
|
11
|
+
},
|
|
12
|
+
{ validators: TxValidators.matchFields('password', 'confirm', 'passwordMismatch') },
|
|
13
|
+
);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Functions
|
|
17
|
+
| Name | Description |
|
|
18
|
+
|---|---|
|
|
19
|
+
| TxValidators.numericCode(length?) | Exactly `length` digits (6) — one-time codes. Error `invalidCodeFormat: { length }` |
|
|
20
|
+
| TxValidators.isoDate() | A real calendar date as `yyyy-MM-dd`. Error `invalidDate` |
|
|
21
|
+
| TxValidators.futureDate() | Not earlier than the current minute. Error `pastDate` |
|
|
22
|
+
| TxValidators.url({ https?, host? }) | A link; `https` only by default (`false` allows `http`); `host` — a domain (subdomains pass) or a RegExp. Error `invalidUrl` |
|
|
23
|
+
| TxValidators.strongPassword({ minLength?, upper?, lower?, digit?, symbol? }) | 6+ characters with upper and lower case letters and a symbol by default; any script. Error `weakPassword: { minLength, missing }` |
|
|
24
|
+
| TxValidators.matchFields(field, confirmField, errorKey?) | Group validator: the second field equals the first; the error also lands on the second field. Error `mismatch` (or your key, e.g. `passwordMismatch`) |
|
|
25
|
+
| TxValidators.distinctFields(first, second) | Group validator: two enabled fields differ. Error `distinctControls` |
|
|
26
|
+
| TxValidators.ip({ cidr?, ipv6? }) | IPv4, with a `/mask` when `cidr`, IPv6 when `ipv6`. Error `invalidIp: { value }` |
|
|
27
|
+
| TxValidators.domain() | A domain name, Cyrillic and punycode included. Error `invalidDomain` |
|
|
28
|
+
| TxValidators.duplicate(taken, { message?, caseSensitive?, trim? }) | Not one of the taken values (an array or a getter). Error `duplicate` |
|
|
29
|
+
| TxValidators.time24() | `HH:mm` from `00:00` to `23:59`. Error `invalidTime` |
|
|
30
|
+
| TxValidators.noUnsafeChars() | No control characters, `<` or `>`. Error `pattern` |
|
|
31
|
+
| TxValidators.jsonObject() | Text that parses to a JSON object. Error `invalidJson` |
|
|
32
|
+
| TxValidators.exactValue(expected, message?) | Typed confirmation ("type DELETE"). Error `valueMismatch: { expected }` |
|
|
33
|
+
| TxValidators.cssSelector({ allowClass?, allowId? }) | `.class` or `#id`. Error `pattern` |
|
|
34
|
+
| TxValidators.requiredWhen(field, isRequired?) | Required while a sibling field is set (or `isRequired(value)` says so). Error `required` |
|
|
35
|
+
| TxValidators.arraySumMax(field, max) | Array validator: the sum of `field` over the rows is at most `max`. Error `sumExceeded: { max, total }` |
|
|
36
|
+
| TxValidators.price() | Up to 12 digits and 2 decimals, `.` or `,`, above zero. Errors `priceFormat`, `pricePositive` |
|
|
37
|
+
| parsePrice(value) | A number from a price text, or `null` |
|
|
38
|
+
|
|
39
|
+
## Constants
|
|
40
|
+
| Name | Description |
|
|
41
|
+
|---|---|
|
|
42
|
+
| TX_DOMAIN_PATTERN | The domain pattern as a string, for `Validators.pattern` or a key filter |
|