@quaffui/quaff 1.0.0-beta4 → 1.0.0-beta6
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/dist/components/button/QBtn.svelte +13 -7
- package/dist/components/button/docs.props.js +27 -3
- package/dist/components/button/props.d.ts +9 -2
- package/dist/components/expansion-item/QExpansionItem.scss +46 -0
- package/dist/components/expansion-item/QExpansionItem.svelte +306 -0
- package/dist/components/expansion-item/QExpansionItem.svelte.d.ts +21 -0
- package/dist/components/expansion-item/docs.d.ts +2 -0
- package/dist/components/expansion-item/docs.js +17 -0
- package/dist/components/expansion-item/docs.props.d.ts +3 -0
- package/dist/components/expansion-item/docs.props.js +280 -0
- package/dist/components/expansion-item/props.d.ts +129 -0
- package/dist/components/expansion-item/props.js +1 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/list/QItem.svelte +1 -0
- package/dist/css/_components.scss +1 -0
- package/dist/css/index.css +1 -1
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
let {
|
|
11
11
|
disabled = false,
|
|
12
12
|
variant,
|
|
13
|
+
color,
|
|
13
14
|
filled = false,
|
|
14
15
|
tonal = false,
|
|
15
16
|
outlined = false,
|
|
@@ -25,17 +26,18 @@
|
|
|
25
26
|
unelevated = false,
|
|
26
27
|
size = "md",
|
|
27
28
|
target,
|
|
29
|
+
tag,
|
|
28
30
|
onclick,
|
|
29
31
|
children,
|
|
30
32
|
...props
|
|
31
33
|
}: QBtnProps = $props();
|
|
32
34
|
|
|
33
|
-
let qBtn:
|
|
35
|
+
let qBtn: HTMLElement;
|
|
34
36
|
let qBtnLabel: HTMLSpanElement;
|
|
35
37
|
|
|
36
38
|
type QBtnMouseEvent = QEvent<MouseEvent, typeof qBtn>;
|
|
37
39
|
|
|
38
|
-
const
|
|
40
|
+
const computedTag = $derived(to ? "a" : tag || "button");
|
|
39
41
|
const qSize = $derived(useSize(size, "q-btn"));
|
|
40
42
|
|
|
41
43
|
const src = $derived(extractImgSrc(icon));
|
|
@@ -57,11 +59,15 @@
|
|
|
57
59
|
variant || boolVariant || "elevated",
|
|
58
60
|
);
|
|
59
61
|
|
|
60
|
-
const
|
|
62
|
+
const computedColor = $derived.by(() => {
|
|
61
63
|
if (disabled) {
|
|
62
64
|
return undefined;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
if (color) {
|
|
68
|
+
return color;
|
|
69
|
+
}
|
|
70
|
+
|
|
65
71
|
if (finalVariant === "filled") {
|
|
66
72
|
return "on-primary";
|
|
67
73
|
}
|
|
@@ -73,7 +79,7 @@
|
|
|
73
79
|
return "primary";
|
|
74
80
|
});
|
|
75
81
|
|
|
76
|
-
const colorVar = $derived(
|
|
82
|
+
const colorVar = $derived(computedColor && `var(--${computedColor})`);
|
|
77
83
|
|
|
78
84
|
const rippleColorVar = $derived(
|
|
79
85
|
rippleColor ? `var(--${rippleColor}, ${rippleColor})` : colorVar,
|
|
@@ -118,7 +124,7 @@
|
|
|
118
124
|
</script>
|
|
119
125
|
|
|
120
126
|
<svelte:element
|
|
121
|
-
this={
|
|
127
|
+
this={computedTag}
|
|
122
128
|
bind:this={qBtn}
|
|
123
129
|
use:ripple={{
|
|
124
130
|
disabled: noRipple || disabled,
|
|
@@ -138,9 +144,9 @@
|
|
|
138
144
|
style:--ripple-color={colorVar}
|
|
139
145
|
{target}
|
|
140
146
|
href={to}
|
|
141
|
-
role={
|
|
147
|
+
role={computedTag === "a" ? "button" : undefined}
|
|
142
148
|
aria-disabled={disabled || undefined}
|
|
143
|
-
tabindex={disabled ? -1 : 0}
|
|
149
|
+
tabindex={disabled ? -1 : props.tabindex || 0}
|
|
144
150
|
{onkeydown}
|
|
145
151
|
onclick={stopIfDisabled}
|
|
146
152
|
data-quaff
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
2
|
+
// @quaffHash 7a471ce6ecf43b530f7b11bbb7dcabc9
|
|
3
3
|
export const QBtnDocsProps = [
|
|
4
4
|
{
|
|
5
5
|
isArray: false,
|
|
@@ -13,6 +13,18 @@ export const QBtnDocsProps = [
|
|
|
13
13
|
description: "Puts the button in a disabled state, making it unclickable.",
|
|
14
14
|
default: "false",
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
isArray: false,
|
|
18
|
+
optional: true,
|
|
19
|
+
isSnippet: false,
|
|
20
|
+
name: "color",
|
|
21
|
+
type: {
|
|
22
|
+
name: "string",
|
|
23
|
+
isClickable: false,
|
|
24
|
+
},
|
|
25
|
+
description: "Sets the color of the button. If a color is specified, it overwrites all other color variants defined with boolean attributes.",
|
|
26
|
+
default: "",
|
|
27
|
+
},
|
|
16
28
|
{
|
|
17
29
|
isArray: false,
|
|
18
30
|
optional: true,
|
|
@@ -23,7 +35,7 @@ export const QBtnDocsProps = [
|
|
|
23
35
|
isClickable: true,
|
|
24
36
|
},
|
|
25
37
|
description: "Choose the variant for the button. If a variant is specified, it overwrites all other variants defined with boolean attributes. If no variant is specified using this prop or boolean props, the `elevated` variant will be used.",
|
|
26
|
-
default: "
|
|
38
|
+
default: "",
|
|
27
39
|
},
|
|
28
40
|
{
|
|
29
41
|
isArray: false,
|
|
@@ -211,13 +223,25 @@ export const QBtnDocsProps = [
|
|
|
211
223
|
description: 'For "a" (anchor) tag only, apply the target attribute.',
|
|
212
224
|
default: "undefined",
|
|
213
225
|
},
|
|
226
|
+
{
|
|
227
|
+
isArray: false,
|
|
228
|
+
optional: true,
|
|
229
|
+
isSnippet: false,
|
|
230
|
+
name: "tag",
|
|
231
|
+
type: {
|
|
232
|
+
name: "keyof HTMLElementTagNameMap",
|
|
233
|
+
isClickable: false,
|
|
234
|
+
},
|
|
235
|
+
description: "The tag to use for the button. If not specified, a button element will be used or, if `to` is specified, an anchor tag will be used.",
|
|
236
|
+
default: "",
|
|
237
|
+
},
|
|
214
238
|
{
|
|
215
239
|
isArray: false,
|
|
216
240
|
optional: true,
|
|
217
241
|
isSnippet: false,
|
|
218
242
|
name: "onclick",
|
|
219
243
|
type: {
|
|
220
|
-
name: "MouseEventHandler<
|
|
244
|
+
name: "MouseEventHandler<HTMLElement>",
|
|
221
245
|
isClickable: false,
|
|
222
246
|
},
|
|
223
247
|
description: "This event is emitted when the button is clicked.",
|
|
@@ -8,9 +8,12 @@ export interface QBtnProps extends HTMLAttributes<HTMLButtonElement> {
|
|
|
8
8
|
* @default false
|
|
9
9
|
*/
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the color of the button. If a color is specified, it overwrites all other color variants defined with boolean attributes.
|
|
13
|
+
*/
|
|
14
|
+
color?: string;
|
|
11
15
|
/**
|
|
12
16
|
* Choose the variant for the button. If a variant is specified, it overwrites all other variants defined with boolean attributes. If no variant is specified using this prop or boolean props, the `elevated` variant will be used.
|
|
13
|
-
* @default undefined
|
|
14
17
|
*/
|
|
15
18
|
variant?: QBtnVariantOptions;
|
|
16
19
|
/**
|
|
@@ -88,9 +91,13 @@ export interface QBtnProps extends HTMLAttributes<HTMLButtonElement> {
|
|
|
88
91
|
* @default undefined
|
|
89
92
|
*/
|
|
90
93
|
target?: HTMLAnchorAttributes["target"];
|
|
94
|
+
/**
|
|
95
|
+
* The tag to use for the button. If not specified, a button element will be used or, if `to` is specified, an anchor tag will be used.
|
|
96
|
+
*/
|
|
97
|
+
tag?: keyof HTMLElementTagNameMap;
|
|
91
98
|
/**
|
|
92
99
|
* This event is emitted when the button is clicked.
|
|
93
100
|
* @default undefined
|
|
94
101
|
*/
|
|
95
|
-
onclick?: MouseEventHandler<
|
|
102
|
+
onclick?: MouseEventHandler<HTMLElement>;
|
|
96
103
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
3
|
+
|
|
4
|
+
.q-expansion-item {
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 0;
|
|
7
|
+
|
|
8
|
+
&[aria-disabled] :is(.q-item__section, .q-item__section *) {
|
|
9
|
+
color: unset;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
& summary::marker,
|
|
13
|
+
& summary::-webkit-details-marker {
|
|
14
|
+
display: none;
|
|
15
|
+
content: "";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&::details-content {
|
|
19
|
+
transition: content-visibility var(--duration) allow-discrete;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__toggle-icon {
|
|
23
|
+
margin: 0;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
|
|
26
|
+
&:is(.q-btn) {
|
|
27
|
+
margin-right: -0.5rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:not(.q-btn),
|
|
31
|
+
&.q-btn .q-icon {
|
|
32
|
+
transition: rotate var(--duration);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--rotate:not(.q-btn),
|
|
36
|
+
&--rotate.q-btn .q-icon {
|
|
37
|
+
rotate: 180deg;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__content {
|
|
42
|
+
@include mixins.padding("x-md", "y-sm");
|
|
43
|
+
width: 100%;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { slide } from "svelte/transition";
|
|
3
|
+
import { goto } from "$app/navigation";
|
|
4
|
+
import { QBtn, QIcon, QItem, QItemSection } from "..";
|
|
5
|
+
import { isActivationKey, type QEvent } from "../../utils";
|
|
6
|
+
import type { QExpansionItemProps } from "./props";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
value = $bindable(false),
|
|
10
|
+
label,
|
|
11
|
+
icon,
|
|
12
|
+
caption,
|
|
13
|
+
expandIcon = "keyboard_arrow_down",
|
|
14
|
+
expandedIcon,
|
|
15
|
+
defaultOpened = false,
|
|
16
|
+
dense = false,
|
|
17
|
+
duration = 300,
|
|
18
|
+
hideExpandIcon = false,
|
|
19
|
+
toggleAriaLabel = "Open details",
|
|
20
|
+
expandIconToggle = false,
|
|
21
|
+
to,
|
|
22
|
+
href,
|
|
23
|
+
name,
|
|
24
|
+
noRotateExpandIcon = false,
|
|
25
|
+
disabled = false,
|
|
26
|
+
noRipple = false,
|
|
27
|
+
summary,
|
|
28
|
+
children,
|
|
29
|
+
onExpandIconClick,
|
|
30
|
+
...props
|
|
31
|
+
}: QExpansionItemProps = $props();
|
|
32
|
+
|
|
33
|
+
const id = $props.id();
|
|
34
|
+
const contentId = `q-expansion-item__content-${id}`;
|
|
35
|
+
const summaryId = `q-expansion-item__summary-${id}`;
|
|
36
|
+
|
|
37
|
+
const supportDetailsContent = CSS.supports(
|
|
38
|
+
"selector(details::details-content)",
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const summaryAttributes = $derived(
|
|
42
|
+
!supportDetailsContent
|
|
43
|
+
? {
|
|
44
|
+
id: summaryId,
|
|
45
|
+
"aria-expanded": value,
|
|
46
|
+
"aria-controls": contentId,
|
|
47
|
+
}
|
|
48
|
+
: {},
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const contentAttributes = $derived(
|
|
52
|
+
!supportDetailsContent
|
|
53
|
+
? {
|
|
54
|
+
id: contentId,
|
|
55
|
+
role: "region",
|
|
56
|
+
"aria-labelledby": summaryId,
|
|
57
|
+
}
|
|
58
|
+
: {},
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
let detailsEl = $state<HTMLDetailsElement>();
|
|
62
|
+
|
|
63
|
+
const iconAttributes = $derived({
|
|
64
|
+
[expandIconToggle ? "icon" : "name"]:
|
|
65
|
+
expandedIcon && value ? expandedIcon : expandIcon,
|
|
66
|
+
flat: expandIconToggle || undefined,
|
|
67
|
+
"aria-label": toggleAriaLabel,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
$effect.pre(() => {
|
|
71
|
+
if (defaultOpened) {
|
|
72
|
+
show();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
$effect(() => {
|
|
77
|
+
if (supportDetailsContent || !name || !value) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// If the browser does not support details content, we need to manually
|
|
82
|
+
// handle the group open state of the details elements
|
|
83
|
+
const parent = detailsEl?.parentElement;
|
|
84
|
+
|
|
85
|
+
if (!parent) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const group = parent.querySelectorAll("details[open]");
|
|
90
|
+
group.forEach((item) => {
|
|
91
|
+
if (item !== detailsEl) {
|
|
92
|
+
item.removeAttribute("open");
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export function toggle() {
|
|
98
|
+
value = !value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function show() {
|
|
102
|
+
value = true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function hide() {
|
|
106
|
+
value = false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function preventAndStop<T extends Event>(e: T) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function onclick(e: QEvent<MouseEvent, HTMLElement>) {
|
|
115
|
+
if (disabled) {
|
|
116
|
+
preventAndStop(e);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
props.onclick?.(e);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function onIconClick(e: QEvent<MouseEvent, HTMLElement>) {
|
|
124
|
+
if (disabled) {
|
|
125
|
+
preventAndStop(e);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
|
|
132
|
+
toggle();
|
|
133
|
+
onExpandIconClick?.(e);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function onkeydown(e: KeyboardEvent) {
|
|
137
|
+
if (disabled) {
|
|
138
|
+
preventAndStop(e);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (e.key === "Escape") {
|
|
143
|
+
detailsEl?.blur();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!isActivationKey(e)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (to || href) {
|
|
152
|
+
preventAndStop(e);
|
|
153
|
+
goto((to || href) as string);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (expandIconToggle) {
|
|
158
|
+
// If expandIconToggle is true, we don't want to toggle the expansion item
|
|
159
|
+
// as the icon should do it
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
toggle();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function onIconKeydown(e: KeyboardEvent) {
|
|
168
|
+
if (disabled) {
|
|
169
|
+
preventAndStop(e);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (e.key === "Escape") {
|
|
174
|
+
(e.target as HTMLElement)?.blur();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!isActivationKey(e) || !expandIconToggle) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
preventAndStop(e);
|
|
183
|
+
|
|
184
|
+
const clickEvent = new MouseEvent("click", {
|
|
185
|
+
relatedTarget: e.target as HTMLElement,
|
|
186
|
+
}) as QEvent<MouseEvent, HTMLElement>;
|
|
187
|
+
onIconClick(clickEvent);
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
{#snippet labelSnippet()}
|
|
192
|
+
{label}
|
|
193
|
+
{/snippet}
|
|
194
|
+
|
|
195
|
+
{#snippet captionSnippet()}
|
|
196
|
+
{caption}
|
|
197
|
+
{/snippet}
|
|
198
|
+
|
|
199
|
+
{#snippet content()}
|
|
200
|
+
{#if value}
|
|
201
|
+
<div
|
|
202
|
+
class="q-expansion-item__content"
|
|
203
|
+
{...contentAttributes}
|
|
204
|
+
transition:slide={{ duration }}
|
|
205
|
+
>
|
|
206
|
+
{@render children?.()}
|
|
207
|
+
</div>
|
|
208
|
+
{/if}
|
|
209
|
+
{/snippet}
|
|
210
|
+
|
|
211
|
+
<details
|
|
212
|
+
bind:this={detailsEl}
|
|
213
|
+
bind:open={value}
|
|
214
|
+
{...props}
|
|
215
|
+
{name}
|
|
216
|
+
aria-disabled={disabled || undefined}
|
|
217
|
+
class={["q-expansion-item", value && "q-expansion-item--expanded"]}
|
|
218
|
+
style:--duration="{duration}ms"
|
|
219
|
+
>
|
|
220
|
+
<summary
|
|
221
|
+
tabindex={-1}
|
|
222
|
+
{...summaryAttributes}
|
|
223
|
+
onmousedown={disabled ? preventAndStop : undefined}
|
|
224
|
+
>
|
|
225
|
+
{#if summary}
|
|
226
|
+
<QItem
|
|
227
|
+
{dense}
|
|
228
|
+
{to}
|
|
229
|
+
{href}
|
|
230
|
+
{disabled}
|
|
231
|
+
noRipple={expandIconToggle || noRipple}
|
|
232
|
+
clickable={!expandIconToggle}
|
|
233
|
+
{onclick}
|
|
234
|
+
{onkeydown}
|
|
235
|
+
>
|
|
236
|
+
{@render summary({ expanded: value, show, hide, toggle })}
|
|
237
|
+
</QItem>
|
|
238
|
+
{:else}
|
|
239
|
+
<QItem
|
|
240
|
+
{dense}
|
|
241
|
+
{to}
|
|
242
|
+
{href}
|
|
243
|
+
{disabled}
|
|
244
|
+
noRipple={expandIconToggle || noRipple}
|
|
245
|
+
clickable={!expandIconToggle}
|
|
246
|
+
{onclick}
|
|
247
|
+
{onkeydown}
|
|
248
|
+
>
|
|
249
|
+
{#if icon}
|
|
250
|
+
<QItemSection type="icon">
|
|
251
|
+
<QIcon name={icon} />
|
|
252
|
+
</QItemSection>
|
|
253
|
+
{/if}
|
|
254
|
+
|
|
255
|
+
{#if label || caption}
|
|
256
|
+
<QItemSection
|
|
257
|
+
headline={label ? labelSnippet : undefined}
|
|
258
|
+
line1={caption ? captionSnippet : undefined}
|
|
259
|
+
/>
|
|
260
|
+
{/if}
|
|
261
|
+
|
|
262
|
+
{#if !hideExpandIcon}
|
|
263
|
+
<QItemSection type="trailingIcon">
|
|
264
|
+
{#if expandIconToggle}
|
|
265
|
+
<QBtn
|
|
266
|
+
class={[
|
|
267
|
+
"q-expansion-item__toggle-icon",
|
|
268
|
+
value &&
|
|
269
|
+
!expandedIcon &&
|
|
270
|
+
!noRotateExpandIcon &&
|
|
271
|
+
"q-expansion-item__toggle-icon--rotate",
|
|
272
|
+
]}
|
|
273
|
+
{...iconAttributes}
|
|
274
|
+
{disabled}
|
|
275
|
+
color="on-surface"
|
|
276
|
+
tag="div"
|
|
277
|
+
tabindex={0}
|
|
278
|
+
onclick={onIconClick}
|
|
279
|
+
onkeydowncapture={onIconKeydown}
|
|
280
|
+
/>
|
|
281
|
+
{:else}
|
|
282
|
+
<QIcon
|
|
283
|
+
class={[
|
|
284
|
+
"q-expansion-item__toggle-icon",
|
|
285
|
+
value &&
|
|
286
|
+
!expandedIcon &&
|
|
287
|
+
!noRotateExpandIcon &&
|
|
288
|
+
"q-expansion-item__toggle-icon--rotate",
|
|
289
|
+
]}
|
|
290
|
+
{...iconAttributes}
|
|
291
|
+
/>
|
|
292
|
+
{/if}
|
|
293
|
+
</QItemSection>
|
|
294
|
+
{/if}
|
|
295
|
+
</QItem>
|
|
296
|
+
{/if}
|
|
297
|
+
</summary>
|
|
298
|
+
|
|
299
|
+
{#if supportDetailsContent}
|
|
300
|
+
{@render content()}
|
|
301
|
+
{/if}
|
|
302
|
+
</details>
|
|
303
|
+
|
|
304
|
+
{#if !supportDetailsContent}
|
|
305
|
+
{@render content()}
|
|
306
|
+
{/if}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
toggle?: () => void;
|
|
5
|
+
show?: () => void;
|
|
6
|
+
hide?: () => void;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
type QExpansionItemProps_ = typeof __propDef.props;
|
|
14
|
+
export { QExpansionItemProps_ as QExpansionItemProps };
|
|
15
|
+
export type QExpansionItemEvents = typeof __propDef.events;
|
|
16
|
+
export type QExpansionItemSlots = typeof __propDef.slots;
|
|
17
|
+
export default class QExpansionItem extends SvelteComponentTyped<QExpansionItemProps_, QExpansionItemEvents, QExpansionItemSlots> {
|
|
18
|
+
get toggle(): () => void;
|
|
19
|
+
get show(): () => void;
|
|
20
|
+
get hide(): () => void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QExpansionItemDocsProps, QExpansionItemDocsSnippets } from "./docs.props";
|
|
2
|
+
export const QExpansionItemDocs = {
|
|
3
|
+
name: "QExpansionItem",
|
|
4
|
+
description: "The QExpansionItem component allows users to create expandable/collapsible sections within a list or a card.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QExpansionItemDocsProps,
|
|
7
|
+
snippets: QExpansionItemDocsSnippets,
|
|
8
|
+
methods: [],
|
|
9
|
+
events: [
|
|
10
|
+
{
|
|
11
|
+
name: "click",
|
|
12
|
+
type: "(e: MouseEvent) => void",
|
|
13
|
+
description: "Emitted when the user clicks on the expansion item.",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
};
|