@exmg/exm-dialogs 1.1.35 → 1.1.37-alpha.31
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/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-confirm-base.d.ts +65 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-confirm-base.js +142 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-confirm.d.ts +9 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-confirm.js +12 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-form-base.d.ts +68 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-form-base.js +172 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-form.d.ts +10 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog-form.js +16 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog.d.ts +10 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/exm-dialog.js +24 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/index.d.ts +7 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/index.js +8 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/styles/exm-dialog-confirm-css.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/styles/exm-dialog-confirm-css.js +236 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/styles/exm-dialog-form-css.d.ts +1 -0
- package/.rollup.cache/root/repo/packages/exm-dialogs/dist/styles/exm-dialog-form-css.js +259 -0
- package/dist/exm-dialog-confirm-base.js +8 -6
- package/dist/exm-dialog-confirm.js +4 -2
- package/dist/exm-dialog-form-base.d.ts +1 -1
- package/dist/exm-dialog-form-base.js +8 -6
- package/dist/exm-dialog-form.js +4 -2
- package/dist/exm-dialog.js +4 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/styles/exm-dialog-confirm-css.js +5 -2
- package/dist/styles/exm-dialog-form-css.js +5 -2
- package/package.json +4 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import '@exmg/exm-dialogs/exm-dialog.js';
|
|
2
|
+
import { ExmDialog } from '@exmg/exm-dialogs/exm-dialog.js';
|
|
3
|
+
import '@material/web/button/text-button.js';
|
|
4
|
+
import '@exmg/exm-button/exm-filled-button.js';
|
|
5
|
+
import '@material/web/icon/icon.js';
|
|
6
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
7
|
+
export declare const CLOSE_ACTION = "close";
|
|
8
|
+
export declare class ExmDialogConfirmBase extends ExmgElement {
|
|
9
|
+
/**
|
|
10
|
+
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
11
|
+
*/
|
|
12
|
+
open: boolean;
|
|
13
|
+
type?: 'alert' | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Set to make the dialog position draggable.
|
|
16
|
+
*/
|
|
17
|
+
message: string;
|
|
18
|
+
/**
|
|
19
|
+
* Title of the dialog
|
|
20
|
+
*/
|
|
21
|
+
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* Submit button copy
|
|
24
|
+
*/
|
|
25
|
+
submitBtn: string;
|
|
26
|
+
/**
|
|
27
|
+
* Cancel button copy
|
|
28
|
+
*/
|
|
29
|
+
cancelBtn: string;
|
|
30
|
+
/**
|
|
31
|
+
* Hide cancel button
|
|
32
|
+
*/
|
|
33
|
+
hideCancelButton: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Icon of the dialog
|
|
36
|
+
*/
|
|
37
|
+
icon: string;
|
|
38
|
+
/**
|
|
39
|
+
* Used to show button spinner.
|
|
40
|
+
*/
|
|
41
|
+
submitting: boolean;
|
|
42
|
+
protected dialog: ExmDialog;
|
|
43
|
+
/**
|
|
44
|
+
* Opens and shows the dialog. This is equivalent to setting the `open`
|
|
45
|
+
* property to true.
|
|
46
|
+
*/
|
|
47
|
+
show(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Closes the dialog. This is equivalent to setting the `open`
|
|
50
|
+
* property to false.
|
|
51
|
+
*/
|
|
52
|
+
close(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Opens and shows the dialog if it is closed; otherwise closes it.
|
|
55
|
+
*/
|
|
56
|
+
toggleShow(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Action method that needs to be implemented
|
|
59
|
+
* @param {CustomEvent} e
|
|
60
|
+
*/
|
|
61
|
+
doAction?(): Promise<void> | void;
|
|
62
|
+
private handleSubmit;
|
|
63
|
+
private handleClose;
|
|
64
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import '@exmg/exm-dialogs/exm-dialog.js';
|
|
4
|
+
import '@material/web/button/text-button.js';
|
|
5
|
+
import '@exmg/exm-button/exm-filled-button.js';
|
|
6
|
+
import '@material/web/icon/icon.js';
|
|
7
|
+
import { property, query } from 'lit/decorators.js';
|
|
8
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
9
|
+
export const CLOSE_ACTION = 'close';
|
|
10
|
+
export class ExmDialogConfirmBase extends ExmgElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
15
|
+
*/
|
|
16
|
+
this.open = false;
|
|
17
|
+
this.type = 'alert';
|
|
18
|
+
/**
|
|
19
|
+
* Set to make the dialog position draggable.
|
|
20
|
+
*/
|
|
21
|
+
this.message = `The selected item will be permanently removed from the system. Are you sure you want to delete`;
|
|
22
|
+
/**
|
|
23
|
+
* Title of the dialog
|
|
24
|
+
*/
|
|
25
|
+
this.title = 'Permanently delete?';
|
|
26
|
+
/**
|
|
27
|
+
* Submit button copy
|
|
28
|
+
*/
|
|
29
|
+
this.submitBtn = 'Delete';
|
|
30
|
+
/**
|
|
31
|
+
* Cancel button copy
|
|
32
|
+
*/
|
|
33
|
+
this.cancelBtn = 'Cancel';
|
|
34
|
+
/**
|
|
35
|
+
* Hide cancel button
|
|
36
|
+
*/
|
|
37
|
+
this.hideCancelButton = false;
|
|
38
|
+
/**
|
|
39
|
+
* Icon of the dialog
|
|
40
|
+
*/
|
|
41
|
+
this.icon = 'delete';
|
|
42
|
+
/**
|
|
43
|
+
* Used to show button spinner.
|
|
44
|
+
*/
|
|
45
|
+
this.submitting = false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Opens and shows the dialog. This is equivalent to setting the `open`
|
|
49
|
+
* property to true.
|
|
50
|
+
*/
|
|
51
|
+
show() {
|
|
52
|
+
this.open = true;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Closes the dialog. This is equivalent to setting the `open`
|
|
56
|
+
* property to false.
|
|
57
|
+
*/
|
|
58
|
+
close() {
|
|
59
|
+
this.open = false;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Opens and shows the dialog if it is closed; otherwise closes it.
|
|
63
|
+
*/
|
|
64
|
+
toggleShow() {
|
|
65
|
+
if (this.open) {
|
|
66
|
+
this.close();
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.show();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async handleSubmit() {
|
|
73
|
+
if (this.doAction) {
|
|
74
|
+
try {
|
|
75
|
+
this.submitting = true;
|
|
76
|
+
await this.doAction();
|
|
77
|
+
this.fire('action-success');
|
|
78
|
+
this.close();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
this.fire('action-error', { message: error instanceof Error ? error.message : 'Unknown error' }, true);
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
this.submitting = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.fire('action-confirmed', {}, true);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
handleClose() {
|
|
92
|
+
this.fire('action-close');
|
|
93
|
+
this.close();
|
|
94
|
+
}
|
|
95
|
+
render() {
|
|
96
|
+
const { type } = this;
|
|
97
|
+
return html ` <exm-dialog .type=${type} .open=${this.open} @closed=${() => (this.open = false)}>
|
|
98
|
+
<md-icon slot="headline-prefix">${this.icon}</md-icon>
|
|
99
|
+
<span slot="headline">${this.title}</span>
|
|
100
|
+
<div slot="content"><span class="description">${this.message}</span></div>
|
|
101
|
+
<div slot="actions">
|
|
102
|
+
${this.hideCancelButton
|
|
103
|
+
? nothing
|
|
104
|
+
: html ` <md-text-button dialogFocus @click=${this.handleClose}>${this.cancelBtn}</md-text-button> `}
|
|
105
|
+
<exm-filled-button @click=${this.handleSubmit} ?disabled=${this.submitting} ?loading=${this.submitting}
|
|
106
|
+
>${this.submitBtn}</exm-filled-button
|
|
107
|
+
>
|
|
108
|
+
</div>
|
|
109
|
+
</exm-dialog>`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: Boolean })
|
|
114
|
+
], ExmDialogConfirmBase.prototype, "open", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ type: String })
|
|
117
|
+
], ExmDialogConfirmBase.prototype, "type", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: String })
|
|
120
|
+
], ExmDialogConfirmBase.prototype, "message", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: String })
|
|
123
|
+
], ExmDialogConfirmBase.prototype, "title", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ type: String })
|
|
126
|
+
], ExmDialogConfirmBase.prototype, "submitBtn", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
property({ type: String })
|
|
129
|
+
], ExmDialogConfirmBase.prototype, "cancelBtn", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
property({ type: Boolean })
|
|
132
|
+
], ExmDialogConfirmBase.prototype, "hideCancelButton", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ type: String })
|
|
135
|
+
], ExmDialogConfirmBase.prototype, "icon", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
property({ type: Boolean })
|
|
138
|
+
], ExmDialogConfirmBase.prototype, "submitting", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
query('md-dialog')
|
|
141
|
+
], ExmDialogConfirmBase.prototype, "dialog", void 0);
|
|
142
|
+
//# sourceMappingURL=exm-dialog-confirm-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
2
|
+
export declare class ExmDialogConfirm extends ExmDialogConfirmBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-dialog-confirm': ExmDialogConfirm;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
4
|
+
import { style } from './styles/exm-dialog-confirm-css.js';
|
|
5
|
+
let ExmDialogConfirm = class ExmDialogConfirm extends ExmDialogConfirmBase {
|
|
6
|
+
};
|
|
7
|
+
ExmDialogConfirm.styles = [style];
|
|
8
|
+
ExmDialogConfirm = __decorate([
|
|
9
|
+
customElement('exm-dialog-confirm')
|
|
10
|
+
], ExmDialogConfirm);
|
|
11
|
+
export { ExmDialogConfirm };
|
|
12
|
+
//# sourceMappingURL=exm-dialog-confirm.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import '@exmg/exm-dialogs/exm-dialog.js';
|
|
2
|
+
import { ExmDialog } from '@exmg/exm-dialogs/exm-dialog.js';
|
|
3
|
+
import '@exmg/exm-button/exm-filled-button.js';
|
|
4
|
+
import '@material/web/button/text-button.js';
|
|
5
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
6
|
+
import '@material/web/icon/icon.js';
|
|
7
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
8
|
+
export declare const CLOSE_ACTION = "close";
|
|
9
|
+
declare const ExmDialogFormBase_base: import("@exmg/exm-form").Constructor<import("@exmg/exm-form/exm-form-validate-mixin.js").FormValidateMixinInterface> & typeof ExmgElement;
|
|
10
|
+
export declare class ExmDialogFormBase extends ExmDialogFormBase_base {
|
|
11
|
+
/**
|
|
12
|
+
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
13
|
+
*/
|
|
14
|
+
open: boolean;
|
|
15
|
+
type?: 'alert' | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Title of the dialog
|
|
18
|
+
*/
|
|
19
|
+
title: string;
|
|
20
|
+
/**
|
|
21
|
+
* Submit button copy
|
|
22
|
+
*/
|
|
23
|
+
submitBtn: string;
|
|
24
|
+
/**
|
|
25
|
+
* Cancel button copy
|
|
26
|
+
*/
|
|
27
|
+
cancelBtn: string;
|
|
28
|
+
/**
|
|
29
|
+
* Icon of the dialog
|
|
30
|
+
*/
|
|
31
|
+
icon: string;
|
|
32
|
+
/**
|
|
33
|
+
* Internall used to show button spinner.
|
|
34
|
+
*/
|
|
35
|
+
submitting: boolean;
|
|
36
|
+
protected dialog: ExmDialog;
|
|
37
|
+
errorMessage?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Opens and shows the dialog. This is equivalent to setting the `open`
|
|
40
|
+
* property to true.
|
|
41
|
+
*/
|
|
42
|
+
show(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Closes the dialog. This is equivalent to setting the `open`
|
|
45
|
+
* property to false.
|
|
46
|
+
*/
|
|
47
|
+
close(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Opens and shows the dialog if it is closed; otherwise closes it.
|
|
50
|
+
*/
|
|
51
|
+
toggleShow(): void;
|
|
52
|
+
private handleCancelBtnClick;
|
|
53
|
+
reset(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Action method that needs to be implemented
|
|
56
|
+
* @param {CustomEvent} e
|
|
57
|
+
*/
|
|
58
|
+
doAction?(formData: unknown): Promise<void> | void;
|
|
59
|
+
protected handleSubmit(): Promise<void>;
|
|
60
|
+
showError(message: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Method should be overriden to render form content
|
|
63
|
+
*/
|
|
64
|
+
protected renderFormContent(): import("lit-html").TemplateResult<1>;
|
|
65
|
+
protected renderError(): import("lit-html").TemplateResult<1>;
|
|
66
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import '@exmg/exm-dialogs/exm-dialog.js';
|
|
4
|
+
import '@exmg/exm-button/exm-filled-button.js';
|
|
5
|
+
import '@material/web/button/text-button.js';
|
|
6
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
7
|
+
import '@material/web/icon/icon.js';
|
|
8
|
+
import { property, query } from 'lit/decorators.js';
|
|
9
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
10
|
+
import { serializeFormData, ExmFormValidateMixin } from '@exmg/exm-form';
|
|
11
|
+
export const CLOSE_ACTION = 'close';
|
|
12
|
+
export class ExmDialogFormBase extends ExmFormValidateMixin(ExmgElement) {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
17
|
+
*/
|
|
18
|
+
this.open = false;
|
|
19
|
+
/**
|
|
20
|
+
* Title of the dialog
|
|
21
|
+
*/
|
|
22
|
+
this.title = 'Create entry';
|
|
23
|
+
/**
|
|
24
|
+
* Submit button copy
|
|
25
|
+
*/
|
|
26
|
+
this.submitBtn = 'Save';
|
|
27
|
+
/**
|
|
28
|
+
* Cancel button copy
|
|
29
|
+
*/
|
|
30
|
+
this.cancelBtn = 'Cancel';
|
|
31
|
+
/**
|
|
32
|
+
* Icon of the dialog
|
|
33
|
+
*/
|
|
34
|
+
this.icon = 'close';
|
|
35
|
+
/**
|
|
36
|
+
* Internall used to show button spinner.
|
|
37
|
+
*/
|
|
38
|
+
this.submitting = false;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Opens and shows the dialog. This is equivalent to setting the `open`
|
|
42
|
+
* property to true.
|
|
43
|
+
*/
|
|
44
|
+
show() {
|
|
45
|
+
this.open = true;
|
|
46
|
+
this.checkFormValidity();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Closes the dialog. This is equivalent to setting the `open`
|
|
50
|
+
* property to false.
|
|
51
|
+
*/
|
|
52
|
+
close() {
|
|
53
|
+
this.open = false;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Opens and shows the dialog if it is closed; otherwise closes it.
|
|
57
|
+
*/
|
|
58
|
+
toggleShow() {
|
|
59
|
+
if (this.open) {
|
|
60
|
+
this.close();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.show();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
handleCancelBtnClick() {
|
|
67
|
+
this.reset();
|
|
68
|
+
this.close();
|
|
69
|
+
this.fire('action-close');
|
|
70
|
+
}
|
|
71
|
+
reset() {
|
|
72
|
+
this.errorMessage = null;
|
|
73
|
+
const form = this.getForm();
|
|
74
|
+
form.reset();
|
|
75
|
+
}
|
|
76
|
+
async handleSubmit() {
|
|
77
|
+
const form = this.getForm();
|
|
78
|
+
this.errorMessage = null;
|
|
79
|
+
// Check form validity
|
|
80
|
+
this.checkFormValidity();
|
|
81
|
+
// Return when there are invalid fields
|
|
82
|
+
if (!this.formValid) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// Serialize form data
|
|
86
|
+
const data = serializeFormData(form);
|
|
87
|
+
if (this.doAction) {
|
|
88
|
+
try {
|
|
89
|
+
this.submitting = true;
|
|
90
|
+
await this.doAction(data);
|
|
91
|
+
this.fire('action-success');
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
this.showError(error instanceof Error ? error.message : 'Unknown error');
|
|
95
|
+
this.fire('action-error', { message: error instanceof Error ? error.message : 'Unkbnown error' }, true);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
this.submitting = false;
|
|
99
|
+
if (this.errorMessage === null) {
|
|
100
|
+
this.open = false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
this.fire('action-submit', data, true);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
showError(message) {
|
|
109
|
+
this.errorMessage = message;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Method should be overriden to render form content
|
|
113
|
+
*/
|
|
114
|
+
renderFormContent() {
|
|
115
|
+
return html `<slot></slot>`;
|
|
116
|
+
}
|
|
117
|
+
renderError() {
|
|
118
|
+
return html `<div class="error"><div>${this.errorMessage}</div></div>`;
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
const { type } = this;
|
|
122
|
+
return html ` <exm-dialog .type=${type} .open=${this.open} @closed=${() => (this.open = false)}>
|
|
123
|
+
<span slot="headline">
|
|
124
|
+
<md-icon-button @click=${() => this.close()}><md-icon>close</md-icon></md-icon-button>
|
|
125
|
+
<span class="headline">${this.title}</span>
|
|
126
|
+
</span>
|
|
127
|
+
|
|
128
|
+
<div slot="content">
|
|
129
|
+
${this.errorMessage ? this.renderError() : nothing}
|
|
130
|
+
<div class="content">${this.renderFormContent()}</div>
|
|
131
|
+
</div>
|
|
132
|
+
<div slot="actions">
|
|
133
|
+
<md-text-button slot="footer" @click=${() => this.handleCancelBtnClick()}>${this.cancelBtn}</md-text-button>
|
|
134
|
+
<exm-filled-button
|
|
135
|
+
slot="footer"
|
|
136
|
+
@click=${this.handleSubmit}
|
|
137
|
+
?disabled=${this.submitting || !this.formValid}
|
|
138
|
+
?loading=${this.submitting}
|
|
139
|
+
>${this.submitBtn}</exm-filled-button
|
|
140
|
+
>
|
|
141
|
+
</div>
|
|
142
|
+
</exm-dialog>`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
__decorate([
|
|
146
|
+
property({ type: Boolean })
|
|
147
|
+
], ExmDialogFormBase.prototype, "open", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
property({ type: String })
|
|
150
|
+
], ExmDialogFormBase.prototype, "type", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
property({ type: String })
|
|
153
|
+
], ExmDialogFormBase.prototype, "title", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
property({ type: String })
|
|
156
|
+
], ExmDialogFormBase.prototype, "submitBtn", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
property({ type: String })
|
|
159
|
+
], ExmDialogFormBase.prototype, "cancelBtn", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: String })
|
|
162
|
+
], ExmDialogFormBase.prototype, "icon", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
property({ type: Boolean })
|
|
165
|
+
], ExmDialogFormBase.prototype, "submitting", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
query('md-dialog')
|
|
168
|
+
], ExmDialogFormBase.prototype, "dialog", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: String })
|
|
171
|
+
], ExmDialogFormBase.prototype, "errorMessage", void 0);
|
|
172
|
+
//# sourceMappingURL=exm-dialog-form-base.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
2
|
+
export declare class ExmDialogForm extends ExmDialogFormBase {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
getForm(): HTMLFormElement | null;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'exm-dialog-form': ExmDialogForm;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { style } from './styles/exm-dialog-form-css.js';
|
|
4
|
+
import { formStyles } from '@exmg/exm-form';
|
|
5
|
+
import { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
6
|
+
let ExmDialogForm = class ExmDialogForm extends ExmDialogFormBase {
|
|
7
|
+
getForm() {
|
|
8
|
+
return this.querySelector('form');
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
ExmDialogForm.styles = [style, formStyles];
|
|
12
|
+
ExmDialogForm = __decorate([
|
|
13
|
+
customElement('exm-dialog-form')
|
|
14
|
+
], ExmDialogForm);
|
|
15
|
+
export { ExmDialogForm };
|
|
16
|
+
//# sourceMappingURL=exm-dialog-form.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSResultOrNative } from 'lit';
|
|
2
|
+
import { Dialog } from '@material/web/dialog/internal/dialog.js';
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
'exm-dialog': ExmDialog;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare class ExmDialog extends Dialog {
|
|
9
|
+
static styles: CSSResultOrNative[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { Dialog } from '@material/web/dialog/internal/dialog.js';
|
|
5
|
+
import { styles } from '@material/web/dialog/internal/dialog-styles.js';
|
|
6
|
+
let ExmDialog = class ExmDialog extends Dialog {
|
|
7
|
+
};
|
|
8
|
+
ExmDialog.styles = [
|
|
9
|
+
styles,
|
|
10
|
+
css `
|
|
11
|
+
:host([open]) .scrim {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
::backdrop {
|
|
15
|
+
background: rgba(0, 0, 0, 0.7);
|
|
16
|
+
backdrop-filter: blur(4px);
|
|
17
|
+
}
|
|
18
|
+
`,
|
|
19
|
+
];
|
|
20
|
+
ExmDialog = __decorate([
|
|
21
|
+
customElement('exm-dialog')
|
|
22
|
+
], ExmDialog);
|
|
23
|
+
export { ExmDialog };
|
|
24
|
+
//# sourceMappingURL=exm-dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ExmDialogConfirm } from './exm-dialog-confirm.js';
|
|
2
|
+
export { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
3
|
+
export { ExmDialogForm } from './exm-dialog-form.js';
|
|
4
|
+
export { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
5
|
+
export { ExmDialog } from './exm-dialog.js';
|
|
6
|
+
export { style as dialogConfirmStyles } from './styles/exm-dialog-confirm-css.js';
|
|
7
|
+
export { style as dialogFormStyles } from './styles/exm-dialog-form-css.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ExmDialogConfirm } from './exm-dialog-confirm.js';
|
|
2
|
+
export { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
3
|
+
export { ExmDialogForm } from './exm-dialog-form.js';
|
|
4
|
+
export { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
5
|
+
export { ExmDialog } from './exm-dialog.js';
|
|
6
|
+
export { style as dialogConfirmStyles } from './styles/exm-dialog-confirm-css.js';
|
|
7
|
+
export { style as dialogFormStyles } from './styles/exm-dialog-form-css.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
border-start-start-radius: var(
|
|
5
|
+
--md-dialog-container-shape-start-start,
|
|
6
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
7
|
+
);
|
|
8
|
+
border-start-end-radius: var(
|
|
9
|
+
--md-dialog-container-shape-start-end,
|
|
10
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
11
|
+
);
|
|
12
|
+
border-end-end-radius: var(
|
|
13
|
+
--md-dialog-container-shape-end-end,
|
|
14
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
15
|
+
);
|
|
16
|
+
border-end-start-radius: var(
|
|
17
|
+
--md-dialog-container-shape-end-start,
|
|
18
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
19
|
+
);
|
|
20
|
+
display: contents;
|
|
21
|
+
margin: auto;
|
|
22
|
+
max-height: min(560px, 100% - 48px);
|
|
23
|
+
max-width: min(560px, 100% - 48px);
|
|
24
|
+
min-height: 140px;
|
|
25
|
+
min-width: 280px;
|
|
26
|
+
position: fixed;
|
|
27
|
+
height: fit-content;
|
|
28
|
+
width: fit-content;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
dialog {
|
|
32
|
+
background: rgba(0, 0, 0, 0);
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
height: inherit;
|
|
37
|
+
margin: inherit;
|
|
38
|
+
max-height: inherit;
|
|
39
|
+
max-width: inherit;
|
|
40
|
+
min-height: inherit;
|
|
41
|
+
min-width: inherit;
|
|
42
|
+
outline: none;
|
|
43
|
+
overflow: visible;
|
|
44
|
+
padding: 0;
|
|
45
|
+
width: inherit;
|
|
46
|
+
|
|
47
|
+
&::backdrop {
|
|
48
|
+
background: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
dialog[open] {
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.scrim {
|
|
57
|
+
background: var(--md-sys-color-scrim, #000);
|
|
58
|
+
display: none;
|
|
59
|
+
inset: 0;
|
|
60
|
+
opacity: 32%;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
position: fixed;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([open]) .scrim {
|
|
67
|
+
display: flex;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
h2 {
|
|
71
|
+
all: unset;
|
|
72
|
+
align-self: stretch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.headline {
|
|
76
|
+
align-items: center;
|
|
77
|
+
color: var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
font-family: var(
|
|
81
|
+
--md-dialog-headline-font,
|
|
82
|
+
var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto))
|
|
83
|
+
);
|
|
84
|
+
font-size: var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));
|
|
85
|
+
line-height: var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));
|
|
86
|
+
font-weight: var(
|
|
87
|
+
--md-dialog-headline-weight,
|
|
88
|
+
var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400))
|
|
89
|
+
);
|
|
90
|
+
position: relative;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
slot[name='headline']::slotted(*) {
|
|
94
|
+
align-items: center;
|
|
95
|
+
align-self: stretch;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
display: flex;
|
|
98
|
+
gap: 8px;
|
|
99
|
+
padding: 24px 24px 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.icon {
|
|
103
|
+
display: flex;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
slot[name='icon']::slotted(*) {
|
|
107
|
+
color: var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));
|
|
108
|
+
fill: currentColor;
|
|
109
|
+
font-size: var(--md-dialog-icon-size, 24px);
|
|
110
|
+
margin-top: 24px;
|
|
111
|
+
height: var(--md-dialog-icon-size, 24px);
|
|
112
|
+
width: var(--md-dialog-icon-size, 24px);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.has-icon slot[name='headline']::slotted(*) {
|
|
116
|
+
justify-content: center;
|
|
117
|
+
padding-top: 16px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.scrollable slot[name='headline']::slotted(*) {
|
|
121
|
+
padding-bottom: 16px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.scrollable.has-headline slot[name='content']::slotted(*) {
|
|
125
|
+
padding-top: 8px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.container {
|
|
129
|
+
border-radius: inherit;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
flex-grow: 1;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
position: relative;
|
|
135
|
+
transform-origin: top;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.container::before {
|
|
139
|
+
background: var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));
|
|
140
|
+
border-radius: inherit;
|
|
141
|
+
content: '';
|
|
142
|
+
inset: 0;
|
|
143
|
+
position: absolute;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.scroller {
|
|
147
|
+
display: flex;
|
|
148
|
+
flex: 1;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
z-index: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.scrollable .scroller {
|
|
155
|
+
overflow-y: scroll;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.content {
|
|
159
|
+
color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
160
|
+
font-family: var(
|
|
161
|
+
--md-dialog-supporting-text-font,
|
|
162
|
+
var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto))
|
|
163
|
+
);
|
|
164
|
+
font-size: var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));
|
|
165
|
+
line-height: var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));
|
|
166
|
+
flex: 1;
|
|
167
|
+
font-weight: var(
|
|
168
|
+
--md-dialog-supporting-text-weight,
|
|
169
|
+
var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400))
|
|
170
|
+
);
|
|
171
|
+
height: min-content;
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
slot[name='content']::slotted(*) {
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
padding: 24px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.anchor {
|
|
181
|
+
position: absolute;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.top.anchor {
|
|
185
|
+
top: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.bottom.anchor {
|
|
189
|
+
bottom: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.actions {
|
|
193
|
+
position: relative;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
slot[name='actions']::slotted(*) {
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
display: flex;
|
|
199
|
+
gap: 8px;
|
|
200
|
+
justify-content: flex-end;
|
|
201
|
+
padding: 16px 24px 24px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.has-actions slot[name='content']::slotted(*) {
|
|
205
|
+
padding-bottom: 8px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
md-divider {
|
|
209
|
+
display: none;
|
|
210
|
+
position: absolute;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.has-headline.show-top-divider .headline md-divider,
|
|
214
|
+
.has-actions.show-bottom-divider .actions md-divider {
|
|
215
|
+
display: flex;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.headline md-divider {
|
|
219
|
+
bottom: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.actions md-divider {
|
|
223
|
+
top: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media (forced-colors: active) {
|
|
227
|
+
dialog {
|
|
228
|
+
outline: 2px solid WindowText;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
md-dialog {
|
|
233
|
+
--md-dialog-container-max-inline-size: 320px;
|
|
234
|
+
}
|
|
235
|
+
`;
|
|
236
|
+
//# sourceMappingURL=exm-dialog-confirm-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
border-start-start-radius: var(
|
|
5
|
+
--md-dialog-container-shape-start-start,
|
|
6
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
7
|
+
);
|
|
8
|
+
border-start-end-radius: var(
|
|
9
|
+
--md-dialog-container-shape-start-end,
|
|
10
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
11
|
+
);
|
|
12
|
+
border-end-end-radius: var(
|
|
13
|
+
--md-dialog-container-shape-end-end,
|
|
14
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
15
|
+
);
|
|
16
|
+
border-end-start-radius: var(
|
|
17
|
+
--md-dialog-container-shape-end-start,
|
|
18
|
+
var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px))
|
|
19
|
+
);
|
|
20
|
+
display: contents;
|
|
21
|
+
margin: auto;
|
|
22
|
+
max-height: min(560px, 100% - 48px);
|
|
23
|
+
max-width: min(560px, 100% - 48px);
|
|
24
|
+
min-height: 140px;
|
|
25
|
+
min-width: 280px;
|
|
26
|
+
position: fixed;
|
|
27
|
+
height: fit-content;
|
|
28
|
+
width: fit-content;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
dialog {
|
|
32
|
+
background: rgba(0, 0, 0, 0);
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
height: inherit;
|
|
37
|
+
margin: inherit;
|
|
38
|
+
max-height: inherit;
|
|
39
|
+
max-width: inherit;
|
|
40
|
+
min-height: inherit;
|
|
41
|
+
min-width: inherit;
|
|
42
|
+
outline: none;
|
|
43
|
+
overflow: visible;
|
|
44
|
+
padding: 0;
|
|
45
|
+
width: inherit;
|
|
46
|
+
|
|
47
|
+
&::backdrop {
|
|
48
|
+
background: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
dialog[open] {
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.scrim {
|
|
57
|
+
background: var(--md-sys-color-scrim, #000);
|
|
58
|
+
display: none;
|
|
59
|
+
inset: 0;
|
|
60
|
+
opacity: 32%;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
position: fixed;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([open]) .scrim {
|
|
67
|
+
display: flex;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
h2 {
|
|
71
|
+
all: unset;
|
|
72
|
+
align-self: stretch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.headline {
|
|
76
|
+
align-items: center;
|
|
77
|
+
color: var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
font-family: var(
|
|
81
|
+
--md-dialog-headline-font,
|
|
82
|
+
var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto))
|
|
83
|
+
);
|
|
84
|
+
font-size: var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));
|
|
85
|
+
line-height: var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));
|
|
86
|
+
font-weight: var(
|
|
87
|
+
--md-dialog-headline-weight,
|
|
88
|
+
var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400))
|
|
89
|
+
);
|
|
90
|
+
position: relative;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
slot[name='headline']::slotted(*) {
|
|
94
|
+
align-items: center;
|
|
95
|
+
align-self: stretch;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
display: flex;
|
|
98
|
+
gap: 8px;
|
|
99
|
+
padding: 24px 24px 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.icon {
|
|
103
|
+
display: flex;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
slot[name='icon']::slotted(*) {
|
|
107
|
+
color: var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));
|
|
108
|
+
fill: currentColor;
|
|
109
|
+
font-size: var(--md-dialog-icon-size, 24px);
|
|
110
|
+
margin-top: 24px;
|
|
111
|
+
height: var(--md-dialog-icon-size, 24px);
|
|
112
|
+
width: var(--md-dialog-icon-size, 24px);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.has-icon slot[name='headline']::slotted(*) {
|
|
116
|
+
justify-content: center;
|
|
117
|
+
padding-top: 16px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.scrollable slot[name='headline']::slotted(*) {
|
|
121
|
+
padding-bottom: 16px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.scrollable.has-headline slot[name='content']::slotted(*) {
|
|
125
|
+
padding-top: 8px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.container {
|
|
129
|
+
border-radius: inherit;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
flex-grow: 1;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
position: relative;
|
|
135
|
+
transform-origin: top;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.container::before {
|
|
139
|
+
background: var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));
|
|
140
|
+
border-radius: inherit;
|
|
141
|
+
content: '';
|
|
142
|
+
inset: 0;
|
|
143
|
+
position: absolute;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.scroller {
|
|
147
|
+
display: flex;
|
|
148
|
+
flex: 1;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
z-index: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.scrollable .scroller {
|
|
155
|
+
overflow-y: scroll;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.content {
|
|
159
|
+
color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));
|
|
160
|
+
font-family: var(
|
|
161
|
+
--md-dialog-supporting-text-font,
|
|
162
|
+
var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto))
|
|
163
|
+
);
|
|
164
|
+
font-size: var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));
|
|
165
|
+
line-height: var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));
|
|
166
|
+
flex: 1;
|
|
167
|
+
font-weight: var(
|
|
168
|
+
--md-dialog-supporting-text-weight,
|
|
169
|
+
var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400))
|
|
170
|
+
);
|
|
171
|
+
height: min-content;
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
slot[name='content']::slotted(*) {
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
padding: 24px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.anchor {
|
|
181
|
+
position: absolute;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.top.anchor {
|
|
185
|
+
top: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.bottom.anchor {
|
|
189
|
+
bottom: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.actions {
|
|
193
|
+
position: relative;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
slot[name='actions']::slotted(*) {
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
display: flex;
|
|
199
|
+
gap: 8px;
|
|
200
|
+
justify-content: flex-end;
|
|
201
|
+
padding: 16px 24px 24px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.has-actions slot[name='content']::slotted(*) {
|
|
205
|
+
padding-bottom: 8px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
md-divider {
|
|
209
|
+
display: none;
|
|
210
|
+
position: absolute;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.has-headline.show-top-divider .headline md-divider,
|
|
214
|
+
.has-actions.show-bottom-divider .actions md-divider {
|
|
215
|
+
display: flex;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.headline md-divider {
|
|
219
|
+
bottom: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.actions md-divider {
|
|
223
|
+
top: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media (forced-colors: active) {
|
|
227
|
+
dialog {
|
|
228
|
+
outline: 2px solid WindowText;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
[slot='headline'] {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: row-reverse;
|
|
235
|
+
align-items: center;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
[showing-fullscreen] [slot='headline'] {
|
|
239
|
+
flex-direction: row;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.headline {
|
|
243
|
+
flex: 1;
|
|
244
|
+
display: block;
|
|
245
|
+
text-align: left;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.error {
|
|
249
|
+
background-color: var(--md-sys-color-error-container);
|
|
250
|
+
color: var(--md-sys-color-on-error-container);
|
|
251
|
+
padding: 0.5rem;
|
|
252
|
+
margin-bottom: 1rem;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.error > * {
|
|
256
|
+
margin: 1rem;
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
259
|
+
//# sourceMappingURL=exm-dialog-form-css.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __decorate } from
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { nothing, html } from 'lit';
|
|
3
|
+
import './exm-dialog.js';
|
|
4
4
|
import '@material/web/button/text-button.js';
|
|
5
5
|
import '@exmg/exm-button/exm-filled-button.js';
|
|
6
6
|
import '@material/web/icon/icon.js';
|
|
7
7
|
import { property, query } from 'lit/decorators.js';
|
|
8
8
|
import { ExmgElement } from '@exmg/lit-base';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
class ExmDialogConfirmBase extends ExmgElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
/**
|
|
@@ -139,4 +139,6 @@ __decorate([
|
|
|
139
139
|
__decorate([
|
|
140
140
|
query('md-dialog')
|
|
141
141
|
], ExmDialogConfirmBase.prototype, "dialog", void 0);
|
|
142
|
-
|
|
142
|
+
|
|
143
|
+
export { ExmDialogConfirmBase };
|
|
144
|
+
//# sourceMappingURL=exm-dialog-confirm-base.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
4
4
|
import { style } from './styles/exm-dialog-confirm-css.js';
|
|
5
|
+
|
|
5
6
|
let ExmDialogConfirm = class ExmDialogConfirm extends ExmDialogConfirmBase {
|
|
6
7
|
};
|
|
7
8
|
ExmDialogConfirm.styles = [style];
|
|
8
9
|
ExmDialogConfirm = __decorate([
|
|
9
10
|
customElement('exm-dialog-confirm')
|
|
10
11
|
], ExmDialogConfirm);
|
|
12
|
+
|
|
11
13
|
export { ExmDialogConfirm };
|
|
12
|
-
//# sourceMappingURL=exm-dialog-confirm.js.map
|
|
14
|
+
//# sourceMappingURL=exm-dialog-confirm.js.map
|
|
@@ -6,7 +6,7 @@ import '@material/web/iconbutton/icon-button.js';
|
|
|
6
6
|
import '@material/web/icon/icon.js';
|
|
7
7
|
import { ExmgElement } from '@exmg/lit-base';
|
|
8
8
|
export declare const CLOSE_ACTION = "close";
|
|
9
|
-
declare const ExmDialogFormBase_base: import("@exmg/exm-form").Constructor<import("@exmg/exm-form/
|
|
9
|
+
declare const ExmDialogFormBase_base: import("@exmg/exm-form").Constructor<import("@exmg/exm-form/exm-form-validate-mixin.js").FormValidateMixinInterface> & typeof ExmgElement;
|
|
10
10
|
export declare class ExmDialogFormBase extends ExmDialogFormBase_base {
|
|
11
11
|
/**
|
|
12
12
|
* Opens the dialog when set to `true` and closes it when set to `false`.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { html, nothing } from 'lit';
|
|
3
|
-
import '
|
|
3
|
+
import './exm-dialog.js';
|
|
4
4
|
import '@exmg/exm-button/exm-filled-button.js';
|
|
5
5
|
import '@material/web/button/text-button.js';
|
|
6
6
|
import '@material/web/iconbutton/icon-button.js';
|
|
7
7
|
import '@material/web/icon/icon.js';
|
|
8
8
|
import { property, query } from 'lit/decorators.js';
|
|
9
9
|
import { ExmgElement } from '@exmg/lit-base';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { ExmFormValidateMixin, serializeFormData } from '@exmg/exm-form';
|
|
11
|
+
|
|
12
|
+
class ExmDialogFormBase extends ExmFormValidateMixin(ExmgElement) {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
/**
|
|
@@ -169,4 +169,6 @@ __decorate([
|
|
|
169
169
|
__decorate([
|
|
170
170
|
property({ type: String })
|
|
171
171
|
], ExmDialogFormBase.prototype, "errorMessage", void 0);
|
|
172
|
-
|
|
172
|
+
|
|
173
|
+
export { ExmDialogFormBase };
|
|
174
|
+
//# sourceMappingURL=exm-dialog-form-base.js.map
|
package/dist/exm-dialog-form.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import { style } from './styles/exm-dialog-form-css.js';
|
|
4
4
|
import { formStyles } from '@exmg/exm-form';
|
|
5
5
|
import { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
6
|
+
|
|
6
7
|
let ExmDialogForm = class ExmDialogForm extends ExmDialogFormBase {
|
|
7
8
|
getForm() {
|
|
8
9
|
return this.querySelector('form');
|
|
@@ -12,5 +13,6 @@ ExmDialogForm.styles = [style, formStyles];
|
|
|
12
13
|
ExmDialogForm = __decorate([
|
|
13
14
|
customElement('exm-dialog-form')
|
|
14
15
|
], ExmDialogForm);
|
|
16
|
+
|
|
15
17
|
export { ExmDialogForm };
|
|
16
|
-
//# sourceMappingURL=exm-dialog-form.js.map
|
|
18
|
+
//# sourceMappingURL=exm-dialog-form.js.map
|
package/dist/exm-dialog.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { __decorate } from
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
2
|
import { css } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
4
|
import { Dialog } from '@material/web/dialog/internal/dialog.js';
|
|
5
5
|
import { styles } from '@material/web/dialog/internal/dialog-styles.js';
|
|
6
|
+
|
|
6
7
|
let ExmDialog = class ExmDialog extends Dialog {
|
|
7
8
|
};
|
|
8
9
|
ExmDialog.styles = [
|
|
@@ -20,5 +21,6 @@ ExmDialog.styles = [
|
|
|
20
21
|
ExmDialog = __decorate([
|
|
21
22
|
customElement('exm-dialog')
|
|
22
23
|
], ExmDialog);
|
|
24
|
+
|
|
23
25
|
export { ExmDialog };
|
|
24
|
-
//# sourceMappingURL=exm-dialog.js.map
|
|
26
|
+
//# sourceMappingURL=exm-dialog.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { ExmDialogConfirm } from './exm-dialog-confirm.js';
|
|
|
2
2
|
export { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
3
3
|
export { ExmDialogForm } from './exm-dialog-form.js';
|
|
4
4
|
export { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
5
|
+
export { ExmDialog } from './exm-dialog.js';
|
|
5
6
|
export { style as dialogConfirmStyles } from './styles/exm-dialog-confirm-css.js';
|
|
6
7
|
export { style as dialogFormStyles } from './styles/exm-dialog-form-css.js';
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { ExmDialogConfirm } from './exm-dialog-confirm.js';
|
|
|
2
2
|
export { ExmDialogConfirmBase } from './exm-dialog-confirm-base.js';
|
|
3
3
|
export { ExmDialogForm } from './exm-dialog-form.js';
|
|
4
4
|
export { ExmDialogFormBase } from './exm-dialog-form-base.js';
|
|
5
|
+
export { ExmDialog } from './exm-dialog.js';
|
|
5
6
|
export { style as dialogConfirmStyles } from './styles/exm-dialog-confirm-css.js';
|
|
6
7
|
export { style as dialogFormStyles } from './styles/exm-dialog-form-css.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const style = css `
|
|
3
4
|
:host {
|
|
4
5
|
border-start-start-radius: var(
|
|
5
6
|
--md-dialog-container-shape-start-start,
|
|
@@ -233,4 +234,6 @@ export const style = css `
|
|
|
233
234
|
--md-dialog-container-max-inline-size: 320px;
|
|
234
235
|
}
|
|
235
236
|
`;
|
|
236
|
-
|
|
237
|
+
|
|
238
|
+
export { style };
|
|
239
|
+
//# sourceMappingURL=exm-dialog-confirm-css.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const style = css `
|
|
3
4
|
:host {
|
|
4
5
|
border-start-start-radius: var(
|
|
5
6
|
--md-dialog-container-shape-start-start,
|
|
@@ -256,4 +257,6 @@ export const style = css `
|
|
|
256
257
|
margin: 1rem;
|
|
257
258
|
}
|
|
258
259
|
`;
|
|
259
|
-
|
|
260
|
+
|
|
261
|
+
export { style };
|
|
262
|
+
//# sourceMappingURL=exm-dialog-form-css.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-dialogs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.37-alpha.31+513140a",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"homepage": "https://bitbucket.org/exmachina/exm-web-components",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@exmg/exm-button": "^1.1.
|
|
28
|
-
"@exmg/exm-form": "^1.1.
|
|
27
|
+
"@exmg/exm-button": "^1.1.37-alpha.31+513140a",
|
|
28
|
+
"@exmg/exm-form": "^1.1.37-alpha.31+513140a"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@exmg/lit-base": "^3.0.3",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "513140a59e3a5a9a0fa572147ba6c0cf9801816e"
|
|
40
40
|
}
|