@vaadin/confirm-dialog 24.8.4 → 25.0.0-alpha10
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 +0 -23
- package/package.json +15 -16
- package/src/{vaadin-confirm-dialog-overlay-styles.d.ts → styles/vaadin-confirm-dialog-overlay-base-styles.d.ts} +1 -1
- package/src/styles/vaadin-confirm-dialog-overlay-base-styles.js +44 -0
- package/src/styles/vaadin-confirm-dialog-overlay-core-styles.d.ts +8 -0
- package/src/styles/vaadin-confirm-dialog-overlay-core-styles.js +31 -0
- package/src/vaadin-confirm-dialog-mixin.d.ts +5 -11
- package/src/vaadin-confirm-dialog-mixin.js +65 -93
- package/src/vaadin-confirm-dialog-overlay.js +44 -54
- package/src/vaadin-confirm-dialog.d.ts +6 -10
- package/src/vaadin-confirm-dialog.js +54 -39
- package/theme/lumo/vaadin-confirm-dialog-styles.js +5 -3
- package/web-types.json +70 -26
- package/web-types.lit.json +24 -10
- package/src/vaadin-confirm-dialog-base-mixin.d.ts +0 -29
- package/src/vaadin-confirm-dialog-base-mixin.js +0 -71
- package/src/vaadin-confirm-dialog-overlay-styles.js +0 -31
- package/src/vaadin-lit-confirm-dialog-overlay.js +0 -122
- package/src/vaadin-lit-confirm-dialog.js +0 -78
- package/theme/lumo/vaadin-lit-confirm-dialog.d.ts +0 -3
- package/theme/lumo/vaadin-lit-confirm-dialog.js +0 -3
- package/theme/material/vaadin-confirm-dialog-styles.d.ts +0 -1
- package/theme/material/vaadin-confirm-dialog-styles.js +0 -41
- package/theme/material/vaadin-confirm-dialog.d.ts +0 -3
- package/theme/material/vaadin-confirm-dialog.js +0 -3
- package/theme/material/vaadin-lit-confirm-dialog.d.ts +0 -3
- package/theme/material/vaadin-lit-confirm-dialog.js +0 -3
- package/vaadin-lit-confirm-dialog.d.ts +0 -1
- package/vaadin-lit-confirm-dialog.js +0 -2
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2018 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
|
-
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
11
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
-
import { DialogBaseMixin } from '@vaadin/dialog/src/vaadin-dialog-base-mixin.js';
|
|
13
|
-
import { dialogOverlay } from '@vaadin/dialog/src/vaadin-dialog-styles.js';
|
|
14
|
-
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
15
|
-
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
16
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
-
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
18
|
-
import { ConfirmDialogBaseMixin } from './vaadin-confirm-dialog-base-mixin.js';
|
|
19
|
-
import { confirmDialogOverlay } from './vaadin-confirm-dialog-overlay-styles.js';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* An element used internally by `<vaadin-confirm-dialog>`. Not intended to be used separately.
|
|
23
|
-
*
|
|
24
|
-
* @customElement
|
|
25
|
-
* @extends HTMLElement
|
|
26
|
-
* @mixes DirMixin
|
|
27
|
-
* @mixes OverlayMixin
|
|
28
|
-
* @mixes ThemableMixin
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
class ConfirmDialogOverlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
32
|
-
static get is() {
|
|
33
|
-
return 'vaadin-confirm-dialog-overlay';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static get styles() {
|
|
37
|
-
return [overlayStyles, dialogOverlay, confirmDialogOverlay];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** @protected */
|
|
41
|
-
render() {
|
|
42
|
-
return html`
|
|
43
|
-
<div part="backdrop" id="backdrop" ?hidden="${!this.withBackdrop}"></div>
|
|
44
|
-
<div part="overlay" id="overlay" tabindex="0">
|
|
45
|
-
<section id="resizerContainer" class="resizer-container">
|
|
46
|
-
<header part="header"><slot name="header"></slot></header>
|
|
47
|
-
<div part="content" id="content">
|
|
48
|
-
<div part="message"><slot></slot></div>
|
|
49
|
-
</div>
|
|
50
|
-
<footer part="footer" role="toolbar">
|
|
51
|
-
<div part="cancel-button">
|
|
52
|
-
<slot name="cancel-button"></slot>
|
|
53
|
-
</div>
|
|
54
|
-
<div part="reject-button">
|
|
55
|
-
<slot name="reject-button"></slot>
|
|
56
|
-
</div>
|
|
57
|
-
<div part="confirm-button">
|
|
58
|
-
<slot name="confirm-button"></slot>
|
|
59
|
-
</div>
|
|
60
|
-
</footer>
|
|
61
|
-
</section>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @protected
|
|
68
|
-
* @override
|
|
69
|
-
*/
|
|
70
|
-
ready() {
|
|
71
|
-
super.ready();
|
|
72
|
-
|
|
73
|
-
// ConfirmDialog has header and footer but does not use renderers
|
|
74
|
-
this.setAttribute('has-header', '');
|
|
75
|
-
this.setAttribute('has-footer', '');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
defineCustomElement(ConfirmDialogOverlay);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* An element used internally by `<vaadin-confirm-dialog>`. Not intended to be used separately.
|
|
83
|
-
* @private
|
|
84
|
-
*/
|
|
85
|
-
class ConfirmDialogDialog extends ConfirmDialogBaseMixin(
|
|
86
|
-
DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(PolylitMixin(LitElement)))),
|
|
87
|
-
) {
|
|
88
|
-
static get is() {
|
|
89
|
-
return 'vaadin-confirm-dialog-dialog';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
static get styles() {
|
|
93
|
-
return css`
|
|
94
|
-
:host {
|
|
95
|
-
display: none;
|
|
96
|
-
}
|
|
97
|
-
`;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** @protected */
|
|
101
|
-
render() {
|
|
102
|
-
return html`
|
|
103
|
-
<vaadin-confirm-dialog-overlay
|
|
104
|
-
id="overlay"
|
|
105
|
-
.owner="${this}"
|
|
106
|
-
.opened="${this.opened}"
|
|
107
|
-
@opened-changed="${this._onOverlayOpened}"
|
|
108
|
-
@mousedown="${this._bringOverlayToFront}"
|
|
109
|
-
@touchstart="${this._bringOverlayToFront}"
|
|
110
|
-
theme="${ifDefined(this._theme)}"
|
|
111
|
-
.modeless="${this.modeless}"
|
|
112
|
-
.withBackdrop="${!this.modeless}"
|
|
113
|
-
?resizable="${this.resizable}"
|
|
114
|
-
aria-label="${this.ariaLabel}"
|
|
115
|
-
restore-focus-on-close
|
|
116
|
-
focus-trap
|
|
117
|
-
></vaadin-confirm-dialog-overlay>
|
|
118
|
-
`;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
defineCustomElement(ConfirmDialogDialog);
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2018 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/button/src/vaadin-lit-button.js';
|
|
7
|
-
import './vaadin-lit-confirm-dialog-overlay.js';
|
|
8
|
-
import { css, html, LitElement } from 'lit';
|
|
9
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
|
-
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
14
|
-
import { ConfirmDialogMixin } from './vaadin-confirm-dialog-mixin.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* LitElement based version of `<vaadin-confirm-dialog>` web component.
|
|
18
|
-
*
|
|
19
|
-
* ## Disclaimer
|
|
20
|
-
*
|
|
21
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
22
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
23
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
24
|
-
*
|
|
25
|
-
* @extends HTMLElement
|
|
26
|
-
* @mixes ConfirmDialogMixin
|
|
27
|
-
* @mixes ElementMixin
|
|
28
|
-
* @mixes ThemePropertyMixin
|
|
29
|
-
*/
|
|
30
|
-
class ConfirmDialog extends ConfirmDialogMixin(ElementMixin(ThemePropertyMixin(PolylitMixin(LitElement)))) {
|
|
31
|
-
static get is() {
|
|
32
|
-
return 'vaadin-confirm-dialog';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static get styles() {
|
|
36
|
-
return css`
|
|
37
|
-
:host,
|
|
38
|
-
[hidden] {
|
|
39
|
-
display: none !important;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** @protected */
|
|
45
|
-
render() {
|
|
46
|
-
return html`
|
|
47
|
-
<vaadin-confirm-dialog-dialog
|
|
48
|
-
id="dialog"
|
|
49
|
-
.opened="${this.opened}"
|
|
50
|
-
.overlayClass="${this.overlayClass}"
|
|
51
|
-
aria-label="${this.header || 'confirmation'}"
|
|
52
|
-
theme="${ifDefined(this._theme)}"
|
|
53
|
-
no-close-on-outside-click
|
|
54
|
-
.noCloseOnEsc="${this.noCloseOnEsc}"
|
|
55
|
-
.contentHeight="${this._contentHeight}"
|
|
56
|
-
.contentWidth="${this._contentWidth}"
|
|
57
|
-
@opened-changed="${this._onOpenedChanged}"
|
|
58
|
-
></vaadin-confirm-dialog-dialog>
|
|
59
|
-
|
|
60
|
-
<div hidden>
|
|
61
|
-
<slot name="header"></slot>
|
|
62
|
-
<slot></slot>
|
|
63
|
-
<slot name="cancel-button"></slot>
|
|
64
|
-
<slot name="reject-button"></slot>
|
|
65
|
-
<slot name="confirm-button"></slot>
|
|
66
|
-
</div>
|
|
67
|
-
`;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** @private */
|
|
71
|
-
_onOpenedChanged(event) {
|
|
72
|
-
this.opened = event.detail.value;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
defineCustomElement(ConfirmDialog);
|
|
77
|
-
|
|
78
|
-
export { ConfirmDialog };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { dialogOverlay } from '@vaadin/dialog/theme/material/vaadin-dialog-styles.js';
|
|
2
|
-
import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
registerStyles(
|
|
6
|
-
'vaadin-confirm-dialog-overlay',
|
|
7
|
-
[
|
|
8
|
-
overlay,
|
|
9
|
-
dialogOverlay,
|
|
10
|
-
css`
|
|
11
|
-
[part='overlay'] {
|
|
12
|
-
max-width: 100%;
|
|
13
|
-
min-width: 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[part='content'] {
|
|
17
|
-
min-width: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='header'] ::slotted(h3) {
|
|
21
|
-
margin-top: 0 !important;
|
|
22
|
-
margin-bottom: 0 !important;
|
|
23
|
-
margin-inline-start: 8px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[part='message'] {
|
|
27
|
-
width: 25em;
|
|
28
|
-
max-width: 100%;
|
|
29
|
-
margin-inline-end: 24px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@media (max-width: 360px) {
|
|
33
|
-
[part='footer'] {
|
|
34
|
-
flex-direction: column-reverse;
|
|
35
|
-
align-items: flex-end;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`,
|
|
39
|
-
],
|
|
40
|
-
{ moduleId: 'material-confirm-dialog-overlay' },
|
|
41
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-confirm-dialog.js';
|