@quidgest/ui 0.18.0 → 0.19.0
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/CHANGELOG.md +79 -0
- package/dist/json/api.json +136 -129
- package/dist/manifest/components.json +2 -1
- package/dist/ui.css +242 -155
- package/dist/ui.esm.js +365 -343
- package/dist/ui.js +121 -99
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +121 -99
- package/dist/ui.scss +225 -151
- package/esm/components/QGrid/QCol.vue.js +1 -1
- package/esm/components/{QGroupBox/QGroupBox.d.ts → QSection/QSection.d.ts} +4 -4
- package/esm/components/QSection/QSection.d.ts.map +1 -0
- package/esm/components/{QGroupBox/QGroupBox.vue.js → QSection/QSection.vue.js} +8 -8
- package/esm/components/QSection/QSection2.vue.js +5 -0
- package/esm/components/{QGroupBox → QSection}/index.d.ts +8 -8
- package/esm/components/QSection/index.d.ts.map +1 -0
- package/esm/components/QSection/index.js +6 -0
- package/esm/components/QSection/types.d.ts +32 -0
- package/esm/components/QSection/types.d.ts.map +1 -0
- package/esm/components/QSidebar/QSidebar.d.ts +53 -6
- package/esm/components/QSidebar/QSidebar.d.ts.map +1 -1
- package/esm/components/QSidebar/QSidebar.vue.js +76 -106
- package/esm/components/QSidebar/QSidebarAnchor.d.ts +24 -210
- package/esm/components/QSidebar/QSidebarAnchor.d.ts.map +1 -1
- package/esm/components/QSidebar/QSidebarAnchor.vue.js +47 -59
- package/esm/components/QSidebar/QSidebarItem.d.ts +213 -0
- package/esm/components/QSidebar/QSidebarItem.d.ts.map +1 -0
- package/esm/components/QSidebar/QSidebarItem.vue.js +130 -0
- package/esm/components/QSidebar/QSidebarItem2.vue.js +5 -0
- package/esm/components/QSidebar/QSidebarPanel.d.ts +1 -7
- package/esm/components/QSidebar/QSidebarPanel.d.ts.map +1 -1
- package/esm/components/QSidebar/QSidebarPanel.vue.js +4 -10
- package/esm/components/QSidebar/context.d.ts +108 -0
- package/esm/components/QSidebar/context.d.ts.map +1 -0
- package/esm/components/QSidebar/context.js +4 -0
- package/esm/components/QSidebar/index.d.ts +166 -8
- package/esm/components/QSidebar/index.d.ts.map +1 -1
- package/esm/components/QSidebar/index.js +3 -2
- package/esm/components/QSidebar/types.d.ts +77 -42
- package/esm/components/QSidebar/types.d.ts.map +1 -1
- package/esm/components/QTabs/QTab.d.ts +1 -0
- package/esm/components/QTabs/QTab.d.ts.map +1 -1
- package/esm/components/QTabs/QTab.vue.js +2 -1
- package/esm/components/QTabs/QTabs.d.ts +2 -0
- package/esm/components/QTabs/QTabs.d.ts.map +1 -1
- package/esm/components/QTabs/QTabs.vue.js +125 -46
- package/esm/components/QTabs/context.d.ts +10 -3
- package/esm/components/QTabs/context.d.ts.map +1 -1
- package/esm/components/QTabs/index.d.ts +2 -0
- package/esm/components/QTabs/index.d.ts.map +1 -1
- package/esm/components/QTabs/types.d.ts +3 -1
- package/esm/components/QTabs/types.d.ts.map +1 -1
- package/esm/components/index.d.ts +1 -1
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +41 -40
- package/esm/index.d.ts +2 -1
- package/package.json +7 -6
- package/esm/components/QGroupBox/QGroupBox.d.ts.map +0 -1
- package/esm/components/QGroupBox/QGroupBox2.vue.js +0 -5
- package/esm/components/QGroupBox/index.d.ts.map +0 -1
- package/esm/components/QGroupBox/index.js +0 -6
- package/esm/components/QGroupBox/types.d.ts +0 -32
- package/esm/components/QGroupBox/types.d.ts.map +0 -1
|
@@ -1,80 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { QToggle as t } from "../QToggle/index.js";
|
|
3
|
-
import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, nextTick as u, normalizeStyle as d, openBlock as f, ref as p, renderList as m, renderSlot as h, unref as g, useModel as _, watch as v, withCtx as y } from "vue";
|
|
1
|
+
import { computed as e, createElementBlock as t, createElementVNode as n, defineComponent as r, nextTick as i, normalizeStyle as a, openBlock as o, ref as s, useTemplateRef as c, watch as l } from "vue";
|
|
4
2
|
//#region src/components/QSidebar/QSidebarAnchor.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
3
|
+
var u = {
|
|
4
|
+
ref: "items",
|
|
5
|
+
class: "q-sidebar__items"
|
|
6
|
+
}, d = /*@__PURE__*/ r({
|
|
6
7
|
__name: "QSidebarAnchor",
|
|
7
|
-
props:
|
|
8
|
-
panels: {},
|
|
8
|
+
props: {
|
|
9
9
|
anchorWidth: {},
|
|
10
|
-
showLabels: { type: Boolean }
|
|
11
|
-
}, {
|
|
12
10
|
modelValue: {},
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
items: {}
|
|
12
|
+
},
|
|
13
|
+
setup(r, { expose: d }) {
|
|
14
|
+
let f = r;
|
|
15
|
+
d({ itemsEl: c("items") });
|
|
16
|
+
let p = e(() => {
|
|
17
|
+
if (f.anchorWidth !== void 0) return { width: `${f.anchorWidth}px` };
|
|
18
|
+
}), m = s({
|
|
18
19
|
height: "0",
|
|
19
20
|
transform: "translateY(0)",
|
|
20
21
|
opacity: "0",
|
|
21
22
|
transition: "transform 0.3s ease, height 0.3s ease, opacity 0.2s ease"
|
|
22
|
-
})
|
|
23
|
-
function
|
|
24
|
-
|
|
23
|
+
});
|
|
24
|
+
function h(e) {
|
|
25
|
+
let t = e.anchorRef.value;
|
|
26
|
+
return t ? "$el" in t ? t.$el : t : null;
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
function g() {
|
|
29
|
+
m.value = {
|
|
30
|
+
...m.value,
|
|
31
|
+
opacity: "0",
|
|
32
|
+
height: "0"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function _() {
|
|
36
|
+
if (!f.modelValue) {
|
|
37
|
+
g();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let e = f.items.findIndex((e) => e.value === f.modelValue);
|
|
41
|
+
if (e === -1) {
|
|
42
|
+
g();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let t = h(f.items[e]);
|
|
46
|
+
if (!t) {
|
|
47
|
+
g();
|
|
33
48
|
return;
|
|
34
49
|
}
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!t) return;
|
|
39
|
-
let n = e === T.value.length - 1 ? t.offsetHeight : t.offsetHeight - 1, r = t.offsetTop;
|
|
40
|
-
w.value = {
|
|
41
|
-
...w.value,
|
|
50
|
+
let n = e === f.items.length - 1 ? t.offsetHeight : t.offsetHeight - 1, r = t.offsetTop;
|
|
51
|
+
m.value = {
|
|
52
|
+
...m.value,
|
|
42
53
|
height: `${n}px`,
|
|
43
54
|
transform: `translateY(${r}px)`,
|
|
44
55
|
opacity: "1"
|
|
45
56
|
};
|
|
46
57
|
}
|
|
47
|
-
return
|
|
58
|
+
return l(() => [f.modelValue, f.items.length], () => i(_), { immediate: !0 }), (e, r) => (o(), t("div", {
|
|
48
59
|
class: "q-sidebar-anchor",
|
|
49
|
-
style:
|
|
50
|
-
}, [
|
|
60
|
+
style: a(p.value)
|
|
61
|
+
}, [n("div", u, [n("div", {
|
|
51
62
|
class: "q-sidebar__indicator",
|
|
52
|
-
style:
|
|
53
|
-
}, null, 4),
|
|
54
|
-
key: n.id,
|
|
55
|
-
ref_for: !0,
|
|
56
|
-
ref_key: "itemRefs",
|
|
57
|
-
ref: T,
|
|
58
|
-
"data-testid": "q-sidebar-panel-button",
|
|
59
|
-
"model-value": C.value === n.id,
|
|
60
|
-
label: x.showLabels ? n.title : void 0,
|
|
61
|
-
title: x.showLabels ? void 0 : n.title,
|
|
62
|
-
"icon-pos": "top",
|
|
63
|
-
class: "q-sidebar__item",
|
|
64
|
-
onClick: () => E(n.id)
|
|
65
|
-
}, {
|
|
66
|
-
default: y(() => [h(c.$slots, n.id, { item: n }, () => [n.icon ? (f(), r(g(e), l({
|
|
67
|
-
key: 0,
|
|
68
|
-
ref_for: !0
|
|
69
|
-
}, n.icon), null, 16)) : i("v-if", !0)])]),
|
|
70
|
-
_: 2
|
|
71
|
-
}, 1032, [
|
|
72
|
-
"model-value",
|
|
73
|
-
"label",
|
|
74
|
-
"title",
|
|
75
|
-
"onClick"
|
|
76
|
-
]))), 128))])], 4));
|
|
63
|
+
style: a(m.value)
|
|
64
|
+
}, null, 4)], 512)], 4));
|
|
77
65
|
}
|
|
78
66
|
});
|
|
79
67
|
//#endregion
|
|
80
|
-
export {
|
|
68
|
+
export { d as default };
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { QSidebarItemProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
anchor?(_: {}): any;
|
|
6
|
+
'header.prepend'?(_: {}): any;
|
|
7
|
+
header?(_: {}): any;
|
|
8
|
+
'header.append'?(_: {}): any;
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
footer?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {
|
|
13
|
+
anchor: ({
|
|
14
|
+
$: import('vue').ComponentInternalInstance;
|
|
15
|
+
$data: {};
|
|
16
|
+
$props: {
|
|
17
|
+
readonly modelValue?: boolean | undefined;
|
|
18
|
+
readonly id?: string | undefined;
|
|
19
|
+
readonly class?: string | unknown[] | undefined;
|
|
20
|
+
readonly label?: string | undefined;
|
|
21
|
+
readonly variant?: import('..').QButtonVariant | undefined;
|
|
22
|
+
readonly color?: string | undefined;
|
|
23
|
+
readonly borderless?: boolean | undefined;
|
|
24
|
+
readonly elevated?: boolean | undefined;
|
|
25
|
+
readonly block?: boolean | undefined;
|
|
26
|
+
readonly size?: import('..').QButtonSize | undefined;
|
|
27
|
+
readonly iconPos?: import('..').QButtonIconPosition | undefined;
|
|
28
|
+
readonly pill?: boolean | undefined;
|
|
29
|
+
readonly disabled?: boolean | undefined;
|
|
30
|
+
readonly loading?: boolean | undefined;
|
|
31
|
+
readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
32
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
33
|
+
$attrs: import('vue').Attrs;
|
|
34
|
+
$refs: {
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
$slots: Readonly<{
|
|
38
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
41
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
42
|
+
$host: Element | null;
|
|
43
|
+
$emit: (event: "update:modelValue", value: boolean) => void;
|
|
44
|
+
$el: HTMLButtonElement;
|
|
45
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
46
|
+
modelValue?: boolean;
|
|
47
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
48
|
+
label?: string;
|
|
49
|
+
variant?: import('..').QButtonVariant;
|
|
50
|
+
color?: string;
|
|
51
|
+
borderless?: boolean;
|
|
52
|
+
elevated?: boolean;
|
|
53
|
+
block?: boolean;
|
|
54
|
+
size?: import('..').QButtonSize;
|
|
55
|
+
iconPos?: import('..').QButtonIconPosition;
|
|
56
|
+
pill?: boolean;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
}> & Readonly<{
|
|
60
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
61
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
62
|
+
"update:modelValue": (value: boolean) => any;
|
|
63
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
64
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
65
|
+
created?: (() => void) | (() => void)[];
|
|
66
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
67
|
+
mounted?: (() => void) | (() => void)[];
|
|
68
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
69
|
+
updated?: (() => void) | (() => void)[];
|
|
70
|
+
activated?: (() => void) | (() => void)[];
|
|
71
|
+
deactivated?: (() => void) | (() => void)[];
|
|
72
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
73
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
74
|
+
destroyed?: (() => void) | (() => void)[];
|
|
75
|
+
unmounted?: (() => void) | (() => void)[];
|
|
76
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
77
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
78
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
79
|
+
};
|
|
80
|
+
$forceUpdate: () => void;
|
|
81
|
+
$nextTick: typeof import('vue').nextTick;
|
|
82
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
83
|
+
} & Readonly<{}> & Omit<Readonly<{
|
|
84
|
+
modelValue?: boolean;
|
|
85
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
86
|
+
label?: string;
|
|
87
|
+
variant?: import('..').QButtonVariant;
|
|
88
|
+
color?: string;
|
|
89
|
+
borderless?: boolean;
|
|
90
|
+
elevated?: boolean;
|
|
91
|
+
block?: boolean;
|
|
92
|
+
size?: import('..').QButtonSize;
|
|
93
|
+
iconPos?: import('..').QButtonIconPosition;
|
|
94
|
+
pill?: boolean;
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
loading?: boolean;
|
|
97
|
+
}> & Readonly<{
|
|
98
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
99
|
+
}>, never> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
100
|
+
$slots: {
|
|
101
|
+
default?(_: {}): any;
|
|
102
|
+
};
|
|
103
|
+
}) | null;
|
|
104
|
+
};
|
|
105
|
+
rootEl: any;
|
|
106
|
+
};
|
|
107
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
108
|
+
declare const __VLS_component: import('vue').DefineComponent<QSidebarItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<QSidebarItemProps> & Readonly<{}>, {
|
|
109
|
+
showGrip: boolean;
|
|
110
|
+
initialWidth: import('./types').QSidebarPanelSize;
|
|
111
|
+
minWidth: import('./types').QSidebarPanelSize;
|
|
112
|
+
maxWidth: import('./types').QSidebarPanelSize;
|
|
113
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
114
|
+
anchor: ({
|
|
115
|
+
$: import('vue').ComponentInternalInstance;
|
|
116
|
+
$data: {};
|
|
117
|
+
$props: {
|
|
118
|
+
readonly modelValue?: boolean | undefined;
|
|
119
|
+
readonly id?: string | undefined;
|
|
120
|
+
readonly class?: string | unknown[] | undefined;
|
|
121
|
+
readonly label?: string | undefined;
|
|
122
|
+
readonly variant?: import('..').QButtonVariant | undefined;
|
|
123
|
+
readonly color?: string | undefined;
|
|
124
|
+
readonly borderless?: boolean | undefined;
|
|
125
|
+
readonly elevated?: boolean | undefined;
|
|
126
|
+
readonly block?: boolean | undefined;
|
|
127
|
+
readonly size?: import('..').QButtonSize | undefined;
|
|
128
|
+
readonly iconPos?: import('..').QButtonIconPosition | undefined;
|
|
129
|
+
readonly pill?: boolean | undefined;
|
|
130
|
+
readonly disabled?: boolean | undefined;
|
|
131
|
+
readonly loading?: boolean | undefined;
|
|
132
|
+
readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
133
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
134
|
+
$attrs: import('vue').Attrs;
|
|
135
|
+
$refs: {
|
|
136
|
+
[x: string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
$slots: Readonly<{
|
|
139
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
142
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
143
|
+
$host: Element | null;
|
|
144
|
+
$emit: (event: "update:modelValue", value: boolean) => void;
|
|
145
|
+
$el: HTMLButtonElement;
|
|
146
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
147
|
+
modelValue?: boolean;
|
|
148
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
149
|
+
label?: string;
|
|
150
|
+
variant?: import('..').QButtonVariant;
|
|
151
|
+
color?: string;
|
|
152
|
+
borderless?: boolean;
|
|
153
|
+
elevated?: boolean;
|
|
154
|
+
block?: boolean;
|
|
155
|
+
size?: import('..').QButtonSize;
|
|
156
|
+
iconPos?: import('..').QButtonIconPosition;
|
|
157
|
+
pill?: boolean;
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
loading?: boolean;
|
|
160
|
+
}> & Readonly<{
|
|
161
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
162
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
163
|
+
"update:modelValue": (value: boolean) => any;
|
|
164
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
165
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
166
|
+
created?: (() => void) | (() => void)[];
|
|
167
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
168
|
+
mounted?: (() => void) | (() => void)[];
|
|
169
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
170
|
+
updated?: (() => void) | (() => void)[];
|
|
171
|
+
activated?: (() => void) | (() => void)[];
|
|
172
|
+
deactivated?: (() => void) | (() => void)[];
|
|
173
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
174
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
175
|
+
destroyed?: (() => void) | (() => void)[];
|
|
176
|
+
unmounted?: (() => void) | (() => void)[];
|
|
177
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
178
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
179
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
180
|
+
};
|
|
181
|
+
$forceUpdate: () => void;
|
|
182
|
+
$nextTick: typeof import('vue').nextTick;
|
|
183
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
184
|
+
} & Readonly<{}> & Omit<Readonly<{
|
|
185
|
+
modelValue?: boolean;
|
|
186
|
+
} & import('../../types/component').QBaseComponentProps & {
|
|
187
|
+
label?: string;
|
|
188
|
+
variant?: import('..').QButtonVariant;
|
|
189
|
+
color?: string;
|
|
190
|
+
borderless?: boolean;
|
|
191
|
+
elevated?: boolean;
|
|
192
|
+
block?: boolean;
|
|
193
|
+
size?: import('..').QButtonSize;
|
|
194
|
+
iconPos?: import('..').QButtonIconPosition;
|
|
195
|
+
pill?: boolean;
|
|
196
|
+
disabled?: boolean;
|
|
197
|
+
loading?: boolean;
|
|
198
|
+
}> & Readonly<{
|
|
199
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
200
|
+
}>, never> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
201
|
+
$slots: {
|
|
202
|
+
default?(_: {}): any;
|
|
203
|
+
};
|
|
204
|
+
}) | null;
|
|
205
|
+
}, any>;
|
|
206
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
207
|
+
export default _default;
|
|
208
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
209
|
+
new (): {
|
|
210
|
+
$slots: S;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=QSidebarItem.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/QSidebarItem.vue"],"names":[],"mappings":"AAkEA;AAiLC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAgGjD,iBAAS,cAAc;WAiMT,OAAO,IAA6B;;wBAhBrB,GAAG;kCACO,GAAG;wBACb,GAAG;iCACM,GAAG;yBACX,GAAG;wBACJ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmEi2S,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAnDt/S;AAqBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA6B42S,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;OArBr/S,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useGroupItem as e } from "../../composables/useGroup/index.js";
|
|
2
|
+
import { QIcon as t } from "../QIcon/index.js";
|
|
3
|
+
import { useId as n } from "../../composables/uid.js";
|
|
4
|
+
import { SidebarSymbol as r } from "./context.js";
|
|
5
|
+
import { QToggle as i } from "../QToggle/index.js";
|
|
6
|
+
import a from "./QSidebarPanel2.vue.js";
|
|
7
|
+
import { Fragment as o, Teleport as s, Transition as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createSlots as p, createVNode as m, defineComponent as h, inject as g, mergeProps as _, normalizeClass as v, normalizeProps as y, onBeforeMount as b, onBeforeUnmount as x, openBlock as S, renderSlot as C, toRef as w, unref as T, useTemplateRef as E, withCtx as D } from "vue";
|
|
8
|
+
//#region src/components/QSidebar/QSidebarItem.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var O = /*@__PURE__*/ h({
|
|
10
|
+
__name: "QSidebarItem",
|
|
11
|
+
props: {
|
|
12
|
+
id: {},
|
|
13
|
+
class: {},
|
|
14
|
+
title: {},
|
|
15
|
+
icon: {},
|
|
16
|
+
value: {},
|
|
17
|
+
resizable: { type: Boolean },
|
|
18
|
+
showGrip: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !0
|
|
21
|
+
},
|
|
22
|
+
initialWidth: { default: "medium" },
|
|
23
|
+
minWidth: { default: "small" },
|
|
24
|
+
maxWidth: { default: "block" }
|
|
25
|
+
},
|
|
26
|
+
setup(h) {
|
|
27
|
+
let O = h, k = g(r);
|
|
28
|
+
if (!k) throw Error("QSidebarItem: Failed to retrieve sidebar context. Ensure the component is used within a QSidebar context.");
|
|
29
|
+
let A = n(w(O, "value")), j = n(w(O, "id")), M = n(), N = e(A);
|
|
30
|
+
if (!N) throw Error("QSidebarItem: Failed to retrieve group item. Ensure the component is used within a QSidebar context.");
|
|
31
|
+
let P = k, F = N, I = E("anchor"), L = l(() => P.anchorItemsEl.value), R = l(() => P.position.value === "left" ? "right" : "left"), z = l(() => P.position.value === "left" ? "slide-right" : "slide-left");
|
|
32
|
+
function B() {
|
|
33
|
+
F.toggle(), P.onItemClick(A.value);
|
|
34
|
+
}
|
|
35
|
+
function V() {
|
|
36
|
+
P.onPanelAfterLeave();
|
|
37
|
+
}
|
|
38
|
+
return b(() => {
|
|
39
|
+
P.register({
|
|
40
|
+
value: A.value,
|
|
41
|
+
resizable: w(O, "resizable"),
|
|
42
|
+
initialWidth: w(O, "initialWidth"),
|
|
43
|
+
minWidth: w(O, "minWidth"),
|
|
44
|
+
maxWidth: w(O, "maxWidth"),
|
|
45
|
+
anchorRef: I
|
|
46
|
+
});
|
|
47
|
+
}), x(() => {
|
|
48
|
+
P.unregister(A.value);
|
|
49
|
+
}), (e, n) => (S(), f(o, null, [L.value ? (S(), u(s, {
|
|
50
|
+
key: 0,
|
|
51
|
+
to: L.value
|
|
52
|
+
}, [m(T(i), {
|
|
53
|
+
id: T(j),
|
|
54
|
+
ref: "anchor",
|
|
55
|
+
"data-testid": "q-sidebar-panel-button",
|
|
56
|
+
borderless: "",
|
|
57
|
+
"icon-pos": "top",
|
|
58
|
+
class: v(["q-sidebar__item", O.class]),
|
|
59
|
+
"model-value": T(F).isActive.value,
|
|
60
|
+
"aria-controls": T(M),
|
|
61
|
+
label: T(P).showLabels.value ? O.title : void 0,
|
|
62
|
+
title: T(P).showLabels.value ? void 0 : O.title,
|
|
63
|
+
"onUpdate:modelValue": B
|
|
64
|
+
}, {
|
|
65
|
+
default: D(() => [C(e.$slots, "anchor", {}, () => [O.icon ? (S(), u(T(t), y(_({ key: 0 }, O.icon)), null, 16)) : d("v-if", !0)])]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 8, [
|
|
68
|
+
"id",
|
|
69
|
+
"class",
|
|
70
|
+
"model-value",
|
|
71
|
+
"aria-controls",
|
|
72
|
+
"label",
|
|
73
|
+
"title"
|
|
74
|
+
])], 8, ["to"])) : d("v-if", !0), m(c, {
|
|
75
|
+
name: z.value,
|
|
76
|
+
css: T(P).animatePanel.value,
|
|
77
|
+
onAfterLeave: V
|
|
78
|
+
}, {
|
|
79
|
+
default: D(() => [T(F).isActive.value ? (S(), u(a, {
|
|
80
|
+
key: 0,
|
|
81
|
+
id: T(M),
|
|
82
|
+
"aria-labelledby": T(j),
|
|
83
|
+
title: O.title,
|
|
84
|
+
resizable: O.resizable,
|
|
85
|
+
"show-grip": O.showGrip,
|
|
86
|
+
"resize-position": R.value,
|
|
87
|
+
"onResize:start": T(P).onResizeStart,
|
|
88
|
+
onResize: T(P).onPanelResize,
|
|
89
|
+
"onResize:end": T(P).onResizeEnd
|
|
90
|
+
}, p({
|
|
91
|
+
content: D(() => [C(e.$slots, "default")]),
|
|
92
|
+
_: 2
|
|
93
|
+
}, [
|
|
94
|
+
e.$slots["header.prepend"] ? {
|
|
95
|
+
name: "header.prepend",
|
|
96
|
+
fn: D(() => [C(e.$slots, "header.prepend")]),
|
|
97
|
+
key: "0"
|
|
98
|
+
} : void 0,
|
|
99
|
+
e.$slots.header ? {
|
|
100
|
+
name: "header",
|
|
101
|
+
fn: D(() => [C(e.$slots, "header")]),
|
|
102
|
+
key: "1"
|
|
103
|
+
} : void 0,
|
|
104
|
+
e.$slots["header.append"] ? {
|
|
105
|
+
name: "header.append",
|
|
106
|
+
fn: D(() => [C(e.$slots, "header.append")]),
|
|
107
|
+
key: "2"
|
|
108
|
+
} : void 0,
|
|
109
|
+
e.$slots.footer ? {
|
|
110
|
+
name: "footer",
|
|
111
|
+
fn: D(() => [C(e.$slots, "footer")]),
|
|
112
|
+
key: "3"
|
|
113
|
+
} : void 0
|
|
114
|
+
]), 1032, [
|
|
115
|
+
"id",
|
|
116
|
+
"aria-labelledby",
|
|
117
|
+
"title",
|
|
118
|
+
"resizable",
|
|
119
|
+
"show-grip",
|
|
120
|
+
"resize-position",
|
|
121
|
+
"onResize:start",
|
|
122
|
+
"onResize",
|
|
123
|
+
"onResize:end"
|
|
124
|
+
])) : d("v-if", !0)]),
|
|
125
|
+
_: 3
|
|
126
|
+
}, 8, ["name", "css"])], 64));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
//#endregion
|
|
130
|
+
export { O as default };
|
|
@@ -22,13 +22,7 @@ declare const __VLS_component: import('vue').DefineComponent<QSidebarPanelProps,
|
|
|
22
22
|
onResize?: ((width: number) => any) | undefined;
|
|
23
23
|
"onResize:start"?: (() => any) | undefined;
|
|
24
24
|
"onResize:end"?: ((finalWidth: number) => any) | undefined;
|
|
25
|
-
}>, {
|
|
26
|
-
showGrip: boolean;
|
|
27
|
-
initialWidth: import('./types').QSidebarPanelSize;
|
|
28
|
-
minWidth: import('./types').QSidebarPanelSize;
|
|
29
|
-
maxWidth: import('./types').QSidebarPanelSize;
|
|
30
|
-
resizePosition: "left" | "right";
|
|
31
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
32
26
|
panel: HTMLDivElement;
|
|
33
27
|
}, HTMLDivElement>;
|
|
34
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QSidebarPanel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/QSidebarPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QSidebarPanel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/QSidebarPanel.vue"],"names":[],"mappings":"AAuCA;AAmIC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAA;AA0F5C,iBAAS,cAAc;WAuET,OAAO,IAA6B;;wBAftB,GAAG;kCACO,GAAG;iCACJ,GAAG;yBACX,GAAG;wBACJ,GAAG;;;;;;EAgB9B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;kBASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { createCommentVNode as e, createElementBlock as t, createElementVNode as
|
|
|
2
2
|
//#region src/components/QSidebar/QSidebarPanel.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var d = {
|
|
4
4
|
ref: "panel",
|
|
5
|
-
class: "q-sidebar-panel"
|
|
5
|
+
class: "q-sidebar-panel",
|
|
6
|
+
role: "region"
|
|
6
7
|
}, f = { class: "q-sidebar-panel__header" }, p = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "q-sidebar-panel__title"
|
|
@@ -16,16 +17,9 @@ var d = {
|
|
|
16
17
|
__name: "QSidebarPanel",
|
|
17
18
|
props: {
|
|
18
19
|
title: {},
|
|
19
|
-
icon: {},
|
|
20
20
|
resizable: { type: Boolean },
|
|
21
|
-
showGrip: {
|
|
22
|
-
|
|
23
|
-
default: !0
|
|
24
|
-
},
|
|
25
|
-
initialWidth: { default: "medium" },
|
|
26
|
-
minWidth: { default: "small" },
|
|
27
|
-
maxWidth: { default: "large" },
|
|
28
|
-
resizePosition: { default: "right" }
|
|
21
|
+
showGrip: { type: Boolean },
|
|
22
|
+
resizePosition: {}
|
|
29
23
|
},
|
|
30
24
|
emits: [
|
|
31
25
|
"resize",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { QSidebarPanelSize } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Metadata registered by each {@link QSidebarItem} with its parent {@link QSidebar}.
|
|
5
|
+
*/
|
|
6
|
+
export type SidebarItemRegistration = {
|
|
7
|
+
/**
|
|
8
|
+
* Identity of the item, matching the value used by `v-model` on `QSidebar`.
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the panel can be resized by the user.
|
|
13
|
+
*/
|
|
14
|
+
resizable: Ref<boolean | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Initial panel width preset.
|
|
17
|
+
*/
|
|
18
|
+
initialWidth: Ref<QSidebarPanelSize | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Minimum allowed panel width preset.
|
|
21
|
+
*/
|
|
22
|
+
minWidth: Ref<QSidebarPanelSize | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum allowed panel width preset.
|
|
25
|
+
*/
|
|
26
|
+
maxWidth: Ref<QSidebarPanelSize | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Template ref for the anchor toggle element (indicator positioning).
|
|
29
|
+
*/
|
|
30
|
+
anchorRef: Ref<{
|
|
31
|
+
$el?: HTMLElement;
|
|
32
|
+
} | HTMLElement | null>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Provide/inject context shared between {@link QSidebar} and its {@link QSidebarItem} children.
|
|
36
|
+
*/
|
|
37
|
+
export type SidebarContext = {
|
|
38
|
+
/**
|
|
39
|
+
* DOM element that hosts teleported anchor toggles.
|
|
40
|
+
*/
|
|
41
|
+
anchorItemsEl: ComputedRef<HTMLElement | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Sidebar position on the screen.
|
|
44
|
+
*/
|
|
45
|
+
position: ComputedRef<'left' | 'right'>;
|
|
46
|
+
/**
|
|
47
|
+
* Whether anchor labels are shown alongside icons.
|
|
48
|
+
*/
|
|
49
|
+
showLabels: ComputedRef<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* Width of the anchor section in pixels.
|
|
52
|
+
*/
|
|
53
|
+
anchorWidth: ComputedRef<number | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Whether panel enter/leave should use the slide CSS transition.
|
|
56
|
+
* True for open/close; false when switching between two open items
|
|
57
|
+
* so the root width can change without a competing slide animation.
|
|
58
|
+
*/
|
|
59
|
+
animatePanel: ComputedRef<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Registered sidebar items in mount order.
|
|
62
|
+
*/
|
|
63
|
+
items: ShallowRef<SidebarItemRegistration[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Registers an item with the parent sidebar.
|
|
66
|
+
*
|
|
67
|
+
* @param item - Item metadata to register.
|
|
68
|
+
*/
|
|
69
|
+
register: (item: SidebarItemRegistration) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Removes a previously registered item (typically on unmount).
|
|
72
|
+
*
|
|
73
|
+
* @param value - The item `value` to remove.
|
|
74
|
+
*/
|
|
75
|
+
unregister: (value: string) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Notifies the parent that an anchor item was clicked.
|
|
78
|
+
*
|
|
79
|
+
* @param value - The clicked item value.
|
|
80
|
+
*/
|
|
81
|
+
onItemClick: (value: string) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Notifies the parent that panel resizing started.
|
|
84
|
+
*/
|
|
85
|
+
onResizeStart: () => void;
|
|
86
|
+
/**
|
|
87
|
+
* Notifies the parent of an in-progress panel resize.
|
|
88
|
+
*
|
|
89
|
+
* @param width - The new panel width in pixels.
|
|
90
|
+
*/
|
|
91
|
+
onPanelResize: (width: number) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Notifies the parent that panel resizing ended.
|
|
94
|
+
*
|
|
95
|
+
* @param width - The final panel width in pixels.
|
|
96
|
+
*/
|
|
97
|
+
onResizeEnd: (width: number) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Notifies the parent that a panel leave transition finished.
|
|
100
|
+
* Used to clear expanded sizing after the close animation.
|
|
101
|
+
*/
|
|
102
|
+
onPanelAfterLeave: () => void;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Injection key for the {@link SidebarContext} provided by `QSidebar`.
|
|
106
|
+
*/
|
|
107
|
+
export declare const SidebarSymbol: InjectionKey<SidebarContext>;
|
|
108
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;IAEnC;;OAEG;IACH,YAAY,EAAE,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;IAEhD;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;IAE5C;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAA;IAE5C;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;QAAE,GAAG,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,WAAW,GAAG,IAAI,CAAC,CAAA;CAC1D,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAE9C;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,CAAA;IAEvC;;OAEG;IACH,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAEhC;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE5C;;;;OAIG;IACH,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAElC;;OAEG;IACH,KAAK,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAA;IAE5C;;;;OAIG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAEjD;;;;OAIG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEnC;;;;OAIG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEpC;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAA;IAEzB;;;;OAIG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEtC;;;;OAIG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEpC;;;OAGG;IACH,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,cAAc,CAAuB,CAAA"}
|