@leavittsoftware/web 1.26.1 → 2.0.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/leavitt/company-select/company-select.js +3 -3
- package/leavitt/company-select/company-select.js.map +1 -1
- package/leavitt/file-explorer/add-folder-modal.js +2 -2
- package/leavitt/file-explorer/add-folder-modal.js.map +1 -1
- package/leavitt/file-explorer/file-explorer.js +16 -10
- package/leavitt/file-explorer/file-explorer.js.map +1 -1
- package/leavitt/file-explorer/file-modal.js +2 -2
- package/leavitt/file-explorer/file-modal.js.map +1 -1
- package/leavitt/file-explorer/folder-modal.js +2 -2
- package/leavitt/file-explorer/folder-modal.js.map +1 -1
- package/leavitt/person-company-select/person-company-select.js +3 -3
- package/leavitt/person-company-select/person-company-select.js.map +1 -1
- package/leavitt/person-group-select/person-group-select.js +3 -3
- package/leavitt/person-group-select/person-group-select.js.map +1 -1
- package/leavitt/person-select/person-select.js +2 -2
- package/leavitt/person-select/person-select.js.map +1 -1
- package/leavitt/user-feedback/user-feedback.js +9 -7
- package/leavitt/user-feedback/user-feedback.js.map +1 -1
- package/package.json +2 -2
- package/titanium/address-input/google-address-input.js +3 -3
- package/titanium/address-input/google-address-input.js.map +1 -1
- package/titanium/date-range-selector/date-range-selector.js +68 -52
- package/titanium/date-range-selector/date-range-selector.js.map +1 -1
- package/titanium/duration-input/duration-input.d.ts +1 -0
- package/titanium/duration-input/duration-input.js +23 -4
- package/titanium/duration-input/duration-input.js.map +1 -1
- package/titanium/hacks/dialog-zindex-hack.js +4 -1
- package/titanium/hacks/dialog-zindex-hack.js.map +1 -1
- package/titanium/service-worker-notifier/service-worker-notifier.js +2 -2
- package/titanium/service-worker-notifier/service-worker-notifier.js.map +1 -1
- package/titanium/single-select-base/single-select-base.js +0 -3
- package/titanium/single-select-base/single-select-base.js.map +1 -1
- package/titanium/snackbar/show-snackbar-event.d.ts +9 -0
- package/titanium/snackbar/show-snackbar-event.js +9 -0
- package/titanium/snackbar/show-snackbar-event.js.map +1 -0
- package/titanium/snackbar/snackbar-stack.d.ts +22 -0
- package/titanium/snackbar/snackbar-stack.js +80 -0
- package/titanium/snackbar/snackbar-stack.js.map +1 -0
- package/titanium/snackbar/snackbars/http-error-snackbar.d.ts +23 -0
- package/titanium/snackbar/snackbars/http-error-snackbar.js +134 -0
- package/titanium/snackbar/snackbars/http-error-snackbar.js.map +1 -0
- package/titanium/snackbar/snackbars/simple-snackbar.d.ts +23 -0
- package/titanium/snackbar/snackbars/simple-snackbar.js +134 -0
- package/titanium/snackbar/snackbars/simple-snackbar.js.map +1 -0
- package/titanium/snackbar/types/snackbar-options.d.ts +8 -0
- package/titanium/snackbar/types/snackbar-options.js +2 -0
- package/titanium/snackbar/types/snackbar-options.js.map +1 -0
- package/titanium/snackbar/snackbar.d.ts +0 -78
- package/titanium/snackbar/snackbar.js +0 -337
- package/titanium/snackbar/snackbar.js.map +0 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { SimpleSnackbar } from './simple-snackbar';
|
|
5
|
+
import '@material/web/button/text-button';
|
|
6
|
+
/**
|
|
7
|
+
* Material design snackbar.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
let HttpErrorSnackbar = class HttpErrorSnackbar extends LitElement {
|
|
12
|
+
#resolve;
|
|
13
|
+
#open_accessor_storage;
|
|
14
|
+
/**
|
|
15
|
+
* Firefox support
|
|
16
|
+
*/
|
|
17
|
+
get open() { return this.#open_accessor_storage; }
|
|
18
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
19
|
+
#httpErrors_accessor_storage = [];
|
|
20
|
+
get httpErrors() { return this.#httpErrors_accessor_storage; }
|
|
21
|
+
set httpErrors(value) { this.#httpErrors_accessor_storage = value; }
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.popover = 'manual';
|
|
25
|
+
}
|
|
26
|
+
show(httpError) {
|
|
27
|
+
//Firefox support
|
|
28
|
+
this.showPopover ? this.showPopover() : (this.open = true);
|
|
29
|
+
this.httpErrors.push(httpError);
|
|
30
|
+
return new Promise((resolve) => {
|
|
31
|
+
this.#resolve = resolve;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
addError(httpError) {
|
|
35
|
+
this.httpErrors = [...this.httpErrors, httpError];
|
|
36
|
+
}
|
|
37
|
+
#autoCloseTimeout = 0;
|
|
38
|
+
close(reason = '') {
|
|
39
|
+
clearTimeout(this.#autoCloseTimeout);
|
|
40
|
+
//Firefox support
|
|
41
|
+
this.hidePopover ? this.hidePopover() : (this.open = false);
|
|
42
|
+
this.#resolve(reason);
|
|
43
|
+
}
|
|
44
|
+
static { this.styles = [
|
|
45
|
+
...SimpleSnackbar.styles,
|
|
46
|
+
css `
|
|
47
|
+
/* HTTP error styles */
|
|
48
|
+
http-error {
|
|
49
|
+
display: grid;
|
|
50
|
+
gap: 24px;
|
|
51
|
+
grid:
|
|
52
|
+
'action status'
|
|
53
|
+
'error error';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
http-error [detail] {
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
max-height: 400px;
|
|
61
|
+
grid-column: 1 / -1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
http-error [error] {
|
|
65
|
+
grid-area: error;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
http-error [status] {
|
|
69
|
+
grid-area: status;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
justify-self: end;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
http-error [action] {
|
|
75
|
+
grid-area: action;
|
|
76
|
+
|
|
77
|
+
font-size: 12px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
div[actions] {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
justify-content: flex-end;
|
|
84
|
+
gap: 6px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[hidden] {
|
|
88
|
+
display: none !important;
|
|
89
|
+
}
|
|
90
|
+
`,
|
|
91
|
+
]; }
|
|
92
|
+
#addNewLineBreaks(text) {
|
|
93
|
+
const lines = text.split('\n');
|
|
94
|
+
const l = lines.length;
|
|
95
|
+
return lines.map((line, i) => (i === l - 1 ? line : html `${line}<br />`));
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
return html `
|
|
99
|
+
<div main>
|
|
100
|
+
<http-error>
|
|
101
|
+
<span action> ${this.httpErrors.length > 1 ? html `${this.httpErrors.length} Network errors` : this.httpErrors?.[0]?.action} </span>
|
|
102
|
+
<span status> ${this.httpErrors.length > 1 ? html `${this.httpErrors?.[0]?.action}` : nothing} ${this.httpErrors?.[0]?.statusCode} </span>
|
|
103
|
+
<span error>${this.#addNewLineBreaks(this.httpErrors?.[0]?.message ?? '')}</span>
|
|
104
|
+
${this.httpErrors?.[0]?.detail ? html ` <code detail>${this.#addNewLineBreaks(this.httpErrors?.[0]?.detail)}</code>` : nothing}
|
|
105
|
+
</http-error>
|
|
106
|
+
</div>
|
|
107
|
+
<div actions>
|
|
108
|
+
<md-text-button
|
|
109
|
+
@click=${() => {
|
|
110
|
+
if (this.httpErrors.length === 1) {
|
|
111
|
+
this.close('dismiss');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.httpErrors = [...this.httpErrors.filter((o) => o !== this.httpErrors?.[0])];
|
|
115
|
+
}
|
|
116
|
+
}}
|
|
117
|
+
>Dismiss
|
|
118
|
+
</md-text-button>
|
|
119
|
+
<md-text-button ?hidden=${this.httpErrors.length === 1} @click=${() => this.close('dismiss')}>Dismiss all (${this.httpErrors.length}) </md-text-button>
|
|
120
|
+
</div>
|
|
121
|
+
`;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: Boolean, reflect: true })
|
|
126
|
+
], HttpErrorSnackbar.prototype, "open", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ type: Array })
|
|
129
|
+
], HttpErrorSnackbar.prototype, "httpErrors", null);
|
|
130
|
+
HttpErrorSnackbar = __decorate([
|
|
131
|
+
customElement('titanium-http-error-snackbar')
|
|
132
|
+
], HttpErrorSnackbar);
|
|
133
|
+
export { HttpErrorSnackbar };
|
|
134
|
+
//# sourceMappingURL=http-error-snackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-error-snackbar.js","sourceRoot":"","sources":["http-error-snackbar.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,kCAAkC,CAAC;AAE1C;;;;GAIG;AAGI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAC/C,QAAQ,CAA2B;IAK0B,uBAAc;IAH3E;;OAEG;IAC0D,IAAA,IAAI,0CAAU;IAAd,IAAA,IAAI,gDAAU;IAE/B,+BAAmC,EAAE,CAAC;IAAtC,IAAA,UAAU,gDAA4B;IAAtC,IAAA,UAAU,sDAA4B;IAElF;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,SAA6B;QAChC,iBAAiB;QACjB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAE3D,IAAI,CAAC,UAAU,CAAC,IAAI,C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CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAgC;AAE/B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAwD;AARvE,iBAAiB;IAD7B,aAAa,CAAC,8BAA8B,CAAC;GACjC,iBAAiB,CAuH7B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { SnackbarOptions } from '../types/snackbar-options';
|
|
3
|
+
import '@material/web/button/text-button';
|
|
4
|
+
/**
|
|
5
|
+
* Material design snackbar.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare class SimpleSnackbar extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* Firefox support
|
|
12
|
+
*/
|
|
13
|
+
private accessor open;
|
|
14
|
+
private accessor noAction;
|
|
15
|
+
private accessor actionText;
|
|
16
|
+
private accessor message;
|
|
17
|
+
constructor();
|
|
18
|
+
show(message: string, options?: SnackbarOptions): Promise<string>;
|
|
19
|
+
close(reason?: string): void;
|
|
20
|
+
static styles: import("lit").CSSResult[];
|
|
21
|
+
render(): TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=simple-snackbar.d.ts.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import '@material/web/button/text-button';
|
|
5
|
+
/**
|
|
6
|
+
* Material design snackbar.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
let SimpleSnackbar = class SimpleSnackbar extends LitElement {
|
|
10
|
+
#resolve;
|
|
11
|
+
#open_accessor_storage;
|
|
12
|
+
/**
|
|
13
|
+
* Firefox support
|
|
14
|
+
*/
|
|
15
|
+
get open() { return this.#open_accessor_storage; }
|
|
16
|
+
set open(value) { this.#open_accessor_storage = value; }
|
|
17
|
+
#noAction_accessor_storage;
|
|
18
|
+
get noAction() { return this.#noAction_accessor_storage; }
|
|
19
|
+
set noAction(value) { this.#noAction_accessor_storage = value; }
|
|
20
|
+
#actionText_accessor_storage;
|
|
21
|
+
get actionText() { return this.#actionText_accessor_storage; }
|
|
22
|
+
set actionText(value) { this.#actionText_accessor_storage = value; }
|
|
23
|
+
#message_accessor_storage;
|
|
24
|
+
get message() { return this.#message_accessor_storage; }
|
|
25
|
+
set message(value) { this.#message_accessor_storage = value; }
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.popover = 'manual';
|
|
29
|
+
}
|
|
30
|
+
show(message, options) {
|
|
31
|
+
//Firefox support
|
|
32
|
+
this.showPopover ? this.showPopover() : (this.open = true);
|
|
33
|
+
this.message = options?.overrideTemplate ? options?.overrideTemplate : message;
|
|
34
|
+
this.noAction = options?.noAction ?? false;
|
|
35
|
+
this.actionText = options?.actionText ?? 'Dismiss';
|
|
36
|
+
if (options?.autoHide) {
|
|
37
|
+
const duration = typeof options?.autoHide === 'number' ? options?.autoHide : 5000;
|
|
38
|
+
this.#autoCloseTimeout = window.setTimeout(() => this.close('auto-close'), duration);
|
|
39
|
+
}
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
this.#resolve = resolve;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
#autoCloseTimeout = 0;
|
|
45
|
+
close(reason = '') {
|
|
46
|
+
clearTimeout(this.#autoCloseTimeout);
|
|
47
|
+
//Firefox support
|
|
48
|
+
this.hidePopover ? this.hidePopover() : (this.open = false);
|
|
49
|
+
this.#resolve(reason);
|
|
50
|
+
}
|
|
51
|
+
static { this.styles = [
|
|
52
|
+
css `
|
|
53
|
+
:host {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([popover]),
|
|
58
|
+
:host([open]) {
|
|
59
|
+
display: flex;
|
|
60
|
+
|
|
61
|
+
position: fixed;
|
|
62
|
+
inset: unset;
|
|
63
|
+
left: 0;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
border: 0;
|
|
66
|
+
|
|
67
|
+
min-width: 240px;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
font-family: Roboto, Noto, sans-serif;
|
|
70
|
+
-webkit-font-smoothing: antialiased;
|
|
71
|
+
margin: 16px;
|
|
72
|
+
padding: 8px;
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
background: var(--md-sys-color-inverse-surface);
|
|
75
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
-webkit-box-shadow:
|
|
78
|
+
0 3px 5px -1px rgba(0, 0, 0, 0.2),
|
|
79
|
+
0 6px 10px 0 rgba(0, 0, 0, 0.14),
|
|
80
|
+
0 1px 18px 0 rgba(0, 0, 0, 0.12);
|
|
81
|
+
box-shadow:
|
|
82
|
+
0 3px 5px -1px rgba(0, 0, 0, 0.2),
|
|
83
|
+
0 6px 10px 0 rgba(0, 0, 0, 0.14),
|
|
84
|
+
0 1px 18px 0 rgba(0, 0, 0, 0.12);
|
|
85
|
+
|
|
86
|
+
-webkit-box-sizing: border-box;
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Firefox non-popover support */
|
|
91
|
+
:host([open]) {
|
|
92
|
+
z-index: 99;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
div[main] {
|
|
96
|
+
max-width: 600px;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
margin: 12px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
md-text-button {
|
|
102
|
+
--md-text-button-label-text-color: var(--md-sys-color-inverse-primary);
|
|
103
|
+
align-self: flex-end;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[hidden] {
|
|
107
|
+
display: none !important;
|
|
108
|
+
}
|
|
109
|
+
`,
|
|
110
|
+
]; }
|
|
111
|
+
render() {
|
|
112
|
+
return html `
|
|
113
|
+
<div main>${this.message}</div>
|
|
114
|
+
<md-text-button ?hidden=${this.noAction} @click=${() => this.close('dismiss')}>${this.actionText} </md-text-button>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: Boolean, reflect: true })
|
|
120
|
+
], SimpleSnackbar.prototype, "open", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Boolean, reflect: true })
|
|
123
|
+
], SimpleSnackbar.prototype, "noAction", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: String })
|
|
126
|
+
], SimpleSnackbar.prototype, "actionText", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ type: String })
|
|
129
|
+
], SimpleSnackbar.prototype, "message", null);
|
|
130
|
+
SimpleSnackbar = __decorate([
|
|
131
|
+
customElement('titanium-simple-snackbar')
|
|
132
|
+
], SimpleSnackbar);
|
|
133
|
+
export { SimpleSnackbar };
|
|
134
|
+
//# sourceMappingURL=simple-snackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-snackbar.js","sourceRoot":"","sources":["simple-snackbar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,kCAAkC,CAAC;AAC1C;;;GAGG;AAGI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAC5C,QAAQ,CAA2B;IAK0B,uBAAc;IAH3E;;OAEG;IAC0D,IAAA,IAAI,0CAAU;IAAd,IAAA,IAAI,gDAAU;IAEd,2BAAkB;IAAlB,IAAA,QAAQ,8CAAU;IAAlB,IAAA,QAAQ,oDAAU;IAClC,6BAAmB;IAAnB,IAAA,UAAU,gDAAS;IAAnB,IAA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CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;aAEM,WAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyDF;KACF,AA3DY,CA2DX;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA;kBACG,IAAI,CAAC,OAAO;gCACE,IAAI,CAAC,QAAQ,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU;KACjG,CAAC;IACJ,CAAC;;AAvG4D;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAgC;AAEd;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAoC;AAClC;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAqC;AACnB;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmD;AAVnE,cAAc;IAD1B,aAAa,CAAC,0BAA0B,CAAC;GAC7B,cAAc,CA8G1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar-options.js","sourceRoot":"","sources":["snackbar-options.ts"],"names":[],"mappings":""}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { HttpError } from '../../leavitt/api-service/HttpError';
|
|
2
|
-
import { LitElement, TemplateResult } from 'lit';
|
|
3
|
-
import '@material/web/button/text-button';
|
|
4
|
-
export declare class BasicSnackBar {
|
|
5
|
-
_isComponent: boolean;
|
|
6
|
-
open(message: string | TemplateResult, options?: SnackbarOptions): void;
|
|
7
|
-
close(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare let TitaniumSnackbarSingleton: BasicSnackBar;
|
|
10
|
-
export type SnackbarOptions = {
|
|
11
|
-
actionText?: string | null;
|
|
12
|
-
autoHide?: boolean;
|
|
13
|
-
noAction?: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Material design snackbar.
|
|
17
|
-
*
|
|
18
|
-
* @element titanium-snackbar
|
|
19
|
-
*
|
|
20
|
-
* Only one snackbar is intended to be used per site.
|
|
21
|
-
* Use TitaniumSnackbarSingleton export to fetch the instance of the snackbar when you need to use it.
|
|
22
|
-
* ex.
|
|
23
|
-
* import { TitaniumSnackbarSingleton } from '@leavittsoftware/web/snackbar/snackbar';
|
|
24
|
-
* TitaniumSnackbarSingleton.open('Hello world');
|
|
25
|
-
*
|
|
26
|
-
* @cssprop {Color} [--titanium-snackbar-background-color=#323232] - Snackbar background color
|
|
27
|
-
* @cssprop {Color} [--titanium-snackbar-text-color=#f1f1f1] - Color of the text in the snackbar
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare class TitaniumSnackbar extends LitElement implements BasicSnackBar {
|
|
31
|
-
#private;
|
|
32
|
-
/**
|
|
33
|
-
* True when opened
|
|
34
|
-
*/
|
|
35
|
-
protected accessor opened: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* True when closing
|
|
38
|
-
*/
|
|
39
|
-
protected accessor closing: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* True when opening
|
|
42
|
-
*/
|
|
43
|
-
protected accessor opening: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Hides the action button
|
|
46
|
-
*/
|
|
47
|
-
protected accessor noaction: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Text used on the button
|
|
50
|
-
*/
|
|
51
|
-
protected accessor actionText: string;
|
|
52
|
-
/**
|
|
53
|
-
* Message used in the snackbar.
|
|
54
|
-
*/
|
|
55
|
-
protected accessor message: string | TemplateResult;
|
|
56
|
-
/**
|
|
57
|
-
* @ignore
|
|
58
|
-
*/
|
|
59
|
-
_isComponent: boolean;
|
|
60
|
-
constructor();
|
|
61
|
-
/**
|
|
62
|
-
* Opens the snackbar with the supplied message.
|
|
63
|
-
*
|
|
64
|
-
* optional options object:
|
|
65
|
-
* actionText?: string | null;
|
|
66
|
-
* autoHide?: boolean;
|
|
67
|
-
* noAction?: boolean;
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
open(message: string | TemplateResult | HttpError, options?: SnackbarOptions): Promise<unknown>;
|
|
71
|
-
/**
|
|
72
|
-
* Closes the snackbar
|
|
73
|
-
*/
|
|
74
|
-
close(): void;
|
|
75
|
-
static styles: import("lit").CSSResult;
|
|
76
|
-
render(): TemplateResult<1>;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=snackbar.d.ts.map
|