@vaadin/confirm-dialog 23.0.0-beta4 → 23.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/confirm-dialog",
3
- "version": "23.0.0-beta4",
3
+ "version": "23.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,19 +34,19 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/button": "23.0.0-beta4",
38
- "@vaadin/component-base": "23.0.0-beta4",
39
- "@vaadin/dialog": "23.0.0-beta4",
37
+ "@vaadin/button": "^23.0.0",
38
+ "@vaadin/component-base": "^23.0.0",
39
+ "@vaadin/dialog": "^23.0.0",
40
40
  "@vaadin/vaadin-license-checker": "^2.1.0",
41
- "@vaadin/vaadin-lumo-styles": "23.0.0-beta4",
42
- "@vaadin/vaadin-material-styles": "23.0.0-beta4",
43
- "@vaadin/vaadin-overlay": "23.0.0-beta4",
44
- "@vaadin/vaadin-themable-mixin": "23.0.0-beta4"
41
+ "@vaadin/vaadin-lumo-styles": "^23.0.0",
42
+ "@vaadin/vaadin-material-styles": "^23.0.0",
43
+ "@vaadin/vaadin-overlay": "^23.0.0",
44
+ "@vaadin/vaadin-themable-mixin": "^23.0.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@esm-bundle/chai": "^4.3.4",
48
48
  "@vaadin/testing-helpers": "^0.3.2",
49
49
  "sinon": "^9.2.1"
50
50
  },
51
- "gitHead": "d0b447f1c31ca4256a5e26f2dcd27784447ff79b"
51
+ "gitHead": "e5ce38429a14de1448d732614e359fb32b2c42e0"
52
52
  }
@@ -90,12 +90,14 @@ declare class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(HT
90
90
 
91
91
  /**
92
92
  * Text displayed on confirm-button.
93
+ * This only affects the default button, custom slotted buttons will not be altered.
93
94
  * @attr {string} confirm-text
94
95
  */
95
96
  confirmText: string;
96
97
 
97
98
  /**
98
99
  * Theme for a confirm-button.
100
+ * This only affects the default button, custom slotted buttons will not be altered.
99
101
  * @attr {string} confirm-theme
100
102
  */
101
103
  confirmTheme: string;
@@ -113,12 +115,14 @@ declare class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(HT
113
115
 
114
116
  /**
115
117
  * Text displayed on reject-button.
118
+ * This only affects the default button, custom slotted buttons will not be altered.
116
119
  * @attr {string} reject-text
117
120
  */
118
121
  rejectText: string;
119
122
 
120
123
  /**
121
124
  * Theme for a reject-button.
125
+ * This only affects the default button, custom slotted buttons will not be altered.
122
126
  * @attr {string} reject-theme
123
127
  */
124
128
  rejectTheme: string;
@@ -130,12 +134,14 @@ declare class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(HT
130
134
 
131
135
  /**
132
136
  * Text displayed on cancel-button.
137
+ * This only affects the default button, custom slotted buttons will not be altered.
133
138
  * @attr {string} cancel-text
134
139
  */
135
140
  cancelText: string;
136
141
 
137
142
  /**
138
143
  * Theme for a cancel-button.
144
+ * This only affects the default button, custom slotted buttons will not be altered.
139
145
  * @attr {string} cancel-theme
140
146
  */
141
147
  cancelTheme: string;
@@ -131,6 +131,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
131
131
 
132
132
  /**
133
133
  * Text displayed on confirm-button.
134
+ * This only affects the default button, custom slotted buttons will not be altered.
134
135
  * @attr {string} confirm-text
135
136
  * @type {string}
136
137
  */
@@ -141,6 +142,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
141
142
 
142
143
  /**
143
144
  * Theme for a confirm-button.
145
+ * This only affects the default button, custom slotted buttons will not be altered.
144
146
  * @attr {string} confirm-theme
145
147
  * @type {string}
146
148
  */
@@ -171,6 +173,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
171
173
 
172
174
  /**
173
175
  * Text displayed on reject-button.
176
+ * This only affects the default button, custom slotted buttons will not be altered.
174
177
  * @attr {string} reject-text
175
178
  * @type {string}
176
179
  */
@@ -181,6 +184,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
181
184
 
182
185
  /**
183
186
  * Theme for a reject-button.
187
+ * This only affects the default button, custom slotted buttons will not be altered.
184
188
  * @attr {string} reject-theme
185
189
  * @type {string}
186
190
  */
@@ -201,6 +205,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
201
205
 
202
206
  /**
203
207
  * Text displayed on cancel-button.
208
+ * This only affects the default button, custom slotted buttons will not be altered.
204
209
  * @attr {string} cancel-text
205
210
  * @type {string}
206
211
  */
@@ -211,6 +216,7 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
211
216
 
212
217
  /**
213
218
  * Theme for a cancel-button.
219
+ * This only affects the default button, custom slotted buttons will not be altered.
214
220
  * @attr {string} cancel-theme
215
221
  * @type {string}
216
222
  */
@@ -305,16 +311,20 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
305
311
  const button = document.createElement('vaadin-button');
306
312
  button.setAttribute('theme', this.cancelTheme);
307
313
  button.textContent = this.cancelText;
314
+ button._isDefaultButton = true;
308
315
  return button;
309
316
  },
310
317
  'reject-button': () => {
311
318
  const button = document.createElement('vaadin-button');
312
319
  button.setAttribute('theme', this.rejectTheme);
313
320
  button.textContent = this.rejectText;
321
+ button._isDefaultButton = true;
314
322
  return button;
315
323
  },
316
324
  'confirm-button': () => {
317
- return document.createElement('vaadin-button');
325
+ const button = document.createElement('vaadin-button');
326
+ button._isDefaultButton = true;
327
+ return button;
318
328
  }
319
329
  };
320
330
  }
@@ -430,15 +440,17 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
430
440
  /** @private */
431
441
  __updateCancelButton(button, cancelText, cancelTheme, showCancel) {
432
442
  if (button) {
433
- button.textContent = cancelText;
434
- button.setAttribute('theme', cancelTheme);
443
+ if (button._isDefaultButton) {
444
+ button.textContent = cancelText;
445
+ button.setAttribute('theme', cancelTheme);
446
+ }
435
447
  button.toggleAttribute('hidden', !showCancel);
436
448
  }
437
449
  }
438
450
 
439
451
  /** @private */
440
452
  __updateConfirmButton(button, confirmText, confirmTheme) {
441
- if (button) {
453
+ if (button && button._isDefaultButton) {
442
454
  button.textContent = confirmText;
443
455
  button.setAttribute('theme', confirmTheme);
444
456
  }
@@ -463,8 +475,10 @@ class ConfirmDialog extends SlotMixin(ElementMixin(ThemePropertyMixin(PolymerEle
463
475
  /** @private */
464
476
  __updateRejectButton(button, rejectText, rejectTheme, showReject) {
465
477
  if (button) {
466
- button.textContent = rejectText;
467
- button.setAttribute('theme', rejectTheme);
478
+ if (button._isDefaultButton) {
479
+ button.textContent = rejectText;
480
+ button.setAttribute('theme', rejectTheme);
481
+ }
468
482
  button.toggleAttribute('hidden', !showReject);
469
483
  }
470
484
  }