@vaadin/master-detail-layout 24.8.0-alpha7 → 24.8.0-alpha9

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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A web component for building UIs with a master (or primary) area and a detail (or secondary) area.
4
4
 
5
+ > ⚠️ This component is experimental and the API may change. In order to use it, enable the feature flag by setting `window.Vaadin.featureFlags.masterDetailLayoutComponent = true`.
6
+
5
7
  ```html
6
8
  <vaadin-master-detail-layout>
7
9
  <div>Master content</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/master-detail-layout",
3
- "version": "24.8.0-alpha7",
3
+ "version": "24.8.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,15 +34,15 @@
34
34
  "web-component"
35
35
  ],
36
36
  "dependencies": {
37
- "@vaadin/a11y-base": "24.8.0-alpha7",
38
- "@vaadin/component-base": "24.8.0-alpha7",
39
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha7",
40
- "@vaadin/vaadin-material-styles": "24.8.0-alpha7",
41
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha7",
37
+ "@vaadin/a11y-base": "24.8.0-alpha9",
38
+ "@vaadin/component-base": "24.8.0-alpha9",
39
+ "@vaadin/vaadin-lumo-styles": "24.8.0-alpha9",
40
+ "@vaadin/vaadin-material-styles": "24.8.0-alpha9",
41
+ "@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
42
42
  "lit": "^3.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@vaadin/chai-plugins": "24.8.0-alpha7",
45
+ "@vaadin/chai-plugins": "24.8.0-alpha9",
46
46
  "@vaadin/testing-helpers": "^1.1.0",
47
47
  "sinon": "^18.0.0"
48
48
  },
@@ -50,5 +50,5 @@
50
50
  "web-types.json",
51
51
  "web-types.lit.json"
52
52
  ],
53
- "gitHead": "7e65e14cbdcc372ab89620ba00e04251291d3c63"
53
+ "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
54
54
  }
@@ -133,6 +133,28 @@ export const transitionStyles = css`
133
133
  }
134
134
  }
135
135
 
136
+ /* Stack - horizontal - viewport - add */
137
+
138
+ vaadin-master-detail-layout[stack][orientation='horizontal'][containment='viewport'][transition='add'] {
139
+ view-transition-name: vaadin-master-detail-layout-stack-horizontal-viewport-add;
140
+ }
141
+
142
+ ::view-transition-new(vaadin-master-detail-layout-stack-horizontal-viewport-add) {
143
+ animation: var(--vaadin-master-detail-layout-transition-duration, 300ms) ease both
144
+ vaadin-master-detail-layout-stack-horizontal-add-new;
145
+ }
146
+
147
+ /* Stack - horizontal - viewport - remove */
148
+
149
+ vaadin-master-detail-layout[stack][orientation='horizontal'][containment='viewport'][transition='remove'] {
150
+ view-transition-name: vaadin-master-detail-layout-stack-horizontal-viewport-remove;
151
+ }
152
+
153
+ ::view-transition-old(vaadin-master-detail-layout-stack-horizontal-viewport-remove) {
154
+ animation: var(--vaadin-master-detail-layout-transition-duration, 300ms) ease both
155
+ vaadin-master-detail-layout-stack-horizontal-remove-old;
156
+ }
157
+
136
158
  /* Overlay - vertical - add */
137
159
 
138
160
  vaadin-master-detail-layout[overlay][orientation='vertical'][transition='add']::part(detail) {
@@ -242,4 +264,26 @@ export const transitionStyles = css`
242
264
  opacity: 0;
243
265
  }
244
266
  }
267
+
268
+ /* Stack - vertical - viewport - add */
269
+
270
+ vaadin-master-detail-layout[stack][orientation='vertical'][containment='viewport'][transition='add'] {
271
+ view-transition-name: vaadin-master-detail-layout-stack-vertical-viewport-add;
272
+ }
273
+
274
+ ::view-transition-new(vaadin-master-detail-layout-stack-vertical-viewport-add) {
275
+ animation: var(--vaadin-master-detail-layout-transition-duration, 300ms) ease both
276
+ vaadin-master-detail-layout-stack-vertical-add-new;
277
+ }
278
+
279
+ /* Stack - vertical - viewport - remove */
280
+
281
+ vaadin-master-detail-layout[stack][orientation='vertical'][containment='viewport'][transition='remove'] {
282
+ view-transition-name: vaadin-master-detail-layout-stack-vertical-viewport-remove;
283
+ }
284
+
285
+ ::view-transition-old(vaadin-master-detail-layout-stack-vertical-viewport-remove) {
286
+ animation: var(--vaadin-master-detail-layout-transition-duration, 300ms) ease both
287
+ vaadin-master-detail-layout-stack-vertical-remove-old;
288
+ }
245
289
  `;
@@ -94,6 +94,11 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
94
94
  :host([overlay][has-detail]) [part='backdrop'] {
95
95
  display: block;
96
96
  inset: 0;
97
+ z-index: 1;
98
+ }
99
+
100
+ :host([overlay]) [part='detail'] {
101
+ z-index: 1;
97
102
  }
98
103
 
99
104
  :host([overlay][orientation='horizontal']) [part='detail'] {
@@ -353,9 +358,24 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
353
358
  reflectToAttribute: true,
354
359
  sync: true,
355
360
  },
361
+
362
+ /**
363
+ * When true, the component has the detail content provided.
364
+ * @protected
365
+ */
366
+ _hasDetail: {
367
+ type: Boolean,
368
+ attribute: 'has-detail',
369
+ reflectToAttribute: true,
370
+ sync: true,
371
+ },
356
372
  };
357
373
  }
358
374
 
375
+ static get experimental() {
376
+ return true;
377
+ }
378
+
359
379
  /** @override */
360
380
  get slotStyles() {
361
381
  return [transitionStyles];
@@ -365,7 +385,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
365
385
  render() {
366
386
  return html`
367
387
  <div part="backdrop"></div>
368
- <div id="master" part="master" ?inert="${this._overlay && this.containment === 'layout'}">
388
+ <div id="master" part="master" ?inert="${this._hasDetail && this._overlay && this.containment === 'layout'}">
369
389
  <slot></slot>
370
390
  </div>
371
391
  <div
@@ -383,7 +403,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
383
403
  __onDetailSlotChange(e) {
384
404
  const children = e.target.assignedNodes();
385
405
 
386
- this.toggleAttribute('has-detail', children.length > 0);
406
+ this._hasDetail = children.length > 0;
387
407
  this.__detectLayoutMode();
388
408
 
389
409
  // Move focus to the detail area when it is added to the DOM,
@@ -477,15 +497,20 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
477
497
  }
478
498
 
479
499
  if (this.stackThreshold != null) {
500
+ // Set stack to true to disable masterMinSize and detailMinSize
501
+ // that would affect size measurements below when in split mode
502
+ this._stack = true;
503
+
480
504
  const threshold = this.__getStackThresholdInPixels();
481
505
  const size = this.orientation === 'vertical' ? this.offsetHeight : this.offsetWidth;
482
- if (size <= threshold) {
483
- this._stack = true;
506
+ if (size > threshold) {
507
+ this._stack = false;
508
+ } else {
484
509
  return;
485
510
  }
486
511
  }
487
512
 
488
- if (!this.hasAttribute('has-detail')) {
513
+ if (!this._hasDetail) {
489
514
  return;
490
515
  }
491
516
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/master-detail-layout",
4
- "version": "24.8.0-alpha7",
4
+ "version": "24.8.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/master-detail-layout",
4
- "version": "24.8.0-alpha7",
4
+ "version": "24.8.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {