@tectra-ng/utils 0.3.2 → 0.4.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.
Files changed (78) hide show
  1. package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -1
  2. package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -1
  3. package/fesm2022/tectra-ng-utils-currency.mjs.map +1 -1
  4. package/fesm2022/tectra-ng-utils-date.mjs.map +1 -1
  5. package/fesm2022/tectra-ng-utils-drag-scroll.mjs.map +1 -1
  6. package/fesm2022/tectra-ng-utils-file.mjs.map +1 -1
  7. package/fesm2022/tectra-ng-utils-filter-state.mjs.map +1 -1
  8. package/fesm2022/tectra-ng-utils-filter.mjs.map +1 -1
  9. package/fesm2022/tectra-ng-utils-form-changes.mjs.map +1 -1
  10. package/fesm2022/tectra-ng-utils-form-validation.mjs.map +1 -1
  11. package/fesm2022/tectra-ng-utils-http.mjs.map +1 -1
  12. package/fesm2022/tectra-ng-utils-in-view.mjs.map +1 -1
  13. package/fesm2022/tectra-ng-utils-polling.mjs.map +1 -1
  14. package/fesm2022/tectra-ng-utils-selection.mjs.map +1 -1
  15. package/fesm2022/tectra-ng-utils-text.mjs.map +1 -1
  16. package/fesm2022/tectra-ng-utils-title.mjs.map +1 -1
  17. package/fesm2022/tectra-ng-utils-validators.mjs.map +1 -1
  18. package/fesm2022/tectra-ng-utils.mjs +1 -1
  19. package/fesm2022/tectra-ng-utils.mjs.map +1 -1
  20. package/package.json +5 -5
  21. package/types/tectra-ng-utils-auto-focus.d.ts +7 -0
  22. package/types/tectra-ng-utils-auto-focus.d.ts.map +1 -1
  23. package/types/tectra-ng-utils-breakpoint.d.ts +15 -0
  24. package/types/tectra-ng-utils-breakpoint.d.ts.map +1 -1
  25. package/types/tectra-ng-utils-clipboard.d.ts +19 -0
  26. package/types/tectra-ng-utils-clipboard.d.ts.map +1 -1
  27. package/types/tectra-ng-utils-clock.d.ts +11 -0
  28. package/types/tectra-ng-utils-clock.d.ts.map +1 -1
  29. package/types/tectra-ng-utils-currency.d.ts +9 -0
  30. package/types/tectra-ng-utils-currency.d.ts.map +1 -1
  31. package/types/tectra-ng-utils-date.d.ts +96 -0
  32. package/types/tectra-ng-utils-date.d.ts.map +1 -1
  33. package/types/tectra-ng-utils-debounce-input.d.ts +11 -0
  34. package/types/tectra-ng-utils-debounce-input.d.ts.map +1 -1
  35. package/types/tectra-ng-utils-drag-scroll.d.ts +13 -0
  36. package/types/tectra-ng-utils-drag-scroll.d.ts.map +1 -1
  37. package/types/tectra-ng-utils-file.d.ts +21 -0
  38. package/types/tectra-ng-utils-file.d.ts.map +1 -1
  39. package/types/tectra-ng-utils-filter-state.d.ts +58 -0
  40. package/types/tectra-ng-utils-filter-state.d.ts.map +1 -1
  41. package/types/tectra-ng-utils-filter.d.ts +29 -0
  42. package/types/tectra-ng-utils-filter.d.ts.map +1 -1
  43. package/types/tectra-ng-utils-form-changes.d.ts +18 -0
  44. package/types/tectra-ng-utils-form-changes.d.ts.map +1 -1
  45. package/types/tectra-ng-utils-form-validation.d.ts +26 -0
  46. package/types/tectra-ng-utils-form-validation.d.ts.map +1 -1
  47. package/types/tectra-ng-utils-go-back.d.ts +8 -0
  48. package/types/tectra-ng-utils-go-back.d.ts.map +1 -1
  49. package/types/tectra-ng-utils-http.d.ts +72 -0
  50. package/types/tectra-ng-utils-http.d.ts.map +1 -1
  51. package/types/tectra-ng-utils-in-view.d.ts +19 -0
  52. package/types/tectra-ng-utils-in-view.d.ts.map +1 -1
  53. package/types/tectra-ng-utils-plural.d.ts +23 -0
  54. package/types/tectra-ng-utils-plural.d.ts.map +1 -1
  55. package/types/tectra-ng-utils-polling.d.ts +69 -0
  56. package/types/tectra-ng-utils-polling.d.ts.map +1 -1
  57. package/types/tectra-ng-utils-random.d.ts +12 -0
  58. package/types/tectra-ng-utils-random.d.ts.map +1 -1
  59. package/types/tectra-ng-utils-relative-time.d.ts +16 -0
  60. package/types/tectra-ng-utils-relative-time.d.ts.map +1 -1
  61. package/types/tectra-ng-utils-scroll-end.d.ts +10 -0
  62. package/types/tectra-ng-utils-scroll-end.d.ts.map +1 -1
  63. package/types/tectra-ng-utils-selection.d.ts +16 -0
  64. package/types/tectra-ng-utils-selection.d.ts.map +1 -1
  65. package/types/tectra-ng-utils-stop-propagation.d.ts +6 -0
  66. package/types/tectra-ng-utils-stop-propagation.d.ts.map +1 -1
  67. package/types/tectra-ng-utils-stream.d.ts +8 -0
  68. package/types/tectra-ng-utils-stream.d.ts.map +1 -1
  69. package/types/tectra-ng-utils-style-class.d.ts +17 -0
  70. package/types/tectra-ng-utils-style-class.d.ts.map +1 -1
  71. package/types/tectra-ng-utils-text.d.ts +41 -0
  72. package/types/tectra-ng-utils-text.d.ts.map +1 -1
  73. package/types/tectra-ng-utils-title.d.ts +14 -0
  74. package/types/tectra-ng-utils-title.d.ts.map +1 -1
  75. package/types/tectra-ng-utils-validators.d.ts +61 -0
  76. package/types/tectra-ng-utils-validators.d.ts.map +1 -1
  77. package/types/tectra-ng-utils.d.ts +2 -1
  78. package/types/tectra-ng-utils.d.ts.map +1 -1
@@ -1,60 +1,129 @@
1
1
  import { Observable } from "rxjs";
2
2
  import { TxHttpRetryOptions } from "@tectra-ng/utils/http";
3
+ /** A pause that grows with each poll. */
3
4
  export interface TxPollBackoff {
5
+ /** First pause in ms. */
4
6
  startMs: number;
7
+ /** Multiplier applied to the pause after each poll. */
5
8
  factor: number;
9
+ /** Longest pause in ms. */
6
10
  maxMs: number;
7
11
  }
12
+ /** Pause between polls: a fixed number of ms or a growing back-off. */
8
13
  export type TxPollDelay = number | TxPollBackoff;
14
+ /** Shared options of `poll` and `TxPoller`: when to go on, how long to wait and how to handle errors. */
9
15
  export interface TxPollOptions<T> {
16
+ /** Tells from a response whether the job is still running; polling stops when it returns `false`. */
10
17
  isActive: (value: T) => boolean;
18
+ /** Pause between polls (default: back-off from 2 s by 1.5 up to 15 s). */
11
19
  delay?: TxPollDelay;
20
+ /** Most polls after the first request (default: no limit). */
12
21
  maxAttempts?: number;
22
+ /** Retry settings for failed reads; `false` turns retries off (default: the `retryHttpReads` defaults). */
13
23
  retry?: TxHttpRetryOptions | false;
24
+ /** Ignores a failed poll and tries again instead of ending with the error (default `false`). */
14
25
  skipErrors?: boolean;
26
+ /** Waits while the tab is hidden (default `true`). */
15
27
  pauseWhenHidden?: boolean;
16
28
  }
29
+ /** Config of `poll`: the request and the shared options. */
17
30
  export interface TxPollConfig<T> extends TxPollOptions<T> {
31
+ /** Loads the state of the job; gets the number of the attempt, starting at 0. */
18
32
  request: (attempt: number) => Observable<T>;
33
+ /** A response already known: polling starts from it instead of the first request. */
19
34
  initial?: T;
20
35
  }
36
+ /** What `TxPoller` passes to its request. */
21
37
  export interface TxPollerRequest<TParams> {
38
+ /** Parameters given to `start`. */
22
39
  params: TParams;
40
+ /** Number of the attempt, starting at 0. */
23
41
  attempt: number;
24
42
  }
43
+ /** Config of `TxPoller`: the request and the shared options. */
25
44
  export interface TxPollerConfig<TParams, T> extends TxPollOptions<T> {
45
+ /** Loads the state of the job from the parameters and the attempt number. */
26
46
  request: (data: TxPollerRequest<TParams>) => Observable<T>;
27
47
  }
48
+ /** Error of a polling request in a simple form. */
28
49
  export interface TxPollingError {
50
+ /** HTTP status, `0` when there was no response. */
29
51
  status: number;
52
+ /** Message from the response body, or `null`. */
30
53
  message: string | null;
31
54
  }
55
+ /** Config of `refreshEvery`: what to load and how often. */
32
56
  export interface TxRefreshEveryConfig<T> {
57
+ /** Loads fresh data; the next call waits until it ends. */
33
58
  request: () => Observable<T>;
59
+ /** Pause between loads in ms. */
34
60
  delay: number;
61
+ /** Skips a tick while it returns `false`. */
35
62
  when?: () => boolean;
63
+ /** Loads at once instead of after the first pause (default `false`). */
36
64
  immediate?: boolean;
65
+ /** Skips ticks while the tab is hidden (default `true`). */
37
66
  pauseWhenHidden?: boolean;
67
+ /** Ignores a failed load and goes on (default `true`). */
38
68
  skipErrors?: boolean;
39
69
  }
70
+ /**
71
+ * `{ startMs: 2000, factor: 1.5, maxMs: 15000 }`
72
+ * @see https://tectra-ng.com/components/polling
73
+ */
40
74
  export declare const TX_POLL_DEFAULT_DELAY: TxPollBackoff;
75
+ /**
76
+ * `{ startMs: 5000, factor: 1.5, maxMs: 30000 }`
77
+ * @see https://tectra-ng.com/components/polling
78
+ */
41
79
  export declare const TX_POLL_SLOW_DELAY: TxPollBackoff;
80
+ /**
81
+ * The wait before an attempt
82
+ * @see https://tectra-ng.com/components/polling
83
+ */
42
84
  export declare function pollDelay(delay: TxPollDelay, attempt: number): number;
85
+ /**
86
+ * Tab visibility helpers
87
+ * @see https://tectra-ng.com/components/polling
88
+ */
43
89
  export declare function isPageHidden(): boolean;
90
+ /** Emits at once when the tab is visible, otherwise when it becomes visible again. */
44
91
  export declare function waitUntilVisible(): Observable<void>;
92
+ /**
93
+ * `{ status, message }` from an `HttpErrorResponse` (`message` from `error.error` or `error.message` of the body)
94
+ * @see https://tectra-ng.com/components/polling
95
+ */
45
96
  export declare function toPollingError(error: unknown): TxPollingError;
97
+ /**
98
+ * Emits every answer while `isActive(answer)` is true, then completes. `delay` — ms or `{ startMs, factor, maxMs }` (`TX_POLL_DEFAULT_DELAY`); `retry` — options of `retryHttpReads` or `false`; `skipErrors` keeps polling after a failed try; `initial` — a value you already have, so the first request waits for the delay
99
+ * @see https://tectra-ng.com/components/polling
100
+ */
46
101
  export declare function poll<T>(config: TxPollConfig<T>): Observable<T>;
102
+ /**
103
+ * Runs `request` every `delay` ms while `when()` is true, skipping a tick while the previous request still runs; errors are skipped by default
104
+ * @see https://tectra-ng.com/components/polling
105
+ */
47
106
  export declare function refreshEvery<T>(config: TxRefreshEveryConfig<T>): Observable<T>;
107
+ /**
108
+ * A poller with state for a page: `config` is the `poll` options with `request({ params, attempt })`
109
+ * @see https://tectra-ng.com/components/polling
110
+ */
48
111
  export declare class TxPoller<TParams, T> {
49
112
  private readonly config;
50
113
  private readonly restarts;
51
114
  private readonly stops;
115
+ /** Signals: waiting for the first answer, polling, the last error (`TxPollingError`) */
52
116
  readonly isLoading: import("@angular/core").WritableSignal<boolean>;
117
+ /** Signals: waiting for the first answer, polling, the last error (`TxPollingError`) */
53
118
  readonly isPolling: import("@angular/core").WritableSignal<boolean>;
119
+ /** Signals: waiting for the first answer, polling, the last error (`TxPollingError`) */
54
120
  readonly error: import("@angular/core").WritableSignal<TxPollingError | null>;
55
121
  constructor(config: TxPollerConfig<TParams, T>);
122
+ /** Starts polling for these params (stops the previous run); subscribe to get the answers */
56
123
  watch(params: TParams): Observable<T>;
124
+ /** Polls again from the first request with the same params */
57
125
  restart(): void;
126
+ /** Stops and clears the error */
58
127
  stop(): void;
59
128
  private cycle;
60
129
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-utils-polling.d.ts","names":[],"sources":["../../../../packages/utils/polling/src/polling.types.ts","../../../../packages/utils/polling/src/poll.ts","../../../../packages/utils/polling/src/poller.ts"],"mappings":";;iBAGiB;EACf;EACA;EACA;;YAGU,uBAAuB;iBAElB,cAAc;EAC7B,WAAW,OAAO;EAClB,QAAQ;EACR;EACA,QAAQ;EACR;EACA;;iBAGe,aAAa,WAAW,cAAc;EACrD,UAAU,oBAAoB,WAAW;EACzC,UAAU;;iBAGK,gBAAgB;EAC/B,QAAQ;EACR;;iBAGe,eAAe,SAAS,WAAW,cAAc;EAChE,UAAU,MAAM,gBAAgB,aAAa,WAAW;;iBAGzC;EACf;EACA;;iBAGe,qBAAqB;EACpC,eAAe,WAAW;EAC1B;EACA;EACA;EACA;EACA;;qBCxCW,uBAAuB;qBACvB,oBAAoB;wBASjB,UAAU,OAAO,aAAa;wBAI9B;wBAIA,oBAAoB;wBAYpB,eAAe,iBAAiB;wBAQhC,KAAK,GAAG,QAAQ,aAAa,KAAK,WAAW;wBAsB7C,aAAa,GAAG,QAAQ,qBAAqB,KAAK,WAAW;qBC5DhE,SAAS,SAAS;mBAQA;mBAPZ;mBACA;WAER,mCAAS;WACT,mCAAS;WACT,+BAAK,eAAA;EAEe,YAAA,QAAQ,eAAe,SAAS;EAE7D,MAAM,QAAQ,UAAU,WAAW;EASnC;EAIA;UAKQ"}
1
+ {"version":3,"file":"tectra-ng-utils-polling.d.ts","names":[],"sources":["../../../../packages/utils/polling/src/polling.types.ts","../../../../packages/utils/polling/src/poll.ts","../../../../packages/utils/polling/src/poller.ts"],"mappings":";;;iBAIiB;;EAEf;;EAEA;;EAEA;;;YAIU,uBAAuB;;iBAGlB,cAAc;;EAE7B,WAAW,OAAO;;EAElB,QAAQ;;EAER;;EAEA,QAAQ;;EAER;;EAEA;;;iBAIe,aAAa,WAAW,cAAc;;EAErD,UAAU,oBAAoB,WAAW;;EAEzC,UAAU;;;iBAIK,gBAAgB;;EAE/B,QAAQ;;EAER;;;iBAIe,eAAe,SAAS,WAAW,cAAc;;EAEhE,UAAU,MAAM,gBAAgB,aAAa,WAAW;;;iBAIzC;;EAEf;;EAEA;;;iBAIe,qBAAqB;;EAEpC,eAAe,WAAW;;EAE1B;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;qBCtEW,uBAAuB;;;;;qBACvB,oBAAoB;;;;;wBASjB,UAAU,OAAO,aAAa;;;;;wBAI9B;;wBAKA,oBAAoB;;;;;wBAYpB,eAAe,iBAAiB;;;;;wBAQhC,KAAK,GAAG,QAAQ,aAAa,KAAK,WAAW;;;;;wBAsB7C,aAAa,GAAG,QAAQ,qBAAqB,KAAK,WAAW;;;;;qBC7DhE,SAAS,SAAS;mBAQA;mBAPZ;mBACA;;WAER,mCAAS;;WACT,mCAAS;;WACT,+BAAK,eAAA;EAEe,YAAA,QAAQ,eAAe,SAAS;;EAE7D,MAAM,QAAQ,UAAU,WAAW;;EASnC;;EAIA;UAKQ"}
@@ -1,4 +1,16 @@
1
+ /**
2
+ * One item, or `null` for an empty list
3
+ * @see https://tectra-ng.com/components/random
4
+ */
1
5
  export declare function pickRandom<T>(items: readonly T[] | null | undefined, random?: () => number): T | null;
6
+ /**
7
+ * Up to `count` different items
8
+ * @see https://tectra-ng.com/components/random
9
+ */
2
10
  export declare function pickRandomN<T>(items: readonly T[] | null | undefined, count: number, random?: () => number): T[];
11
+ /**
12
+ * A shuffled copy; the input stays as it is
13
+ * @see https://tectra-ng.com/components/random
14
+ */
3
15
  export declare function shuffle<T>(items: readonly T[], random?: () => number): T[];
4
16
  //# sourceMappingURL=tectra-ng-utils-random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-utils-random.d.ts","names":[],"sources":["../../../../packages/utils/random/src/random.ts"],"mappings":"AAAA,wBAAgB,WAAW,GAAG,gBAAgB,wBAAwB,wBAAqC;wBAO3F,YAAY,GAAG,gBAAgB,wBAAwB,eAAe,wBAAqC;wBAa3G,QAAQ,GAAG,gBAAgB,KAAK,wBAAqC"}
1
+ {"version":3,"file":"tectra-ng-utils-random.d.ts","names":[],"sources":["../../../../packages/utils/random/src/random.ts"],"mappings":";;;;AAAA,wBAAgB,WAAW,GAAG,gBAAgB,wBAAwB,wBAAqC;;;;;wBAO3F,YAAY,GAAG,gBAAgB,wBAAwB,eAAe,wBAAqC;;;;;wBAa3G,QAAQ,GAAG,gBAAgB,KAAK,wBAAqC"}
@@ -1,16 +1,32 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { PipeTransform } from "@angular/core";
3
3
  import { TxDateInput } from "@tectra-ng/utils/date";
4
+ /** Smallest step of a relative time: `time` (seconds, minutes, hours) or `day`. */
4
5
  export type TxRelativeTimeGranularity = 'time' | 'day';
6
+ /** Options of `txRelativeTime` and `relativeTime`. */
5
7
  export interface TxRelativeTimeOptions {
8
+ /** Locale of the text (default `en-US`; the pipe uses the tectra locale). */
6
9
  locale?: string;
10
+ /** The moment to compare with (default: now). */
7
11
  now?: Date | number;
12
+ /** `time` (default) counts seconds, minutes and hours within a day; `day` counts whole days only. */
8
13
  granularity?: TxRelativeTimeGranularity;
14
+ /** Largest unit used: `day`, `month` or `year` (default `year`). */
9
15
  largestUnit?: 'day' | 'month' | 'year';
16
+ /** `auto` (default) says "yesterday", `always` says "1 day ago". */
10
17
  numeric?: 'auto' | 'always';
18
+ /** Length of the text: `long` (default), `short` or `narrow`. */
11
19
  style?: 'long' | 'short' | 'narrow';
12
20
  }
21
+ /**
22
+ * The function behind the pipe; `en-US` unless `locale` is given
23
+ * @see https://tectra-ng.com/components/relative-time
24
+ */
13
25
  export declare function relativeTime(value: TxDateInput, options?: TxRelativeTimeOptions): string;
26
+ /**
27
+ * The text for a `Date`, ISO string or timestamp; `''` when empty or invalid. Follows the tectra locale
28
+ * @see https://tectra-ng.com/components/relative-time
29
+ */
14
30
  export declare class TxRelativeTimePipe implements PipeTransform {
15
31
  private readonly localeService;
16
32
  private lastKey;
@@ -1 +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"}
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":";;;;YACY;;iBAGK;;EAEf;;EAEA,MAAM;;EAEN,cAAc;;EAEd;;EAEA;;EAEA;;;;;;wBCRc,aAAa,OAAO,aAAa,UAAS;;;;;qBAkC7C,8BAA8B;mBACxB;UACT;UACA;EAER,UAAU,OAAO,aAAa,UAAS;SAL5B,MAAA,GAAA,qBAAA;SAAA,OAAA,GAAA,kBAAA"}
@@ -1,13 +1,23 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Infinite scrolling for a box: asks for the next page when the user scrolls near the end, once per page — it waits until new content makes the box taller — and stops when everything is loaded.
4
+ * @see https://tectra-ng.com/components/scroll-end
5
+ */
2
6
  export declare class TxScrollEnd {
3
7
  private readonly host;
4
8
  private reportedHeight;
9
+ /** Distance from the end in px that counts as the end */
5
10
  readonly offset: import("@angular/core").InputSignalWithTransform<number, unknown>;
11
+ /** How many there are; no more requests once `currentCount` reaches it */
6
12
  readonly maxLimit: import("@angular/core").InputSignalWithTransform<number, unknown>;
13
+ /** How many items are loaded */
7
14
  readonly currentCount: import("@angular/core").InputSignalWithTransform<number, unknown>;
15
+ /** Stops asking, e.g. while a page loads */
8
16
  readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
17
+ /** Time to load the next page */
9
18
  readonly scrolledToBottom: import("@angular/core").OutputEmitterRef<void>;
10
19
  check(): void;
20
+ /** Forget the last height — after replacing the list with a shorter one (`exportAs: 'txScrollEnd'`) */
11
21
  reset(): void;
12
22
  static ɵfac: i0.ɵɵFactoryDeclaration<TxScrollEnd, never>;
13
23
  static ɵdir: i0.ɵɵDirectiveDeclaration<TxScrollEnd, "[txScrollEnd]", ["txScrollEnd"], {
@@ -1 +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"}
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"}
@@ -1,19 +1,35 @@
1
1
  import { Signal } from "@angular/core";
2
+ /**
3
+ * Checked rows of a list or a table by key, in a signal: one, a filtered part or all, with the state of a header checkbox (all, some, none). Keys survive paging and filtering, so a selection made on one page stays when the user goes to the next.
4
+ * @see https://tectra-ng.com/components/selection
5
+ */
2
6
  export declare class TxSelection<T> {
3
7
  private readonly getKey;
4
8
  private readonly selected;
9
+ /** Signals of the selected keys and their number */
5
10
  readonly selectedIds: Signal<ReadonlySet<string>>;
11
+ /** Signals of the selected keys and their number */
6
12
  readonly count: Signal<number>;
7
13
  constructor(getKey: (item: T) => string);
14
+ /** Every item that passes the predicate */
8
15
  select(predicate: (item: T) => boolean, items: readonly T[], isChecked: boolean): void;
16
+ /** Checks or unchecks one; flips it without `checked` */
9
17
  toggleOne(idOrItem: string | T, isChecked?: boolean): void;
18
+ /** All of these items; flips them as a group without `checked` */
10
19
  toggleAll(items: readonly T[], isChecked?: boolean): void;
20
+ /** One item is checked */
11
21
  isSelected(idOrItem: string | T): boolean;
22
+ /** Every item (that passes the predicate) is checked; `false` for an empty list */
12
23
  areAllSelected(items: readonly T[]): boolean;
24
+ /** Whether every item that passes the predicate is selected. */
13
25
  areAllSelectedWithPredicate(items: readonly T[], predicate: (item: T) => boolean): boolean;
26
+ /** Some but not all — the indeterminate header checkbox */
14
27
  isPartial(items: readonly T[]): boolean;
28
+ /** The checked items among these */
15
29
  selectedItems(items: readonly T[]): T[];
30
+ /** Replaces or empties the selection */
16
31
  setSelected(ids: readonly string[]): void;
32
+ /** Unselects everything. */
17
33
  clear(): void;
18
34
  private keyOf;
19
35
  private change;
@@ -1 +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"}
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;;EAK/B,4BAA4B,gBAAgB,KAAK,YAAY,MAAM;;EAInE,UAAU,gBAAgB;;EAK1B,cAAc,gBAAgB,MAAM;;EAIpC,YAAY;;EAKZ;UAIQ;UAIA"}
@@ -1,8 +1,14 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Keeps a click (or other events) inside an element — a menu button in a clickable card or table row, a link inside an expandable header. Optionally prevents the default action too.
4
+ * @see https://tectra-ng.com/components/stop-propagation
5
+ */
2
6
  export declare class TxStopPropagation {
3
7
  private readonly element;
4
8
  private readonly renderer;
9
+ /** Events to stop: `click` by default, or a list (`"click keydown"`) */
5
10
  readonly events: import("@angular/core").InputSignalWithTransform<readonly string[], unknown>;
11
+ /** Also prevent the default action */
6
12
  readonly preventDefault: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
7
13
  constructor();
8
14
  static ɵfac: i0.ɵɵFactoryDeclaration<TxStopPropagation, never>;
@@ -1 +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"}
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"}
@@ -1,3 +1,11 @@
1
+ /**
2
+ * The same as an async iterator: `for await (const chunk of textChunks(response))`
3
+ * @see https://tectra-ng.com/components/stream
4
+ */
1
5
  export declare function textChunks(response: Response): AsyncGenerator<string>;
6
+ /**
7
+ * Calls `onChunk(chunk, textSoFar)` for every piece and resolves to the whole text
8
+ * @see https://tectra-ng.com/components/stream
9
+ */
2
10
  export declare function readTextStream(response: Response, onChunk: (chunk: string, text: string) => void): Promise<string>;
3
11
  //# sourceMappingURL=tectra-ng-utils-stream.d.ts.map
@@ -1 +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"}
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"}
@@ -1,4 +1,8 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Shows, hides or toggles another element by classes from a button, with enter and leave animations — small menus, collapsible sections, a mobile nav — without writing a component. The target is the next or previous sibling, the parent, the grandparent or any CSS selector. The leave animation finishes before the hiding class lands; animations are skipped with reduced motion. The host gets `aria-expanded`.
4
+ * @see https://tectra-ng.com/components/style-class
5
+ */
2
6
  export declare class TxStyleClass {
3
7
  private readonly host;
4
8
  private readonly renderer;
@@ -6,20 +10,33 @@ export declare class TxStyleClass {
6
10
  private readonly listeners;
7
11
  private animating;
8
12
  private endTimer;
13
+ /** Target: `@next` (default), `@prev`, `@parent`, `@grandparent` or a selector */
9
14
  readonly selector: import("@angular/core").InputSignalWithTransform<string, unknown>;
15
+ /** Removed when the target opens (e.g. `hidden`) */
10
16
  readonly enterFromClass: import("@angular/core").InputSignal<string | undefined>;
17
+ /** Added while the target opens, until its animation or transition ends */
11
18
  readonly enterActiveClass: import("@angular/core").InputSignal<string | undefined>;
19
+ /** Added when the target is open */
12
20
  readonly enterToClass: import("@angular/core").InputSignal<string | undefined>;
21
+ /** Added when the target starts to close */
13
22
  readonly leaveFromClass: import("@angular/core").InputSignal<string | undefined>;
23
+ /** Added while the target closes */
14
24
  readonly leaveActiveClass: import("@angular/core").InputSignal<string | undefined>;
25
+ /** Added when the target is closed (e.g. `hidden`); also tells that it is closed */
15
26
  readonly leaveToClass: import("@angular/core").InputSignal<string | undefined>;
27
+ /** Just toggles these classes on the target, no open / close */
16
28
  readonly toggleClass: import("@angular/core").InputSignal<string | undefined>;
29
+ /** Closes on a click outside the target and the host */
17
30
  readonly hideOnOutsideClick: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
31
+ /** Closes on Escape and returns the focus to the host */
18
32
  readonly hideOnEscape: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
33
+ /** Closes when the window is resized */
19
34
  readonly hideOnResize: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
35
+ /** Signal: the target is open */
20
36
  readonly expanded: import("@angular/core").WritableSignal<boolean>;
21
37
  constructor();
22
38
  target(): HTMLElement | null;
39
+ /** Open or close from code (`exportAs: 'txStyleClass'`) */
23
40
  toggle(): void;
24
41
  enter(target?: HTMLElement | null): void;
25
42
  leave(target?: HTMLElement | null): void;
@@ -1 +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"}
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"}
@@ -1,23 +1,64 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { PipeTransform } from "@angular/core";
3
+ /** Where `txTruncate` cuts the text: at the `end` or in the `middle`. */
3
4
  export type TxTruncatePosition = 'end' | 'middle';
5
+ /**
6
+ * The function behind `txTruncate`
7
+ * @see https://tectra-ng.com/components/text
8
+ */
4
9
  export declare function truncate(value: string | null | undefined, limit?: number, trail?: string, position?: TxTruncatePosition, empty?: string): string;
10
+ /**
11
+ * The function behind `txCapitalize`
12
+ * @see https://tectra-ng.com/components/text
13
+ */
5
14
  export declare function capitalize(value: string | null | undefined): string;
15
+ /**
16
+ * Trimmed lower case — compare keywords and tags
17
+ * @see https://tectra-ng.com/components/text
18
+ */
6
19
  export declare function normalizeKeyword(value: string | null | undefined): string;
20
+ /**
21
+ * The function behind `txHttpPrefix`
22
+ * @see https://tectra-ng.com/components/text
23
+ */
7
24
  export declare function withHttpPrefix(link: string | null | undefined, protocol?: 'https' | 'http'): string;
25
+ /**
26
+ * Ukrainian and Russian letters to Latin, the case kept (`Щука` → `Shchuka`)
27
+ * @see https://tectra-ng.com/components/text
28
+ */
8
29
  export declare function transliterate(value: string): string;
30
+ /**
31
+ * Latin lower-case slug for URLs and file names (`Привіт, світе!` → `privit-svite`)
32
+ * @see https://tectra-ng.com/components/text
33
+ */
9
34
  export declare function slugify(value: string, separator?: string): string;
35
+ /**
36
+ * `&`, `<`, `>`, `"` and `'` as entities, for attributes and text you build by hand
37
+ * @see https://tectra-ng.com/components/text
38
+ */
10
39
  export declare function escapeHtml(value: string): string;
40
+ /**
41
+ * Cuts after `limit` characters (15) and adds the trail (`...`); `middle` keeps the start and the end; `-` for an empty value. Emoji count as one character
42
+ * @see https://tectra-ng.com/components/text
43
+ */
11
44
  export declare class TxTruncatePipe implements PipeTransform {
12
45
  transform(value: string | null | undefined, limit?: number, trail?: string, position?: TxTruncatePosition): string;
13
46
  static ɵfac: i0.ɵɵFactoryDeclaration<TxTruncatePipe, never>;
14
47
  static ɵpipe: i0.ɵɵPipeDeclaration<TxTruncatePipe, "txTruncate", true>;
15
48
  }
49
+ /**
50
+ * First letter upper case, the rest as it is
51
+ * @see https://tectra-ng.com/components/text
52
+ */
16
53
  export declare class TxCapitalizePipe implements PipeTransform {
17
54
  transform(value: string | null | undefined): string;
18
55
  static ɵfac: i0.ɵɵFactoryDeclaration<TxCapitalizePipe, never>;
19
56
  static ɵpipe: i0.ɵɵPipeDeclaration<TxCapitalizePipe, "txCapitalize", true>;
20
57
  }
58
+ /**
59
+ * Adds `https://` (or `http://`) when the link has no scheme; `mailto:` and others stay
60
+ * @see https://tectra-ng.com/components/text
61
+ */
21
62
  export declare class TxHttpPrefixPipe implements PipeTransform {
22
63
  transform(link: string | null | undefined, protocol?: 'https' | 'http'): string;
23
64
  static ɵfac: i0.ɵɵFactoryDeclaration<TxHttpPrefixPipe, never>;
@@ -1 +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"}
1
+ {"version":3,"file":"tectra-ng-utils-text.d.ts","names":[],"sources":["../../../../packages/utils/text/src/text.ts"],"mappings":";;;YAGY;;;;;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"}
@@ -2,12 +2,18 @@ import * as i0 from "@angular/core";
2
2
  import { InjectionToken, Provider } from "@angular/core";
3
3
  import { RouterStateSnapshot, TitleStrategy } from "@angular/router";
4
4
  import { Observable } from "rxjs";
5
+ /** Settings of the tab title, passed to `provideTxTitle`. */
5
6
  export interface TxTitleConfig {
7
+ /** App name shown after the page title. */
6
8
  appName: string;
9
+ /** Text between the page title and the app name (default ` · `). */
7
10
  separator?: string;
11
+ /** Turns the title of a route into the shown text, as a string or an observable. */
8
12
  translate?: (page: string) => string | Observable<string>;
9
13
  }
14
+ /** App name, separator and translation of page titles; set with `provideTxTitle`. */
10
15
  export declare const TX_TITLE_CONFIG: InjectionToken<TxTitleConfig>;
16
+ /** Builds the tab title as "prefix page · app"; set the page and a prefix such as a counter. */
11
17
  export declare class TxTitle {
12
18
  private readonly title;
13
19
  private readonly config;
@@ -15,17 +21,25 @@ export declare class TxTitle {
15
21
  private readonly prefix$;
16
22
  private touched;
17
23
  constructor();
24
+ /** Sets the page part by hand, for a title that is not on a route (a record name) */
18
25
  setPage(page: string | undefined): void;
26
+ /** Text before every title, `''` to remove it */
19
27
  setPrefix(prefix: string): void;
20
28
  private translate;
21
29
  static ɵfac: i0.ɵɵFactoryDeclaration<TxTitle, never>;
22
30
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
23
31
  }
32
+ /** Router title strategy that sets the page part of the tab title through `TxTitle`. */
24
33
  export declare class TxTitleStrategy extends TitleStrategy {
25
34
  private readonly txTitle;
35
+ /** Sets the page title from the route titles after each navigation. */
26
36
  updateTitle(snapshot: RouterStateSnapshot): void;
27
37
  static ɵfac: i0.ɵɵFactoryDeclaration<TxTitleStrategy, never>;
28
38
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
29
39
  }
40
+ /**
41
+ * Sets the router title strategy: `title` of the route, then the separator (` · `), then the app name; `translate(key)` returns text or an `Observable` of it
42
+ * @see https://tectra-ng.com/components/title
43
+ */
30
44
  export declare function provideTxTitle(config: TxTitleConfig): Provider[];
31
45
  //# sourceMappingURL=tectra-ng-utils-title.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"tectra-ng-utils-title.d.ts","names":[],"sources":["../../../../packages/utils/title/src/title.ts"],"mappings":";;;;;iBAOiB;;EAEf;;EAEA;;EAEA,aAAa,0BAA0B;;;qBAI5B,iBAAe,eAAA;;qBAIf;mBACM;mBACA;mBACA;mBACA;UACT;;;EAeR,QAAQ;;EAKR,UAAU;UAKF;SA9BG,MAAA,GAAA,qBAAA;;;;qBAyCA,wBAAwB;mBAClB;;EAGR,YAAY,UAAU;SAJpB,MAAA,GAAA,qBAAA;;;;;;;wBASG,eAAe,QAAQ,gBAAgB"}
@@ -1,48 +1,109 @@
1
1
  import { ValidatorFn } from "@angular/forms";
2
+ /** Options of `TxValidators.url`. */
2
3
  export interface TxUrlValidatorOptions {
4
+ /** Allows `https` only (default `true`); `false` also allows `http`. */
3
5
  https?: boolean;
6
+ /** Required host: a name that matches it or its subdomains, or a pattern for the host name. */
4
7
  host?: string | RegExp;
5
8
  }
9
+ /** Options of `TxValidators.strongPassword`. */
6
10
  export interface TxStrongPasswordOptions {
11
+ /** Shortest password (default 6). */
7
12
  minLength?: number;
13
+ /** Needs an uppercase letter (default `true`). */
8
14
  upper?: boolean;
15
+ /** Needs a lowercase letter (default `true`). */
9
16
  lower?: boolean;
17
+ /** Needs a digit (default `false`). */
10
18
  digit?: boolean;
19
+ /** Needs a symbol that is not a letter, digit or space (default `true`). */
11
20
  symbol?: boolean;
12
21
  }
22
+ /** Options of `TxValidators.ip`. */
13
23
  export interface TxIpValidatorOptions {
24
+ /** Needs a CIDR suffix such as `/24` on IPv4 (default `false`). */
14
25
  cidr?: boolean;
26
+ /** Also accepts IPv6 addresses (default `false`). */
15
27
  ipv6?: boolean;
16
28
  }
29
+ /** Options of `TxValidators.duplicate`. */
17
30
  export interface TxDuplicateValidatorOptions {
31
+ /** Own error text, or a function that returns it. */
18
32
  message?: string | (() => string);
33
+ /** Tells `A` from `a` (default `false`). */
19
34
  caseSensitive?: boolean;
35
+ /** Ignores spaces around the value (default `true`). */
20
36
  trim?: boolean;
21
37
  }
38
+ /** Options of `TxValidators.cssSelector`. */
22
39
  export interface TxCssSelectorValidatorOptions {
40
+ /** Accepts a class selector like `.name` (default `true`). */
23
41
  allowClass?: boolean;
42
+ /** Accepts an id selector like `#name` (default `true`). */
24
43
  allowId?: boolean;
25
44
  }
45
+ /**
46
+ * The domain pattern as a string, for `Validators.pattern` or a key filter
47
+ * @see https://tectra-ng.com/components/validators
48
+ */
26
49
  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*$";
50
+ /**
51
+ * A number from a price text, or `null`
52
+ * @see https://tectra-ng.com/components/validators
53
+ */
27
54
  export declare function parsePrice(value: unknown): number | null;
55
+ /** A fixed number of digits, such as a code from a message (default 6); error `invalidCodeFormat`. */
28
56
  declare function numericCode(length?: number): ValidatorFn;
57
+ /** A real calendar date as `YYYY-MM-DD`; error `invalidDate`. */
29
58
  declare function isoDate(): ValidatorFn;
59
+ /** A date and time not in the past, compared to the minute; errors `invalidDate`, `pastDate`. */
30
60
  declare function futureDate(): ValidatorFn;
61
+ /**
62
+ * A web address with no spaces; `https` only unless `https: false`, optionally for one host or its
63
+ * subdomains; error `invalidUrl`.
64
+ */
31
65
  declare function url(options?: TxUrlValidatorOptions): ValidatorFn;
66
+ /**
67
+ * Checks the password length and the kinds of characters it needs; error `weakPassword` lists what is
68
+ * missing.
69
+ */
32
70
  declare function strongPassword(options?: TxStrongPasswordOptions): ValidatorFn;
71
+ /**
72
+ * For a group: the confirm field must equal another field; sets the error on the confirm field too
73
+ * (default key `mismatch`).
74
+ */
33
75
  declare function matchFields(field: string, confirmField: string, errorKey?: string): ValidatorFn;
76
+ /** For a group: two enabled fields must differ; error `distinctControls`. */
34
77
  declare function distinctFields(first: string, second: string): ValidatorFn;
78
+ /** An IPv4 address, optionally with a CIDR suffix or as IPv6; error `invalidIp`. */
35
79
  declare function ip(options?: TxIpValidatorOptions): ValidatorFn;
80
+ /** A domain name such as `example.com`; error `invalidDomain`. */
36
81
  declare function domain(): ValidatorFn;
82
+ /** The value must not be in the list of taken values, which can be a function; error `duplicate`. */
37
83
  declare function duplicate(taken: readonly string[] | (() => readonly string[]), options?: TxDuplicateValidatorOptions): ValidatorFn;
84
+ /** A time as `HH:mm` on the 24-hour clock; error `invalidTime`. */
38
85
  declare function time24(): ValidatorFn;
86
+ /** Rejects control characters and the angle brackets `<` and `>`; error `pattern`. */
39
87
  declare function noUnsafeChars(): ValidatorFn;
88
+ /** A JSON text whose value is an object, not an array or a primitive; error `invalidJson`. */
40
89
  declare function jsonObject(): ValidatorFn;
90
+ /** The value must equal the expected text, as in a delete confirmation; error `valueMismatch`. */
41
91
  declare function exactValue(expected: string, message?: string): ValidatorFn;
92
+ /** A simple class or id selector such as `.title` or `#main`; error `pattern`. */
42
93
  declare function cssSelector(options?: TxCssSelectorValidatorOptions): ValidatorFn;
94
+ /**
95
+ * The control is required while a sibling control's value passes the check (default: it is truthy);
96
+ * error `required`.
97
+ */
43
98
  declare function requiredWhen(field: string, isRequired?: (value: unknown) => boolean): ValidatorFn;
99
+ /** For a form array: the sum of one field over its items must not exceed a maximum; error `sumExceeded`. */
44
100
  declare function arraySumMax(field: string, max: number): ValidatorFn;
101
+ /** A positive number with a point or comma as the decimal sign; errors `priceFormat`, `pricePositive`. */
45
102
  declare function price(): ValidatorFn;
103
+ /**
104
+ * Exactly `length` digits (6) — one-time codes. Error `invalidCodeFormat: { length }`
105
+ * @see https://tectra-ng.com/components/validators
106
+ */
46
107
  export declare const TxValidators: {
47
108
  readonly numericCode: typeof numericCode;
48
109
  readonly isoDate: typeof isoDate;
@@ -1 +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"}
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":";;iBACiB;;EAEf;;EAEA,gBAAgB;;;iBAID;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;iBAIe;;EAEf;;EAEA;;;iBAIe;;EAEf;;EAEA;;EAEA;;;iBAIe;;EAEf;;EAEA;;;;;;qBC1CW;;;;;wBA8BG,WAAW;;iBAWlB,YAAY,kBAAa;;iBAMzB,WAAW;;iBAkBX,cAAc;;;;;iBAoBd,IAAI,UAAS,wBAA6B;;;;;iBAsB1C,eAAe,UAAS,0BAA+B;;;;;iBAuBvD,YAAY,eAAe,sBAAsB,oBAAwB;;iBAmBzE,eAAe,eAAe,iBAAiB;;iBAY/C,GAAG,UAAS,uBAA4B;;iBAYxC,UAAU;;iBAKV,UAAU,sDAAsD,UAAS,8BAAmC;;iBAmB5G,UAAU;;iBAKV,iBAAiB;;iBAiBjB,cAAc;;iBAgBd,WAAW,kBAAkB,mBAAmB;;iBAWhD,YAAY,UAAS,gCAAqC;;;;;iBAkB1D,aAAa,eAAe,cAAa,6BAAuC;;iBAWhF,YAAY,eAAe,cAAc;;iBAWzC,SAAS;;;;;qBAaL"}
@@ -1,2 +1,3 @@
1
- export declare const TECTRA_UTILS_VERSION = "0.0.0";
1
+ /** Version of the installed `@tectra-ng/utils` package, written in when the package is built. */
2
+ export declare const TECTRA_UTILS_VERSION = "0.4.1";
2
3
  //# sourceMappingURL=tectra-ng-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tectra-ng-utils.d.ts","names":[],"sources":["../../../../packages/utils/index.ts"],"mappings":"AAAA,qBAAa"}
1
+ {"version":3,"file":"tectra-ng-utils.d.ts","names":[],"sources":["../../../../packages/utils/index.ts"],"mappings":"AACA;qBAAa"}