@tectra-ng/utils 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -2
- package/auto-focus/README.md +19 -0
- package/breakpoint/README.md +23 -0
- package/clipboard/README.md +37 -0
- package/clock/README.md +21 -0
- package/currency/README.md +17 -0
- package/date/README.md +46 -0
- package/debounce-input/README.md +31 -0
- package/drag-scroll/README.md +25 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs +100 -0
- package/fesm2022/tectra-ng-utils-auto-focus.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs +54 -0
- package/fesm2022/tectra-ng-utils-breakpoint.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs +225 -0
- package/fesm2022/tectra-ng-utils-clipboard.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-clock.mjs +59 -0
- package/fesm2022/tectra-ng-utils-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-currency.mjs +63 -0
- package/fesm2022/tectra-ng-utils-currency.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-date.mjs +200 -0
- package/fesm2022/tectra-ng-utils-date.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs +156 -0
- package/fesm2022/tectra-ng-utils-debounce-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs +199 -0
- package/fesm2022/tectra-ng-utils-drag-scroll.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-file.mjs +78 -0
- package/fesm2022/tectra-ng-utils-file.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs +238 -0
- package/fesm2022/tectra-ng-utils-filter-state.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-filter.mjs +88 -0
- package/fesm2022/tectra-ng-utils-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs +70 -0
- package/fesm2022/tectra-ng-utils-form-changes.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs +162 -0
- package/fesm2022/tectra-ng-utils-form-validation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs +117 -0
- package/fesm2022/tectra-ng-utils-go-back.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-http.mjs +189 -0
- package/fesm2022/tectra-ng-utils-http.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs +297 -0
- package/fesm2022/tectra-ng-utils-in-view.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-plural.mjs +98 -0
- package/fesm2022/tectra-ng-utils-plural.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-polling.mjs +109 -0
- package/fesm2022/tectra-ng-utils-polling.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-random.mjs +20 -0
- package/fesm2022/tectra-ng-utils-random.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs +87 -0
- package/fesm2022/tectra-ng-utils-relative-time.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs +136 -0
- package/fesm2022/tectra-ng-utils-scroll-end.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-selection.mjs +52 -0
- package/fesm2022/tectra-ng-utils-selection.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs +92 -0
- package/fesm2022/tectra-ng-utils-stop-propagation.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-stream.mjs +30 -0
- package/fesm2022/tectra-ng-utils-stream.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs +350 -0
- package/fesm2022/tectra-ng-utils-style-class.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-text.mjs +173 -0
- package/fesm2022/tectra-ng-utils-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-title.mjs +99 -0
- package/fesm2022/tectra-ng-utils-title.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils-validators.mjs +232 -0
- package/fesm2022/tectra-ng-utils-validators.mjs.map +1 -0
- package/fesm2022/tectra-ng-utils.mjs +4 -0
- package/fesm2022/tectra-ng-utils.mjs.map +1 -0
- package/file/README.md +19 -0
- package/filter/README.md +22 -0
- package/filter-state/README.md +36 -0
- package/form-changes/README.md +26 -0
- package/form-validation/README.md +40 -0
- package/go-back/README.md +28 -0
- package/http/README.md +34 -0
- package/in-view/README.md +34 -0
- package/package.json +181 -3
- package/plural/README.md +21 -0
- package/polling/README.md +34 -0
- package/random/README.md +10 -0
- package/relative-time/README.md +29 -0
- package/scroll-end/README.md +25 -0
- package/selection/README.md +24 -0
- package/stop-propagation/README.md +15 -0
- package/stream/README.md +14 -0
- package/style-class/README.md +34 -0
- package/text/README.md +25 -0
- package/title/README.md +26 -0
- package/types/tectra-ng-utils-auto-focus.d.ts +22 -0
- package/types/tectra-ng-utils-auto-focus.d.ts.map +1 -0
- package/types/tectra-ng-utils-breakpoint.d.ts +15 -0
- package/types/tectra-ng-utils-breakpoint.d.ts.map +1 -0
- package/types/tectra-ng-utils-clipboard.d.ts +48 -0
- package/types/tectra-ng-utils-clipboard.d.ts.map +1 -0
- package/types/tectra-ng-utils-clock.d.ts +18 -0
- package/types/tectra-ng-utils-clock.d.ts.map +1 -0
- package/types/tectra-ng-utils-currency.d.ts +11 -0
- package/types/tectra-ng-utils-currency.d.ts.map +1 -0
- package/types/tectra-ng-utils-date.d.ts +65 -0
- package/types/tectra-ng-utils-date.d.ts.map +1 -0
- package/types/tectra-ng-utils-debounce-input.d.ts +38 -0
- package/types/tectra-ng-utils-debounce-input.d.ts.map +1 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts +41 -0
- package/types/tectra-ng-utils-drag-scroll.d.ts.map +1 -0
- package/types/tectra-ng-utils-file.d.ts +18 -0
- package/types/tectra-ng-utils-file.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter-state.d.ts +55 -0
- package/types/tectra-ng-utils-filter-state.d.ts.map +1 -0
- package/types/tectra-ng-utils-filter.d.ts +21 -0
- package/types/tectra-ng-utils-filter.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-changes.d.ts +22 -0
- package/types/tectra-ng-utils-form-changes.d.ts.map +1 -0
- package/types/tectra-ng-utils-form-validation.d.ts +45 -0
- package/types/tectra-ng-utils-form-validation.d.ts.map +1 -0
- package/types/tectra-ng-utils-go-back.d.ts +25 -0
- package/types/tectra-ng-utils-go-back.d.ts.map +1 -0
- package/types/tectra-ng-utils-http.d.ts +47 -0
- package/types/tectra-ng-utils-http.d.ts.map +1 -0
- package/types/tectra-ng-utils-in-view.d.ts +80 -0
- package/types/tectra-ng-utils-in-view.d.ts.map +1 -0
- package/types/tectra-ng-utils-plural.d.ts +21 -0
- package/types/tectra-ng-utils-plural.d.ts.map +1 -0
- package/types/tectra-ng-utils-polling.d.ts +61 -0
- package/types/tectra-ng-utils-polling.d.ts.map +1 -0
- package/types/tectra-ng-utils-random.d.ts +4 -0
- package/types/tectra-ng-utils-random.d.ts.map +1 -0
- package/types/tectra-ng-utils-relative-time.d.ts +22 -0
- package/types/tectra-ng-utils-relative-time.d.ts.map +1 -0
- package/types/tectra-ng-utils-scroll-end.d.ts +38 -0
- package/types/tectra-ng-utils-scroll-end.d.ts.map +1 -0
- package/types/tectra-ng-utils-selection.d.ts +21 -0
- package/types/tectra-ng-utils-selection.d.ts.map +1 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts +22 -0
- package/types/tectra-ng-utils-stop-propagation.d.ts.map +1 -0
- package/types/tectra-ng-utils-stream.d.ts +3 -0
- package/types/tectra-ng-utils-stream.d.ts.map +1 -0
- package/types/tectra-ng-utils-style-class.d.ts +91 -0
- package/types/tectra-ng-utils-style-class.d.ts.map +1 -0
- package/types/tectra-ng-utils-text.d.ts +26 -0
- package/types/tectra-ng-utils-text.d.ts.map +1 -0
- package/types/tectra-ng-utils-title.d.ts +31 -0
- package/types/tectra-ng-utils-title.d.ts.map +1 -0
- package/types/tectra-ng-utils-validators.d.ts +67 -0
- package/types/tectra-ng-utils-validators.d.ts.map +1 -0
- package/types/tectra-ng-utils.d.ts +2 -0
- package/types/tectra-ng-utils.d.ts.map +1 -0
- package/validators/README.md +42 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { DOCUMENT } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Directive, ElementRef, HostAttributeToken, Injectable, inject, input, output } from "@angular/core";
|
|
4
|
+
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
5
|
+
import { TxToastService } from "@tectra-ng/ui/toast";
|
|
6
|
+
async function copyToClipboard(text, document = globalThis.document) {
|
|
7
|
+
const view = document?.defaultView;
|
|
8
|
+
if (!document || !view) return false;
|
|
9
|
+
if (view.isSecureContext && view.navigator.clipboard?.writeText) try {
|
|
10
|
+
await view.navigator.clipboard.writeText(text);
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return copyWithSelection(text, document);
|
|
14
|
+
}
|
|
15
|
+
return copyWithSelection(text, document);
|
|
16
|
+
}
|
|
17
|
+
function copyWithSelection(text, document) {
|
|
18
|
+
const area = document.createElement("textarea");
|
|
19
|
+
area.value = text;
|
|
20
|
+
area.setAttribute("readonly", "");
|
|
21
|
+
area.style.position = "fixed";
|
|
22
|
+
area.style.opacity = "0";
|
|
23
|
+
area.style.pointerEvents = "none";
|
|
24
|
+
const active = document.activeElement;
|
|
25
|
+
document.body.appendChild(area);
|
|
26
|
+
area.select();
|
|
27
|
+
let copied = false;
|
|
28
|
+
try {
|
|
29
|
+
copied = document.execCommand("copy");
|
|
30
|
+
} catch {
|
|
31
|
+
copied = false;
|
|
32
|
+
}
|
|
33
|
+
document.body.removeChild(area);
|
|
34
|
+
active?.focus?.({ preventScroll: true });
|
|
35
|
+
return copied;
|
|
36
|
+
}
|
|
37
|
+
var TxClipboard = class TxClipboard {
|
|
38
|
+
document = inject(DOCUMENT);
|
|
39
|
+
toast = inject(TxToastService);
|
|
40
|
+
locale = inject(TxLocaleService);
|
|
41
|
+
async copy(value, options = {}) {
|
|
42
|
+
const text = value === null || value === void 0 ? "" : String(value);
|
|
43
|
+
if (!text) return false;
|
|
44
|
+
const copied = await copyToClipboard(text, this.document);
|
|
45
|
+
if (copied && options.message !== false) this.toast.success(options.message ?? this.locale.translate("copiedToClipboard"));
|
|
46
|
+
if (!copied && options.errorMessage !== false) this.toast.error(options.errorMessage ?? this.locale.translate("copyToClipboardFailed"));
|
|
47
|
+
return copied;
|
|
48
|
+
}
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
50
|
+
minVersion: "12.0.0",
|
|
51
|
+
version: "22.2.3",
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
type: TxClipboard,
|
|
54
|
+
deps: [],
|
|
55
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
56
|
+
});
|
|
57
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
58
|
+
minVersion: "12.0.0",
|
|
59
|
+
version: "22.2.3",
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
type: TxClipboard,
|
|
62
|
+
providedIn: "root"
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
66
|
+
minVersion: "12.0.0",
|
|
67
|
+
version: "22.2.3",
|
|
68
|
+
ngImport: i0,
|
|
69
|
+
type: TxClipboard,
|
|
70
|
+
decorators: [{
|
|
71
|
+
type: Injectable,
|
|
72
|
+
args: [{ providedIn: "root" }]
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
75
|
+
const NATIVE_CONTROLS = [
|
|
76
|
+
"BUTTON",
|
|
77
|
+
"A",
|
|
78
|
+
"INPUT",
|
|
79
|
+
"SELECT",
|
|
80
|
+
"TEXTAREA",
|
|
81
|
+
"SUMMARY"
|
|
82
|
+
];
|
|
83
|
+
var TxCopy = class TxCopy {
|
|
84
|
+
clipboard = inject(TxClipboard);
|
|
85
|
+
element = inject(ElementRef).nativeElement;
|
|
86
|
+
value = input(void 0, {
|
|
87
|
+
...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
|
|
88
|
+
alias: "txCopy"
|
|
89
|
+
});
|
|
90
|
+
copyMessage = input(void 0, ...ngDevMode ? [{ debugName: "copyMessage" }] : /* istanbul ignore next */ []);
|
|
91
|
+
copyErrorMessage = input(void 0, ...ngDevMode ? [{ debugName: "copyErrorMessage" }] : /* istanbul ignore next */ []);
|
|
92
|
+
copied = output();
|
|
93
|
+
copyFailed = output();
|
|
94
|
+
needsRole = !NATIVE_CONTROLS.includes(this.element.tagName.toUpperCase()) && inject(new HostAttributeToken("role"), { optional: true }) === null;
|
|
95
|
+
async copy() {
|
|
96
|
+
const value = this.value();
|
|
97
|
+
const text = value === null || value === void 0 ? "" : String(value);
|
|
98
|
+
if (!text) return false;
|
|
99
|
+
const done = await this.clipboard.copy(text, {
|
|
100
|
+
message: this.copyMessage(),
|
|
101
|
+
errorMessage: this.copyErrorMessage()
|
|
102
|
+
});
|
|
103
|
+
if (done) this.copied.emit(text);
|
|
104
|
+
else this.copyFailed.emit(text);
|
|
105
|
+
return done;
|
|
106
|
+
}
|
|
107
|
+
onKey(event) {
|
|
108
|
+
if (this.needsRole) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
this.copy();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
114
|
+
minVersion: "12.0.0",
|
|
115
|
+
version: "22.2.3",
|
|
116
|
+
ngImport: i0,
|
|
117
|
+
type: TxCopy,
|
|
118
|
+
deps: [],
|
|
119
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
120
|
+
});
|
|
121
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
122
|
+
minVersion: "17.1.0",
|
|
123
|
+
version: "22.2.3",
|
|
124
|
+
type: TxCopy,
|
|
125
|
+
isStandalone: true,
|
|
126
|
+
selector: "[txCopy]",
|
|
127
|
+
inputs: {
|
|
128
|
+
value: {
|
|
129
|
+
classPropertyName: "value",
|
|
130
|
+
publicName: "txCopy",
|
|
131
|
+
isSignal: true,
|
|
132
|
+
isRequired: false,
|
|
133
|
+
transformFunction: null
|
|
134
|
+
},
|
|
135
|
+
copyMessage: {
|
|
136
|
+
classPropertyName: "copyMessage",
|
|
137
|
+
publicName: "copyMessage",
|
|
138
|
+
isSignal: true,
|
|
139
|
+
isRequired: false,
|
|
140
|
+
transformFunction: null
|
|
141
|
+
},
|
|
142
|
+
copyErrorMessage: {
|
|
143
|
+
classPropertyName: "copyErrorMessage",
|
|
144
|
+
publicName: "copyErrorMessage",
|
|
145
|
+
isSignal: true,
|
|
146
|
+
isRequired: false,
|
|
147
|
+
transformFunction: null
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
outputs: {
|
|
151
|
+
copied: "copied",
|
|
152
|
+
copyFailed: "copyFailed"
|
|
153
|
+
},
|
|
154
|
+
host: {
|
|
155
|
+
listeners: {
|
|
156
|
+
"click": "copy()",
|
|
157
|
+
"keydown.enter": "onKey($event)",
|
|
158
|
+
"keydown.space": "onKey($event)"
|
|
159
|
+
},
|
|
160
|
+
properties: {
|
|
161
|
+
"attr.role": "needsRole ? \"button\" : null",
|
|
162
|
+
"attr.tabindex": "needsRole ? 0 : null"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
exportAs: ["txCopy"],
|
|
166
|
+
ngImport: i0
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
170
|
+
minVersion: "12.0.0",
|
|
171
|
+
version: "22.2.3",
|
|
172
|
+
ngImport: i0,
|
|
173
|
+
type: TxCopy,
|
|
174
|
+
decorators: [{
|
|
175
|
+
type: Directive,
|
|
176
|
+
args: [{
|
|
177
|
+
selector: "[txCopy]",
|
|
178
|
+
exportAs: "txCopy",
|
|
179
|
+
host: {
|
|
180
|
+
"[attr.role]": "needsRole ? \"button\" : null",
|
|
181
|
+
"[attr.tabindex]": "needsRole ? 0 : null",
|
|
182
|
+
"(click)": "copy()",
|
|
183
|
+
"(keydown.enter)": "onKey($event)",
|
|
184
|
+
"(keydown.space)": "onKey($event)"
|
|
185
|
+
}
|
|
186
|
+
}]
|
|
187
|
+
}],
|
|
188
|
+
propDecorators: {
|
|
189
|
+
value: [{
|
|
190
|
+
type: i0.Input,
|
|
191
|
+
args: [{
|
|
192
|
+
isSignal: true,
|
|
193
|
+
alias: "txCopy",
|
|
194
|
+
required: false
|
|
195
|
+
}]
|
|
196
|
+
}],
|
|
197
|
+
copyMessage: [{
|
|
198
|
+
type: i0.Input,
|
|
199
|
+
args: [{
|
|
200
|
+
isSignal: true,
|
|
201
|
+
alias: "copyMessage",
|
|
202
|
+
required: false
|
|
203
|
+
}]
|
|
204
|
+
}],
|
|
205
|
+
copyErrorMessage: [{
|
|
206
|
+
type: i0.Input,
|
|
207
|
+
args: [{
|
|
208
|
+
isSignal: true,
|
|
209
|
+
alias: "copyErrorMessage",
|
|
210
|
+
required: false
|
|
211
|
+
}]
|
|
212
|
+
}],
|
|
213
|
+
copied: [{
|
|
214
|
+
type: i0.Output,
|
|
215
|
+
args: ["copied"]
|
|
216
|
+
}],
|
|
217
|
+
copyFailed: [{
|
|
218
|
+
type: i0.Output,
|
|
219
|
+
args: ["copyFailed"]
|
|
220
|
+
}]
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
export { TxClipboard, TxCopy, copyToClipboard };
|
|
224
|
+
|
|
225
|
+
//# sourceMappingURL=tectra-ng-utils-clipboard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clipboard.mjs","names":[],"sources":["../../../../packages/utils/clipboard/src/clipboard.ts","../../../../packages/utils/clipboard/src/copy.directive.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { TxToastService } from '@tectra-ng/ui/toast';\n\nexport interface TxCopyOptions {\n message?: string | false;\n errorMessage?: string | false;\n}\n\nexport async function copyToClipboard(text: string, document: Document | undefined = globalThis.document): Promise<boolean> {\n const view = document?.defaultView;\n if (!document || !view) {\n return false;\n }\n if (view.isSecureContext && view.navigator.clipboard?.writeText) {\n try {\n await view.navigator.clipboard.writeText(text);\n return true;\n } catch {\n return copyWithSelection(text, document);\n }\n }\n return copyWithSelection(text, document);\n}\n\nfunction copyWithSelection(text: string, document: Document): boolean {\n const area = document.createElement('textarea');\n area.value = text;\n area.setAttribute('readonly', '');\n area.style.position = 'fixed';\n area.style.opacity = '0';\n area.style.pointerEvents = 'none';\n const active = document.activeElement as HTMLElement | null;\n document.body.appendChild(area);\n area.select();\n let copied = false;\n try {\n copied = document.execCommand('copy');\n } catch {\n copied = false;\n }\n document.body.removeChild(area);\n active?.focus?.({ preventScroll: true });\n return copied;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class TxClipboard {\n private readonly document = inject(DOCUMENT);\n private readonly toast = inject(TxToastService);\n private readonly locale = inject(TxLocaleService);\n\n async copy(value: string | number | null | undefined, options: TxCopyOptions = {}): Promise<boolean> {\n const text = value === null || value === undefined ? '' : String(value);\n if (!text) {\n return false;\n }\n const copied = await copyToClipboard(text, this.document);\n if (copied && options.message !== false) {\n this.toast.success(options.message ?? this.locale.translate('copiedToClipboard'));\n }\n if (!copied && options.errorMessage !== false) {\n this.toast.error(options.errorMessage ?? this.locale.translate('copyToClipboardFailed'));\n }\n return copied;\n }\n}\n","import { Directive, ElementRef, HostAttributeToken, inject, input, output } from '@angular/core';\nimport { TxClipboard } from './clipboard';\n\nconst NATIVE_CONTROLS = ['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA', 'SUMMARY'];\n\n@Directive({\n selector: '[txCopy]',\n exportAs: 'txCopy',\n host: {\n '[attr.role]': 'needsRole ? \"button\" : null',\n '[attr.tabindex]': 'needsRole ? 0 : null',\n '(click)': 'copy()',\n '(keydown.enter)': 'onKey($event)',\n '(keydown.space)': 'onKey($event)',\n },\n})\nexport class TxCopy {\n private readonly clipboard = inject(TxClipboard);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n readonly value = input<string | number | null | undefined>(undefined, { alias: 'txCopy' });\n readonly copyMessage = input<string | false | undefined>(undefined);\n readonly copyErrorMessage = input<string | false | undefined>(undefined);\n\n readonly copied = output<string>();\n readonly copyFailed = output<string>();\n\n protected readonly needsRole = !NATIVE_CONTROLS.includes(this.element.tagName.toUpperCase()) && inject(new HostAttributeToken('role'), { optional: true }) === null;\n\n async copy(): Promise<boolean> {\n const value = this.value();\n const text = value === null || value === undefined ? '' : String(value);\n if (!text) {\n return false;\n }\n const done = await this.clipboard.copy(text, { message: this.copyMessage(), errorMessage: this.copyErrorMessage() });\n if (done) {\n this.copied.emit(text);\n } else {\n this.copyFailed.emit(text);\n }\n return done;\n }\n\n protected onKey(event: Event): void {\n if (this.needsRole) {\n event.preventDefault();\n void this.copy();\n }\n }\n}\n"],"mappings":";;;;;AAUA,eAAsB,gBAAgB,MAAc,WAAiC,WAAW,UAAQ;CACtG,MAAM,OAAO,UAAU;CACvB,IAAI,CAAC,YAAY,CAAC,MAChB,OAAO;CAET,IAAI,KAAK,mBAAmB,KAAK,UAAU,WAAW,WACpD,IAAI;EACF,MAAM,KAAK,UAAU,UAAU,UAAU,IAAI;EAC7C,OAAO;CACT,QAAQ;EACN,OAAO,kBAAkB,MAAM,QAAQ;CACzC;CAEF,OAAO,kBAAkB,MAAM,QAAQ;AACzC;AAEA,SAAS,kBAAkB,MAAc,UAAkB;CACzD,MAAM,OAAO,SAAS,cAAc,UAAU;CAC9C,KAAK,QAAQ;CACb,KAAK,aAAa,YAAY,EAAE;CAChC,KAAK,MAAM,WAAW;CACtB,KAAK,MAAM,UAAU;CACrB,KAAK,MAAM,gBAAgB;CAC3B,MAAM,SAAS,SAAS;CACxB,SAAS,KAAK,YAAY,IAAI;CAC9B,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AAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,kBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA;GAAA,QAAA;GAAA,YAAA;EAAA;EAAA,MAAA;GAAA,WAAA;IAAA,SAAA;IAAA,iBAAA;IAAA,iBAAA;GAAA;GAAA,YAAA;IAAA,aAAA;IAAA,iBAAA;GAAA;EAAA;EAAA,UAAA,CAAA,QAAA;EAAA,UAAA;CAAA,CAAA;;AAAN,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAM,YAAA,CAAA;EAXlB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IACJ,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,mBAAmB;IACnB,mBAAmB;GACpB;EACF,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isPlatformBrowser } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { DestroyRef, Injectable, PLATFORM_ID, computed, inject, isSignal, signal } from "@angular/core";
|
|
4
|
+
import { MS_IN_SECOND, toDate } from "@tectra-ng/utils/date";
|
|
5
|
+
var TxClock = class TxClock {
|
|
6
|
+
current = signal(Date.now(), ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
7
|
+
now = this.current.asReadonly();
|
|
8
|
+
constructor() {
|
|
9
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
10
|
+
const timer = setInterval(() => this.current.set(Date.now()), MS_IN_SECOND);
|
|
11
|
+
inject(DestroyRef).onDestroy(() => clearInterval(timer));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
countdown(target, endingSoonMs = 0) {
|
|
15
|
+
const targetTime = computed(() => toDate(isSignal(target) ? target() : target)?.getTime() ?? null, ...ngDevMode ? [{ debugName: "targetTime" }] : /* istanbul ignore next */ []);
|
|
16
|
+
const remainingMs = computed(() => {
|
|
17
|
+
const time = targetTime();
|
|
18
|
+
return time === null ? 0 : Math.max(0, time - this.now());
|
|
19
|
+
}, ...ngDevMode ? [{ debugName: "remainingMs" }] : /* istanbul ignore next */ []);
|
|
20
|
+
return {
|
|
21
|
+
remainingMs,
|
|
22
|
+
isExpired: computed(() => targetTime() !== null && remainingMs() === 0),
|
|
23
|
+
isEndingSoon: computed(() => remainingMs() > 0 && remainingMs() <= endingSoonMs)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
isInFuture(value) {
|
|
27
|
+
const time = toDate(value)?.getTime();
|
|
28
|
+
return time !== void 0 && time > this.now();
|
|
29
|
+
}
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: TxClock,
|
|
35
|
+
deps: [],
|
|
36
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
37
|
+
});
|
|
38
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: TxClock,
|
|
43
|
+
providedIn: "root"
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
47
|
+
minVersion: "12.0.0",
|
|
48
|
+
version: "22.2.3",
|
|
49
|
+
ngImport: i0,
|
|
50
|
+
type: TxClock,
|
|
51
|
+
decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{ providedIn: "root" }]
|
|
54
|
+
}],
|
|
55
|
+
ctorParameters: () => []
|
|
56
|
+
});
|
|
57
|
+
export { TxClock };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=tectra-ng-utils-clock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-clock.mjs","names":[],"sources":["../../../../packages/utils/clock/src/clock.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Injectable, PLATFORM_ID, Signal, computed, inject, isSignal, signal } from '@angular/core';\nimport { MS_IN_SECOND, TxDateInput, toDate } from '@tectra-ng/utils/date';\n\nexport interface TxCountdownState {\n remainingMs: Signal<number>;\n isExpired: Signal<boolean>;\n isEndingSoon: Signal<boolean>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class TxClock {\n private readonly current = signal(Date.now());\n\n readonly now = this.current.asReadonly();\n\n constructor() {\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n const timer = setInterval(() => this.current.set(Date.now()), MS_IN_SECOND);\n inject(DestroyRef).onDestroy(() => clearInterval(timer));\n }\n }\n\n countdown(target: Signal<TxDateInput> | TxDateInput, endingSoonMs = 0): TxCountdownState {\n const targetTime = computed(() => toDate(isSignal(target) ? target() : target)?.getTime() ?? null);\n const remainingMs = computed(() => {\n const time = targetTime();\n return time === null ? 0 : Math.max(0, time - this.now());\n });\n return {\n remainingMs,\n isExpired: computed(() => targetTime() !== null && remainingMs() === 0),\n isEndingSoon: computed(() => remainingMs() > 0 && remainingMs() <= endingSoonMs),\n };\n }\n\n isInFuture(value: TxDateInput): boolean {\n const time = toDate(value)?.getTime();\n return time !== undefined && time > this.now();\n }\n}\n"],"mappings":";;;;AAWA,IAAa,UAAb,MAAa,QAAO;CACD,UAAU,OAAO,KAAK,IAAG,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEpC,MAAM,KAAK,QAAQ,WAAU;CAEtC,cAAA;EACE,IAAI,kBAAkB,OAAO,WAAW,CAAC,GAAG;GAC1C,MAAM,QAAQ,kBAAkB,KAAK,QAAQ,IAAI,KAAK,IAAG,CAAE,GAAG,YAAY;GAC1E,OAAO,UAAU,CAAC,CAAC,gBAAgB,cAAc,KAAK,CAAC;EACzD;CACF;CAEA,UAAU,QAA2C,eAAe,GAAC;EACnE,MAAM,aAAa,eAAe,OAAO,SAAS,MAAM,IAAI,OAAM,IAAK,MAAM,CAAC,EAAE,QAAO,KAAM,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;EAClG,MAAM,cAAc,eAAc;GAChC,MAAM,OAAO,WAAU;GACvB,OAAO,SAAS,OAAO,IAAI,KAAK,IAAI,GAAG,OAAO,KAAK,IAAG,CAAE;EAC1D,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EACF,OAAO;GACL;GACA,WAAW,eAAe,WAAU,MAAO,QAAQ,YAAW,MAAO,CAAC;GACtE,cAAc,eAAe,YAAW,IAAK,KAAK,YAAW,KAAM,YAAY;EAChF;CACH;CAEA,WAAW,OAAkB;EAC3B,MAAM,OAAO,OAAO,KAAK,CAAC,EAAE,QAAO;EACnC,OAAO,SAAS,UAAa,OAAO,KAAK,IAAG;CAC9C;CA5BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAP,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,YADM;CAAM,CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EADnB,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe, inject } from "@angular/core";
|
|
3
|
+
import { TxLocaleService } from "@tectra-ng/core/i18n";
|
|
4
|
+
const cache = /* @__PURE__ */ new Map();
|
|
5
|
+
function currencySymbol(currency, locale = "en-US", display = "narrowSymbol") {
|
|
6
|
+
const code = currency?.trim().toUpperCase();
|
|
7
|
+
if (!code) return "";
|
|
8
|
+
const key = `${code}|${locale}|${display}`;
|
|
9
|
+
const cached = cache.get(key);
|
|
10
|
+
if (cached !== void 0) return cached;
|
|
11
|
+
let symbol = code;
|
|
12
|
+
try {
|
|
13
|
+
if (display === "name") symbol = new Intl.DisplayNames(locale, { type: "currency" }).of(code) ?? code;
|
|
14
|
+
else symbol = new Intl.NumberFormat(locale, {
|
|
15
|
+
style: "currency",
|
|
16
|
+
currency: code,
|
|
17
|
+
currencyDisplay: display
|
|
18
|
+
}).formatToParts(0).find((part) => part.type === "currency")?.value ?? code;
|
|
19
|
+
} catch {
|
|
20
|
+
symbol = code;
|
|
21
|
+
}
|
|
22
|
+
cache.set(key, symbol);
|
|
23
|
+
return symbol;
|
|
24
|
+
}
|
|
25
|
+
var TxCurrencySymbolPipe = class TxCurrencySymbolPipe {
|
|
26
|
+
localeService = inject(TxLocaleService);
|
|
27
|
+
transform(currency, display = "narrowSymbol", locale) {
|
|
28
|
+
return currencySymbol(currency, locale ?? this.localeService.locale().intl, display);
|
|
29
|
+
}
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: TxCurrencySymbolPipe,
|
|
35
|
+
deps: [],
|
|
36
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
37
|
+
});
|
|
38
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
39
|
+
minVersion: "14.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: TxCurrencySymbolPipe,
|
|
43
|
+
isStandalone: true,
|
|
44
|
+
name: "txCurrencySymbol",
|
|
45
|
+
pure: false
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
49
|
+
minVersion: "12.0.0",
|
|
50
|
+
version: "22.2.3",
|
|
51
|
+
ngImport: i0,
|
|
52
|
+
type: TxCurrencySymbolPipe,
|
|
53
|
+
decorators: [{
|
|
54
|
+
type: Pipe,
|
|
55
|
+
args: [{
|
|
56
|
+
name: "txCurrencySymbol",
|
|
57
|
+
pure: false
|
|
58
|
+
}]
|
|
59
|
+
}]
|
|
60
|
+
});
|
|
61
|
+
export { TxCurrencySymbolPipe, currencySymbol };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=tectra-ng-utils-currency.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-currency.mjs","names":[],"sources":["../../../../packages/utils/currency/src/currency.ts"],"sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\n\nexport type TxCurrencyDisplay = 'narrowSymbol' | 'symbol' | 'code' | 'name';\n\nconst cache = new Map<string, string>();\n\nexport function currencySymbol(currency: string | null | undefined, locale = 'en-US', display: TxCurrencyDisplay = 'narrowSymbol'): string {\n const code = currency?.trim().toUpperCase();\n if (!code) {\n return '';\n }\n const key = `${code}|${locale}|${display}`;\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached;\n }\n let symbol = code;\n try {\n if (display === 'name') {\n symbol = new Intl.DisplayNames(locale, { type: 'currency' }).of(code) ?? code;\n } else {\n const parts = new Intl.NumberFormat(locale, { style: 'currency', currency: code, currencyDisplay: display }).formatToParts(0);\n symbol = parts.find((part) => part.type === 'currency')?.value ?? code;\n }\n } catch {\n symbol = code;\n }\n cache.set(key, symbol);\n return symbol;\n}\n\n@Pipe({ name: 'txCurrencySymbol', pure: false })\nexport class TxCurrencySymbolPipe implements PipeTransform {\n private readonly localeService = inject(TxLocaleService);\n\n transform(currency: string | null | undefined, display: TxCurrencyDisplay = 'narrowSymbol', locale?: string): string {\n return currenc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YAAA,CAAA;EADhC,MAAA;EAAK,MAAA,CAAA;GAAE,MAAM;GAAoB,MAAM;EAAK,CAAE"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InjectionToken, Pipe, inject } from "@angular/core";
|
|
3
|
+
import { formatDate } from "@angular/common";
|
|
4
|
+
const TX_DATE_FORMAT_DEFAULTS = {
|
|
5
|
+
format: "mediumDate",
|
|
6
|
+
empty: "-",
|
|
7
|
+
locale: "en-US",
|
|
8
|
+
timezone: void 0
|
|
9
|
+
};
|
|
10
|
+
const TX_DATE_FORMAT_CONFIG = new InjectionToken("TX_DATE_FORMAT_CONFIG", {
|
|
11
|
+
providedIn: "root",
|
|
12
|
+
factory: () => TX_DATE_FORMAT_DEFAULTS
|
|
13
|
+
});
|
|
14
|
+
function provideTxDateFormat(config) {
|
|
15
|
+
return {
|
|
16
|
+
provide: TX_DATE_FORMAT_CONFIG,
|
|
17
|
+
useValue: {
|
|
18
|
+
...TX_DATE_FORMAT_DEFAULTS,
|
|
19
|
+
...config
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const MS_IN_SECOND = 1e3;
|
|
24
|
+
const SECONDS_IN_MINUTE = 60;
|
|
25
|
+
const MINUTES_IN_HOUR = 60;
|
|
26
|
+
const HOURS_IN_DAY = 24;
|
|
27
|
+
const DAYS_IN_WEEK = 7;
|
|
28
|
+
const MONTHS_IN_YEAR = 12;
|
|
29
|
+
const SECONDS_IN_HOUR = 3600;
|
|
30
|
+
const SECONDS_IN_DAY = SECONDS_IN_HOUR * 24;
|
|
31
|
+
const MS_IN_MINUTE = MS_IN_SECOND * 60;
|
|
32
|
+
const MS_IN_HOUR = MS_IN_MINUTE * 60;
|
|
33
|
+
const MS_IN_DAY = MS_IN_HOUR * 24;
|
|
34
|
+
const MS_IN_WEEK = MS_IN_DAY * 7;
|
|
35
|
+
const TX_DATE_FORMATS = {
|
|
36
|
+
dateTime: "dd.MM.yy HH:mm",
|
|
37
|
+
date: "dd.MM.yyyy",
|
|
38
|
+
time: "HH:mm:ss",
|
|
39
|
+
timeShort: "HH:mm",
|
|
40
|
+
isoDay: "yyyy-MM-dd",
|
|
41
|
+
isoMonth: "yyyy-MM",
|
|
42
|
+
day: "dd",
|
|
43
|
+
dayMonth: "dd.MM"
|
|
44
|
+
};
|
|
45
|
+
const MIDDLE_OF_DAY_HOUR = 12;
|
|
46
|
+
function toDate(value) {
|
|
47
|
+
if (value === null || value === void 0 || value === "") return null;
|
|
48
|
+
const date = value instanceof Date ? new Date(value.getTime()) : new Date(value);
|
|
49
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
50
|
+
}
|
|
51
|
+
function isValidDate(value) {
|
|
52
|
+
return toDate(value) !== null;
|
|
53
|
+
}
|
|
54
|
+
function copy(value) {
|
|
55
|
+
return value instanceof Date ? new Date(value.getTime()) : new Date(value);
|
|
56
|
+
}
|
|
57
|
+
function startOfDay(value) {
|
|
58
|
+
const date = copy(value);
|
|
59
|
+
date.setHours(0, 0, 0, 0);
|
|
60
|
+
return date;
|
|
61
|
+
}
|
|
62
|
+
function middleOfDay(value) {
|
|
63
|
+
const date = copy(value);
|
|
64
|
+
date.setHours(MIDDLE_OF_DAY_HOUR, 0, 0, 0);
|
|
65
|
+
return date;
|
|
66
|
+
}
|
|
67
|
+
function endOfDay(value) {
|
|
68
|
+
const date = copy(value);
|
|
69
|
+
date.setHours(23, 59, 59, 999);
|
|
70
|
+
return date;
|
|
71
|
+
}
|
|
72
|
+
function addDays(value, days) {
|
|
73
|
+
const date = copy(value);
|
|
74
|
+
date.setDate(date.getDate() + days);
|
|
75
|
+
return date;
|
|
76
|
+
}
|
|
77
|
+
function addMonths(value, months) {
|
|
78
|
+
const date = copy(value);
|
|
79
|
+
const day = date.getDate();
|
|
80
|
+
date.setDate(1);
|
|
81
|
+
date.setMonth(date.getMonth() + months);
|
|
82
|
+
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
83
|
+
date.setDate(Math.min(day, lastDay));
|
|
84
|
+
return date;
|
|
85
|
+
}
|
|
86
|
+
function addYears(value, years) {
|
|
87
|
+
return addMonths(value, years * 12);
|
|
88
|
+
}
|
|
89
|
+
function startOfWeek(value, firstDayOfWeek = 1) {
|
|
90
|
+
const date = startOfDay(value);
|
|
91
|
+
date.setDate(date.getDate() - (date.getDay() - firstDayOfWeek + 7) % 7);
|
|
92
|
+
return date;
|
|
93
|
+
}
|
|
94
|
+
function calendarDaysBetween(from, to) {
|
|
95
|
+
const start = startOfDay(from);
|
|
96
|
+
const end = startOfDay(to);
|
|
97
|
+
const startUtc = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate());
|
|
98
|
+
const endUtc = Date.UTC(end.getFullYear(), end.getMonth(), end.getDate());
|
|
99
|
+
return Math.round((endUtc - startUtc) / MS_IN_DAY);
|
|
100
|
+
}
|
|
101
|
+
function isSameDay(a, b) {
|
|
102
|
+
const first = toDate(a);
|
|
103
|
+
const second = toDate(b);
|
|
104
|
+
return !!first && !!second && calendarDaysBetween(first, second) === 0;
|
|
105
|
+
}
|
|
106
|
+
function toIsoDay(value) {
|
|
107
|
+
const date = copy(value);
|
|
108
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
109
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
110
|
+
return `${date.getFullYear()}-${month}-${day}`;
|
|
111
|
+
}
|
|
112
|
+
function toIsoString(value) {
|
|
113
|
+
if (typeof value === "string") return value || void 0;
|
|
114
|
+
return toDate(value)?.toISOString();
|
|
115
|
+
}
|
|
116
|
+
function toIsoRange(range) {
|
|
117
|
+
if (!range || range.length !== 2) return null;
|
|
118
|
+
const start = toDate(range[0]);
|
|
119
|
+
const end = toDate(range[1]);
|
|
120
|
+
return start && end ? {
|
|
121
|
+
start: start.toISOString(),
|
|
122
|
+
end: end.toISOString()
|
|
123
|
+
} : null;
|
|
124
|
+
}
|
|
125
|
+
function isExpiringWithin(value, periodMs = MS_IN_WEEK, now = Date.now()) {
|
|
126
|
+
const date = toDate(value);
|
|
127
|
+
return !!date && date.getTime() - new Date(now).getTime() <= periodMs;
|
|
128
|
+
}
|
|
129
|
+
var TxDatePipe = class TxDatePipe {
|
|
130
|
+
config = inject(TX_DATE_FORMAT_CONFIG);
|
|
131
|
+
transform(value, format, timezone, locale) {
|
|
132
|
+
const date = toDate(value);
|
|
133
|
+
if (!date) return this.config.empty;
|
|
134
|
+
try {
|
|
135
|
+
return formatDate(date, format ?? this.config.format, locale ?? this.config.locale, timezone ?? this.config.timezone) || this.config.empty;
|
|
136
|
+
} catch {
|
|
137
|
+
return this.config.empty;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
141
|
+
minVersion: "12.0.0",
|
|
142
|
+
version: "22.2.3",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: TxDatePipe,
|
|
145
|
+
deps: [],
|
|
146
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
147
|
+
});
|
|
148
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
149
|
+
minVersion: "14.0.0",
|
|
150
|
+
version: "22.2.3",
|
|
151
|
+
ngImport: i0,
|
|
152
|
+
type: TxDatePipe,
|
|
153
|
+
isStandalone: true,
|
|
154
|
+
name: "txDate"
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
158
|
+
minVersion: "12.0.0",
|
|
159
|
+
version: "22.2.3",
|
|
160
|
+
ngImport: i0,
|
|
161
|
+
type: TxDatePipe,
|
|
162
|
+
decorators: [{
|
|
163
|
+
type: Pipe,
|
|
164
|
+
args: [{ name: "txDate" }]
|
|
165
|
+
}]
|
|
166
|
+
});
|
|
167
|
+
var TxDateRangePipe = class TxDateRangePipe {
|
|
168
|
+
transform(range) {
|
|
169
|
+
return toIsoRange(range);
|
|
170
|
+
}
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
172
|
+
minVersion: "12.0.0",
|
|
173
|
+
version: "22.2.3",
|
|
174
|
+
ngImport: i0,
|
|
175
|
+
type: TxDateRangePipe,
|
|
176
|
+
deps: [],
|
|
177
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
178
|
+
});
|
|
179
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
180
|
+
minVersion: "14.0.0",
|
|
181
|
+
version: "22.2.3",
|
|
182
|
+
ngImport: i0,
|
|
183
|
+
type: TxDateRangePipe,
|
|
184
|
+
isStandalone: true,
|
|
185
|
+
name: "txDateRange"
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
189
|
+
minVersion: "12.0.0",
|
|
190
|
+
version: "22.2.3",
|
|
191
|
+
ngImport: i0,
|
|
192
|
+
type: TxDateRangePipe,
|
|
193
|
+
decorators: [{
|
|
194
|
+
type: Pipe,
|
|
195
|
+
args: [{ name: "txDateRange" }]
|
|
196
|
+
}]
|
|
197
|
+
});
|
|
198
|
+
export { DAYS_IN_WEEK, HOURS_IN_DAY, MINUTES_IN_HOUR, MONTHS_IN_YEAR, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, MS_IN_SECOND, MS_IN_WEEK, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE, TX_DATE_FORMATS, TX_DATE_FORMAT_CONFIG, TX_DATE_FORMAT_DEFAULTS, TxDatePipe, TxDateRangePipe, addDays, addMonths, addYears, calendarDaysBetween, endOfDay, isExpiringWithin, isSameDay, isValidDate, middleOfDay, provideTxDateFormat, startOfDay, startOfWeek, toDate, toIsoDay, toIsoRange, toIsoString };
|
|
199
|
+
|
|
200
|
+
//# sourceMappingURL=tectra-ng-utils-date.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-utils-date.mjs","names":[],"sources":["../../../../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"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport { TxDateFormatConfig } from './date.types';\n\nexport const TX_DATE_FORMAT_DEFAULTS: TxDateFormatConfig = {\n format: 'mediumDate',\n empty: '-',\n locale: 'en-US',\n timezone: undefined,\n};\n\nexport const TX_DATE_FORMAT_CONFIG = new InjectionToken<TxDateFormatConfig>('TX_DATE_FORMAT_CONFIG', {\n providedIn: 'root',\n factory: () => TX_DATE_FORMAT_DEFAULTS,\n});\n\nexport function provideTxDateFormat(config: Partial<TxDateFormatConfig>): Provider {\n return { provide: TX_DATE_FORMAT_CONFIG, useValue: { ...TX_DATE_FORMAT_DEFAULTS, ...config } };\n}\n","export const MS_IN_SECOND = 1000;\nexport const SECONDS_IN_MINUTE = 60;\nexport const MINUTES_IN_HOUR = 60;\nexport const HOURS_IN_DAY = 24;\nexport const DAYS_IN_WEEK = 7;\nexport const MONTHS_IN_YEAR = 12;\nexport const SECONDS_IN_HOUR = SECONDS_IN_MINUTE * MINUTES_IN_HOUR;\nexport const SECONDS_IN_DAY = SECONDS_IN_HOUR * HOURS_IN_DAY;\nexport const MS_IN_MINUTE = MS_IN_SECOND * SECONDS_IN_MINUTE;\nexport const MS_IN_HOUR = MS_IN_MINUTE * MINUTES_IN_HOUR;\nexport const MS_IN_DAY = MS_IN_HOUR * HOURS_IN_DAY;\nexport const MS_IN_WEEK = MS_IN_DAY * DAYS_IN_WEEK;\n\nexport const TX_DATE_FORMATS = {\n dateTime: 'dd.MM.yy HH:mm',\n date: 'dd.MM.yyyy',\n time: 'HH:mm:ss',\n timeShort: 'HH:mm',\n isoDay: 'yyyy-MM-dd',\n isoMonth: 'yyyy-MM',\n day: 'dd',\n dayMonth: 'dd.MM',\n} as const;\n","import { DAYS_IN_WEEK, MS_IN_DAY, MS_IN_WEEK } from './date.constants';\nimport { TxDateInput, TxIsoRange } from './date.types';\n\nconst MIDDLE_OF_DAY_HOUR = 12;\n\nexport function toDate(value: TxDateInput): Date | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n const date = value instanceof Date ? new Date(value.getTime()) : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\nexport function isValidDate(value: TxDateInput): boolean {\n return toDate(value) !== null;\n}\n\nfunction copy(value: Date | string | number): Date {\n return value instanceof Date ? new Date(value.getTime()) : new Date(value);\n}\n\nexport function startOfDay(value: Date | string | number): Date {\n const date = copy(value);\n date.setHours(0, 0, 0, 0);\n return date;\n}\n\nexport function middleOfDay(value: Date | string | number): Date {\n const date = copy(value);\n date.setHours(MIDDLE_OF_DAY_HOUR, 0, 0, 0);\n return date;\n}\n\nexport function endOfDay(value: Date | string | number): Date {\n const date = copy(value);\n date.setHours(23, 59, 59, 999);\n return date;\n}\n\nexport function addDays(value: Date | string | number, days: number): Date {\n const date = copy(value);\n date.setDate(date.getDate() + days);\n return date;\n}\n\nexport function addMonths(value: Date | string | number, months: number): Date {\n const date = copy(value);\n const day = date.getDate();\n date.setDate(1);\n date.setMonth(date.getMonth() + months);\n const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n date.setDate(Math.min(day, lastDay));\n return date;\n}\n\nexport function addYears(value: Date | string | number, years: number): Date {\n return addMonths(value, years * 12);\n}\n\nexport function startOfWeek(value: Date | string | number, firstDayOfWeek = 1): Date {\n const date = startOfDay(value);\n date.setDate(date.getDate() - ((date.getDay() - firstDayOfWeek + DAYS_IN_WEEK) % DAYS_IN_WEEK));\n return date;\n}\n\nexport function calendarDaysBetween(from: Date | string | number, to: Date | string | number): number {\n const start = startOfDay(from);\n const end = startOfDay(to);\n const startUtc = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate());\n const endUtc = Date.UTC(end.getFullYear(), end.getMonth(), end.getDate());\n return Math.round((endUtc - startUtc) / MS_IN_DAY);\n}\n\nexport function isSameDay(a: TxDateInput, b: TxDateInput): boolean {\n const first = toDate(a);\n const second = toDate(b);\n return !!first && !!second && calendarDaysBetween(first, second) === 0;\n}\n\nexport function toIsoDay(value: Date | string | number): string {\n const date = copy(value);\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n return `${date.getFullYear()}-${month}-${day}`;\n}\n\nexport function toIsoString(value: TxDateInput): string | undefined {\n if (typeof value === 'string') {\n return value || undefined;\n }\n return toDate(value)?.toISOString();\n}\n\nexport function toIsoRange(range: readonly TxDateInput[] | null | undefined): TxIsoRange | null {\n if (!range || range.length !== 2) {\n return null;\n }\n const start = toDate(range[0]);\n const end = toDate(range[1]);\n return start && end ? { start: start.toISOString(), end: end.toISOString() } : null;\n}\n\nexport function isExpiringWithin(value: TxDateInput, periodMs = MS_IN_WEEK, now: Date | number = Date.now()): boolean {\n const date = toDate(value);\n return !!date && date.getTime() - new Date(now).getTime() <= periodMs;\n}\n","import { formatDate } from '@angular/common';\nimport { Pipe, PipeTransform, inject } from '@angular/core';\nimport { TX_DATE_FORMAT_CONFIG } from './date.config';\nimport { toDate, toIsoRange } from './date.functions';\nimport { TxDateInput, TxIsoRange } from './date.types';\n\n@Pipe({ name: 'txDate' })\nexport class TxDatePipe implements PipeTransform {\n private readonly config = inject(TX_DATE_FORMAT_CONFIG);\n\n transform(value: TxDateInput, format?: string, timezone?: string, locale?: string): string {\n const date = toDate(value);\n if (!date) {\n return this.config.empty;\n }\n try {\n return formatDate(date, format ?? this.config.format, locale ?? this.config.locale, timezone ?? this.config.timezone) || this.config.empty;\n } catch {\n return this.config.empty;\n }\n }\n}\n\n@Pipe({ name: 'txDateRange' })\nexport class TxDateRangePipe implements PipeTransform {\n transform(range: readonly TxDateInput[] | null | undefined): TxIsoRange | null {\n return toIsoRange(range);\n }\n}\n"],"mappings":";;;AAGA,MAAa,0BAA8C;CACzD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,UAAU;AACX;AAED,MAAa,wBAAwB,IAAI,eAAmC,yBAAyB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