@vaadin/common-frontend 0.0.19 → 0.0.21
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/ConnectionIndicator.d.ts +21 -35
- package/ConnectionIndicator.d.ts.map +1 -1
- package/ConnectionIndicator.js +293 -268
- package/ConnectionIndicator.js.map +7 -1
- package/ConnectionState.d.ts +3 -7
- package/ConnectionState.d.ts.map +1 -1
- package/ConnectionState.js +100 -129
- package/ConnectionState.js.map +7 -1
- package/README.md +2 -2
- package/index.js +11 -12
- package/index.js.map +7 -1
- package/package.json +24 -20
package/ConnectionIndicator.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
2
|
/**
|
|
3
3
|
* The loading indicator states
|
|
4
4
|
*/
|
|
@@ -8,11 +8,18 @@ export declare const enum LoadingBarState {
|
|
|
8
8
|
SECOND = "second",
|
|
9
9
|
THIRD = "third"
|
|
10
10
|
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'vaadin-connection-indicator': ConnectionIndicator;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
11
16
|
/**
|
|
12
17
|
* Component showing loading and connection indicator. When added to DOM,
|
|
13
18
|
* listens for changes on `window.Vaadin.connectionState` ConnectionStateStore.
|
|
14
19
|
*/
|
|
15
20
|
export declare class ConnectionIndicator extends LitElement {
|
|
21
|
+
#private;
|
|
22
|
+
static get instance(): ConnectionIndicator;
|
|
16
23
|
/**
|
|
17
24
|
* Initialize global connection indicator instance at
|
|
18
25
|
* window.Vaadin.connectionIndicator and add instance to the document body.
|
|
@@ -21,66 +28,45 @@ export declare class ConnectionIndicator extends LitElement {
|
|
|
21
28
|
/**
|
|
22
29
|
* The delay before showing the loading indicator, in ms.
|
|
23
30
|
*/
|
|
24
|
-
firstDelay: number;
|
|
31
|
+
accessor firstDelay: number;
|
|
25
32
|
/**
|
|
26
33
|
* The delay before the loading indicator goes into "second" state, in ms.
|
|
27
34
|
*/
|
|
28
|
-
secondDelay: number;
|
|
35
|
+
accessor secondDelay: number;
|
|
29
36
|
/**
|
|
30
37
|
* The delay before the loading indicator goes into "third" state, in ms.
|
|
31
38
|
*/
|
|
32
|
-
thirdDelay: number;
|
|
39
|
+
accessor thirdDelay: number;
|
|
33
40
|
/**
|
|
34
41
|
* The duration for which the connection state change message is visible,
|
|
35
42
|
* in ms.
|
|
36
43
|
*/
|
|
37
|
-
expandedDuration: number;
|
|
44
|
+
accessor expandedDuration: number;
|
|
38
45
|
/**
|
|
39
46
|
* The message shown when the connection goes to connected state.
|
|
40
47
|
*/
|
|
41
|
-
onlineText: string;
|
|
48
|
+
accessor onlineText: string;
|
|
42
49
|
/**
|
|
43
50
|
* The message shown when the connection goes to lost state.
|
|
44
51
|
*/
|
|
45
|
-
offlineText: string;
|
|
52
|
+
accessor offlineText: string;
|
|
46
53
|
/**
|
|
47
54
|
* The message shown when the connection goes to reconnecting state.
|
|
48
55
|
*/
|
|
49
|
-
reconnectingText: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
private applyDefaultThemeState;
|
|
56
|
-
private firstTimeout;
|
|
57
|
-
private secondTimeout;
|
|
58
|
-
private thirdTimeout;
|
|
59
|
-
private expandedTimeout;
|
|
60
|
-
private connectionStateStore?;
|
|
61
|
-
private readonly connectionStateListener;
|
|
62
|
-
private lastMessageState;
|
|
56
|
+
accessor reconnectingText: string;
|
|
57
|
+
accessor offline: boolean;
|
|
58
|
+
accessor reconnecting: boolean;
|
|
59
|
+
accessor expanded: boolean;
|
|
60
|
+
accessor loading: boolean;
|
|
61
|
+
readonly connectionStateListener: () => void;
|
|
63
62
|
constructor();
|
|
64
63
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
65
64
|
connectedCallback(): void;
|
|
66
65
|
disconnectedCallback(): void;
|
|
66
|
+
protected updated(props: PropertyValues): void;
|
|
67
67
|
get applyDefaultTheme(): boolean;
|
|
68
68
|
set applyDefaultTheme(applyDefaultTheme: boolean);
|
|
69
69
|
protected createRenderRoot(): this;
|
|
70
|
-
/**
|
|
71
|
-
* Update state flags.
|
|
72
|
-
*
|
|
73
|
-
* @returns true if the connection message changes, and therefore a new
|
|
74
|
-
* message should be shown
|
|
75
|
-
*/
|
|
76
|
-
private updateConnectionState;
|
|
77
|
-
private updateLoading;
|
|
78
|
-
private renderMessage;
|
|
79
|
-
private updateTheme;
|
|
80
|
-
private getDefaultStyle;
|
|
81
|
-
private getLoadingBarStyle;
|
|
82
|
-
private timeoutFor;
|
|
83
|
-
static get instance(): ConnectionIndicator;
|
|
84
70
|
}
|
|
85
71
|
/**
|
|
86
72
|
* The global connection indicator object. Its appearance and behavior can be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionIndicator.d.ts","sourceRoot":"","sources":["src/ConnectionIndicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectionIndicator.d.ts","sourceRoot":"","sources":["src/ConnectionIndicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAQ,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAO5D;;GAEG;AACH,0BAAkB,eAAe;IAC/B,IAAI,KAAK;IACT,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,mBAAmB,CAAC;KACpD;CACF;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;;IACjD,MAAM,KAAK,QAAQ,IAAI,mBAAmB,CAEzC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAM,IAAI,mBAAmB;IAUpC;;OAEG;IAEH,QAAQ,CAAC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