@cedx/base 0.14.0 → 0.14.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/ReadMe.md +1 -1
- package/lib/UI/Components/Toast.js +1 -1
- package/lib/UI/Components/Toaster.d.ts +5 -5
- package/lib/UI/Components/Toaster.d.ts.map +1 -1
- package/lib/UI/Components/Toaster.js +7 -8
- package/package.json +1 -1
- package/src/Client/UI/Components/Toast.ts +1 -1
- package/src/Client/UI/Components/Toaster.ts +7 -8
package/ReadMe.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Belin.io Base
|
|
2
|
-
   
|
|
3
3
|
|
|
4
4
|
Base library by [Cédric Belin](https://belin.io), full stack developer,
|
|
5
5
|
implemented in [C#](https://learn.microsoft.com/en-us/dotnet/csharp) and [TypeScript](https://www.typescriptlang.org).
|
|
@@ -221,6 +221,6 @@ export class Toast extends HTMLElement {
|
|
|
221
221
|
* @param value The new value.
|
|
222
222
|
*/
|
|
223
223
|
#updateIcon(value) {
|
|
224
|
-
this.querySelector(".toast-header .icon").textContent = value.trim() || getIcon(
|
|
224
|
+
this.querySelector(".toast-header .icon").textContent = value.trim() || getIcon(this.context);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
@@ -89,14 +89,14 @@ export declare class Toaster extends HTMLElement {
|
|
|
89
89
|
*/
|
|
90
90
|
attributeChangedCallback(attribute: string, oldValue: string | null, newValue: string | null): void;
|
|
91
91
|
/**
|
|
92
|
-
* Shows a toast
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
92
|
+
* Shows a toast.
|
|
93
|
+
* @param context The contextual modifier.
|
|
94
|
+
* @param caption The title displayed in the toast header.
|
|
95
|
+
* @param childContent The child content displayed in the toast body.
|
|
96
96
|
*/
|
|
97
97
|
notify(context: Context, caption: string, childContent: DocumentFragment | string): void;
|
|
98
98
|
/**
|
|
99
|
-
* Shows
|
|
99
|
+
* Shows the specified toast.
|
|
100
100
|
* @param toast The toast to show.
|
|
101
101
|
*/
|
|
102
102
|
show(toast: IToast): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../src/Client/UI/Components/Toaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../../src/Client/UI/Components/Toaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAQ,MAAM,gBAAgB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,MAAM;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,gBAAgB,GAAC,MAAM,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;;IAEvC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,WAAgB;IAclD;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAG3B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAG1B;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAGrB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,CAAC,MAAM,CAGzB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAE7B;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAGlB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAEtB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,QAAQ,CAGvB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAE3B;IAED;;;;;OAKG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAC,IAAI,GAAG,IAAI;IAS/F;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAC,MAAM,GAAG,IAAI;IAItF;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CA2BzB;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,OAAO,CAAC;KAC7B;CACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context
|
|
1
|
+
import { Context } from "../Context.js";
|
|
2
2
|
import { createDocumentFragment } from "../ElementExtensions.js";
|
|
3
3
|
import { Position, toCss } from "../Position.js";
|
|
4
4
|
/**
|
|
@@ -77,8 +77,7 @@ export class Toaster extends HTMLElement {
|
|
|
77
77
|
* The default icon displayed next to the captions.
|
|
78
78
|
*/
|
|
79
79
|
get icon() {
|
|
80
|
-
|
|
81
|
-
return value.trim() || getIcon(this.context);
|
|
80
|
+
return (this.getAttribute("icon") ?? "").trim();
|
|
82
81
|
}
|
|
83
82
|
set icon(value) {
|
|
84
83
|
this.setAttribute("icon", value);
|
|
@@ -109,16 +108,16 @@ export class Toaster extends HTMLElement {
|
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
/**
|
|
112
|
-
* Shows a toast
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
111
|
+
* Shows a toast.
|
|
112
|
+
* @param context The contextual modifier.
|
|
113
|
+
* @param caption The title displayed in the toast header.
|
|
114
|
+
* @param childContent The child content displayed in the toast body.
|
|
116
115
|
*/
|
|
117
116
|
notify(context, caption, childContent) {
|
|
118
117
|
this.show({ context, caption, childContent });
|
|
119
118
|
}
|
|
120
119
|
/**
|
|
121
|
-
* Shows
|
|
120
|
+
* Shows the specified toast.
|
|
122
121
|
* @param toast The toast to show.
|
|
123
122
|
*/
|
|
124
123
|
show(toast) {
|
package/package.json
CHANGED
|
@@ -248,7 +248,7 @@ export class Toast extends HTMLElement {
|
|
|
248
248
|
* @param value The new value.
|
|
249
249
|
*/
|
|
250
250
|
#updateIcon(value: string): void {
|
|
251
|
-
this.querySelector(".toast-header .icon")!.textContent = value.trim() || getIcon(
|
|
251
|
+
this.querySelector(".toast-header .icon")!.textContent = value.trim() || getIcon(this.context);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Context
|
|
1
|
+
import {Context} from "../Context.js";
|
|
2
2
|
import {createDocumentFragment} from "../ElementExtensions.js";
|
|
3
3
|
import {Position, toCss} from "../Position.js";
|
|
4
4
|
|
|
@@ -129,8 +129,7 @@ export class Toaster extends HTMLElement {
|
|
|
129
129
|
* The default icon displayed next to the captions.
|
|
130
130
|
*/
|
|
131
131
|
get icon(): string {
|
|
132
|
-
|
|
133
|
-
return value.trim() || getIcon(this.context);
|
|
132
|
+
return (this.getAttribute("icon") ?? "").trim();
|
|
134
133
|
}
|
|
135
134
|
set icon(value: string) {
|
|
136
135
|
this.setAttribute("icon", value);
|
|
@@ -163,17 +162,17 @@ export class Toaster extends HTMLElement {
|
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
|
-
* Shows a toast
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
165
|
+
* Shows a toast.
|
|
166
|
+
* @param context The contextual modifier.
|
|
167
|
+
* @param caption The title displayed in the toast header.
|
|
168
|
+
* @param childContent The child content displayed in the toast body.
|
|
170
169
|
*/
|
|
171
170
|
notify(context: Context, caption: string, childContent: DocumentFragment|string): void {
|
|
172
171
|
this.show({context, caption, childContent});
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
/**
|
|
176
|
-
* Shows
|
|
175
|
+
* Shows the specified toast.
|
|
177
176
|
* @param toast The toast to show.
|
|
178
177
|
*/
|
|
179
178
|
show(toast: IToast): void {
|