@tectra-ng/utils 0.4.3 → 0.4.5
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/clock/README.md +1 -1
- package/date/README.md +8 -1
- package/fesm2022/tectra-ng-utils-auto-focus.mjs +3 -3
- package/fesm2022/tectra-ng-utils-breakpoint.mjs +3 -3
- package/fesm2022/tectra-ng-utils-clipboard.mjs +10 -41
- package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-clock.mjs +8 -16
- package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-currency.mjs +3 -3
- package/fesm2022/tectra-ng-utils-date.mjs +37 -26
- package/fesm2022/tectra-ng-utils-date.mjs.map +1 -1
- package/fesm2022/tectra-ng-utils-debounce-input.mjs +3 -3
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs +3 -3
- package/fesm2022/tectra-ng-utils-file.mjs +3 -3
- package/fesm2022/tectra-ng-utils-filter-state.mjs +6 -6
- package/fesm2022/tectra-ng-utils-filter.mjs +6 -6
- package/fesm2022/tectra-ng-utils-form-changes.mjs +3 -3
- package/fesm2022/tectra-ng-utils-form-validation.mjs +6 -6
- package/fesm2022/tectra-ng-utils-go-back.mjs +3 -3
- package/fesm2022/tectra-ng-utils-http.mjs +9 -9
- package/fesm2022/tectra-ng-utils-in-view.mjs +6 -6
- package/fesm2022/tectra-ng-utils-number.mjs +3 -3
- package/fesm2022/tectra-ng-utils-plural.mjs +6 -6
- package/fesm2022/tectra-ng-utils-relative-time.mjs +3 -3
- package/fesm2022/tectra-ng-utils-scroll-end.mjs +3 -3
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs +3 -3
- package/fesm2022/tectra-ng-utils-style-class.mjs +3 -3
- package/fesm2022/tectra-ng-utils-text.mjs +9 -9
- package/fesm2022/tectra-ng-utils-title.mjs +6 -6
- package/fesm2022/tectra-ng-utils.mjs +1 -1
- package/package.json +5 -5
- package/types/tectra-ng-utils-clipboard.d.ts.map +1 -1
- package/types/tectra-ng-utils-clock.d.ts +1 -3
- package/types/tectra-ng-utils-clock.d.ts.map +1 -1
- package/types/tectra-ng-utils-date.d.ts +20 -2
- package/types/tectra-ng-utils-date.d.ts.map +1 -1
- package/types/tectra-ng-utils.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tectra-ng/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Angular utilities on signals next to the tectra components: date, number, relative time, plural, file size and currency pipes; debounced input, copy to clipboard, in view, defer, drag scroll and auto focus directives; form validators and scroll to the first invalid field; filters kept in storage and the URL; HTTP params, retries and polling; clock, page title, router scrolling and breakpoints. Server rendering safe.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://tectra-ng.com/components/date",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@angular/platform-browser": "^22.2.0",
|
|
35
35
|
"@angular/router": "^22.2.0",
|
|
36
36
|
"rxjs": "^7.8.0",
|
|
37
|
-
"@tectra-ng/core": "^0.4.
|
|
38
|
-
"@tectra-ng/icons": "^0.4.
|
|
39
|
-
"@tectra-ng/themes": "^0.4.
|
|
40
|
-
"@tectra-ng/ui": "^0.4.
|
|
37
|
+
"@tectra-ng/core": "^0.4.5",
|
|
38
|
+
"@tectra-ng/icons": "^0.4.5",
|
|
39
|
+
"@tectra-ng/themes": "^0.4.5",
|
|
40
|
+
"@tectra-ng/ui": "^0.4.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@angular/forms": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-clipboard.d.ts","names":[],"sources":["../../../../packages/utils/clipboard/src/clipboard.ts","../../../../packages/utils/clipboard/src/copy.directive.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clipboard.d.ts","names":[],"sources":["../../../../packages/utils/clipboard/src/clipboard.ts","../../../../packages/utils/clipboard/src/copy.directive.ts"],"mappings":";;iBAOiB;;EAEf;;EAEA;;;;;;wBAGc,gBAAgB,cAAc,WAAU,uBAA6C;;qBAMxF;mBACM;mBACA;mBACA;;EAEX,KAAK,2CAA2C,UAAS,gBAAqB;SALzE,MAAA,GAAA,qBAAA;;;;;;;qBCJA;mBACM;mBACA;;WAER,+BAAK;;WACL,qCAAW;;WACX,0CAAgB;;WAEhB,gCAAM;;WACN,oCAAU;qBAEA;;EAEb,QAAQ;YAeJ,MAAM,OAAO;SA5BZ,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAM;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA"}
|
|
@@ -15,10 +15,8 @@ export interface TxCountdownState {
|
|
|
15
15
|
* @see https://tectra-ng.com/components/clock
|
|
16
16
|
*/
|
|
17
17
|
export declare class TxClock {
|
|
18
|
-
|
|
19
|
-
/** Signal of `Date.now()`, updated every second in the browser */
|
|
18
|
+
/** Signal of `Date.now()`, updated at the start of every second in the browser; the same signal as `TxTimeSource.every('second')` of `@tectra-ng/core/utils`, so it ticks together with every `tx-analog-clock` */
|
|
20
19
|
readonly now: Signal<number>;
|
|
21
|
-
constructor();
|
|
22
20
|
/** Signals `remainingMs`, `isExpired` (the target passed) and `isEndingSoon` (less than `endingSoonMs` left) for a date or a signal of one */
|
|
23
21
|
countdown(target: Signal<TxDateInput> | TxDateInput, endingSoonMs?: number): TxCountdownState;
|
|
24
22
|
/** The date is later than `now()` */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-clock.d.ts","names":[],"sources":["../../../../packages/utils/clock/src/clock.ts"],"mappings":";;;;iBAKiB;;EAEf,aAAa;;EAEb,WAAW;;EAEX,cAAc;;;;;;qBAIH
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clock.d.ts","names":[],"sources":["../../../../packages/utils/clock/src/clock.ts"],"mappings":";;;;iBAKiB;;EAEf,aAAa;;EAEb,WAAW;;EAEX,cAAc;;;;;;qBAIH;;WACF,KAAK;;EAEd,UAAU,QAAQ,OAAO,eAAe,aAAa,wBAAmB;;EAaxE,WAAW,OAAO;SAhBP,MAAA,GAAA,qBAAA"}
|
|
@@ -15,6 +15,17 @@ export interface TxDateFormatConfig {
|
|
|
15
15
|
/** Time zone of the formatted dates; the local one when not set. */
|
|
16
16
|
timezone: string | undefined;
|
|
17
17
|
}
|
|
18
|
+
/** Options of `formatTxDate`; every field is optional. */
|
|
19
|
+
export interface TxDateFormatOptions {
|
|
20
|
+
/** Locale of the formatted date (default `en-US`). */
|
|
21
|
+
locale?: string;
|
|
22
|
+
/** Time zone: an offset (`'+0200'`), `'UTC'` or an IANA name; the local one when not set. */
|
|
23
|
+
timezone?: string;
|
|
24
|
+
/** Text returned for an empty or invalid date (default `-`). */
|
|
25
|
+
empty?: string;
|
|
26
|
+
/** Locale of an Angular pattern when Angular has no locale data for `locale` (default `en-US`); `null` returns the empty text instead. */
|
|
27
|
+
fallbackLocale?: string | null;
|
|
28
|
+
}
|
|
18
29
|
/** A date range as two ISO strings. */
|
|
19
30
|
export interface TxIsoRange {
|
|
20
31
|
/** First day or moment of the range. */
|
|
@@ -94,6 +105,15 @@ export declare const TX_DATE_STYLES: {
|
|
|
94
105
|
readonly dateStyle: "long";
|
|
95
106
|
};
|
|
96
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* Formats a date by the rules of the `txDate` pipe, without dependency injection: usable in services, workers, tests and plain functions.
|
|
110
|
+
*
|
|
111
|
+
* `format` is `Intl.DateTimeFormat` options (`TX_DATE_STYLES.dateTime`) or an Angular date pattern (`'dd.MM.yyyy'`, `'mediumDate'`);
|
|
112
|
+
* a medium date when not set. Returns `options.empty` (`-`) for an empty or invalid value, and when the format or time zone fails.
|
|
113
|
+
*
|
|
114
|
+
* @example formatTxDate(order.paidAt, TX_DATE_STYLES.dateTime, { locale: 'uk-UA', timezone: 'Europe/Kyiv' })
|
|
115
|
+
*/
|
|
116
|
+
export declare function formatTxDate(value: TxDateInput, format?: TxDateFormat, options?: TxDateFormatOptions): string;
|
|
97
117
|
/**
|
|
98
118
|
* A new `Date` from a `Date`, string or number; `null` when empty or invalid
|
|
99
119
|
* @see https://tectra-ng.com/components/date
|
|
@@ -173,8 +193,6 @@ export declare class TxDatePipe implements PipeTransform {
|
|
|
173
193
|
private lastKey;
|
|
174
194
|
private lastText;
|
|
175
195
|
transform(value: TxDateInput, format?: TxDateFormat, timezone?: string, locale?: string): string;
|
|
176
|
-
private format;
|
|
177
|
-
private formatPattern;
|
|
178
196
|
static ɵfac: i0.ɵɵFactoryDeclaration<TxDatePipe, never>;
|
|
179
197
|
static ɵpipe: i0.ɵɵPipeDeclaration<TxDatePipe, "txDate", true>;
|
|
180
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-utils-date.d.ts","names":[],"sources":["../../../../packages/utils/date/src/date.types.ts","../../../../packages/utils/date/src/date.config.ts","../../../../packages/utils/date/src/date.constants.ts","../../../../packages/utils/date/src/date.functions.ts","../../../../packages/utils/date/src/date.pipe.ts"],"mappings":";;;YACY,cAAc;;YAGd,wBAAwB,KAAK;;iBAGxB;;EAEf,QAAQ;;EAER;;EAEA;;EAEA;;;iBAIe;;EAEf;;EAEA;;;
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-date.d.ts","names":[],"sources":["../../../../packages/utils/date/src/date.types.ts","../../../../packages/utils/date/src/date.config.ts","../../../../packages/utils/date/src/date.constants.ts","../../../../packages/utils/date/src/date.format.ts","../../../../packages/utils/date/src/date.functions.ts","../../../../packages/utils/date/src/date.pipe.ts"],"mappings":";;;YACY,cAAc;;YAGd,wBAAwB,KAAK;;iBAGxB;;EAEf,QAAQ;;EAER;;EAEA;;EAEA;;;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