@cedx/base 0.6.0 → 0.8.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} +4 -13
- package/lib/Hosting/Environment.d.ts +22 -0
- package/lib/Hosting/Environment.d.ts.map +1 -0
- package/lib/Hosting/Environment.js +17 -0
- package/lib/Hosting/HostEnvironment.d.ts +61 -0
- package/lib/Hosting/HostEnvironment.d.ts.map +1 -0
- package/lib/Hosting/HostEnvironment.js +56 -0
- 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/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/FormExtensions.d.ts +33 -0
- package/lib/UI/FormExtensions.d.ts.map +1 -0
- package/lib/UI/FormExtensions.js +50 -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 -10
- 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} +4 -14
- package/src/Client/Hosting/Environment.ts +25 -0
- package/src/Client/Hosting/HostEnvironment.ts +86 -0
- package/src/Client/{Abstractions → Hosting}/tsconfig.json +3 -3
- package/src/Client/Net/Http/HttpMethod.ts +55 -0
- 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/{DependencyInjection → 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/FormExtensions.ts +55 -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 -6
- package/src/Client/tsconfig.json +2 -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 +0 -68
- package/lib/Http/HttpClient.d.ts.map +0 -1
- package/lib/Http/HttpClient.js +0 -102
- package/lib/Http/HttpError.d.ts +0 -33
- package/lib/Http/HttpError.d.ts.map +0 -1
- package/lib/Http/HttpError.js +0 -66
- 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/Html/tsconfig.json +0 -16
- package/src/Client/Http/HttpClient.ts +0 -127
- package/src/Client/Http/HttpError.ts +0 -75
- 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
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides common HTTP status codes.
|
|
3
|
-
*/
|
|
4
|
-
export const StatusCodes = Object.freeze({
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The `OK` status.
|
|
8
|
-
*/
|
|
9
|
-
OK: 200,
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The `Created` status.
|
|
13
|
-
*/
|
|
14
|
-
Created: 201,
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The `No Content` status.
|
|
18
|
-
*/
|
|
19
|
-
NoContent: 204,
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The `Moved Permanently` status.
|
|
23
|
-
*/
|
|
24
|
-
MovedPermanently: 301,
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The `Found` status.
|
|
28
|
-
*/
|
|
29
|
-
Found: 302,
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* The `Not Modified` status.
|
|
33
|
-
*/
|
|
34
|
-
NotModified: 304,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The `Bad Request` status.
|
|
38
|
-
*/
|
|
39
|
-
BadRequest: 400,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The `Unauthorized` status.
|
|
43
|
-
*/
|
|
44
|
-
Unauthorized: 401,
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The `Payment Required` status.
|
|
48
|
-
*/
|
|
49
|
-
PaymentRequired: 402,
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The `Forbidden` status.
|
|
53
|
-
*/
|
|
54
|
-
Forbidden: 403,
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* The `Not Found` status.
|
|
58
|
-
*/
|
|
59
|
-
NotFound: 404,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* The `Method Not Allowed` status.
|
|
63
|
-
*/
|
|
64
|
-
MethodNotAllowed: 405,
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The `Not Acceptable` status.
|
|
68
|
-
*/
|
|
69
|
-
NotAcceptable: 406,
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* The `Request Timeout` status.
|
|
73
|
-
*/
|
|
74
|
-
RequestTimeout: 408,
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The `Conflict` status.
|
|
78
|
-
*/
|
|
79
|
-
Conflict: 409,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The `Payload Too Large` status.
|
|
83
|
-
*/
|
|
84
|
-
PayloadTooLarge: 413,
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* The `Unsupported Media Type` status.
|
|
88
|
-
*/
|
|
89
|
-
UnsupportedMediaType: 415,
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* The `Page Expired` status.
|
|
93
|
-
*/
|
|
94
|
-
PageExpired: 419,
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* The `Unprocessable Content` status.
|
|
98
|
-
*/
|
|
99
|
-
UnprocessableContent: 422,
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The `Too Many Requests` status.
|
|
103
|
-
*/
|
|
104
|
-
TooManyRequests: 429,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The `Internal Server Error` status.
|
|
108
|
-
*/
|
|
109
|
-
InternalServerError: 500,
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The `Not Implemented` status.
|
|
113
|
-
*/
|
|
114
|
-
NotImplemented: 501,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* The `Bad Gateway` status.
|
|
118
|
-
*/
|
|
119
|
-
BadGateway: 502,
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* The `Service Unavailable` status.
|
|
123
|
-
*/
|
|
124
|
-
ServiceUnavailable: 503,
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* The `Gateway Timeout` status.
|
|
128
|
-
*/
|
|
129
|
-
GatewayTimeout: 504,
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* The `Bandwidth Limit Exceeded` status
|
|
133
|
-
*/
|
|
134
|
-
BandwidthLimitExceeded: 509
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Provides common HTTP status codes.
|
|
139
|
-
*/
|
|
140
|
-
export type StatusCodes = typeof StatusCodes[keyof typeof StatusCodes];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../tsconfig.json",
|
|
3
|
-
"include": ["*.ts"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"composite": true,
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"noEmit": false,
|
|
9
|
-
"outDir": "../../../lib/Http",
|
|
10
|
-
"rootDir": ".",
|
|
11
|
-
"tsBuildInfoFile": "../../../var/Http.tsbuildinfo"
|
|
12
|
-
},
|
|
13
|
-
"references": [
|
|
14
|
-
{"path": "../Abstractions/tsconfig.json"}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {LitElement, type CSSResultGroup} from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The optional base class for UI components. Alternatively, components may extend {@link LitElement} directly.
|
|
5
|
-
*/
|
|
6
|
-
export abstract class Component extends LitElement {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The component styles.
|
|
10
|
-
*/
|
|
11
|
-
static override styles: CSSResultGroup = [document.adoptedStyleSheets];
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Value indicating whether this component uses a shadow root.
|
|
15
|
-
*/
|
|
16
|
-
readonly #useShadowRoot: boolean;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Creates a new component.
|
|
20
|
-
* @param options Value indicating whether this component uses a shadow root.
|
|
21
|
-
*/
|
|
22
|
-
constructor(options: {shadowRoot?: boolean} = {}) {
|
|
23
|
-
super();
|
|
24
|
-
this.#useShadowRoot = options.shadowRoot ?? false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Returns the node into which this component should render.
|
|
29
|
-
* @returns The node into which this component should render.
|
|
30
|
-
*/
|
|
31
|
-
protected override createRenderRoot(): DocumentFragment|HTMLElement {
|
|
32
|
-
return this.#useShadowRoot ? super.createRenderRoot() : this;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import {AppTheme, getIcon} from "#Html/AppTheme.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A dropdown menu for switching the application theme.
|
|
5
|
-
*/
|
|
6
|
-
export class ThemeDropdown extends HTMLElement {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The media query used to check the application theme.
|
|
10
|
-
*/
|
|
11
|
-
readonly #mediaQuery = matchMedia("(prefers-color-scheme: dark)");
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The key of the storage entry providing the saved theme mode.
|
|
15
|
-
*/
|
|
16
|
-
readonly #storageKey = this.getAttribute("storageKey") ?? "AppTheme";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The current application theme.
|
|
20
|
-
*/
|
|
21
|
-
#theme: AppTheme;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new theme dropdown.
|
|
25
|
-
*/
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
const theme = localStorage.getItem(this.#storageKey) as AppTheme;
|
|
29
|
-
this.#theme = Object.values(AppTheme).includes(theme) ? theme : AppTheme.System;
|
|
30
|
-
for (const button of this.querySelectorAll("button")) button.addEventListener("click", this.#setTheme.bind(this));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Registers the component.
|
|
35
|
-
*/
|
|
36
|
-
static {
|
|
37
|
-
customElements.define("theme-dropdown", this);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The current application theme.
|
|
42
|
-
*/
|
|
43
|
-
get theme(): AppTheme {
|
|
44
|
-
return this.#theme;
|
|
45
|
-
}
|
|
46
|
-
set theme(value: AppTheme) {
|
|
47
|
-
localStorage.setItem(this.#storageKey, this.#theme = value);
|
|
48
|
-
this.#applyTheme();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Method invoked when this component is connected.
|
|
53
|
-
*/
|
|
54
|
-
connectedCallback(): void {
|
|
55
|
-
this.#mediaQuery.addEventListener("change", this);
|
|
56
|
-
this.#applyTheme();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Method invoked when this component is disconnected.
|
|
61
|
-
*/
|
|
62
|
-
disconnectedCallback(): void {
|
|
63
|
-
this.#mediaQuery.removeEventListener("change", this);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Handles the events.
|
|
68
|
-
*/
|
|
69
|
-
handleEvent(): void {
|
|
70
|
-
this.#applyTheme();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Applies the theme to the document.
|
|
75
|
-
*/
|
|
76
|
-
#applyTheme(): void {
|
|
77
|
-
const theme = this.#theme == AppTheme.System ? (this.#mediaQuery.matches ? AppTheme.Dark : AppTheme.Light) : this.#theme;
|
|
78
|
-
document.documentElement.dataset.bsTheme = theme.toLowerCase();
|
|
79
|
-
this.querySelector(".dropdown-toggle > .icon")!.textContent = getIcon(this.#theme);
|
|
80
|
-
this.querySelector(`button[data-theme="${this.#theme}"]`)!.appendChild(this.querySelector(".dropdown-item > .icon")!);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Changes the current theme.
|
|
85
|
-
* @param event The dispatched event.
|
|
86
|
-
*/
|
|
87
|
-
#setTheme(event: Event): void {
|
|
88
|
-
const button = (event.target as HTMLElement).closest("button")!;
|
|
89
|
-
this.theme = button.dataset.theme as AppTheme;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Declaration merging.
|
|
95
|
-
*/
|
|
96
|
-
declare global {
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The map of HTML tag names.
|
|
100
|
-
*/
|
|
101
|
-
interface HTMLElementTagNameMap {
|
|
102
|
-
"theme-dropdown": ThemeDropdown;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|