@cedx/base 0.6.0 → 0.7.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/Data/Pagination.d.ts +30 -13
- package/lib/Data/Pagination.d.ts.map +1 -1
- package/lib/Data/Pagination.js +39 -12
- package/lib/Data/Sort.d.ts +25 -23
- package/lib/Data/Sort.d.ts.map +1 -1
- package/lib/Data/Sort.js +37 -33
- package/lib/{Date.d.ts → DateExtensions.d.ts} +1 -1
- package/lib/DateExtensions.d.ts.map +1 -0
- package/lib/{Html/File.d.ts → FileExtensions.d.ts} +4 -11
- package/lib/FileExtensions.d.ts.map +1 -0
- package/lib/{Html/File.js → FileExtensions.js} +3 -12
- package/lib/{Http → Net/Http}/HttpClient.d.ts +17 -2
- package/lib/Net/Http/HttpClient.d.ts.map +1 -0
- package/lib/{Http → Net/Http}/HttpClient.js +17 -15
- package/lib/Net/Http/HttpMethod.d.ts +46 -0
- package/lib/Net/Http/HttpMethod.d.ts.map +1 -0
- package/lib/Net/Http/HttpMethod.js +41 -0
- package/lib/Net/Http/HttpRequestError.d.ts +33 -0
- package/lib/Net/Http/HttpRequestError.d.ts.map +1 -0
- package/lib/{Http/HttpError.js → Net/Http/HttpRequestError.js} +16 -16
- package/lib/Net/Http/StatusCode.d.ts +122 -0
- package/lib/Net/Http/StatusCode.d.ts.map +1 -0
- package/lib/Net/Http/StatusCode.js +117 -0
- package/lib/Net/Mime/DispositionType.d.ts +18 -0
- package/lib/Net/Mime/DispositionType.d.ts.map +1 -0
- package/lib/Net/Mime/DispositionType.js +13 -0
- package/lib/Net/Mime/MediaType.d.ts +151 -0
- package/lib/Net/Mime/MediaType.d.ts.map +1 -0
- package/lib/Net/Mime/MediaType.js +150 -0
- package/lib/{Number.d.ts → NumberExtensions.d.ts} +1 -1
- package/lib/NumberExtensions.d.ts.map +1 -0
- package/lib/{String.d.ts → StringExtensions.d.ts} +1 -1
- package/lib/StringExtensions.d.ts.map +1 -0
- package/lib/{Html → UI}/AppTheme.d.ts +3 -3
- package/lib/UI/AppTheme.d.ts.map +1 -0
- package/lib/{Html → UI}/AppTheme.js +3 -3
- package/lib/UI/{Component.d.ts → Components/ComponentBase.d.ts} +5 -5
- package/lib/UI/Components/ComponentBase.d.ts.map +1 -0
- package/lib/UI/Components/ComponentBase.js +29 -0
- package/lib/UI/{LoadingIndicator.d.ts → Components/LoadingIndicator.d.ts} +1 -2
- package/lib/UI/Components/LoadingIndicator.d.ts.map +1 -0
- package/lib/UI/Components/MenuActivator.d.ts.map +1 -0
- package/lib/UI/Components/OfflineIndicator.d.ts.map +1 -0
- package/lib/UI/Components/ThemeDropdown.d.ts +67 -0
- package/lib/UI/Components/ThemeDropdown.d.ts.map +1 -0
- package/lib/UI/Components/ThemeDropdown.js +140 -0
- package/lib/UI/Context.d.ts.map +1 -0
- package/lib/UI/MenuAlignment.d.ts +18 -0
- package/lib/UI/MenuAlignment.d.ts.map +1 -0
- package/lib/UI/MenuAlignment.js +13 -0
- package/lib/{Html → UI}/ViewportScroller.d.ts +1 -1
- package/lib/UI/ViewportScroller.d.ts.map +1 -0
- package/lib/{Html → UI}/ViewportScroller.js +6 -6
- package/package.json +5 -7
- package/src/Client/Data/Pagination.ts +59 -13
- package/src/Client/Data/Sort.ts +40 -35
- package/src/Client/Data/tsconfig.json +1 -1
- package/src/Client/{Html/File.ts → FileExtensions.ts} +3 -13
- package/src/Client/{Http → Net/Http}/HttpClient.ts +32 -14
- package/src/Client/Net/Http/HttpMethod.ts +55 -0
- package/src/Client/{Http/HttpError.ts → Net/Http/HttpRequestError.ts} +17 -17
- package/src/Client/Net/Http/StatusCode.ts +150 -0
- package/src/Client/Net/Mime/DispositionType.ts +20 -0
- package/src/Client/Net/Mime/MediaType.ts +185 -0
- package/src/Client/{Abstractions → Net}/tsconfig.json +3 -3
- package/src/Client/{Html → UI}/AppTheme.ts +3 -3
- package/src/Client/UI/Components/ComponentBase.ts +34 -0
- package/src/Client/UI/{LoadingIndicator.ts → Components/LoadingIndicator.ts} +1 -3
- package/src/Client/UI/Components/ThemeDropdown.ts +163 -0
- package/src/Client/UI/MenuAlignment.ts +20 -0
- package/src/Client/{Html → UI}/ViewportScroller.ts +6 -6
- package/src/Client/UI/tsconfig.json +2 -3
- package/src/Client/tsconfig.json +1 -4
- package/lib/Abstractions/ILoadingIndicator.d.ts +0 -17
- package/lib/Abstractions/ILoadingIndicator.d.ts.map +0 -1
- package/lib/Abstractions/ILoadingIndicator.js +0 -1
- package/lib/Date.d.ts.map +0 -1
- package/lib/DependencyInjection/Container.d.ts +0 -43
- package/lib/DependencyInjection/Container.d.ts.map +0 -1
- package/lib/DependencyInjection/Container.js +0 -65
- package/lib/Html/AppTheme.d.ts.map +0 -1
- package/lib/Html/Context.d.ts.map +0 -1
- package/lib/Html/File.d.ts.map +0 -1
- package/lib/Html/ViewportScroller.d.ts.map +0 -1
- package/lib/Http/HttpClient.d.ts.map +0 -1
- package/lib/Http/HttpError.d.ts +0 -33
- package/lib/Http/HttpError.d.ts.map +0 -1
- package/lib/Http/StatusCodes.d.ts +0 -114
- package/lib/Http/StatusCodes.d.ts.map +0 -1
- package/lib/Http/StatusCodes.js +0 -109
- package/lib/Number.d.ts.map +0 -1
- package/lib/String.d.ts.map +0 -1
- package/lib/UI/Component.d.ts.map +0 -1
- package/lib/UI/Component.js +0 -29
- package/lib/UI/LoadingIndicator.d.ts.map +0 -1
- package/lib/UI/MenuActivator.d.ts.map +0 -1
- package/lib/UI/OfflineIndicator.d.ts.map +0 -1
- package/lib/UI/ThemeDropdown.d.ts +0 -40
- package/lib/UI/ThemeDropdown.d.ts.map +0 -1
- package/lib/UI/ThemeDropdown.js +0 -80
- package/src/Client/Abstractions/ILoadingIndicator.ts +0 -16
- package/src/Client/DependencyInjection/Container.ts +0 -75
- package/src/Client/DependencyInjection/tsconfig.json +0 -13
- package/src/Client/Html/tsconfig.json +0 -16
- package/src/Client/Http/StatusCodes.ts +0 -140
- package/src/Client/Http/tsconfig.json +0 -16
- package/src/Client/UI/Component.ts +0 -34
- package/src/Client/UI/ThemeDropdown.ts +0 -104
- /package/lib/{Date.js → DateExtensions.js} +0 -0
- /package/lib/{Number.js → NumberExtensions.js} +0 -0
- /package/lib/{String.js → StringExtensions.js} +0 -0
- /package/lib/UI/{LoadingIndicator.js → Components/LoadingIndicator.js} +0 -0
- /package/lib/UI/{MenuActivator.d.ts → Components/MenuActivator.d.ts} +0 -0
- /package/lib/UI/{MenuActivator.js → Components/MenuActivator.js} +0 -0
- /package/lib/UI/{OfflineIndicator.d.ts → Components/OfflineIndicator.d.ts} +0 -0
- /package/lib/UI/{OfflineIndicator.js → Components/OfflineIndicator.js} +0 -0
- /package/lib/{Html → UI}/Context.d.ts +0 -0
- /package/lib/{Html → UI}/Context.js +0 -0
- /package/src/Client/{Date.ts → DateExtensions.ts} +0 -0
- /package/src/Client/{Number.ts → NumberExtensions.ts} +0 -0
- /package/src/Client/{String.ts → StringExtensions.ts} +0 -0
- /package/src/Client/UI/{MenuActivator.ts → Components/MenuActivator.ts} +0 -0
- /package/src/Client/UI/{OfflineIndicator.ts → Components/OfflineIndicator.ts} +0 -0
- /package/src/Client/{Html → UI}/Context.ts +0 -0
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).
|
package/lib/Data/Pagination.d.ts
CHANGED
|
@@ -2,23 +2,17 @@
|
|
|
2
2
|
* Represents information relevant to the pagination of data items.
|
|
3
3
|
*/
|
|
4
4
|
export declare class Pagination {
|
|
5
|
-
|
|
6
|
-
* The one-based current page number.
|
|
7
|
-
*/
|
|
8
|
-
currentPageIndex: number;
|
|
9
|
-
/**
|
|
10
|
-
* The number of items per page.
|
|
11
|
-
*/
|
|
12
|
-
itemsPerPage: number;
|
|
13
|
-
/**
|
|
14
|
-
* The total number of items.
|
|
15
|
-
*/
|
|
16
|
-
totalItemCount: number;
|
|
5
|
+
#private;
|
|
17
6
|
/**
|
|
18
7
|
* Creates a new pagination.
|
|
19
8
|
* @param options An object providing values to initialize this instance.
|
|
20
9
|
*/
|
|
21
10
|
constructor(options?: PaginationOptions);
|
|
11
|
+
/**
|
|
12
|
+
* The one-based current page number.
|
|
13
|
+
*/
|
|
14
|
+
get currentPageIndex(): number;
|
|
15
|
+
set currentPageIndex(value: number);
|
|
22
16
|
/**
|
|
23
17
|
* Value indicating whether a next page exists.
|
|
24
18
|
*/
|
|
@@ -27,6 +21,11 @@ export declare class Pagination {
|
|
|
27
21
|
* Value indicating whether a previous page exists.
|
|
28
22
|
*/
|
|
29
23
|
get hasPreviousPage(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The number of items per page.
|
|
26
|
+
*/
|
|
27
|
+
get itemsPerPage(): number;
|
|
28
|
+
set itemsPerPage(value: number);
|
|
30
29
|
/**
|
|
31
30
|
* The one-based last page number.
|
|
32
31
|
*/
|
|
@@ -43,6 +42,11 @@ export declare class Pagination {
|
|
|
43
42
|
* The search parameters corresponding to this object.
|
|
44
43
|
*/
|
|
45
44
|
get searchParams(): URLSearchParams;
|
|
45
|
+
/**
|
|
46
|
+
* The total number of items.
|
|
47
|
+
*/
|
|
48
|
+
get totalItemCount(): number;
|
|
49
|
+
set totalItemCount(value: number);
|
|
46
50
|
/**
|
|
47
51
|
* Creates a new pagination from the HTTP headers of the specified response.
|
|
48
52
|
* @param response A server response.
|
|
@@ -53,5 +57,18 @@ export declare class Pagination {
|
|
|
53
57
|
/**
|
|
54
58
|
* Defines the options of a {@link Pagination} instance.
|
|
55
59
|
*/
|
|
56
|
-
export type PaginationOptions = Partial<
|
|
60
|
+
export type PaginationOptions = Partial<{
|
|
61
|
+
/**
|
|
62
|
+
* The one-based current page number.
|
|
63
|
+
*/
|
|
64
|
+
currentPageIndex: number;
|
|
65
|
+
/**
|
|
66
|
+
* The number of items per page.
|
|
67
|
+
*/
|
|
68
|
+
itemsPerPage: number;
|
|
69
|
+
/**
|
|
70
|
+
* The total number of items.
|
|
71
|
+
*/
|
|
72
|
+
totalItemCount: number;
|
|
73
|
+
}>;
|
|
57
74
|
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Client/Data/Pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Client/Data/Pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,UAAU;;IAiBtB;;;OAGG;gBACS,OAAO,GAAE,iBAAsB;IAM3C;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IACD,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAEjC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,eAAe,CAElC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,MAAM,CAE3B;IACD,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,EAE/B;IAED;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU;CAOnD;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAEvC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC,CAAC"}
|
package/lib/Data/Pagination.js
CHANGED
|
@@ -5,59 +5,86 @@ export class Pagination {
|
|
|
5
5
|
/**
|
|
6
6
|
* The one-based current page number.
|
|
7
7
|
*/
|
|
8
|
-
currentPageIndex;
|
|
8
|
+
#currentPageIndex;
|
|
9
9
|
/**
|
|
10
10
|
* The number of items per page.
|
|
11
11
|
*/
|
|
12
|
-
itemsPerPage;
|
|
12
|
+
#itemsPerPage;
|
|
13
13
|
/**
|
|
14
14
|
* The total number of items.
|
|
15
15
|
*/
|
|
16
|
-
totalItemCount;
|
|
16
|
+
#totalItemCount;
|
|
17
17
|
/**
|
|
18
18
|
* Creates a new pagination.
|
|
19
19
|
* @param options An object providing values to initialize this instance.
|
|
20
20
|
*/
|
|
21
21
|
constructor(options = {}) {
|
|
22
|
-
this.currentPageIndex =
|
|
23
|
-
this.itemsPerPage =
|
|
24
|
-
this.totalItemCount =
|
|
22
|
+
this.currentPageIndex = options.currentPageIndex ?? 1;
|
|
23
|
+
this.itemsPerPage = options.itemsPerPage ?? 25;
|
|
24
|
+
this.totalItemCount = options.totalItemCount ?? 0;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The one-based current page number.
|
|
28
|
+
*/
|
|
29
|
+
get currentPageIndex() {
|
|
30
|
+
return this.#currentPageIndex;
|
|
31
|
+
}
|
|
32
|
+
set currentPageIndex(value) {
|
|
33
|
+
this.#currentPageIndex = Math.max(1, value);
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
27
36
|
* Value indicating whether a next page exists.
|
|
28
37
|
*/
|
|
29
38
|
get hasNextPage() {
|
|
30
|
-
return this
|
|
39
|
+
return this.#currentPageIndex < this.lastPageIndex;
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
42
|
* Value indicating whether a previous page exists.
|
|
34
43
|
*/
|
|
35
44
|
get hasPreviousPage() {
|
|
36
|
-
return this
|
|
45
|
+
return this.#currentPageIndex > 1;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The number of items per page.
|
|
49
|
+
*/
|
|
50
|
+
get itemsPerPage() {
|
|
51
|
+
return this.#itemsPerPage;
|
|
52
|
+
}
|
|
53
|
+
set itemsPerPage(value) {
|
|
54
|
+
this.#itemsPerPage = Math.max(1, Math.min(1000, value));
|
|
37
55
|
}
|
|
38
56
|
/**
|
|
39
57
|
* The one-based last page number.
|
|
40
58
|
*/
|
|
41
59
|
get lastPageIndex() {
|
|
42
|
-
return Math.ceil(this
|
|
60
|
+
return this.#totalItemCount > 0 ? Math.ceil(this.#totalItemCount / this.#itemsPerPage) : 1;
|
|
43
61
|
}
|
|
44
62
|
/**
|
|
45
63
|
* The data limit.
|
|
46
64
|
*/
|
|
47
65
|
get limit() {
|
|
48
|
-
return this
|
|
66
|
+
return this.#itemsPerPage;
|
|
49
67
|
}
|
|
50
68
|
/**
|
|
51
69
|
* The data offset.
|
|
52
70
|
*/
|
|
53
71
|
get offset() {
|
|
54
|
-
return (this
|
|
72
|
+
return (this.#currentPageIndex - 1) * this.#itemsPerPage;
|
|
55
73
|
}
|
|
56
74
|
/**
|
|
57
75
|
* The search parameters corresponding to this object.
|
|
58
76
|
*/
|
|
59
77
|
get searchParams() {
|
|
60
|
-
return new URLSearchParams({ page: this
|
|
78
|
+
return new URLSearchParams({ page: this.#currentPageIndex.toString(), perPage: this.#itemsPerPage.toString() });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The total number of items.
|
|
82
|
+
*/
|
|
83
|
+
get totalItemCount() {
|
|
84
|
+
return this.#totalItemCount;
|
|
85
|
+
}
|
|
86
|
+
set totalItemCount(value) {
|
|
87
|
+
this.#totalItemCount = Math.max(0, value);
|
|
61
88
|
}
|
|
62
89
|
/**
|
|
63
90
|
* Creates a new pagination from the HTTP headers of the specified response.
|
package/lib/Data/Sort.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Specifies the order of a
|
|
2
|
+
* Specifies the order of a sort property.
|
|
3
3
|
*/
|
|
4
4
|
export declare const SortOrder: Readonly<{
|
|
5
5
|
/**
|
|
6
6
|
* The sort is ascending.
|
|
7
7
|
*/
|
|
8
|
-
Ascending: "
|
|
8
|
+
Ascending: "Ascending";
|
|
9
9
|
/**
|
|
10
10
|
* The sort is descending.
|
|
11
11
|
*/
|
|
12
|
-
Descending: "
|
|
12
|
+
Descending: "Descending";
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
|
-
* Specifies the order of a
|
|
15
|
+
* Specifies the order of a sort property.
|
|
16
16
|
*/
|
|
17
17
|
export type SortOrder = typeof SortOrder[keyof typeof SortOrder];
|
|
18
18
|
/**
|
|
@@ -30,7 +30,11 @@ export declare class Sort implements Iterable<SortProperty> {
|
|
|
30
30
|
*/
|
|
31
31
|
constructor(properties?: SortProperty[]);
|
|
32
32
|
/**
|
|
33
|
-
* The
|
|
33
|
+
* The list of sort properties.
|
|
34
|
+
*/
|
|
35
|
+
get keys(): string[];
|
|
36
|
+
/**
|
|
37
|
+
* The number of properties in this sort.
|
|
34
38
|
*/
|
|
35
39
|
get length(): number;
|
|
36
40
|
/**
|
|
@@ -48,22 +52,26 @@ export declare class Sort implements Iterable<SortProperty> {
|
|
|
48
52
|
static parse(value: string): Sort;
|
|
49
53
|
/**
|
|
50
54
|
* Returns a new iterator that allows iterating the entries of this sort.
|
|
51
|
-
* @returns An iterator over the
|
|
55
|
+
* @returns An iterator over the sort properties.
|
|
52
56
|
*/
|
|
53
|
-
[Symbol.iterator]():
|
|
57
|
+
[Symbol.iterator](): Iterator<SortProperty>;
|
|
54
58
|
/**
|
|
55
59
|
* Appends the specified property to this sort.
|
|
56
60
|
* @param property The property name.
|
|
57
61
|
* @param order The sort order.
|
|
58
|
-
* @
|
|
62
|
+
* @throws `Error` when an item with the property name already exists.
|
|
59
63
|
*/
|
|
60
|
-
|
|
64
|
+
add(property: string, order: SortOrder): void;
|
|
61
65
|
/**
|
|
62
|
-
* Gets the
|
|
66
|
+
* Gets the sort property at the specified index.
|
|
63
67
|
* @param index The position in this sort.
|
|
64
|
-
* @returns The
|
|
68
|
+
* @returns The sort property at the specified index, or `null` if it doesn't exist.
|
|
65
69
|
*/
|
|
66
70
|
at(index: number): SortProperty | null;
|
|
71
|
+
/**
|
|
72
|
+
* Removes all properties from this sort.
|
|
73
|
+
*/
|
|
74
|
+
clear(): void;
|
|
67
75
|
/**
|
|
68
76
|
* Compares the specified objects, according to the current sort properties.
|
|
69
77
|
* @param x The first object to compare.
|
|
@@ -71,6 +79,12 @@ export declare class Sort implements Iterable<SortProperty> {
|
|
|
71
79
|
* @returns A value indicating the relationship between the two objects.
|
|
72
80
|
*/
|
|
73
81
|
compare(x: object, y: object): number;
|
|
82
|
+
/**
|
|
83
|
+
* Returns a value indicating whether the specified property exists in this sort.
|
|
84
|
+
* @param property The property name.
|
|
85
|
+
* @returns `true` if the specified property exists in this sort, otherwise `false`.
|
|
86
|
+
*/
|
|
87
|
+
containsKey(property: string): boolean;
|
|
74
88
|
/**
|
|
75
89
|
* Removes the specified property from this sort.
|
|
76
90
|
* @param property The property name.
|
|
@@ -88,12 +102,6 @@ export declare class Sort implements Iterable<SortProperty> {
|
|
|
88
102
|
* @returns The icon corresponding to the specified property.
|
|
89
103
|
*/
|
|
90
104
|
getIcon(property: string): string;
|
|
91
|
-
/**
|
|
92
|
-
* Returns a value indicating whether the specified property exists in this sort.
|
|
93
|
-
* @param property The property name.
|
|
94
|
-
* @returns `true` if the specified property exists in this sort, otherwise `false`.
|
|
95
|
-
*/
|
|
96
|
-
has(property: string): boolean;
|
|
97
105
|
/**
|
|
98
106
|
* Gets the index of the specified property in the underlying list.
|
|
99
107
|
* @param property The property name.
|
|
@@ -129,12 +137,6 @@ export declare class Sort implements Iterable<SortProperty> {
|
|
|
129
137
|
* @returns The JSON representation of this object.
|
|
130
138
|
*/
|
|
131
139
|
toJSON(): string;
|
|
132
|
-
/**
|
|
133
|
-
* Converts this sort to an SQL clause.
|
|
134
|
-
* @param escape A function used to escape the SQL identifiers.
|
|
135
|
-
* @returns The SQL clause corresponding to this object.
|
|
136
|
-
*/
|
|
137
|
-
toSql(escape?: (identifier: string) => string): string;
|
|
138
140
|
/**
|
|
139
141
|
* Returns a string representation of this object.
|
|
140
142
|
* @returns The string representation of this object.
|
package/lib/Data/Sort.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sort.d.ts","sourceRoot":"","sources":["../../src/Client/Data/Sort.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;IAErB;;OAEG;;IAGH;;OAEG;;EAEF,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE/C;;GAEG;AACH,qBAAa,IAAK,YAAW,QAAQ,CAAC,YAAY,CAAC;;IAOlD;;;OAGG;gBACS,UAAU,GAAE,YAAY,EAAO;IAI3C;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,SAA+B,GAAG,IAAI;IAIzE;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOjC;;;OAGG;
|
|
1
|
+
{"version":3,"file":"Sort.d.ts","sourceRoot":"","sources":["../../src/Client/Data/Sort.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;IAErB;;OAEG;;IAGH;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;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAKjC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAMjD;;;;OAIG;IACH,SAAS,CAAC,UAAU,GAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAC,CAAM,GAAG,OAAO;IAW9F;;;;;OAKG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAU7C;;;OAGG;IACH,MAAM,IAAI,MAAM;IAIhB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAGlB"}
|
package/lib/Data/Sort.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Specifies the order of a
|
|
2
|
+
* Specifies the order of a sort property.
|
|
3
3
|
*/
|
|
4
4
|
export const SortOrder = Object.freeze({
|
|
5
5
|
/**
|
|
6
6
|
* The sort is ascending.
|
|
7
7
|
*/
|
|
8
|
-
Ascending: "
|
|
8
|
+
Ascending: "Ascending",
|
|
9
9
|
/**
|
|
10
10
|
* The sort is descending.
|
|
11
11
|
*/
|
|
12
|
-
Descending: "
|
|
12
|
+
Descending: "Descending"
|
|
13
13
|
});
|
|
14
14
|
/**
|
|
15
15
|
* Represents information relevant to the sorting of data items.
|
|
16
16
|
*/
|
|
17
17
|
export class Sort {
|
|
18
18
|
/**
|
|
19
|
-
* The list of
|
|
19
|
+
* The list of sort properties.
|
|
20
20
|
*/
|
|
21
21
|
#properties;
|
|
22
22
|
/**
|
|
@@ -27,7 +27,13 @@ export class Sort {
|
|
|
27
27
|
this.#properties = properties;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
30
|
+
* The list of sort properties.
|
|
31
|
+
*/
|
|
32
|
+
get keys() {
|
|
33
|
+
return this.#properties.map(item => item[0]);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The number of properties in this sort.
|
|
31
37
|
*/
|
|
32
38
|
get length() {
|
|
33
39
|
return this.#properties.length;
|
|
@@ -54,31 +60,36 @@ export class Sort {
|
|
|
54
60
|
}
|
|
55
61
|
/**
|
|
56
62
|
* Returns a new iterator that allows iterating the entries of this sort.
|
|
57
|
-
* @returns An iterator over the
|
|
63
|
+
* @returns An iterator over the sort properties.
|
|
58
64
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
yield entry;
|
|
65
|
+
[Symbol.iterator]() {
|
|
66
|
+
return this.#properties[Symbol.iterator]();
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
69
|
* Appends the specified property to this sort.
|
|
65
70
|
* @param property The property name.
|
|
66
71
|
* @param order The sort order.
|
|
67
|
-
* @
|
|
72
|
+
* @throws `Error` when an item with the property name already exists.
|
|
68
73
|
*/
|
|
69
|
-
|
|
70
|
-
this.
|
|
74
|
+
add(property, order) {
|
|
75
|
+
if (this.containsKey(property))
|
|
76
|
+
throw new Error("An item with the property name has already been added.");
|
|
71
77
|
this.#properties.push([property, order]);
|
|
72
|
-
return this;
|
|
73
78
|
}
|
|
74
79
|
/**
|
|
75
|
-
* Gets the
|
|
80
|
+
* Gets the sort property at the specified index.
|
|
76
81
|
* @param index The position in this sort.
|
|
77
|
-
* @returns The
|
|
82
|
+
* @returns The sort property at the specified index, or `null` if it doesn't exist.
|
|
78
83
|
*/
|
|
79
84
|
at(index) {
|
|
80
85
|
return this.#properties.at(index) ?? null;
|
|
81
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Removes all properties from this sort.
|
|
89
|
+
*/
|
|
90
|
+
clear() {
|
|
91
|
+
this.#properties = [];
|
|
92
|
+
}
|
|
82
93
|
/**
|
|
83
94
|
* Compares the specified objects, according to the current sort properties.
|
|
84
95
|
* @param x The first object to compare.
|
|
@@ -95,6 +106,14 @@ export class Sort {
|
|
|
95
106
|
}
|
|
96
107
|
return 0;
|
|
97
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns a value indicating whether the specified property exists in this sort.
|
|
111
|
+
* @param property The property name.
|
|
112
|
+
* @returns `true` if the specified property exists in this sort, otherwise `false`.
|
|
113
|
+
*/
|
|
114
|
+
containsKey(property) {
|
|
115
|
+
return this.#properties.some(([key]) => key == property);
|
|
116
|
+
}
|
|
98
117
|
/**
|
|
99
118
|
* Removes the specified property from this sort.
|
|
100
119
|
* @param property The property name.
|
|
@@ -125,14 +144,6 @@ export class Sort {
|
|
|
125
144
|
default: return "swap_vert";
|
|
126
145
|
}
|
|
127
146
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Returns a value indicating whether the specified property exists in this sort.
|
|
130
|
-
* @param property The property name.
|
|
131
|
-
* @returns `true` if the specified property exists in this sort, otherwise `false`.
|
|
132
|
-
*/
|
|
133
|
-
has(property) {
|
|
134
|
-
return this.#properties.some(([key]) => key == property);
|
|
135
|
-
}
|
|
136
147
|
/**
|
|
137
148
|
* Gets the index of the specified property in the underlying list.
|
|
138
149
|
* @param property The property name.
|
|
@@ -182,7 +193,8 @@ export class Sort {
|
|
|
182
193
|
this.#properties[index] = [key, order];
|
|
183
194
|
return this;
|
|
184
195
|
}
|
|
185
|
-
|
|
196
|
+
this.add(property, order);
|
|
197
|
+
return this;
|
|
186
198
|
}
|
|
187
199
|
/**
|
|
188
200
|
* Returns a JSON representation of this object.
|
|
@@ -191,19 +203,11 @@ export class Sort {
|
|
|
191
203
|
toJSON() {
|
|
192
204
|
return this.toString();
|
|
193
205
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Converts this sort to an SQL clause.
|
|
196
|
-
* @param escape A function used to escape the SQL identifiers.
|
|
197
|
-
* @returns The SQL clause corresponding to this object.
|
|
198
|
-
*/
|
|
199
|
-
toSql(escape = id => id) {
|
|
200
|
-
return this.#properties.map(([property, order]) => `${escape(property)} ${order}`).join(", ");
|
|
201
|
-
}
|
|
202
206
|
/**
|
|
203
207
|
* Returns a string representation of this object.
|
|
204
208
|
* @returns The string representation of this object.
|
|
205
209
|
*/
|
|
206
210
|
toString() {
|
|
207
|
-
return this.#properties.map(([property, order]) => `${order == SortOrder.Descending ? "-" : ""}${property}`).join();
|
|
211
|
+
return this.#properties.map(([property, order]) => `${order == SortOrder.Descending ? "-" : ""}${property}`).join(",");
|
|
208
212
|
}
|
|
209
213
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateExtensions.d.ts","sourceRoot":"","sources":["../src/Client/DateExtensions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,SAA2B,GAAG,IAAI,CAY/D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAA2B,GAAG,IAAI,EAAE,CAoBnE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAIhD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAG9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAGhD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAM,GAAG,MAAM,CAM7H"}
|
|
@@ -2,31 +2,24 @@
|
|
|
2
2
|
* Downloads the specified file.
|
|
3
3
|
* @param file The file to be downloaded.
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
6
|
-
/**
|
|
7
|
-
* Downloads the specified text content.
|
|
8
|
-
* @param text The text content.
|
|
9
|
-
* @param fileName The file name.
|
|
10
|
-
* @param options The optional attributes for the file.
|
|
11
|
-
*/
|
|
12
|
-
export declare function downloadString(text: string, fileName: string, options?: FilePropertyBag): void;
|
|
5
|
+
export declare function download(file: File): void;
|
|
13
6
|
/**
|
|
14
7
|
* Opens the specified file.
|
|
15
8
|
* @param file The file to be opened.
|
|
16
9
|
* @param options Value indicating whether to open the file in a new tab.
|
|
17
10
|
*/
|
|
18
|
-
export declare function
|
|
11
|
+
export declare function open(file: File, options?: {
|
|
19
12
|
newTab?: boolean;
|
|
20
13
|
}): void;
|
|
21
14
|
/**
|
|
22
15
|
* Prints the specified file.
|
|
23
16
|
* @param file The file to be printed.
|
|
24
17
|
*/
|
|
25
|
-
export declare function
|
|
18
|
+
export declare function print(file: File): void;
|
|
26
19
|
/**
|
|
27
20
|
* Converts the specified file to a data URL.
|
|
28
21
|
* @param file The file to convert.
|
|
29
22
|
* @returns The data URL corresponding to the given file.
|
|
30
23
|
*/
|
|
31
24
|
export declare function toDataUrl(file: File): Promise<URL>;
|
|
32
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=FileExtensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileExtensions.d.ts","sourceRoot":"","sources":["../src/Client/FileExtensions.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAUzC;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAM,GAAG,IAAI,CAkBvE;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAatC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAOlD"}
|
|
@@ -3,7 +3,7 @@ import { Duration } from "#Base/Duration.js";
|
|
|
3
3
|
* Downloads the specified file.
|
|
4
4
|
* @param file The file to be downloaded.
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function download(file) {
|
|
7
7
|
const url = URL.createObjectURL(file);
|
|
8
8
|
const anchor = document.createElement("a");
|
|
9
9
|
anchor.download = file.name;
|
|
@@ -13,21 +13,12 @@ export function downloadFile(file) {
|
|
|
13
13
|
document.body.removeChild(anchor);
|
|
14
14
|
URL.revokeObjectURL(url);
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Downloads the specified text content.
|
|
18
|
-
* @param text The text content.
|
|
19
|
-
* @param fileName The file name.
|
|
20
|
-
* @param options The optional attributes for the file.
|
|
21
|
-
*/
|
|
22
|
-
export function downloadString(text, fileName, options = {}) {
|
|
23
|
-
downloadFile(new File([text], fileName, options));
|
|
24
|
-
}
|
|
25
16
|
/**
|
|
26
17
|
* Opens the specified file.
|
|
27
18
|
* @param file The file to be opened.
|
|
28
19
|
* @param options Value indicating whether to open the file in a new tab.
|
|
29
20
|
*/
|
|
30
|
-
export function
|
|
21
|
+
export function open(file, options = {}) {
|
|
31
22
|
const url = URL.createObjectURL(file);
|
|
32
23
|
if (!options.newTab) {
|
|
33
24
|
location.assign(url);
|
|
@@ -49,7 +40,7 @@ export function openFile(file, options = {}) {
|
|
|
49
40
|
* Prints the specified file.
|
|
50
41
|
* @param file The file to be printed.
|
|
51
42
|
*/
|
|
52
|
-
export function
|
|
43
|
+
export function print(file) {
|
|
53
44
|
const url = URL.createObjectURL(file);
|
|
54
45
|
const frame = document.createElement("iframe");
|
|
55
46
|
frame.addEventListener("load", () => frame.contentWindow?.print());
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ILoadingIndicator } from "#Abstractions/ILoadingIndicator.js";
|
|
2
1
|
/**
|
|
3
2
|
* Performs HTTP requests.
|
|
4
3
|
*/
|
|
@@ -7,7 +6,7 @@ export declare class HttpClient {
|
|
|
7
6
|
/**
|
|
8
7
|
* The base URL of the remote service.
|
|
9
8
|
*/
|
|
10
|
-
readonly
|
|
9
|
+
readonly baseAddress: URL;
|
|
11
10
|
/**
|
|
12
11
|
* Creates a new HTTP client.
|
|
13
12
|
* @param options An object providing values to initialize this instance.
|
|
@@ -65,4 +64,20 @@ export type HttpClientOptions = Partial<{
|
|
|
65
64
|
*/
|
|
66
65
|
loadingIndicator: () => ILoadingIndicator | null;
|
|
67
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* A component that shows up when an HTTP request starts, and hides when all concurrent HTTP requests are completed.
|
|
69
|
+
*/
|
|
70
|
+
export interface ILoadingIndicator {
|
|
71
|
+
/**
|
|
72
|
+
* Starts the loading indicator.
|
|
73
|
+
*/
|
|
74
|
+
start: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Stops the loading indicator.
|
|
77
|
+
* @param options Value indicating whether to force the loading indicator to stop.
|
|
78
|
+
*/
|
|
79
|
+
stop: (options?: {
|
|
80
|
+
force?: boolean;
|
|
81
|
+
}) => void;
|
|
82
|
+
}
|
|
68
83
|
//# sourceMappingURL=HttpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../../src/Client/Net/Http/HttpClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,UAAU;;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,E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