@vaadin/master-detail-layout 24.8.0-alpha6 → 24.8.0-alpha8
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/master-detail-layout",
|
|
3
|
-
"version": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha8",
|
|
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-
|
|
38
|
-
"@vaadin/component-base": "24.8.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "24.8.0-
|
|
40
|
-
"@vaadin/vaadin-material-styles": "24.8.0-
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-
|
|
37
|
+
"@vaadin/a11y-base": "24.8.0-alpha8",
|
|
38
|
+
"@vaadin/component-base": "24.8.0-alpha8",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha8",
|
|
40
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha8",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha8",
|
|
42
42
|
"lit": "^3.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
45
|
+
"@vaadin/chai-plugins": "24.8.0-alpha8",
|
|
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": "
|
|
53
|
+
"gitHead": "d914bb8f669d7e3d1981feb8eac05688ab9870b4"
|
|
54
54
|
}
|
|
@@ -15,13 +15,13 @@ export const transitionStyles = css`
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/* Default cross-fade animation */
|
|
18
|
-
vaadin-master-detail-layout {
|
|
18
|
+
vaadin-master-detail-layout[transition] {
|
|
19
19
|
view-transition-name: vaadin-master-detail-layout;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
::view-transition-group(vaadin-master-detail-layout) {
|
|
23
23
|
animation-duration: var(--vaadin-master-detail-layout-transition-duration, 300ms);
|
|
24
|
-
|
|
24
|
+
}
|
|
25
25
|
|
|
26
26
|
/* Overlay - horizontal - add */
|
|
27
27
|
|
|
@@ -122,18 +122,6 @@ declare class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ThemableMix
|
|
|
122
122
|
* @attr {boolean} no-animation
|
|
123
123
|
*/
|
|
124
124
|
noAnimation: boolean;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Sets the detail element to be displayed in the detail area and starts a
|
|
128
|
-
* view transition that animates adding, replacing or removing the detail
|
|
129
|
-
* area. During the view transition, the element is added to the DOM and
|
|
130
|
-
* assigned to the `detail` slot. Any previous detail element is removed.
|
|
131
|
-
* When passing null as the element, the current detail element is removed.
|
|
132
|
-
*
|
|
133
|
-
* If the browser does not support view transitions, the respective updates
|
|
134
|
-
* are applied immediately without starting a transition.
|
|
135
|
-
*/
|
|
136
|
-
protected _setDetail(detail: HTMLElement | null): Promise<void>;
|
|
137
125
|
}
|
|
138
126
|
|
|
139
127
|
declare global {
|
|
@@ -550,22 +550,22 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
|
|
|
550
550
|
* When passing null as the element, the current detail element is removed.
|
|
551
551
|
*
|
|
552
552
|
* If the browser does not support view transitions, the respective updates
|
|
553
|
-
* are applied immediately without starting a transition.
|
|
553
|
+
* are applied immediately without starting a transition. The transition can
|
|
554
|
+
* also be skipped using the `skipTransition` parameter.
|
|
554
555
|
*
|
|
555
556
|
* @param element the new detail element, or null to remove the current detail
|
|
557
|
+
* @param skipTransition whether to skip the transition
|
|
556
558
|
* @returns {Promise<void>}
|
|
557
559
|
* @protected
|
|
558
560
|
*/
|
|
559
|
-
_setDetail(element) {
|
|
561
|
+
_setDetail(element, skipTransition) {
|
|
560
562
|
// Don't start a transition if detail didn't change
|
|
561
563
|
const currentDetail = this.querySelector('[slot="detail"]');
|
|
562
564
|
if ((element || null) === currentDetail) {
|
|
563
|
-
return;
|
|
565
|
+
return Promise.resolve();
|
|
564
566
|
}
|
|
565
567
|
|
|
566
|
-
const
|
|
567
|
-
const transitionType = hasDetail && element ? 'replace' : hasDetail ? 'remove' : 'add';
|
|
568
|
-
return this._startTransition(transitionType, () => {
|
|
568
|
+
const updateSlot = () => {
|
|
569
569
|
// Remove old content
|
|
570
570
|
this.querySelectorAll('[slot="detail"]').forEach((oldElement) => oldElement.remove());
|
|
571
571
|
// Add new content
|
|
@@ -573,6 +573,18 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
|
|
|
573
573
|
element.setAttribute('slot', 'detail');
|
|
574
574
|
this.appendChild(element);
|
|
575
575
|
}
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
if (skipTransition) {
|
|
579
|
+
updateSlot();
|
|
580
|
+
return Promise.resolve();
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
const hasDetail = !!currentDetail;
|
|
584
|
+
const transitionType = hasDetail && element ? 'replace' : hasDetail ? 'remove' : 'add';
|
|
585
|
+
return this._startTransition(transitionType, () => {
|
|
586
|
+
// Update the DOM
|
|
587
|
+
updateSlot();
|
|
576
588
|
// Finish the transition
|
|
577
589
|
this._finishTransition();
|
|
578
590
|
});
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED