@vaadin/confirm-dialog 24.2.3 → 24.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/confirm-dialog",
3
- "version": "24.2.3",
3
+ "version": "24.3.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,9 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/vaadin-lit-confirm-dialog-overlay.js",
25
+ "!src/vaadin-lit-confirm-dialog.d.ts",
26
+ "!src/vaadin-lit-confirm-dialog.js",
24
27
  "theme",
25
28
  "vaadin-*.d.ts",
26
29
  "vaadin-*.js",
@@ -35,24 +38,25 @@
35
38
  "polymer"
36
39
  ],
37
40
  "dependencies": {
41
+ "@open-wc/dedupe-mixin": "^1.3.0",
38
42
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/button": "~24.2.3",
40
- "@vaadin/component-base": "~24.2.3",
41
- "@vaadin/dialog": "~24.2.3",
42
- "@vaadin/overlay": "~24.2.3",
43
- "@vaadin/vaadin-lumo-styles": "~24.2.3",
44
- "@vaadin/vaadin-material-styles": "~24.2.3",
45
- "@vaadin/vaadin-themable-mixin": "~24.2.3"
43
+ "@vaadin/button": "24.3.0-alpha10",
44
+ "@vaadin/component-base": "24.3.0-alpha10",
45
+ "@vaadin/dialog": "24.3.0-alpha10",
46
+ "@vaadin/overlay": "24.3.0-alpha10",
47
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha10",
48
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha10",
49
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha10"
46
50
  },
47
51
  "devDependencies": {
48
52
  "@esm-bundle/chai": "^4.3.4",
49
- "@vaadin/a11y-base": "~24.2.3",
50
- "@vaadin/testing-helpers": "^0.5.0",
53
+ "@vaadin/a11y-base": "24.3.0-alpha10",
54
+ "@vaadin/testing-helpers": "^0.6.0",
51
55
  "sinon": "^13.0.2"
52
56
  },
53
57
  "web-types": [
54
58
  "web-types.json",
55
59
  "web-types.lit.json"
56
60
  ],
57
- "gitHead": "72e557e765e72559e9c6a525e257d185ad186dc5"
61
+ "gitHead": "0271523d93fe5df0425ff64206886614f3c6f401"
58
62
  }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+
8
+ export declare function ConfirmDialogBaseMixin<T extends Constructor<HTMLElement>>(
9
+ base: T,
10
+ ): Constructor<ConfirmDialogBaseMixinClass> & T;
11
+
12
+ export declare class ConfirmDialogBaseMixin {
13
+ /**
14
+ * Set the `aria-label` attribute for assistive technologies like
15
+ * screen readers. An empty string value for this property (the
16
+ * default) means that the `aria-label` attribute is not present.
17
+ */
18
+ ariaLabel: string;
19
+
20
+ /**
21
+ * Height to be set on the overlay content.
22
+ */
23
+ contentHeight: string;
24
+
25
+ /**
26
+ * Width to be set on the overlay content.
27
+ */
28
+ contentWidth: string;
29
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2018 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * @polymerMixin
9
+ */
10
+ export const ConfirmDialogBaseMixin = (superClass) =>
11
+ class ConfirmDialogBaseMixinClass extends superClass {
12
+ static get properties() {
13
+ return {
14
+ /**
15
+ * Set the `aria-label` attribute for assistive technologies like
16
+ * screen readers. An empty string value for this property (the
17
+ * default) means that the `aria-label` attribute is not present.
18
+ */
19
+ ariaLabel: {
20
+ type: String,
21
+ value: '',
22
+ },
23
+
24
+ /**
25
+ * Height to be set on the overlay content.
26
+ */
27
+ contentHeight: {
28
+ type: String,
29
+ },
30
+
31
+ /**
32
+ * Width to be set on the overlay content.
33
+ */
34
+ contentWidth: {
35
+ type: String,
36
+ },
37
+ };
38
+ }
39
+
40
+ static get observers() {
41
+ return [
42
+ '__updateContentHeight(contentHeight, _overlayElement)',
43
+ '__updateContentWidth(contentWidth, _overlayElement)',
44
+ ];
45
+ }
46
+
47
+ /** @private */
48
+ __updateDimension(overlay, dimension, value) {
49
+ const prop = `--_vaadin-confirm-dialog-content-${dimension}`;
50
+
51
+ if (value) {
52
+ overlay.style.setProperty(prop, value);
53
+ } else {
54
+ overlay.style.removeProperty(prop);
55
+ }
56
+ }
57
+
58
+ /** @private */
59
+ __updateContentHeight(height, overlay) {
60
+ if (overlay) {
61
+ this.__updateDimension(overlay, 'height', height);
62
+ }
63
+ }
64
+
65
+ /** @private */
66
+ __updateContentWidth(width, overlay) {
67
+ if (overlay) {
68
+ this.__updateDimension(overlay, 'width', width);
69
+ }
70
+ }
71
+ };
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+
8
+ /*
9
+ * Fired when the `opened` property changes.
10
+ */
11
+ export type ConfirmDialogOpenedChangedEvent = CustomEvent<{ value: boolean }>;
12
+
13
+ export interface ConfirmDialogCustomEventMap {
14
+ 'opened-changed': ConfirmDialogOpenedChangedEvent;
15
+
16
+ confirm: Event;
17
+
18
+ cancel: Event;
19
+
20
+ reject: Event;
21
+ }
22
+
23
+ export type ConfirmDialogEventMap = ConfirmDialogCustomEventMap & HTMLElementEventMap;
24
+
25
+ export declare function ConfirmDialogMixin<T extends Constructor<HTMLElement>>(
26
+ base: T,
27
+ ): Constructor<ConfirmDialogMixinClass> & T;
28
+
29
+ export declare class ConfirmDialogMixinClass {
30
+ /**
31
+ * Sets the `aria-describedby` attribute of the overlay element.
32
+ *
33
+ * By default, all elements inside the message area are linked
34
+ * through the `aria-describedby` attribute. However, there are
35
+ * cases where this can confuse screen reader users (e.g. the dialog
36
+ * may present a password confirmation form). For these cases,
37
+ * it's better to associate only the elements that will help describe
38
+ * the confirmation dialog through this API.
39
+ * @attr {string} accessible-description-ref
40
+ */
41
+ accessibleDescriptionRef: string | null | undefined;
42
+
43
+ /**
44
+ * True if the overlay is currently displayed.
45
+ */
46
+ opened: boolean;
47
+
48
+ /**
49
+ * Set the confirmation dialog title.
50
+ */
51
+ header: string;
52
+
53
+ /**
54
+ * Set the message or confirmation question.
55
+ */
56
+ message: string | null | undefined;
57
+
58
+ /**
59
+ * Text displayed on confirm-button.
60
+ * This only affects the default button, custom slotted buttons will not be altered.
61
+ * @attr {string} confirm-text
62
+ */
63
+ confirmText: string;
64
+
65
+ /**
66
+ * Theme for a confirm-button.
67
+ * This only affects the default button, custom slotted buttons will not be altered.
68
+ * @attr {string} confirm-theme
69
+ */
70
+ confirmTheme: string;
71
+
72
+ /**
73
+ * Set to true to disable closing dialog on Escape press
74
+ * @attr {boolean} no-close-on-esc
75
+ */
76
+ noCloseOnEsc: boolean;
77
+
78
+ /**
79
+ * Whether to show reject button or not.
80
+ * @attr {boolean} reject-button-visible
81
+ */
82
+ rejectButtonVisible: boolean;
83
+
84
+ /**
85
+ * Text displayed on reject-button.
86
+ * This only affects the default button, custom slotted buttons will not be altered.
87
+ * @attr {string} reject-text
88
+ */
89
+ rejectText: string;
90
+
91
+ /**
92
+ * Theme for a reject-button.
93
+ * This only affects the default button, custom slotted buttons will not be altered.
94
+ * @attr {string} reject-theme
95
+ */
96
+ rejectTheme: string;
97
+
98
+ /**
99
+ * Whether to show cancel button or not.
100
+ * @attr {boolean} cancel-button-visible
101
+ */
102
+ cancelButtonVisible: boolean;
103
+
104
+ /**
105
+ * Text displayed on cancel-button.
106
+ * This only affects the default button, custom slotted buttons will not be altered.
107
+ * @attr {string} cancel-text
108
+ */
109
+ cancelText: string;
110
+
111
+ /**
112
+ * Theme for a cancel-button.
113
+ * This only affects the default button, custom slotted buttons will not be altered.
114
+ * @attr {string} cancel-theme
115
+ */
116
+ cancelTheme: string;
117
+
118
+ /**
119
+ * A space-delimited list of CSS class names
120
+ * to set on the underlying overlay element.
121
+ *
122
+ * @attr {string} overlay-class
123
+ */
124
+ overlayClass: string;
125
+ }