@cedx/base 0.27.0 → 0.28.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/UI/Components/FullScreenToggler.d.ts +1 -1
- package/lib/UI/Components/FullScreenToggler.js +3 -3
- package/lib/UI/Components/TypeAhead.d.ts +5 -5
- package/lib/UI/Components/TypeAhead.d.ts.map +1 -1
- package/lib/UI/Components/TypeAhead.js +13 -13
- package/package.json +3 -3
- package/src/Client/UI/Components/FullScreenToggler.ts +3 -3
- package/src/Client/UI/Components/TypeAhead.ts +14 -14
package/ReadMe.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Cédric Belin's Base
|
|
2
|
-
   
|
|
3
3
|
|
|
4
4
|
Base library by [Cédric Belin](https://cedric-belin.fr), full stack developer,
|
|
5
5
|
implemented in [C#](https://learn.microsoft.com/en-us/dotnet/csharp) and [TypeScript](https://www.typescriptlang.org).
|
|
@@ -28,7 +28,7 @@ export declare class FullScreenToggler extends HTMLElement {
|
|
|
28
28
|
/**
|
|
29
29
|
* Toggles the full-screen mode of the associated element.
|
|
30
30
|
* @param event The dispatched event.
|
|
31
|
-
* @returns
|
|
31
|
+
* @returns Completes when the full-screen mode has been toggled.
|
|
32
32
|
*/
|
|
33
33
|
toggleFullScreen(event?: Event): Promise<void>;
|
|
34
34
|
}
|
|
@@ -60,7 +60,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
60
60
|
/**
|
|
61
61
|
* Toggles the full-screen mode of the associated element.
|
|
62
62
|
* @param event The dispatched event.
|
|
63
|
-
* @returns
|
|
63
|
+
* @returns Completes when the full-screen mode has been toggled.
|
|
64
64
|
*/
|
|
65
65
|
async toggleFullScreen(event) {
|
|
66
66
|
event?.stopPropagation();
|
|
@@ -71,7 +71,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Acquires a new wake lock.
|
|
74
|
-
* @returns
|
|
74
|
+
* @returns Completes when the wake lock has been acquired.
|
|
75
75
|
*/
|
|
76
76
|
async #acquireWakeLock() {
|
|
77
77
|
if (this.#sentinel && !this.#sentinel.released)
|
|
@@ -99,7 +99,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
101
|
* Releases the acquired wake lock.
|
|
102
|
-
* @returns
|
|
102
|
+
* @returns Completes when the wake lock has been released.
|
|
103
103
|
*/
|
|
104
104
|
async #releaseWakeLock() {
|
|
105
105
|
if (!this.#sentinel || this.#sentinel.released)
|
|
@@ -7,6 +7,11 @@ export declare class TypeAhead extends HTMLElement {
|
|
|
7
7
|
* The list of observed attributes.
|
|
8
8
|
*/
|
|
9
9
|
static readonly observedAttributes: string[];
|
|
10
|
+
/**
|
|
11
|
+
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
12
|
+
*/
|
|
13
|
+
get delay(): number;
|
|
14
|
+
set delay(value: number);
|
|
10
15
|
/**
|
|
11
16
|
* The function invoked when the query has been changed.
|
|
12
17
|
*/
|
|
@@ -26,11 +31,6 @@ export declare class TypeAhead extends HTMLElement {
|
|
|
26
31
|
*/
|
|
27
32
|
get query(): string;
|
|
28
33
|
set query(value: string);
|
|
29
|
-
/**
|
|
30
|
-
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
31
|
-
*/
|
|
32
|
-
get wait(): number;
|
|
33
|
-
set wait(value: number);
|
|
34
34
|
/**
|
|
35
35
|
* Method invoked when an attribute has been changed.
|
|
36
36
|
* @param attribute The attribute name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeAhead.d.ts","sourceRoot":"","sources":["../../../src/Client/UI/Components/TypeAhead.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;;IAEzC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,WAAqB;IAmBvD;;OAEG;IAC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AAI;CAsD/F;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,qBAAqB;QAC9B,YAAY,EAAE,SAAS,CAAC;KACxB;CACD"}
|
|
@@ -20,6 +20,16 @@ export class TypeAhead extends HTMLElement {
|
|
|
20
20
|
static {
|
|
21
21
|
customElements.define("type-ahead", this);
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
25
|
+
*/
|
|
26
|
+
get delay() {
|
|
27
|
+
const value = Number(this.getAttribute("delay"));
|
|
28
|
+
return Math.max(0, Number.isNaN(value) ? 300 : value);
|
|
29
|
+
}
|
|
30
|
+
set delay(value) {
|
|
31
|
+
this.setAttribute("delay", value.toString());
|
|
32
|
+
}
|
|
23
33
|
/**
|
|
24
34
|
* The function invoked when the query has been changed.
|
|
25
35
|
*/
|
|
@@ -31,7 +41,7 @@ export class TypeAhead extends HTMLElement {
|
|
|
31
41
|
catch {
|
|
32
42
|
this.#updateItems([]);
|
|
33
43
|
}
|
|
34
|
-
}, this.
|
|
44
|
+
}, this.delay);
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
37
47
|
* The data list identifier.
|
|
@@ -46,11 +56,11 @@ export class TypeAhead extends HTMLElement {
|
|
|
46
56
|
* The minimum character length needed before triggering autocomplete suggestions.
|
|
47
57
|
*/
|
|
48
58
|
get minLength() {
|
|
49
|
-
const value = Number(this.getAttribute("
|
|
59
|
+
const value = Number(this.getAttribute("minlength"));
|
|
50
60
|
return Math.max(1, Number.isNaN(value) ? 1 : value);
|
|
51
61
|
}
|
|
52
62
|
set minLength(value) {
|
|
53
|
-
this.setAttribute("
|
|
63
|
+
this.setAttribute("minlength", value.toString());
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
56
66
|
* The query to look up.
|
|
@@ -61,16 +71,6 @@ export class TypeAhead extends HTMLElement {
|
|
|
61
71
|
set query(value) {
|
|
62
72
|
this.setAttribute("query", value);
|
|
63
73
|
}
|
|
64
|
-
/**
|
|
65
|
-
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
66
|
-
*/
|
|
67
|
-
get wait() {
|
|
68
|
-
const value = Number(this.getAttribute("wait"));
|
|
69
|
-
return Math.max(0, Number.isNaN(value) ? 300 : value);
|
|
70
|
-
}
|
|
71
|
-
set wait(value) {
|
|
72
|
-
this.setAttribute("wait", value.toString());
|
|
73
|
-
}
|
|
74
74
|
/**
|
|
75
75
|
* Method invoked when an attribute has been changed.
|
|
76
76
|
* @param attribute The attribute name.
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"name": "@cedx/base",
|
|
8
8
|
"repository": "cedx/base",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.28.0",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@playwright/browser-chromium": "^1.55.0",
|
|
13
13
|
"@types/bootstrap": "^5.2.10",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"chai": "^6.0.1",
|
|
19
19
|
"esbuild": "^0.25.9",
|
|
20
20
|
"globals": "^16.3.0",
|
|
21
|
-
"mocha": "^11.7.
|
|
21
|
+
"mocha": "^11.7.2",
|
|
22
22
|
"playwright": "^1.55.0",
|
|
23
23
|
"serve-handler": "^6.1.6",
|
|
24
24
|
"typedoc": "^0.28.12",
|
|
25
25
|
"typescript": "^5.9.2",
|
|
26
|
-
"typescript-eslint": "^8.
|
|
26
|
+
"typescript-eslint": "^8.42.0"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=24.0.0"
|
|
@@ -69,7 +69,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
69
69
|
/**
|
|
70
70
|
* Toggles the full-screen mode of the associated element.
|
|
71
71
|
* @param event The dispatched event.
|
|
72
|
-
* @returns
|
|
72
|
+
* @returns Completes when the full-screen mode has been toggled.
|
|
73
73
|
*/
|
|
74
74
|
async toggleFullScreen(event?: Event): Promise<void> {
|
|
75
75
|
event?.stopPropagation();
|
|
@@ -79,7 +79,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Acquires a new wake lock.
|
|
82
|
-
* @returns
|
|
82
|
+
* @returns Completes when the wake lock has been acquired.
|
|
83
83
|
*/
|
|
84
84
|
async #acquireWakeLock(): Promise<void> {
|
|
85
85
|
if (this.#sentinel && !this.#sentinel.released) return;
|
|
@@ -105,7 +105,7 @@ export class FullScreenToggler extends HTMLElement {
|
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Releases the acquired wake lock.
|
|
108
|
-
* @returns
|
|
108
|
+
* @returns Completes when the wake lock has been released.
|
|
109
109
|
*/
|
|
110
110
|
async #releaseWakeLock(): Promise<void> {
|
|
111
111
|
if (!this.#sentinel || this.#sentinel.released) return;
|
|
@@ -25,6 +25,17 @@ export class TypeAhead extends HTMLElement {
|
|
|
25
25
|
customElements.define("type-ahead", this);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
30
|
+
*/
|
|
31
|
+
get delay(): number {
|
|
32
|
+
const value = Number(this.getAttribute("delay"));
|
|
33
|
+
return Math.max(0, Number.isNaN(value) ? 300 : value);
|
|
34
|
+
}
|
|
35
|
+
set delay(value: number) {
|
|
36
|
+
this.setAttribute("delay", value.toString());
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
/**
|
|
29
40
|
* The function invoked when the query has been changed.
|
|
30
41
|
*/
|
|
@@ -32,7 +43,7 @@ export class TypeAhead extends HTMLElement {
|
|
|
32
43
|
this.#debounced = this.#debounce(async query => { // eslint-disable-line @typescript-eslint/no-misused-promises
|
|
33
44
|
try { this.#updateItems(await callback(query)); }
|
|
34
45
|
catch { this.#updateItems([]); }
|
|
35
|
-
}, this.
|
|
46
|
+
}, this.delay);
|
|
36
47
|
}
|
|
37
48
|
|
|
38
49
|
/**
|
|
@@ -49,11 +60,11 @@ export class TypeAhead extends HTMLElement {
|
|
|
49
60
|
* The minimum character length needed before triggering autocomplete suggestions.
|
|
50
61
|
*/
|
|
51
62
|
get minLength(): number {
|
|
52
|
-
const value = Number(this.getAttribute("
|
|
63
|
+
const value = Number(this.getAttribute("minlength"));
|
|
53
64
|
return Math.max(1, Number.isNaN(value) ? 1 : value);
|
|
54
65
|
}
|
|
55
66
|
set minLength(value: number) {
|
|
56
|
-
this.setAttribute("
|
|
67
|
+
this.setAttribute("minlength", value.toString());
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
/**
|
|
@@ -66,17 +77,6 @@ export class TypeAhead extends HTMLElement {
|
|
|
66
77
|
this.setAttribute("query", value);
|
|
67
78
|
}
|
|
68
79
|
|
|
69
|
-
/**
|
|
70
|
-
* The delay in milliseconds to wait before triggering autocomplete suggestions.
|
|
71
|
-
*/
|
|
72
|
-
get wait(): number {
|
|
73
|
-
const value = Number(this.getAttribute("wait"));
|
|
74
|
-
return Math.max(0, Number.isNaN(value) ? 300 : value);
|
|
75
|
-
}
|
|
76
|
-
set wait(value: number) {
|
|
77
|
-
this.setAttribute("wait", value.toString());
|
|
78
|
-
}
|
|
79
|
-
|
|
80
80
|
/**
|
|
81
81
|
* Method invoked when an attribute has been changed.
|
|
82
82
|
* @param attribute The attribute name.
|