@cedx/base 0.30.0 → 0.32.0
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/ReadMe.md +1 -1
- package/lib/Date.d.ts.map +1 -1
- package/lib/DateRange.d.ts +106 -0
- package/lib/DateRange.d.ts.map +1 -0
- package/lib/DateRange.js +136 -0
- package/lib/File.d.ts.map +1 -1
- package/lib/Number.d.ts.map +1 -1
- package/lib/String.d.ts +7 -4
- package/lib/String.d.ts.map +1 -1
- package/lib/String.js +7 -6
- package/lib/TimeSpan.d.ts.map +1 -1
- package/lib/UI/Components/BackButton.d.ts +1 -1
- package/lib/UI/Components/BackButton.d.ts.map +1 -1
- package/lib/UI/Components/BackButton.js +3 -3
- package/lib/UI/Components/DialogBox.js +5 -5
- package/lib/UI/Components/FullScreenToggler.d.ts +1 -1
- package/lib/UI/Components/FullScreenToggler.d.ts.map +1 -1
- package/lib/UI/Components/FullScreenToggler.js +10 -7
- package/lib/UI/Components/KeyboardAccelerator.d.ts.map +1 -1
- package/lib/UI/Components/KeyboardAccelerator.js +6 -2
- package/lib/UI/Components/LoadingIndicator.d.ts +4 -0
- package/lib/UI/Components/LoadingIndicator.d.ts.map +1 -1
- package/lib/UI/Components/LoadingIndicator.js +6 -0
- package/lib/UI/Components/MenuActivator.d.ts.map +1 -1
- package/lib/UI/Components/MenuActivator.js +7 -4
- package/lib/UI/Components/OfflineIndicator.d.ts +4 -0
- package/lib/UI/Components/OfflineIndicator.d.ts.map +1 -1
- package/lib/UI/Components/OfflineIndicator.js +12 -3
- package/lib/UI/Components/TabActivator.d.ts.map +1 -1
- package/lib/UI/Components/ThemeDropdown.d.ts.map +1 -1
- package/lib/UI/Components/ThemeDropdown.js +9 -5
- package/lib/UI/Components/Toast.d.ts.map +1 -1
- package/lib/UI/Components/Toast.js +7 -5
- package/lib/UI/Components/Toaster.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/Client/Base/DateRange.ts +173 -0
- package/src/Client/{String.ts → Base/String.ts} +7 -6
- package/src/Client/Base/tsconfig.json +2 -2
- package/src/Client/UI/Components/BackButton.ts +3 -3
- package/src/Client/UI/Components/DialogBox.ts +5 -5
- package/src/Client/UI/Components/FullScreenToggler.ts +11 -7
- package/src/Client/UI/Components/KeyboardAccelerator.ts +7 -2
- package/src/Client/UI/Components/LoadingIndicator.ts +7 -0
- package/src/Client/UI/Components/MenuActivator.ts +8 -4
- package/src/Client/UI/Components/OfflineIndicator.ts +14 -2
- package/src/Client/UI/Components/TabActivator.ts +1 -0
- package/src/Client/UI/Components/ThemeDropdown.ts +10 -6
- package/src/Client/UI/Components/Toast.ts +8 -6
- package/src/Client/UI/Components/Toaster.ts +1 -2
- /package/src/Client/{Date.ts → Base/Date.ts} +0 -0
- /package/src/Client/{File.ts → Base/File.ts} +0 -0
- /package/src/Client/{Number.ts → Base/Number.ts} +0 -0
- /package/src/Client/{TimeSpan.ts → Base/TimeSpan.ts} +0 -0
|
@@ -16,6 +16,11 @@ export class Toast extends HTMLElement {
|
|
|
16
16
|
*/
|
|
17
17
|
static readonly #timeUnits: Intl.RelativeTimeFormatUnit[] = ["second", "minute", "hour"];
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* The abort controller used to remove the event listeners.
|
|
21
|
+
*/
|
|
22
|
+
readonly #abortController = new AbortController;
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
25
|
* The formatter used to format the relative time.
|
|
21
26
|
*/
|
|
@@ -173,8 +178,8 @@ export class Toast extends HTMLElement {
|
|
|
173
178
|
*/
|
|
174
179
|
connectedCallback(): void {
|
|
175
180
|
const root = this.firstElementChild!;
|
|
176
|
-
root.addEventListener("hide.bs.toast", this.#stopTimer);
|
|
177
|
-
root.addEventListener("show.bs.toast", this.#startTimer);
|
|
181
|
+
root.addEventListener("hide.bs.toast", this.#stopTimer, {signal: this.#abortController.signal});
|
|
182
|
+
root.addEventListener("show.bs.toast", this.#startTimer, {signal: this.#abortController.signal});
|
|
178
183
|
|
|
179
184
|
this.#toast = new BootstrapToast(root);
|
|
180
185
|
if (this.open) this.show();
|
|
@@ -184,11 +189,8 @@ export class Toast extends HTMLElement {
|
|
|
184
189
|
* Method invoked when this component is disconnected.
|
|
185
190
|
*/
|
|
186
191
|
disconnectedCallback(): void {
|
|
187
|
-
const root = this.firstElementChild!;
|
|
188
|
-
root.removeEventListener("hide.bs.toast", () => this.#stopTimer);
|
|
189
|
-
root.removeEventListener("show.bs.toast", () => this.#startTimer);
|
|
190
|
-
|
|
191
192
|
this.#stopTimer();
|
|
193
|
+
this.#abortController.abort();
|
|
192
194
|
this.#toast.dispose();
|
|
193
195
|
}
|
|
194
196
|
|
|
@@ -67,8 +67,7 @@ export class Toaster extends HTMLElement {
|
|
|
67
67
|
*/
|
|
68
68
|
constructor() {
|
|
69
69
|
super();
|
|
70
|
-
for (const toast of this.querySelectorAll("toaster-item"))
|
|
71
|
-
toast.addEventListener("hidden.bs.toast", () => toast.remove());
|
|
70
|
+
for (const toast of this.querySelectorAll("toaster-item")) toast.addEventListener("hidden.bs.toast", () => toast.remove());
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|