@vaadin/dialog 23.1.0-alpha3 → 23.1.0-alpha4

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/dialog",
3
- "version": "23.1.0-alpha3",
3
+ "version": "23.1.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,18 +35,18 @@
35
35
  "dependencies": {
36
36
  "@open-wc/dedupe-mixin": "^1.3.0",
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/component-base": "23.1.0-alpha3",
39
- "@vaadin/vaadin-lumo-styles": "23.1.0-alpha3",
40
- "@vaadin/vaadin-material-styles": "23.1.0-alpha3",
41
- "@vaadin/vaadin-overlay": "23.1.0-alpha3",
42
- "@vaadin/vaadin-themable-mixin": "23.1.0-alpha3"
38
+ "@vaadin/component-base": "23.1.0-alpha4",
39
+ "@vaadin/vaadin-lumo-styles": "23.1.0-alpha4",
40
+ "@vaadin/vaadin-material-styles": "23.1.0-alpha4",
41
+ "@vaadin/vaadin-overlay": "23.1.0-alpha4",
42
+ "@vaadin/vaadin-themable-mixin": "23.1.0-alpha4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
- "@vaadin/polymer-legacy-adapter": "23.1.0-alpha3",
46
+ "@vaadin/polymer-legacy-adapter": "23.1.0-alpha4",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
- "@vaadin/text-area": "23.1.0-alpha3",
48
+ "@vaadin/text-area": "23.1.0-alpha4",
49
49
  "sinon": "^13.0.2"
50
50
  },
51
- "gitHead": "8c9e64e8dfa158dd52a9bf6da351ff038c88ca85"
51
+ "gitHead": "aacdb7fe09811894751f0378ff7fb66071892c71"
52
52
  }
@@ -6,7 +6,7 @@
6
6
  import { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  export declare function DialogDraggableMixin<T extends Constructor<HTMLElement>>(
9
- base: T
9
+ base: T,
10
10
  ): T & Constructor<DialogDraggableMixinClass>;
11
11
 
12
12
  export declare class DialogDraggableMixinClass {
@@ -28,19 +28,19 @@ export const DialogDraggableMixin = (superClass) =>
28
28
  draggable: {
29
29
  type: Boolean,
30
30
  value: false,
31
- reflectToAttribute: true
31
+ reflectToAttribute: true,
32
32
  },
33
33
 
34
34
  /** @private */
35
35
  _touchDevice: {
36
36
  type: Boolean,
37
- value: isTouch
37
+ value: isTouch,
38
38
  },
39
39
 
40
40
  /* TODO: Expose as a public property (check naming) */
41
41
  __dragHandleClassName: {
42
- type: String
43
- }
42
+ type: String,
43
+ },
44
44
  };
45
45
  }
46
46
 
@@ -82,7 +82,9 @@ export const DialogDraggableMixin = (superClass) =>
82
82
  });
83
83
 
84
84
  if ((isResizerContainer && !isResizerContainerScrollbar) || isContentPart || isDraggable) {
85
- !isDraggable && e.preventDefault();
85
+ if (!isDraggable) {
86
+ e.preventDefault();
87
+ }
86
88
  this._originalBounds = this.$.overlay.getBounds();
87
89
  const event = getMouseOrFirstTouchEvent(e);
88
90
  this._originalMouseCoords = { top: event.pageY, left: event.pageX };
@@ -6,7 +6,7 @@
6
6
  import { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  export declare function DialogResizableMixin<T extends Constructor<HTMLElement>>(
9
- base: T
9
+ base: T,
10
10
  ): T & Constructor<DialogResizableMixinClass>;
11
11
 
12
12
  export declare class DialogResizableMixinClass {
@@ -105,7 +105,7 @@ registerStyles(
105
105
  cursor: nwse-resize;
106
106
  }
107
107
  `,
108
- { moduleId: 'vaadin-dialog-resizable-overlay-styles' }
108
+ { moduleId: 'vaadin-dialog-resizable-overlay-styles' },
109
109
  );
110
110
 
111
111
  /**
@@ -122,8 +122,8 @@ export const DialogResizableMixin = (superClass) =>
122
122
  resizable: {
123
123
  type: Boolean,
124
124
  value: false,
125
- reflectToAttribute: true
126
- }
125
+ reflectToAttribute: true,
126
+ },
127
127
  };
128
128
  }
129
129
 
@@ -252,7 +252,7 @@ export const DialogResizableMixin = (superClass) =>
252
252
  const content = this.$.overlay.$.content;
253
253
  content.setAttribute(
254
254
  'style',
255
- 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;'
255
+ 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;',
256
256
  );
257
257
  const { width: contentWidth, height: contentHeight } = getComputedStyle(content);
258
258
  content.removeAttribute('style');
@@ -208,13 +208,13 @@ declare class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixi
208
208
  addEventListener<K extends keyof DialogEventMap>(
209
209
  type: K,
210
210
  listener: (this: Dialog, ev: DialogEventMap[K]) => void,
211
- options?: boolean | AddEventListenerOptions
211
+ options?: boolean | AddEventListenerOptions,
212
212
  ): void;
213
213
 
214
214
  removeEventListener<K extends keyof DialogEventMap>(
215
215
  type: K,
216
216
  listener: (this: Dialog, ev: DialogEventMap[K]) => void,
217
- options?: boolean | EventListenerOptions
217
+ options?: boolean | EventListenerOptions,
218
218
  ): void;
219
219
  }
220
220
 
@@ -15,10 +15,9 @@ import { DialogResizableMixin } from './vaadin-dialog-resizable-mixin.js';
15
15
  registerStyles(
16
16
  'vaadin-dialog-overlay',
17
17
  css`
18
- /* prefixing with the element tags to avoid styling confirm-dialog header part */
19
- header[part='header'],
18
+ [part='header'],
20
19
  [part='header-content'],
21
- footer[part='footer'] {
20
+ [part='footer'] {
22
21
  display: flex;
23
22
  align-items: center;
24
23
  flex-wrap: wrap;
@@ -27,10 +26,9 @@ registerStyles(
27
26
  z-index: 1;
28
27
  }
29
28
 
30
- :host(:is([has-title], [has-header])) ::slotted([slot='header']),
31
29
  ::slotted([slot='header-content']),
32
30
  ::slotted([slot='title']),
33
- :host([has-footer]) ::slotted([slot='footer']) {
31
+ ::slotted([slot='footer']) {
34
32
  display: contents;
35
33
  pointer-events: auto;
36
34
  }
@@ -39,19 +37,16 @@ registerStyles(
39
37
  flex: 1;
40
38
  }
41
39
 
42
- /* prefixing with the element tag to avoid styling confirm-dialog footer part */
43
40
  :host([has-title]) [part='header-content'],
44
- footer[part='footer'] {
41
+ [part='footer'] {
45
42
  justify-content: flex-end;
46
43
  }
47
44
 
48
- :host(:not([has-title]):not([has-header])) header[part='header'],
49
- :host(:not([has-title])) [part='title'] {
50
- display: none;
51
- }
52
-
53
- :host(:not([has-footer])) footer[part='footer'] {
54
- display: none;
45
+ :host(:not([has-title]):not([has-header])) [part='header'],
46
+ :host(:not([has-header])) [part='header-content'],
47
+ :host(:not([has-title])) [part='title'],
48
+ :host(:not([has-footer])) [part='footer'] {
49
+ display: none !important;
55
50
  }
56
51
 
57
52
  :host(:is([has-title], [has-header], [has-footer])) [part='content'] {
@@ -83,7 +78,7 @@ registerStyles(
83
78
  max-width: none;
84
79
  }
85
80
  `,
86
- { moduleId: 'vaadin-dialog-overlay-styles' }
81
+ { moduleId: 'vaadin-dialog-overlay-styles' },
87
82
  );
88
83
 
89
84
  let memoizedTemplate;
@@ -144,7 +139,7 @@ export class DialogOverlay extends OverlayElement {
144
139
  static get observers() {
145
140
  return [
146
141
  '_headerFooterRendererChange(headerRenderer, footerRenderer, opened)',
147
- '_headerTitleChanged(headerTitle, opened)'
142
+ '_headerTitleChanged(headerTitle, opened)',
148
143
  ];
149
144
  }
150
145
 
@@ -158,7 +153,7 @@ export class DialogOverlay extends OverlayElement {
158
153
 
159
154
  headerRenderer: Function,
160
155
 
161
- footerRenderer: Function
156
+ footerRenderer: Function,
162
157
  };
163
158
  }
164
159
 
@@ -502,7 +497,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
502
497
  opened: {
503
498
  type: Boolean,
504
499
  value: false,
505
- notify: true
500
+ notify: true,
506
501
  },
507
502
 
508
503
  /**
@@ -512,7 +507,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
512
507
  */
513
508
  noCloseOnOutsideClick: {
514
509
  type: Boolean,
515
- value: false
510
+ value: false,
516
511
  },
517
512
 
518
513
  /**
@@ -522,7 +517,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
522
517
  */
523
518
  noCloseOnEsc: {
524
519
  type: Boolean,
525
- value: false
520
+ value: false,
526
521
  },
527
522
 
528
523
  /**
@@ -532,7 +527,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
532
527
  */
533
528
  ariaLabel: {
534
529
  type: String,
535
- value: ''
530
+ value: '',
536
531
  },
537
532
 
538
533
  /**
@@ -591,8 +586,8 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
591
586
  */
592
587
  modeless: {
593
588
  type: Boolean,
594
- value: false
595
- }
589
+ value: false,
590
+ },
596
591
  };
597
592
  }
598
593
 
@@ -600,7 +595,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
600
595
  return [
601
596
  '_openedChanged(opened)',
602
597
  '_ariaLabelChanged(ariaLabel)',
603
- '_rendererChanged(renderer, headerRenderer, footerRenderer)'
598
+ '_rendererChanged(renderer, headerRenderer, footerRenderer)',
604
599
  ];
605
600
  }
606
601
 
@@ -31,20 +31,20 @@ const dialogOverlay = css`
31
31
  padding-top: 0;
32
32
  }
33
33
 
34
- :host(:is([has-header], [has-title])) [part='header'],
35
- :host([has-header]) [part='header-content'],
36
- :host([has-footer]) [part='footer'] {
34
+ [part='header'],
35
+ [part='header-content'],
36
+ [part='footer'] {
37
37
  gap: var(--lumo-space-xs) var(--lumo-space-s);
38
38
  line-height: var(--lumo-line-height-s);
39
39
  }
40
40
 
41
- :host(:is([has-header], [has-title])) [part='header'] {
41
+ [part='header'] {
42
42
  padding: var(--lumo-space-m);
43
43
  background-color: var(--lumo-base-color);
44
44
  border-radius: var(--lumo-border-radius-l) var(--lumo-border-radius-l) 0 0; /* Needed for Safari */
45
45
  }
46
46
 
47
- :host([has-footer]) [part='footer'] {
47
+ [part='footer'] {
48
48
  padding: var(--lumo-space-s) var(--lumo-space-m);
49
49
  background-color: var(--lumo-contrast-5pct);
50
50
  border-radius: 0 0 var(--lumo-border-radius-l) var(--lumo-border-radius-l); /* Needed for Safari */
@@ -63,7 +63,7 @@ const dialogOverlay = css`
63
63
  }
64
64
 
65
65
  @media (min-height: 320px) {
66
- :host(:is([has-header], [has-title])[overflow~='top']) [part='header'] {
66
+ :host([overflow~='top']) [part='header'] {
67
67
  box-shadow: 0 1px 0 0 var(--lumo-contrast-10pct);
68
68
  }
69
69
  }
@@ -16,7 +16,7 @@ const dialogOverlay = css`
16
16
  padding: 24px;
17
17
  }
18
18
 
19
- :host(:is([has-header], [has-title])) [part='header'] {
19
+ [part='header'] {
20
20
  padding: 16px;
21
21
  }
22
22
 
@@ -24,9 +24,9 @@ const dialogOverlay = css`
24
24
  padding-top: 0;
25
25
  }
26
26
 
27
- :host(:is([has-header], [has-title])) [part='header'],
28
- :host([has-header]) [part='header-content'],
29
- :host([has-footer]) [part='footer'] {
27
+ [part='header'],
28
+ [part='header-content'],
29
+ [part='footer'] {
30
30
  gap: 8px;
31
31
  line-height: 1.2;
32
32
  }
@@ -37,16 +37,16 @@ const dialogOverlay = css`
37
37
  margin-inline-start: 8px;
38
38
  }
39
39
 
40
- :host([has-footer]) [part='footer'] {
40
+ [part='footer'] {
41
41
  padding: 8px;
42
42
  }
43
43
 
44
44
  @media (min-height: 320px) {
45
- :host(:is([has-header], [has-title])[overflow~='top']) [part='header'] {
45
+ :host([overflow~='top']) [part='header'] {
46
46
  box-shadow: 0 1px 0 0 var(--material-divider-color);
47
47
  }
48
48
 
49
- :host([has-footer][overflow~='bottom']) [part='footer'] {
49
+ :host([overflow~='bottom']) [part='footer'] {
50
50
  box-shadow: 0 -1px 0 0 var(--material-divider-color);
51
51
  }
52
52
  }
@@ -58,5 +58,5 @@ const dialogOverlay = css`
58
58
  `;
59
59
 
60
60
  registerStyles('vaadin-dialog-overlay', [overlay, dialogOverlay], {
61
- moduleId: 'material-dialog'
61
+ moduleId: 'material-dialog',
62
62
  });