vira 29.5.1 → 29.5.3
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.
|
@@ -13,4 +13,4 @@ export declare const ViraCollapsibleWrapper: import("element-vir").DeclarativeEl
|
|
|
13
13
|
contentHeight: number;
|
|
14
14
|
}, {
|
|
15
15
|
expandChange: import("element-vir").DefineEvent<boolean>;
|
|
16
|
-
}, "vira-collapsible-wrapper-
|
|
16
|
+
}, "vira-collapsible-wrapper-expand-on-print", "vira-collapsible-wrapper-", readonly ["header"], readonly []>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css, defineElementEvent, html, listen, onResize } from 'element-vir';
|
|
2
|
-
import { noNativeFormStyles, viraAnimationDurations } from '../styles/index.js';
|
|
1
|
+
import { classMap, css, defineElementEvent, html, listen, onResize } from 'element-vir';
|
|
2
|
+
import { noNativeFormStyles, noUserSelect, viraAnimationDurations } from '../styles/index.js';
|
|
3
3
|
import { defineViraElement } from './define-vira-element.js';
|
|
4
4
|
/**
|
|
5
5
|
* A wrapper element that can collapse and expand to fit its content dynamically and efficiently.
|
|
@@ -16,7 +16,6 @@ export const ViraCollapsibleWrapper = defineViraElement()({
|
|
|
16
16
|
};
|
|
17
17
|
},
|
|
18
18
|
hostClasses: {
|
|
19
|
-
'vira-collapsible-wrapper-expanded': ({ inputs }) => inputs.expanded,
|
|
20
19
|
'vira-collapsible-wrapper-expand-on-print': ({ inputs }) => !!inputs.expandOnPrint,
|
|
21
20
|
},
|
|
22
21
|
slotNames: ['header'],
|
|
@@ -41,9 +40,10 @@ export const ViraCollapsibleWrapper = defineViraElement()({
|
|
|
41
40
|
.collapsing-element {
|
|
42
41
|
transition: height ${viraAnimationDurations['vira-pretty-animation-duration'].value};
|
|
43
42
|
overflow: hidden;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
|
|
44
|
+
&.collapsed {
|
|
45
|
+
${noUserSelect}
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
@media print {
|
|
@@ -76,7 +76,13 @@ export const ViraCollapsibleWrapper = defineViraElement()({
|
|
|
76
76
|
<slot name=${slotNames.header}>Header</slot>
|
|
77
77
|
</button>
|
|
78
78
|
|
|
79
|
-
<div
|
|
79
|
+
<div
|
|
80
|
+
class="collapsing-element ${classMap({
|
|
81
|
+
collapsed: !inputs.expanded,
|
|
82
|
+
})}"
|
|
83
|
+
style=${collapsingStyles}
|
|
84
|
+
disabled="disabled"
|
|
85
|
+
>
|
|
80
86
|
<div
|
|
81
87
|
${onResize(({ contentRect }) => {
|
|
82
88
|
updateState({ contentHeight: contentRect.height });
|