@tectra-ng/ui 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/amount/README.md +19 -1
- package/analog-clock/README.md +1 -1
- package/autocomplete/README.md +1 -1
- package/avatar/README.md +24 -4
- package/cascade-select/README.md +1 -1
- package/chips-input/README.md +10 -5
- package/color-picker/README.md +5 -0
- package/countdown/README.md +7 -1
- package/country/README.md +14 -1
- package/country-select/README.md +2 -1
- package/export/README.md +27 -2
- package/export-font/README.md +1 -1
- package/fesm2022/tectra-ng-ui-accordion.mjs +21 -21
- package/fesm2022/tectra-ng-ui-amount.mjs +99 -17
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +12 -25
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +8 -7
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-avatar.mjs +68 -26
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +9 -9
- package/fesm2022/tectra-ng-ui-button-group.mjs +3 -3
- package/fesm2022/tectra-ng-ui-button.mjs +11 -11
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-card.mjs +5 -5
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-carousel.mjs +15 -15
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +10 -7
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-checkbox.mjs +9 -9
- package/fesm2022/tectra-ng-ui-chip.mjs +3 -3
- package/fesm2022/tectra-ng-ui-chips-input.mjs +120 -21
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +96 -9
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-swatches.mjs +3 -3
- package/fesm2022/tectra-ng-ui-confirm.mjs +9 -9
- package/fesm2022/tectra-ng-ui-countdown.mjs +48 -19
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country-select.mjs +31 -8
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country.mjs +18 -9
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-data-view.mjs +30 -30
- package/fesm2022/tectra-ng-ui-datepicker.mjs +53 -40
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-dialog.mjs +30 -30
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-divider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-drawer.mjs +9 -9
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +3 -3
- package/fesm2022/tectra-ng-ui-export.mjs +1264 -111
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs +4 -3
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-fieldset.mjs +5 -5
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-file-upload.mjs +12 -12
- package/fesm2022/tectra-ng-ui-galleria.mjs +21 -21
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +3 -3
- package/fesm2022/tectra-ng-ui-icon-field.mjs +63 -35
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-image.mjs +9 -9
- package/fesm2022/tectra-ng-ui-input-group.mjs +6 -6
- package/fesm2022/tectra-ng-ui-input-mask.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input-number.mjs +5 -5
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-otp.mjs +3 -3
- package/fesm2022/tectra-ng-ui-input.mjs +11 -10
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-key-filter.mjs +87 -22
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-knob.mjs +30 -8
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +77 -18
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-link.mjs +44 -20
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-list-input.mjs +3 -3
- package/fesm2022/tectra-ng-ui-listbox.mjs +3 -3
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +19 -8
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menu.mjs +15 -15
- package/fesm2022/tectra-ng-ui-menubar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-message.mjs +23 -19
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +32 -15
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-multiselect.mjs +6 -5
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +3 -3
- package/fesm2022/tectra-ng-ui-paginator.mjs +9 -9
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +51 -20
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel.mjs +7 -5
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs +24 -7
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password.mjs +14 -14
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-pill.mjs +39 -19
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-popover.mjs +15 -15
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +6 -6
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +3 -3
- package/fesm2022/tectra-ng-ui-radio-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-rating.mjs +11 -11
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +3 -3
- package/fesm2022/tectra-ng-ui-select-button.mjs +6 -6
- package/fesm2022/tectra-ng-ui-select.mjs +66 -43
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-skeleton.mjs +6 -6
- package/fesm2022/tectra-ng-ui-slider.mjs +3 -3
- package/fesm2022/tectra-ng-ui-sparkline.mjs +3 -3
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +3 -3
- package/fesm2022/tectra-ng-ui-split-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-splitter.mjs +6 -6
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +99 -14
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-status-icon.mjs +43 -6
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-stepper.mjs +41 -35
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +74 -60
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tabs.mjs +18 -18
- package/fesm2022/tectra-ng-ui-tag.mjs +8 -8
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-textarea.mjs +9 -9
- package/fesm2022/tectra-ng-ui-timeline.mjs +15 -15
- package/fesm2022/tectra-ng-ui-toast.mjs +11 -11
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +3 -3
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +6 -6
- package/fesm2022/tectra-ng-ui-toolbar.mjs +12 -12
- package/fesm2022/tectra-ng-ui-tooltip.mjs +9 -9
- package/fesm2022/tectra-ng-ui-tree-select.mjs +13 -11
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +7 -7
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree.mjs +30 -30
- package/fesm2022/tectra-ng-ui-truncate-text.mjs +36 -12
- package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +15 -15
- package/fesm2022/tectra-ng-ui.mjs +1 -1
- package/icon-field/README.md +2 -1
- package/input/README.md +1 -1
- package/key-filter/README.md +3 -2
- package/knob/README.md +3 -1
- package/label/README.md +4 -1
- package/link/README.md +4 -1
- package/message/README.md +2 -2
- package/month-calendar/README.md +2 -1
- package/multiselect/README.md +1 -1
- package/package.json +4 -4
- package/panel/README.md +3 -1
- package/panel-menu/README.md +3 -2
- package/password-generator/README.md +2 -0
- package/pill/README.md +4 -4
- package/select/README.md +1 -1
- package/stat-tiles/README.md +17 -1
- package/status-icon/README.md +3 -1
- package/table/README.md +1 -1
- package/tag/README.md +2 -0
- package/tree-select/README.md +1 -1
- package/truncate-text/README.md +2 -1
- package/types/tectra-ng-ui-amount.d.ts +41 -1
- package/types/tectra-ng-ui-amount.d.ts.map +1 -1
- package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
- package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
- package/types/tectra-ng-ui-avatar.d.ts +45 -12
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
- package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-chips-input.d.ts +54 -6
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-color-picker.d.ts +38 -1
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
- package/types/tectra-ng-ui-countdown.d.ts +12 -1
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
- package/types/tectra-ng-ui-country-select.d.ts +17 -4
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +7 -1
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-datepicker.d.ts +4 -2
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
- package/types/tectra-ng-ui-export.d.ts +68 -8
- package/types/tectra-ng-ui-export.d.ts.map +1 -1
- package/types/tectra-ng-ui-icon-field.d.ts +9 -2
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
- package/types/tectra-ng-ui-input.d.ts +1 -1
- package/types/tectra-ng-ui-key-filter.d.ts +19 -4
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
- package/types/tectra-ng-ui-knob.d.ts +10 -2
- package/types/tectra-ng-ui-knob.d.ts.map +1 -1
- package/types/tectra-ng-ui-label.d.ts +8 -1
- package/types/tectra-ng-ui-label.d.ts.map +1 -1
- package/types/tectra-ng-ui-link.d.ts +8 -2
- package/types/tectra-ng-ui-link.d.ts.map +1 -1
- package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +1 -1
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
- package/types/tectra-ng-ui-multiselect.d.ts +1 -1
- package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-panel.d.ts +1 -1
- package/types/tectra-ng-ui-panel.d.ts.map +1 -1
- package/types/tectra-ng-ui-password-generator.d.ts +10 -3
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
- package/types/tectra-ng-ui-pill.d.ts +9 -5
- package/types/tectra-ng-ui-pill.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +5 -2
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
- package/types/tectra-ng-ui-status-icon.d.ts +20 -2
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
- package/types/tectra-ng-ui-stepper.d.ts +1 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -1
- package/types/tectra-ng-ui-table.d.ts +2 -1
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +3 -3
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
- package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
- package/types/tectra-ng-ui.d.ts +1 -1
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, InjectionToken, booleanAttribute, computed, inject, input } from "@angular/core";
|
|
3
3
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
4
|
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
5
5
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
6
|
import { amountTokens, toStyleObject } from "@tectra-ng/themes";
|
|
7
7
|
import { provideTxIconDefaults, txIconCode } from "@tectra-ng/icons";
|
|
8
|
+
const TX_AMOUNT_OPTIONS = new InjectionToken("TX_AMOUNT_OPTIONS");
|
|
9
|
+
function provideTxAmount(options) {
|
|
10
|
+
return {
|
|
11
|
+
provide: TX_AMOUNT_OPTIONS,
|
|
12
|
+
useValue: options
|
|
13
|
+
};
|
|
14
|
+
}
|
|
8
15
|
const DIGITS_INFO = /^(\d+)?(?:\.(\d+))?(?:-(\d+))?$/;
|
|
9
16
|
const DEFAULT_FORMAT = "1.0-2";
|
|
17
|
+
const SPACE = /^\s+$/;
|
|
18
|
+
const ENDS_WITH_SYMBOL = /\p{Sc}$/u;
|
|
19
|
+
const NO_BREAK_SPACE = "\xA0";
|
|
10
20
|
function parseDigitsInfo(format) {
|
|
11
21
|
const match = DIGITS_INFO.exec((format ?? "").trim());
|
|
12
22
|
if (!match) return {};
|
|
@@ -32,6 +42,34 @@ function toSegments(parts) {
|
|
|
32
42
|
}
|
|
33
43
|
return segments;
|
|
34
44
|
}
|
|
45
|
+
function ownSymbol(symbols, currency) {
|
|
46
|
+
return symbols?.[currency] ?? symbols?.[currency.toUpperCase()];
|
|
47
|
+
}
|
|
48
|
+
function isSign(part) {
|
|
49
|
+
return part?.type === "minusSign" || part?.type === "plusSign";
|
|
50
|
+
}
|
|
51
|
+
function placeSymbol(parts, position) {
|
|
52
|
+
const index = parts.findIndex((part) => part.type === "currency");
|
|
53
|
+
if (position === "auto" || index < 0) return parts;
|
|
54
|
+
const currency = parts[index];
|
|
55
|
+
const number = parts.filter((part, at) => at !== index && !(Math.abs(at - index) === 1 && part.type === "literal" && SPACE.test(part.value)));
|
|
56
|
+
const space = {
|
|
57
|
+
type: "literal",
|
|
58
|
+
value: NO_BREAK_SPACE
|
|
59
|
+
};
|
|
60
|
+
if (position === "after") return [
|
|
61
|
+
...number,
|
|
62
|
+
space,
|
|
63
|
+
currency
|
|
64
|
+
];
|
|
65
|
+
const lead = isSign(number[0]) ? 1 : 0;
|
|
66
|
+
return [
|
|
67
|
+
...number.slice(0, lead),
|
|
68
|
+
currency,
|
|
69
|
+
...ENDS_WITH_SYMBOL.test(currency.value) ? [] : [space],
|
|
70
|
+
...number.slice(lead)
|
|
71
|
+
];
|
|
72
|
+
}
|
|
35
73
|
function formatAmount(amount, options) {
|
|
36
74
|
const currency = options.currency?.trim();
|
|
37
75
|
const base = (format) => ({
|
|
@@ -40,33 +78,40 @@ function formatAmount(amount, options) {
|
|
|
40
78
|
signDisplay: options.showSign ? "exceptZero" : "auto"
|
|
41
79
|
});
|
|
42
80
|
const plain = base(options.format ?? DEFAULT_FORMAT);
|
|
43
|
-
if (currency)
|
|
44
|
-
|
|
81
|
+
if (!currency) return toSegments(new Intl.NumberFormat(options.locale, plain).formatToParts(amount));
|
|
82
|
+
let parts;
|
|
83
|
+
try {
|
|
84
|
+
parts = new Intl.NumberFormat(options.locale, {
|
|
45
85
|
...base(options.format),
|
|
46
86
|
style: "currency",
|
|
47
87
|
currency,
|
|
48
88
|
currencyDisplay: options.currencyDisplay ?? "narrowSymbol"
|
|
49
|
-
}).formatToParts(amount)
|
|
89
|
+
}).formatToParts(amount);
|
|
50
90
|
} catch {
|
|
51
|
-
|
|
52
|
-
...
|
|
91
|
+
parts = [
|
|
92
|
+
...new Intl.NumberFormat(options.locale, plain).formatToParts(amount),
|
|
53
93
|
{
|
|
54
|
-
|
|
55
|
-
|
|
94
|
+
type: "literal",
|
|
95
|
+
value: " "
|
|
56
96
|
},
|
|
57
97
|
{
|
|
58
|
-
|
|
59
|
-
|
|
98
|
+
type: "currency",
|
|
99
|
+
value: currency
|
|
60
100
|
}
|
|
61
101
|
];
|
|
62
102
|
}
|
|
63
|
-
|
|
103
|
+
const symbol = ownSymbol(options.symbols, currency);
|
|
104
|
+
return toSegments(placeSymbol(symbol === void 0 ? parts : parts.map((part) => part.type === "currency" ? {
|
|
105
|
+
...part,
|
|
106
|
+
value: symbol
|
|
107
|
+
} : part), options.symbolPosition ?? "auto"));
|
|
64
108
|
}
|
|
65
109
|
const AMOUNT_ICON_DEFAULTS = { code: txIconCode };
|
|
66
110
|
const AMOUNT_THEME = { amount: amountTokens };
|
|
67
111
|
var TxAmount = class TxAmount {
|
|
68
112
|
amountTheme = injectTokens(AMOUNT_THEME);
|
|
69
113
|
localeService = inject(TxLocaleService);
|
|
114
|
+
options = inject(TX_AMOUNT_OPTIONS, { optional: true });
|
|
70
115
|
amount = input(null, ...ngDevMode ? [{ debugName: "amount" }] : /* istanbul ignore next */ []);
|
|
71
116
|
currency = input(void 0, ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
|
|
72
117
|
format = input(void 0, ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
|
|
@@ -85,6 +130,8 @@ var TxAmount = class TxAmount {
|
|
|
85
130
|
transform: booleanAttribute
|
|
86
131
|
});
|
|
87
132
|
locale = input(void 0, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
133
|
+
symbolPosition = input(void 0, ...ngDevMode ? [{ debugName: "symbolPosition" }] : /* istanbul ignore next */ []);
|
|
134
|
+
symbols = input(void 0, ...ngDevMode ? [{ debugName: "symbols" }] : /* istanbul ignore next */ []);
|
|
88
135
|
emptyText = input("—", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
|
|
89
136
|
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
90
137
|
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
@@ -108,12 +155,17 @@ var TxAmount = class TxAmount {
|
|
|
108
155
|
const amount = this.amount();
|
|
109
156
|
if (this.isEmpty() || amount === null || amount === void 0) return [];
|
|
110
157
|
return formatAmount(amount, {
|
|
111
|
-
locale: this.locale() ?? this.localeService.locale().intl,
|
|
158
|
+
locale: this.locale() ?? this.options?.locale ?? this.localeService.locale().intl,
|
|
112
159
|
currency: this.currency(),
|
|
113
160
|
format: this.format(),
|
|
114
161
|
notation: this.notation(),
|
|
115
162
|
currencyDisplay: this.currencyDisplay(),
|
|
116
|
-
showSign: this.showSign()
|
|
163
|
+
showSign: this.showSign(),
|
|
164
|
+
symbolPosition: this.symbolPosition() ?? this.options?.symbolPosition,
|
|
165
|
+
symbols: {
|
|
166
|
+
...this.options?.symbols,
|
|
167
|
+
...this.symbols()
|
|
168
|
+
}
|
|
117
169
|
});
|
|
118
170
|
}, ...ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []);
|
|
119
171
|
hostStyle = computed(() => ({
|
|
@@ -122,7 +174,7 @@ var TxAmount = class TxAmount {
|
|
|
122
174
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
123
175
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
124
176
|
minVersion: "12.0.0",
|
|
125
|
-
version: "22.2.
|
|
177
|
+
version: "22.2.6",
|
|
126
178
|
ngImport: i0,
|
|
127
179
|
type: TxAmount,
|
|
128
180
|
deps: [],
|
|
@@ -130,7 +182,7 @@ var TxAmount = class TxAmount {
|
|
|
130
182
|
});
|
|
131
183
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
132
184
|
minVersion: "17.0.0",
|
|
133
|
-
version: "22.2.
|
|
185
|
+
version: "22.2.6",
|
|
134
186
|
type: TxAmount,
|
|
135
187
|
isStandalone: true,
|
|
136
188
|
selector: "tx-amount",
|
|
@@ -198,6 +250,20 @@ var TxAmount = class TxAmount {
|
|
|
198
250
|
isRequired: false,
|
|
199
251
|
transformFunction: null
|
|
200
252
|
},
|
|
253
|
+
symbolPosition: {
|
|
254
|
+
classPropertyName: "symbolPosition",
|
|
255
|
+
publicName: "symbolPosition",
|
|
256
|
+
isSignal: true,
|
|
257
|
+
isRequired: false,
|
|
258
|
+
transformFunction: null
|
|
259
|
+
},
|
|
260
|
+
symbols: {
|
|
261
|
+
classPropertyName: "symbols",
|
|
262
|
+
publicName: "symbols",
|
|
263
|
+
isSignal: true,
|
|
264
|
+
isRequired: false,
|
|
265
|
+
transformFunction: null
|
|
266
|
+
},
|
|
201
267
|
emptyText: {
|
|
202
268
|
classPropertyName: "emptyText",
|
|
203
269
|
publicName: "emptyText",
|
|
@@ -268,7 +334,7 @@ var TxAmount = class TxAmount {
|
|
|
268
334
|
};
|
|
269
335
|
i0.ɵɵngDeclareClassMetadata({
|
|
270
336
|
minVersion: "12.0.0",
|
|
271
|
-
version: "22.2.
|
|
337
|
+
version: "22.2.6",
|
|
272
338
|
ngImport: i0,
|
|
273
339
|
type: TxAmount,
|
|
274
340
|
decorators: [{
|
|
@@ -376,6 +442,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
376
442
|
required: false
|
|
377
443
|
}]
|
|
378
444
|
}],
|
|
445
|
+
symbolPosition: [{
|
|
446
|
+
type: i0.Input,
|
|
447
|
+
args: [{
|
|
448
|
+
isSignal: true,
|
|
449
|
+
alias: "symbolPosition",
|
|
450
|
+
required: false
|
|
451
|
+
}]
|
|
452
|
+
}],
|
|
453
|
+
symbols: [{
|
|
454
|
+
type: i0.Input,
|
|
455
|
+
args: [{
|
|
456
|
+
isSignal: true,
|
|
457
|
+
alias: "symbols",
|
|
458
|
+
required: false
|
|
459
|
+
}]
|
|
460
|
+
}],
|
|
379
461
|
emptyText: [{
|
|
380
462
|
type: i0.Input,
|
|
381
463
|
args: [{
|
|
@@ -418,6 +500,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
418
500
|
}]
|
|
419
501
|
}
|
|
420
502
|
});
|
|
421
|
-
export { TxAmount, formatAmount, parseDigitsInfo };
|
|
503
|
+
export { TX_AMOUNT_OPTIONS, TxAmount, formatAmount, parseDigitsInfo, provideTxAmount };
|
|
422
504
|
|
|
423
505
|
//# sourceMappingURL=tectra-ng-ui-amount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-amount.mjs","names":[],"sources":["../../../../packages/ui/amount/src/format-amount.ts","../../../../packages/ui/amount/src/amount.icons.ts","../../../../packages/ui/amount/src/amount.theme.ts","../../../../packages/ui/amount/src/amount.component.ts"],"sourcesContent":["import { TxAmountFormatOptions, TxAmountSegment } from './amount.types';\n\nconst DIGITS_INFO = /^(\\d+)?(?:\\.(\\d+))?(?:-(\\d+))?$/;\nconst DEFAULT_FORMAT = '1.0-2';\n\n/**\n * Reads a digits-info string like `1.2-2` (integer digits, minimum and maximum fraction digits) into number format options; an invalid string gives no options.\n */\nexport function parseDigitsInfo(format: string | undefined): Pick<Intl.NumberFormatOptions, 'minimumIntegerDigits' | 'minimumFractionDigits' | 'maximumFractionDigits'> {\n const match = DIGITS_INFO.exec((format ?? '').trim());\n if (!match) {\n return {};\n }\n const [, integer, minFraction, maxFraction] = match;\n const minimumFractionDigits = minFraction === undefined ? undefined : Number(minFraction);\n const maximumFractionDigits = maxFraction === undefined ? minimumFractionDigits : Math.max(Number(maxFraction), minimumFractionDigits ?? 0);\n return {\n ...(integer === undefined ? {} : { minimumIntegerDigits: Math.max(1, Number(integer)) }),\n ...(minimumFractionDigits === undefined ? {} : { minimumFractionDigits }),\n ...(maximumFractionDigits === undefined ? {} : { maximumFractionDigits }),\n };\n}\n\nfunction toSegments(parts: Intl.NumberFormatPart[]): TxAmountSegment[] {\n const segments: TxAmountSegment[] = [];\n for (const part of parts) {\n const currency = part.type === 'currency';\n const last = segments[segments.length - 1];\n if (last && last.currency === currency) {\n last.text += part.value;\n } else {\n segments.push({ text: part.value, currency });\n }\n }\n return segments;\n}\n\n/**\n * Formats a number as money in the given locale and currency and splits the result into currency and number segments.\n */\nexport function formatAmount(amount: number, options: TxAmountFormatOptions): TxAmountSegment[] {\n const currency = options.currency?.trim();\n const base = (format: string | undefined): Intl.NumberFormatOptions => ({\n ...parseDigitsInfo(format),\n notation: options.notation ?? 'standard',\n signDisplay: options.showSign ? 'exceptZero' : 'auto',\n });\n const plain = base(options.format ?? DEFAULT_FORMAT);\n if (currency) {\n try {\n return toSegments(\n new Intl.NumberFormat(options.locale, { ...base(options.format), style: 'currency', currency, currencyDisplay: options.currencyDisplay ?? 'narrowSymbol' }).formatToParts(amount),\n );\n } catch {\n return [...toSegments(new Intl.NumberFormat(options.locale, plain).formatToParts(amount)), { text: ' ', currency: false }, { text: currency, currency: true }];\n }\n }\n return toSegments(new Intl.NumberFormat(options.locale, plain).formatToParts(amount));\n}\n","import { TxIconSet, txIconCode } from '@tectra-ng/icons';\n\nexport const AMOUNT_ICON_DEFAULTS: TxIconSet = {\n code: txIconCode,\n};\n","import { amountTokens } from '@tectra-ng/themes';\n\nexport const AMOUNT_THEME = {\n amount: amountTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraAmountTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxAmountCurrencyDisplay, TxAmountNotation, TxAmountPart, TxAmountSign } from './amount.types';\nimport { formatAmount } from './format-amount';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { AMOUNT_ICON_DEFAULTS } from './amount.icons';\nimport { AMOUNT_THEME } from './amount.theme';\n\n@Component({\n selector: 'tx-amount',\n template: `\n @if (isEmpty()) {\n <span class=\"tx-amount__empty\">{{ emptyText() }}</span>\n } @else {\n @for (segment of segments(); track $index) {\n @if (segment.currency) {\n <span class=\"tx-amount__currency\" [class]=\"passThrough().currency?.class\" [style]=\"passThrough().currency?.style\">{{ segment.text }}</span>\n } @else {\n <span class=\"tx-amount__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{ segment.text }}</span>\n }\n }\n }\n `,\n styleUrl: './amount.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-amount',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-sign]': 'signColor() ? sign() : null',\n '[class.tx-amount--strong]': 'strong()',\n '[class.tx-amount--zero]': 'sign() === \"zero\"',\n '[class.tx-amount--empty]': 'isEmpty()',\n },\n viewProviders: [provideTxIconDefaults(AMOUNT_ICON_DEFAULTS)],\n})\nexport class TxAmount {\n private readonly amountTheme = injectTokens(AMOUNT_THEME);\n\n private localeService = inject(TxLocaleService);\n\n readonly amount = input<number | null | undefined>(null);\n readonly currency = input<string | null | undefined>(undefined);\n readonly format = input<string | undefined>(undefined);\n readonly notation = input<TxAmountNotation>('standard');\n readonly currencyDisplay = input<TxAmountCurrencyDisplay>('narrowSymbol');\n readonly showSign = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly signColor = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly strong = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly locale = input<string | undefined>(undefined);\n readonly emptyText = input<string>('—');\n readonly dt = input<TectraDeepPartial<TectraAmountTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAmountPart, TxAmount> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('amount', this, this.pt, this.ptOptions);\n readonly isEmpty = computed(() => {\n const amount = this.amount();\n return amount === null || amount === undefined || Number.isNaN(amount);\n });\n readonly sign = computed<TxAmountSign | null>(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return null;\n }\n return amount > 0 ? 'positive' : amount < 0 ? 'negative' : 'zero';\n });\n readonly segments = computed(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return [];\n }\n return formatAmount(amount, {\n locale: this.locale() ?? this.localeService.locale().intl,\n currency: this.currency(),\n format: this.format(),\n notation: this.notation(),\n currencyDisplay: this.currencyDisplay(),\n showSign: this.showSign(),\n });\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-amount'), ...this.passThrough().root?.style }));\n}\n"],"mappings":";;;;;;;AAEA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AAKvB,SAAgB,gBAAgB,QAA0B;CACxD,MAAM,QAAQ,YAAY,MAAM,UAAU,GAAA,CAAI,KAAI,CAAE;CACpD,IAAI,CAAC,OACH,OAAO,CAAA;CAET,MAAM,GAAG,SAAS,aAAa,eAAe;CAC9C,MAAM,wBAAwB,gBAAgB,SAAY,SAAY,OAAO,WAAW;CACxF,MAAM,wBAAwB,gBAAgB,SAAY,wBAAwB,KAAK,IAAI,OAAO,WAAW,GAAG,yBAAyB,CAAC;CAC1I,OAAO;EACL,GAAI,YAAY,SAAY,CAAA,IAAK,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,OAAO,CAAC,EAAC;EACrF,GAAI,0BAA0B,SAAY,CAAA,IAAK,EAAE,sBAAqB;EACtE,GAAI,0BAA0B,SAAY,CAAA,IAAK,EAAE,sBAAqB;CACvE;AACH;AAEA,SAAS,WAAW,OAA8B;CAChD,MAAM,WAA8B,CAAA;CACpC,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,WAAW,KAAK,SAAS;EAC/B,MAAM,OAAO,SAAS,SAAS,SAAS;EACxC,IAAI,QAAQ,KAAK,aAAa,UAC5B,KAAK,QAAQ,KAAK;OAElB,SAAS,KAAK;GAAE,MAAM,KAAK;GAAO;EAAQ,CAAE;CAEhD;CACA,OAAO;AACT;AAKA,SAAg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AA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EA7BpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,UACX;;;;;;;;;;;;;GAYT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,oBAAoB;IACpB,6BAA6B;IAC7B,2BAA2B;IAC3B,4BAA4B;GAC7B;GAAA,eACc,CAAC,sBAAsB,oBAAoB,CAAC;GAAC,QAAA,CAAA,q3BAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-amount.mjs","names":[],"sources":["../../../../packages/ui/amount/src/amount.options.ts","../../../../packages/ui/amount/src/format-amount.ts","../../../../packages/ui/amount/src/amount.icons.ts","../../../../packages/ui/amount/src/amount.theme.ts","../../../../packages/ui/amount/src/amount.component.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport { TxAmountOptions } from './amount.types';\n\n/** App-wide defaults of every `tx-amount`; set them with `provideTxAmount`. */\nexport const TX_AMOUNT_OPTIONS = new InjectionToken<TxAmountOptions>('TX_AMOUNT_OPTIONS');\n\n/**\n * Sets app-wide defaults of every `tx-amount`: the number locale, where the currency goes and own currency texts,\n * e.g. `provideTxAmount({ locale: 'uk-UA', symbolPosition: 'after', symbols: { USDT: 'USDT' } })`.\n */\nexport function provideTxAmount(options: TxAmountOptions): Provider {\n return { provide: TX_AMOUNT_OPTIONS, useValue: options };\n}\n","import { TxAmountFormatOptions, TxAmountSegment, TxAmountSymbolPosition, TxAmountSymbols } from './amount.types';\n\nconst DIGITS_INFO = /^(\\d+)?(?:\\.(\\d+))?(?:-(\\d+))?$/;\nconst DEFAULT_FORMAT = '1.0-2';\nconst SPACE = /^\\s+$/;\nconst ENDS_WITH_SYMBOL = /\\p{Sc}$/u;\nconst NO_BREAK_SPACE = '\\u00a0';\n\n/**\n * Reads a digits-info string like `1.2-2` (integer digits, minimum and maximum fraction digits) into number format options; an invalid string gives no options.\n */\nexport function parseDigitsInfo(format: string | undefined): Pick<Intl.NumberFormatOptions, 'minimumIntegerDigits' | 'minimumFractionDigits' | 'maximumFractionDigits'> {\n const match = DIGITS_INFO.exec((format ?? '').trim());\n if (!match) {\n return {};\n }\n const [, integer, minFraction, maxFraction] = match;\n const minimumFractionDigits = minFraction === undefined ? undefined : Number(minFraction);\n const maximumFractionDigits = maxFraction === undefined ? minimumFractionDigits : Math.max(Number(maxFraction), minimumFractionDigits ?? 0);\n return {\n ...(integer === undefined ? {} : { minimumIntegerDigits: Math.max(1, Number(integer)) }),\n ...(minimumFractionDigits === undefined ? {} : { minimumFractionDigits }),\n ...(maximumFractionDigits === undefined ? {} : { maximumFractionDigits }),\n };\n}\n\nfunction toSegments(parts: Intl.NumberFormatPart[]): TxAmountSegment[] {\n const segments: TxAmountSegment[] = [];\n for (const part of parts) {\n const currency = part.type === 'currency';\n const last = segments[segments.length - 1];\n if (last && last.currency === currency) {\n last.text += part.value;\n } else {\n segments.push({ text: part.value, currency });\n }\n }\n return segments;\n}\n\nfunction ownSymbol(symbols: TxAmountSymbols | undefined, currency: string): string | undefined {\n return symbols?.[currency] ?? symbols?.[currency.toUpperCase()];\n}\n\nfunction isSign(part: Intl.NumberFormatPart | undefined): boolean {\n return part?.type === 'minusSign' || part?.type === 'plusSign';\n}\n\nfunction placeSymbol(parts: Intl.NumberFormatPart[], position: TxAmountSymbolPosition): Intl.NumberFormatPart[] {\n const index = parts.findIndex((part) => part.type === 'currency');\n if (position === 'auto' || index < 0) {\n return parts;\n }\n const currency = parts[index];\n const number = parts.filter((part, at) => at !== index && !(Math.abs(at - index) === 1 && part.type === 'literal' && SPACE.test(part.value)));\n const space: Intl.NumberFormatPart = { type: 'literal', value: NO_BREAK_SPACE };\n if (position === 'after') {\n return [...number, space, currency];\n }\n const lead = isSign(number[0]) ? 1 : 0;\n return [...number.slice(0, lead), currency, ...(ENDS_WITH_SYMBOL.test(currency.value) ? [] : [space]), ...number.slice(lead)];\n}\n\n/**\n * Formats a number as money in the given locale and currency and splits the result into currency and number segments.\n */\nexport function formatAmount(amount: number, options: TxAmountFormatOptions): TxAmountSegment[] {\n const currency = options.currency?.trim();\n const base = (format: string | undefined): Intl.NumberFormatOptions => ({\n ...parseDigitsInfo(format),\n notation: options.notation ?? 'standard',\n signDisplay: options.showSign ? 'exceptZero' : 'auto',\n });\n const plain = base(options.format ?? DEFAULT_FORMAT);\n if (!currency) {\n return toSegments(new Intl.NumberFormat(options.locale, plain).formatToParts(amount));\n }\n let parts: Intl.NumberFormatPart[];\n try {\n parts = new Intl.NumberFormat(options.locale, { ...base(options.format), style: 'currency', currency, currencyDisplay: options.currencyDisplay ?? 'narrowSymbol' }).formatToParts(amount);\n } catch {\n parts = [...new Intl.NumberFormat(options.locale, plain).formatToParts(amount), { type: 'literal', value: ' ' }, { type: 'currency', value: currency }];\n }\n const symbol = ownSymbol(options.symbols, currency);\n const named = symbol === undefined ? parts : parts.map((part) => (part.type === 'currency' ? { ...part, value: symbol } : part));\n return toSegments(placeSymbol(named, options.symbolPosition ?? 'auto'));\n}\n","import { TxIconSet, txIconCode } from '@tectra-ng/icons';\n\nexport const AMOUNT_ICON_DEFAULTS: TxIconSet = {\n code: txIconCode,\n};\n","import { amountTokens } from '@tectra-ng/themes';\n\nexport const AMOUNT_THEME = {\n amount: amountTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraAmountTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TX_AMOUNT_OPTIONS } from './amount.options';\nimport { TxAmountCurrencyDisplay, TxAmountNotation, TxAmountPart, TxAmountSign, TxAmountSymbolPosition, TxAmountSymbols } from './amount.types';\nimport { formatAmount } from './format-amount';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { AMOUNT_ICON_DEFAULTS } from './amount.icons';\nimport { AMOUNT_THEME } from './amount.theme';\n\n@Component({\n selector: 'tx-amount',\n template: `\n @if (isEmpty()) {\n <span class=\"tx-amount__empty\">{{ emptyText() }}</span>\n } @else {\n @for (segment of segments(); track $index) {\n @if (segment.currency) {\n <span class=\"tx-amount__currency\" [class]=\"passThrough().currency?.class\" [style]=\"passThrough().currency?.style\">{{ segment.text }}</span>\n } @else {\n <span class=\"tx-amount__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{ segment.text }}</span>\n }\n }\n }\n `,\n styleUrl: './amount.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-amount',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-sign]': 'signColor() ? sign() : null',\n '[class.tx-amount--strong]': 'strong()',\n '[class.tx-amount--zero]': 'sign() === \"zero\"',\n '[class.tx-amount--empty]': 'isEmpty()',\n },\n viewProviders: [provideTxIconDefaults(AMOUNT_ICON_DEFAULTS)],\n})\nexport class TxAmount {\n private readonly amountTheme = injectTokens(AMOUNT_THEME);\n\n private localeService = inject(TxLocaleService);\n private options = inject(TX_AMOUNT_OPTIONS, { optional: true });\n\n readonly amount = input<number | null | undefined>(null);\n readonly currency = input<string | null | undefined>(undefined);\n readonly format = input<string | undefined>(undefined);\n readonly notation = input<TxAmountNotation>('standard');\n readonly currencyDisplay = input<TxAmountCurrencyDisplay>('narrowSymbol');\n readonly showSign = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly signColor = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly strong = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly locale = input<string | undefined>(undefined);\n readonly symbolPosition = input<TxAmountSymbolPosition | undefined>(undefined);\n readonly symbols = input<TxAmountSymbols | undefined>(undefined);\n readonly emptyText = input<string>('—');\n readonly dt = input<TectraDeepPartial<TectraAmountTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAmountPart, TxAmount> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('amount', this, this.pt, this.ptOptions);\n readonly isEmpty = computed(() => {\n const amount = this.amount();\n return amount === null || amount === undefined || Number.isNaN(amount);\n });\n readonly sign = computed<TxAmountSign | null>(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return null;\n }\n return amount > 0 ? 'positive' : amount < 0 ? 'negative' : 'zero';\n });\n readonly segments = computed(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return [];\n }\n return formatAmount(amount, {\n locale: this.locale() ?? this.options?.locale ?? this.localeService.locale().intl,\n currency: this.currency(),\n format: this.format(),\n notation: this.notation(),\n currencyDisplay: this.currencyDisplay(),\n showSign: this.showSign(),\n symbolPosition: this.symbolPosition() ?? this.options?.symbolPosition,\n symbols: { ...this.options?.symbols, ...this.symbols() },\n });\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-amount'), ...this.passThrough().root?.style }));\n}\n"],"mappings":";;;;;;;AAIA,MAAa,oBAAoB,IAAI,eAAgC,mBAAmB;AAMxF,SAAgB,gBAAgB,SAAwB;CACtD,OAAO;EAAE,SAAS;EAAmB,UAAU;CAAO;AACxD;ACVA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,QAAQ;AACd,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;AAKvB,SAAgB,gBAAgB,QAA0B;CACxD,MAAM,QAAQ,YAAY,MAAM,UAAU,GAAA,CAAI,KAAI,CAAE;CACpD,IAAI,CAAC,OACH,OAAO,CAAA;CAET,MAAM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AC7B;GAAA,eACc,CAAC,sBAAsB,oBAAoB,CAAC;GAAC,QAAA,CAAA,q3BAAA;EAAA,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Pipe, booleanAttribute, computed, inject, input, linkedSignal } from "@angular/core";
|
|
3
3
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
-
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
4
|
+
import { TxTimeSource, optionalBoolean } from "@tectra-ng/core/utils";
|
|
5
5
|
import { analogClockTokens, toStyleObject } from "@tectra-ng/themes";
|
|
6
6
|
function validTimeZone(timezone) {
|
|
7
7
|
if (!timezone) return void 0;
|
|
@@ -47,7 +47,7 @@ var TxAnalogClockHandsPipe = class TxAnalogClockHandsPipe {
|
|
|
47
47
|
}
|
|
48
48
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
49
49
|
minVersion: "12.0.0",
|
|
50
|
-
version: "22.2.
|
|
50
|
+
version: "22.2.6",
|
|
51
51
|
ngImport: i0,
|
|
52
52
|
type: TxAnalogClockHandsPipe,
|
|
53
53
|
deps: [],
|
|
@@ -55,7 +55,7 @@ var TxAnalogClockHandsPipe = class TxAnalogClockHandsPipe {
|
|
|
55
55
|
});
|
|
56
56
|
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
57
57
|
minVersion: "14.0.0",
|
|
58
|
-
version: "22.2.
|
|
58
|
+
version: "22.2.6",
|
|
59
59
|
ngImport: i0,
|
|
60
60
|
type: TxAnalogClockHandsPipe,
|
|
61
61
|
isStandalone: true,
|
|
@@ -64,7 +64,7 @@ var TxAnalogClockHandsPipe = class TxAnalogClockHandsPipe {
|
|
|
64
64
|
};
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({
|
|
66
66
|
minVersion: "12.0.0",
|
|
67
|
-
version: "22.2.
|
|
67
|
+
version: "22.2.6",
|
|
68
68
|
ngImport: i0,
|
|
69
69
|
type: TxAnalogClockHandsPipe,
|
|
70
70
|
decorators: [{
|
|
@@ -109,10 +109,9 @@ var TxAnalogClock = class TxAnalogClock {
|
|
|
109
109
|
10,
|
|
110
110
|
11
|
|
111
111
|
];
|
|
112
|
-
|
|
113
|
-
timer = null;
|
|
112
|
+
timeSource = inject(TxTimeSource);
|
|
114
113
|
fixedTime = computed(() => clockTime(this.time()), ...ngDevMode ? [{ debugName: "fixedTime" }] : /* istanbul ignore next */ []);
|
|
115
|
-
hands = computed(() => clockHands(this.fixedTime() ?? this.
|
|
114
|
+
hands = computed(() => clockHands(this.fixedTime() ?? this.timeSource.every(this.showSeconds() ? "second" : "minute")(), this.timezone()), ...ngDevMode ? [{ debugName: "hands" }] : /* istanbul ignore next */ []);
|
|
116
115
|
label = computed(() => this.ariaLabel() ? `${this.ariaLabel()}, ${this.hands().time}` : this.hands().time, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
117
116
|
hourAngle = linkedSignal({
|
|
118
117
|
...ngDevMode ? { debugName: "hourAngle" } : /* istanbul ignore next */ {},
|
|
@@ -129,21 +128,9 @@ var TxAnalogClock = class TxAnalogClock {
|
|
|
129
128
|
source: () => this.hands().secondAngle,
|
|
130
129
|
computation: (next, previous) => forwardAngle(previous?.value ?? null, next)
|
|
131
130
|
});
|
|
132
|
-
schedule = effect((onCleanup) => {
|
|
133
|
-
this.now();
|
|
134
|
-
if (this.fixedTime() !== null) return;
|
|
135
|
-
const step = this.showSeconds() ? 1e3 : 6e4;
|
|
136
|
-
this.timer = setTimeout(() => this.now.set(Date.now()), step - Date.now() % step + 5);
|
|
137
|
-
onCleanup(() => {
|
|
138
|
-
if (this.timer) clearTimeout(this.timer);
|
|
139
|
-
});
|
|
140
|
-
}, ...ngDevMode ? [{ debugName: "schedule" }] : /* istanbul ignore next */ []);
|
|
141
|
-
cleanup = inject(DestroyRef).onDestroy(() => {
|
|
142
|
-
if (this.timer) clearTimeout(this.timer);
|
|
143
|
-
});
|
|
144
131
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
145
132
|
minVersion: "12.0.0",
|
|
146
|
-
version: "22.2.
|
|
133
|
+
version: "22.2.6",
|
|
147
134
|
ngImport: i0,
|
|
148
135
|
type: TxAnalogClock,
|
|
149
136
|
deps: [],
|
|
@@ -151,7 +138,7 @@ var TxAnalogClock = class TxAnalogClock {
|
|
|
151
138
|
});
|
|
152
139
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
153
140
|
minVersion: "17.0.0",
|
|
154
|
-
version: "22.2.
|
|
141
|
+
version: "22.2.6",
|
|
155
142
|
type: TxAnalogClock,
|
|
156
143
|
isStandalone: true,
|
|
157
144
|
selector: "tx-analog-clock",
|
|
@@ -261,13 +248,13 @@ var TxAnalogClock = class TxAnalogClock {
|
|
|
261
248
|
</div>
|
|
262
249
|
`,
|
|
263
250
|
isInline: true,
|
|
264
|
-
styles: [":host{display:block}.tx-analog-clock__face{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1;border-radius:50%}.tx-analog-clock__tick,.tx-analog-clock__hand,.tx-analog-clock__pin{position:absolute;left:50%;border-radius:
|
|
251
|
+
styles: [":host{display:block}.tx-analog-clock__face{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1;border-radius:50%}.tx-analog-clock__tick,.tx-analog-clock__hand,.tx-analog-clock__pin{position:absolute;left:50%;border-radius:var(--tx-radius-full)}:host([data-styled]){width:var(--tx-analog-clock-size);max-width:100%;aspect-ratio:1}:host([data-styled]) .tx-analog-clock__face{background:var(--tx-analog-clock-background);box-shadow:0 0 0 1px var(--tx-analog-clock-border-color),var(--tx-analog-clock-shadow)}:host([data-styled]) .tx-analog-clock__tick{top:50%;width:var(--tx-analog-clock-tick-width);height:var(--tx-analog-clock-tick-height);margin-top:calc(var(--tx-analog-clock-tick-height) / -2);margin-left:calc(var(--tx-analog-clock-tick-width) / -2);background:var(--tx-analog-clock-tick-color);transform:rotate(var(--tx-analog-clock-angle)) translateY(var(--tx-analog-clock-tick-offset))}:host([data-styled]) .tx-analog-clock__tick--major{height:var(--tx-analog-clock-tick-major-height);margin-top:calc(var(--tx-analog-clock-tick-major-height) / -2);background:var(--tx-analog-clock-tick-major-color);transform:rotate(var(--tx-analog-clock-angle)) translateY(var(--tx-analog-clock-tick-major-offset))}:host([data-styled]) .tx-analog-clock__hand{bottom:50%;transform-origin:bottom;rotate:var(--tx-analog-clock-angle);transition:rotate var(--tx-analog-clock-transition-duration) var(--tx-analog-clock-transition-easing)}:host([data-styled]) .tx-analog-clock__hand--hour{width:var(--tx-analog-clock-hour-hand-width);height:var(--tx-analog-clock-hour-hand-length);margin-left:calc(var(--tx-analog-clock-hour-hand-width) / -2);background:var(--tx-analog-clock-hour-hand-color)}:host([data-styled]) .tx-analog-clock__hand--minute{width:var(--tx-analog-clock-minute-hand-width);height:var(--tx-analog-clock-minute-hand-length);margin-left:calc(var(--tx-analog-clock-minute-hand-width) / -2);background:var(--tx-analog-clock-minute-hand-color)}:host([data-styled]) .tx-analog-clock__hand--second{width:var(--tx-analog-clock-second-hand-width);height:var(--tx-analog-clock-second-hand-length);margin-left:calc(var(--tx-analog-clock-second-hand-width) / -2);background:var(--tx-analog-clock-second-hand-color)}:host([data-styled]) .tx-analog-clock__pin{top:50%;width:var(--tx-analog-clock-pin-size);height:var(--tx-analog-clock-pin-size);background:var(--tx-analog-clock-pin-color);box-shadow:0 0 0 var(--tx-analog-clock-pin-ring-width) var(--tx-analog-clock-pin-ring-color);transform:translate(-50%,-50%)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-analog-clock__hand{transition:none}}\n"],
|
|
265
252
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
266
253
|
});
|
|
267
254
|
};
|
|
268
255
|
i0.ɵɵngDeclareClassMetadata({
|
|
269
256
|
minVersion: "12.0.0",
|
|
270
|
-
version: "22.2.
|
|
257
|
+
version: "22.2.6",
|
|
271
258
|
ngImport: i0,
|
|
272
259
|
type: TxAnalogClock,
|
|
273
260
|
decorators: [{
|
|
@@ -319,7 +306,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
319
306
|
"[style]": "hostStyle()",
|
|
320
307
|
"[attr.data-styled]": "!isUnstyled() || null"
|
|
321
308
|
},
|
|
322
|
-
styles: [":host{display:block}.tx-analog-clock__face{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1;border-radius:50%}.tx-analog-clock__tick,.tx-analog-clock__hand,.tx-analog-clock__pin{position:absolute;left:50%;border-radius:
|
|
309
|
+
styles: [":host{display:block}.tx-analog-clock__face{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1;border-radius:50%}.tx-analog-clock__tick,.tx-analog-clock__hand,.tx-analog-clock__pin{position:absolute;left:50%;border-radius:var(--tx-radius-full)}:host([data-styled]){width:var(--tx-analog-clock-size);max-width:100%;aspect-ratio:1}:host([data-styled]) .tx-analog-clock__face{background:var(--tx-analog-clock-background);box-shadow:0 0 0 1px var(--tx-analog-clock-border-color),var(--tx-analog-clock-shadow)}:host([data-styled]) .tx-analog-clock__tick{top:50%;width:var(--tx-analog-clock-tick-width);height:var(--tx-analog-clock-tick-height);margin-top:calc(var(--tx-analog-clock-tick-height) / -2);margin-left:calc(var(--tx-analog-clock-tick-width) / -2);background:var(--tx-analog-clock-tick-color);transform:rotate(var(--tx-analog-clock-angle)) translateY(var(--tx-analog-clock-tick-offset))}:host([data-styled]) .tx-analog-clock__tick--major{height:var(--tx-analog-clock-tick-major-height);margin-top:calc(var(--tx-analog-clock-tick-major-height) / -2);background:var(--tx-analog-clock-tick-major-color);transform:rotate(var(--tx-analog-clock-angle)) translateY(var(--tx-analog-clock-tick-major-offset))}:host([data-styled]) .tx-analog-clock__hand{bottom:50%;transform-origin:bottom;rotate:var(--tx-analog-clock-angle);transition:rotate var(--tx-analog-clock-transition-duration) var(--tx-analog-clock-transition-easing)}:host([data-styled]) .tx-analog-clock__hand--hour{width:var(--tx-analog-clock-hour-hand-width);height:var(--tx-analog-clock-hour-hand-length);margin-left:calc(var(--tx-analog-clock-hour-hand-width) / -2);background:var(--tx-analog-clock-hour-hand-color)}:host([data-styled]) .tx-analog-clock__hand--minute{width:var(--tx-analog-clock-minute-hand-width);height:var(--tx-analog-clock-minute-hand-length);margin-left:calc(var(--tx-analog-clock-minute-hand-width) / -2);background:var(--tx-analog-clock-minute-hand-color)}:host([data-styled]) .tx-analog-clock__hand--second{width:var(--tx-analog-clock-second-hand-width);height:var(--tx-analog-clock-second-hand-length);margin-left:calc(var(--tx-analog-clock-second-hand-width) / -2);background:var(--tx-analog-clock-second-hand-color)}:host([data-styled]) .tx-analog-clock__pin{top:50%;width:var(--tx-analog-clock-pin-size);height:var(--tx-analog-clock-pin-size);background:var(--tx-analog-clock-pin-color);box-shadow:0 0 0 var(--tx-analog-clock-pin-ring-width) var(--tx-analog-clock-pin-ring-color);transform:translate(-50%,-50%)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-analog-clock__hand{transition:none}}\n"]
|
|
323
310
|
}]
|
|
324
311
|
}],
|
|
325
312
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-analog-clock.mjs","names":[],"sources":["../../../../packages/ui/analog-clock/src/analog-clock.utils.ts","../../../../packages/ui/analog-clock/src/analog-clock-hands.pipe.ts","../../../../packages/ui/analog-clock/src/analog-clock.theme.ts","../../../../packages/ui/analog-clock/src/analog-clock.component.ts"],"sourcesContent":["import { TxAnalogClockHands, TxAnalogClockTime } from './analog-clock.types';\n\n/** Returns the time zone when the browser knows it, otherwise `undefined`. */\nexport function validTimeZone(timezone: string | null | undefined): string | undefined {\n if (!timezone) return undefined;\n try {\n new Intl.DateTimeFormat('en-GB', { timeZone: timezone });\n return timezone;\n } catch {\n return undefined;\n }\n}\n\n/** Turns a `Date`, milliseconds or an ISO string into milliseconds; `null` when it is empty or not a valid time. */\nexport function clockTime(value: TxAnalogClockTime): number | null {\n if (value === null || value === undefined || value === '') return null;\n const time = value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : value;\n return Number.isFinite(time) ? time : null;\n}\n\n/**\n * Computes the text time and the hand angles of a moment in the given time zone; the local zone is used when it is empty or unknown.\n */\nexport function clockHands(now: number | Date | string, timezone: string | null | undefined): TxAnalogClockHands {\n const parts = Object.fromEntries(\n new Intl.DateTimeFormat('en-GB', { hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23', timeZone: validTimeZone(timezone) })\n .formatToParts(new Date(clockTime(now) ?? Date.now()))\n .map((part) => [part.type, part.value]),\n );\n const hours = Number(parts['hour']);\n const minutes = Number(parts['minute']);\n const seconds = Number(parts['second']);\n return {\n time: `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`,\n hourAngle: ((hours % 12) + minutes / 60) * 30,\n minuteAngle: minutes * 6,\n secondAngle: seconds * 6,\n };\n}\n\n/**\n * Turns the next hand angle into one that never goes back past the previous angle, so a hand animates through 360 instead of rewinding.\n */\nexport function forwardAngle(previous: number | null, next: number): number {\n if (previous === null) return next;\n const turns = Math.floor(previous / 360);\n let angle = turns * 360 + next;\n if (angle < previous - 0.001) angle += 360;\n return angle;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TxAnalogClockHands } from './analog-clock.types';\nimport { clockHands } from './analog-clock.utils';\n\n/** Turns a time into the hand angles of an analog clock in an optional time zone, for custom clock faces. */\n@Pipe({ name: 'txAnalogClockHands' })\nexport class TxAnalogClockHandsPipe implements PipeTransform {\n transform(now: number | Date | string, timezone: string | null = null): TxAnalogClockHands {\n return clockHands(now, timezone);\n }\n}\n","import { analogClockTokens } from '@tectra-ng/themes';\n\nexport const ANALOG_CLOCK_THEME = {\n analogClock: analogClockTokens,\n};\n","import { ChangeDetectionStrategy, Component, DestroyRef, booleanAttribute, computed, effect, inject, input, linkedSignal, signal } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraAnalogClockTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxAnalogClockPart, TxAnalogClockTime } from './analog-clock.types';\nimport { clockHands, clockTime, forwardAngle } from './analog-clock.utils';\nimport { ANALOG_CLOCK_THEME } from './analog-clock.theme';\n\n@Component({\n selector: 'tx-analog-clock',\n template: `\n <div class=\"tx-analog-clock__face\" role=\"img\" [attr.aria-label]=\"label()\" [class]=\"passThrough().face?.class\" [style]=\"passThrough().face?.style\">\n @for (tick of ticks; track tick) {\n <span\n class=\"tx-analog-clock__tick\"\n aria-hidden=\"true\"\n [class.tx-analog-clock__tick--major]=\"tick % 3 === 0\"\n [style.--tx-analog-clock-angle]=\"tick * 30 + 'deg'\"\n [class]=\"passThrough().tick?.class\"\n [style]=\"passThrough().tick?.style\"\n ></span>\n }\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--hour\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"hourAngle() + 'deg'\"\n [class]=\"passThrough().hourHand?.class\"\n [style]=\"passThrough().hourHand?.style\"\n ></span>\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--minute\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"minuteAngle() + 'deg'\"\n [class]=\"passThrough().minuteHand?.class\"\n [style]=\"passThrough().minuteHand?.style\"\n ></span>\n @if (showSeconds()) {\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--second\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"secondAngle() + 'deg'\"\n [class]=\"passThrough().secondHand?.class\"\n [style]=\"passThrough().secondHand?.style\"\n ></span>\n }\n <span class=\"tx-analog-clock__pin\" aria-hidden=\"true\" [class]=\"passThrough().pin?.class\" [style]=\"passThrough().pin?.style\"></span>\n </div>\n `,\n styleUrl: './analog-clock.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-analog-clock',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxAnalogClock {\n private readonly analogClockTheme = injectTokens(ANALOG_CLOCK_THEME);\n\n readonly timezone = input<string | null | undefined>(undefined);\n readonly time = input<TxAnalogClockTime>(undefined);\n readonly showSeconds = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraAnalogClockTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAnalogClockPart, TxAnalogClock> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('analogClock', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-analog-clock'), ...this.passThrough().root?.style }));\n\n protected readonly ticks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n private readonly now = signal(Date.now());\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n private readonly fixedTime = computed(() => clockTime(this.time()));\n readonly hands = computed(() => clockHands(this.fixedTime() ?? this.now(), this.timezone()));\n readonly label = computed(() => (this.ariaLabel() ? `${this.ariaLabel()}, ${this.hands().time}` : this.hands().time));\n readonly hourAngle = linkedSignal<number, number>({ source: () => this.hands().hourAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n readonly minuteAngle = linkedSignal<number, number>({ source: () => this.hands().minuteAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n readonly secondAngle = linkedSignal<number, number>({ source: () => this.hands().secondAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n\n private readonly schedule = effect((onCleanup) => {\n this.now();\n if (this.fixedTime() !== null) return;\n const step = this.showSeconds() ? 1000 : 60000;\n this.timer = setTimeout(() => this.now.set(Date.now()), step - (Date.now() % step) + 5);\n onCleanup(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n });\n\n private readonly cleanup = inject(DestroyRef).onDestroy(() => {\n if (this.timer) clearTimeout(this.timer);\n });\n}\n"],"mappings":";;;;;AAGA,SAAgB,cAAc,UAAmC;CAC/D,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI;EACF,IAAI,KAAK,eAAe,SAAS,EAAE,UAAU,SAAQ,CAAE;EACvD,OAAO;CACT,QAAQ;EACN;CACF;AACF;AAGA,SAAgB,UAAU,OAAwB;CAChD,IAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI,OAAO;CAClE,MAAM,OAAO,iBAAiB,OAAO,MAAM,QAAO,IAAK,OAAO,UAAU,WAAW,KAAK,MAAM,KAAK,IAAI;CACvG,OAAO,OAAO,SAAS,IAAI,IAAI,OAAO;AACxC;AAKA,SAAgB,WAAW,KAA6B,UAAmC;CACzF,MAAM,QAAQ,OAAO,YACnB,IAAI,KAAK,eAAe,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAW,QAAQ;EAAW,WAAW;EAAO,UAAU,cAAc,QAAQ;CAAC,CAAE,CAAC,CAC7I,cAAc,IAAI,KAAK,UAAU,GAAG,KAAK,KAAK,IAAG,CAAE,CAAC,CAAC,CACrD,KAAK,SAAS,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC;CAE3C,MAAM,QAAQ,OAAO,MAAM,OAAO;CAClC,MAAM,UAAU,OAAO,MAAM,SAAS;CACtC,MAAM,UAAU,OAAO,MAAM,SAAS;CACtC,OAAO;EACL,MAAM,GAAG,OAAO,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG,EAAC,GAAI,OAAO,OAAO,CAAC,CAAC,SAAS,GAAG,GAAG;EAC1E,YAAa,QAAQ,KAAM,UAAU,MAAM;EAC3C,aAAa,UAAU;EACvB,aAAa,UAAU;CAC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../packages/ui/analog-clock/src/analog-clock.utils.ts","../../../../packages/ui/analog-clock/src/analog-clock-hands.pipe.ts","../../../../packages/ui/analog-clock/src/analog-clock.theme.ts","../../../../packages/ui/analog-clock/src/analog-clock.component.ts"],"sourcesContent":["import { TxAnalogClockHands, TxAnalogClockTime } from './analog-clock.types';\n\n/** Returns the time zone when the browser knows it, otherwise `undefined`. */\nexport function validTimeZone(timezone: string | null | undefined): string | undefined {\n if (!timezone) return undefined;\n try {\n new Intl.DateTimeFormat('en-GB', { timeZone: timezone });\n return timezone;\n } catch {\n return undefined;\n }\n}\n\n/** Turns a `Date`, milliseconds or an ISO string into milliseconds; `null` when it is empty or not a valid time. */\nexport function clockTime(value: TxAnalogClockTime): number | null {\n if (value === null || value === undefined || value === '') return null;\n const time = value instanceof Date ? value.getTime() : typeof value === 'string' ? Date.parse(value) : value;\n return Number.isFinite(time) ? time : null;\n}\n\n/**\n * Computes the text time and the hand angles of a moment in the given time zone; the local zone is used when it is empty or unknown.\n */\nexport function clockHands(now: number | Date | string, timezone: string | null | undefined): TxAnalogClockHands {\n const parts = Object.fromEntries(\n new Intl.DateTimeFormat('en-GB', { hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23', timeZone: validTimeZone(timezone) })\n .formatToParts(new Date(clockTime(now) ?? Date.now()))\n .map((part) => [part.type, part.value]),\n );\n const hours = Number(parts['hour']);\n const minutes = Number(parts['minute']);\n const seconds = Number(parts['second']);\n return {\n time: `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`,\n hourAngle: ((hours % 12) + minutes / 60) * 30,\n minuteAngle: minutes * 6,\n secondAngle: seconds * 6,\n };\n}\n\n/**\n * Turns the next hand angle into one that never goes back past the previous angle, so a hand animates through 360 instead of rewinding.\n */\nexport function forwardAngle(previous: number | null, next: number): number {\n if (previous === null) return next;\n const turns = Math.floor(previous / 360);\n let angle = turns * 360 + next;\n if (angle < previous - 0.001) angle += 360;\n return angle;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TxAnalogClockHands } from './analog-clock.types';\nimport { clockHands } from './analog-clock.utils';\n\n/** Turns a time into the hand angles of an analog clock in an optional time zone, for custom clock faces. */\n@Pipe({ name: 'txAnalogClockHands' })\nexport class TxAnalogClockHandsPipe implements PipeTransform {\n transform(now: number | Date | string, timezone: string | null = null): TxAnalogClockHands {\n return clockHands(now, timezone);\n }\n}\n","import { analogClockTokens } from '@tectra-ng/themes';\n\nexport const ANALOG_CLOCK_THEME = {\n analogClock: analogClockTokens,\n};\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input, linkedSignal } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean, TxTimeSource } from '@tectra-ng/core/utils';\nimport { TectraAnalogClockTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxAnalogClockPart, TxAnalogClockTime } from './analog-clock.types';\nimport { clockHands, clockTime, forwardAngle } from './analog-clock.utils';\nimport { ANALOG_CLOCK_THEME } from './analog-clock.theme';\n\n@Component({\n selector: 'tx-analog-clock',\n template: `\n <div class=\"tx-analog-clock__face\" role=\"img\" [attr.aria-label]=\"label()\" [class]=\"passThrough().face?.class\" [style]=\"passThrough().face?.style\">\n @for (tick of ticks; track tick) {\n <span\n class=\"tx-analog-clock__tick\"\n aria-hidden=\"true\"\n [class.tx-analog-clock__tick--major]=\"tick % 3 === 0\"\n [style.--tx-analog-clock-angle]=\"tick * 30 + 'deg'\"\n [class]=\"passThrough().tick?.class\"\n [style]=\"passThrough().tick?.style\"\n ></span>\n }\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--hour\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"hourAngle() + 'deg'\"\n [class]=\"passThrough().hourHand?.class\"\n [style]=\"passThrough().hourHand?.style\"\n ></span>\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--minute\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"minuteAngle() + 'deg'\"\n [class]=\"passThrough().minuteHand?.class\"\n [style]=\"passThrough().minuteHand?.style\"\n ></span>\n @if (showSeconds()) {\n <span\n class=\"tx-analog-clock__hand tx-analog-clock__hand--second\"\n aria-hidden=\"true\"\n [style.--tx-analog-clock-angle]=\"secondAngle() + 'deg'\"\n [class]=\"passThrough().secondHand?.class\"\n [style]=\"passThrough().secondHand?.style\"\n ></span>\n }\n <span class=\"tx-analog-clock__pin\" aria-hidden=\"true\" [class]=\"passThrough().pin?.class\" [style]=\"passThrough().pin?.style\"></span>\n </div>\n `,\n styleUrl: './analog-clock.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-analog-clock',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxAnalogClock {\n private readonly analogClockTheme = injectTokens(ANALOG_CLOCK_THEME);\n\n readonly timezone = input<string | null | undefined>(undefined);\n readonly time = input<TxAnalogClockTime>(undefined);\n readonly showSeconds = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraAnalogClockTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAnalogClockPart, TxAnalogClock> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('analogClock', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-analog-clock'), ...this.passThrough().root?.style }));\n\n protected readonly ticks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\n private readonly timeSource = inject(TxTimeSource);\n\n private readonly fixedTime = computed(() => clockTime(this.time()));\n readonly hands = computed(() => clockHands(this.fixedTime() ?? this.timeSource.every(this.showSeconds() ? 'second' : 'minute')(), this.timezone()));\n readonly label = computed(() => (this.ariaLabel() ? `${this.ariaLabel()}, ${this.hands().time}` : this.hands().time));\n readonly hourAngle = linkedSignal<number, number>({ source: () => this.hands().hourAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n readonly minuteAngle = linkedSignal<number, number>({ source: () => this.hands().minuteAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n readonly secondAngle = linkedSignal<number, number>({ source: () => this.hands().secondAngle, computation: (next, previous) => forwardAngle(previous?.value ?? null, next) });\n}\n"],"mappings":";;;;;AAGA,SAAgB,cAAc,UAAmC;CAC/D,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI;EACF,IAAI,KAAK,eAAe,SAAS,EAAE,UAAU,SAAQ,CAAE;EACvD,OAAO;CACT,QAAQ;EACN;CACF;AACF;AAGA,SAAgB,UAAU,OAAwB;CAChD,IAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI,OAAO;CAClE,MAAM,OAAO,iBAAiB,OAAO,MAAM,QAAO,IAAK,OAAO,UAAU,WAAW,KAAK,MAAM,KAAK,IAAI;CACvG,OAAO,OAAO,SAAS,IAAI,IAAI,OAAO;AACxC;AAKA,SAAgB,WAAW,KAA6B,UAAmC;CACzF,MAAM,QAAQ,OAAO,YACnB,IAAI,KAAK,eAAe,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAW,QAAQ;EAAW,WAAW;EAAO,UAAU,cAAc,QAAQ;CAAC,CAAE,CAAC,CAC7I,cAAc,IAAI,KAAK,UAAU,GAAG,KAAK,KAAK,IAAG,CAAE,CAAC,CAAC,CACrD,KAAK,SAAS,CAAC,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC;CAE3C,MAAM,QAAQ,OAAO,MAAM,OAAO;CAClC,MAAM,UAAU,OAAO,MAAM,SAAS;CACtC,MAAM,UAAU,OAAO,MAAM,SAAS;CACtC,OAA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