@quidgest/ui 0.16.8 → 0.16.9
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/ui.esm.js +734 -732
- package/dist/ui.js +9 -9
- package/dist/ui.min.js +664 -662
- package/dist/ui.scss +1 -1
- package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +24 -23
- package/esm/components/QDateTimePicker/index.d.ts +3 -0
- package/esm/components/QDateTimePicker/index.d.ts.map +1 -1
- package/esm/components/QDateTimePicker/types.d.ts +4 -0
- package/esm/components/QDateTimePicker/types.d.ts.map +1 -1
- package/esm/components/QDismissibleLayer/QDismissibleLayer.d.ts +2 -2
- package/esm/components/QDismissibleLayer/QDismissibleLayer.vue.js +17 -20
- package/esm/components/QDismissibleLayer/index.d.ts +1 -1
- package/esm/components/QSidebar/QSidebar.vue.js +16 -13
- package/esm/components/QSidebar/QSidebarAnchor.d.ts.map +1 -1
- package/esm/components/QSidebar/QSidebarAnchor.vue.js +35 -34
- package/esm/components/QSidebar/types.d.ts +2 -2
- package/esm/components/QSidebar/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ui.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as C, mergeModels as O, useModel as F, computed as t, ref as U, createBlock as w, openBlock as D, unref as r, normalizeClass as P, createSlots as E, withCtx as n, createVNode as s, createElementVNode as N, mergeProps as y, renderSlot as Q } from "vue";
|
|
2
2
|
import { DEFAULT_TEXTS as H, DEFAULT_ICONS as I } from "./types.js";
|
|
3
3
|
import { QClearButton as Z } from "../__internal__/QClearButton/index.js";
|
|
4
4
|
import { QField as $ } from "../QField/index.js";
|
|
@@ -9,10 +9,10 @@ import { convertDatePatternToMask as X } from "../../utils/date/date.js";
|
|
|
9
9
|
import { isTimeOnlyFormat as j } from "../../utils/date/tokens.js";
|
|
10
10
|
import { formatUsesTime as G, formatUsesSeconds as W, uses12HourFormat as J } from "../../utils/time.js";
|
|
11
11
|
import { useTheme as Y } from "../../composables/theme.js";
|
|
12
|
-
const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput", "onBlur", "onFocus", "onKeypress", "onKeydown", "onPaste"],
|
|
12
|
+
const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput", "onBlur", "onFocus", "onKeypress", "onKeydown", "onPaste"], ce = /* @__PURE__ */ C({
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "QDateTimePicker",
|
|
15
|
-
props: /* @__PURE__ */
|
|
15
|
+
props: /* @__PURE__ */ O({
|
|
16
16
|
id: {},
|
|
17
17
|
class: {},
|
|
18
18
|
label: {},
|
|
@@ -28,6 +28,7 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
28
28
|
locale: { default: "en-US" },
|
|
29
29
|
placeholder: {},
|
|
30
30
|
inline: { type: Boolean },
|
|
31
|
+
closeOnSelect: { type: Boolean },
|
|
31
32
|
icons: { default: () => I },
|
|
32
33
|
texts: { default: () => H }
|
|
33
34
|
}, {
|
|
@@ -36,12 +37,12 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
36
37
|
}),
|
|
37
38
|
emits: ["update:modelValue"],
|
|
38
39
|
setup(d) {
|
|
39
|
-
const e = d, m =
|
|
40
|
+
const e = d, m = F(d, "modelValue"), u = t({
|
|
40
41
|
get: () => m.value,
|
|
41
42
|
set: (o) => m.value = o || void 0
|
|
42
|
-
}), k = t(() => i.value ? "format" : void 0), v = {
|
|
43
|
-
closeOnAutoApply:
|
|
44
|
-
}, b = Y(), T = t(() => b.current.value.mode === "dark"), x = t(() => G(e.format)), h = t(() => W(e.format)), i = t(() => j(e.format)), z = t(() => J(e.format)),
|
|
43
|
+
}), k = t(() => i.value ? "format" : void 0), v = t(() => ({
|
|
44
|
+
closeOnAutoApply: e.closeOnSelect
|
|
45
|
+
})), b = Y(), T = t(() => b.current.value.mode === "dark"), x = t(() => G(e.format)), h = t(() => W(e.format)), i = t(() => j(e.format)), z = t(() => J(e.format)), B = t(() => p(e.minTime)), _ = t(() => p(e.maxTime)), A = t(() => i.value ? e.icons.clock : e.icons.calendar), M = t(() => ({
|
|
45
46
|
mask: X(e.format),
|
|
46
47
|
tokens: {
|
|
47
48
|
// Default tokens
|
|
@@ -69,9 +70,9 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
69
70
|
},
|
|
70
71
|
eager: !0
|
|
71
72
|
// Show static characters before the user types them
|
|
72
|
-
})),
|
|
73
|
-
R(
|
|
74
|
-
function
|
|
73
|
+
})), c = U();
|
|
74
|
+
R(c, M);
|
|
75
|
+
function p(o) {
|
|
75
76
|
if (!o) return;
|
|
76
77
|
const a = o.split(":");
|
|
77
78
|
return {
|
|
@@ -80,7 +81,7 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
80
81
|
seconds: a[2]
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
return (o, a) => (
|
|
84
|
+
return (o, a) => (D(), w(r($), {
|
|
84
85
|
id: e.id,
|
|
85
86
|
class: P(e.class),
|
|
86
87
|
label: e.label,
|
|
@@ -93,7 +94,7 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
93
94
|
prepend: n(() => [
|
|
94
95
|
s(
|
|
95
96
|
r(K),
|
|
96
|
-
y({ class: "q-date-time-picker__input-icon" },
|
|
97
|
+
y({ class: "q-date-time-picker__input-icon" }, A.value),
|
|
97
98
|
null,
|
|
98
99
|
16
|
|
99
100
|
/* FULL_PROPS */
|
|
@@ -104,8 +105,8 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
104
105
|
modelValue: u.value,
|
|
105
106
|
"onUpdate:modelValue": a[0] || (a[0] = (l) => u.value = l),
|
|
106
107
|
"model-type": k.value,
|
|
107
|
-
"min-time":
|
|
108
|
-
"max-time":
|
|
108
|
+
"min-time": B.value,
|
|
109
|
+
"max-time": _.value,
|
|
109
110
|
disabled: e.disabled,
|
|
110
111
|
readonly: e.readonly,
|
|
111
112
|
format: e.format,
|
|
@@ -114,7 +115,7 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
114
115
|
"enable-time-picker": x.value,
|
|
115
116
|
"enable-seconds": h.value,
|
|
116
117
|
"time-picker": i.value,
|
|
117
|
-
config: v,
|
|
118
|
+
config: v.value,
|
|
118
119
|
teleport: !e.inline,
|
|
119
120
|
offset: 16,
|
|
120
121
|
dark: T.value,
|
|
@@ -123,10 +124,10 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
123
124
|
clearable: "",
|
|
124
125
|
"auto-apply": ""
|
|
125
126
|
}, {
|
|
126
|
-
"dp-input": n(({ value: l, onInput:
|
|
127
|
+
"dp-input": n(({ value: l, onInput: S, onBlur: q, onFocus: V, onKeypress: f, onPaste: g }) => [
|
|
127
128
|
N("input", y({
|
|
128
129
|
ref_key: "inputRef",
|
|
129
|
-
ref:
|
|
130
|
+
ref: c,
|
|
130
131
|
"data-test-id": "dp-input",
|
|
131
132
|
class: "dp__input",
|
|
132
133
|
type: "text",
|
|
@@ -136,12 +137,12 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
136
137
|
readonly: e.readonly,
|
|
137
138
|
required: e.required
|
|
138
139
|
}, o.$attrs, {
|
|
139
|
-
onInput:
|
|
140
|
-
onBlur:
|
|
141
|
-
onFocus:
|
|
140
|
+
onInput: S,
|
|
141
|
+
onBlur: q,
|
|
142
|
+
onFocus: V,
|
|
142
143
|
onKeypress: f,
|
|
143
144
|
onKeydown: f,
|
|
144
|
-
onPaste:
|
|
145
|
+
onPaste: g
|
|
145
146
|
}), null, 16, ee)
|
|
146
147
|
]),
|
|
147
148
|
"clear-icon": n(({ clear: l }) => [
|
|
@@ -152,7 +153,7 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
152
153
|
]),
|
|
153
154
|
_: 1
|
|
154
155
|
/* STABLE */
|
|
155
|
-
}, 8, ["modelValue", "model-type", "min-time", "max-time", "disabled", "readonly", "format", "is24", "locale", "enable-time-picker", "enable-seconds", "time-picker", "teleport", "dark"])
|
|
156
|
+
}, 8, ["modelValue", "model-type", "min-time", "max-time", "disabled", "readonly", "format", "is24", "locale", "enable-time-picker", "enable-seconds", "time-picker", "config", "teleport", "dark"])
|
|
156
157
|
]),
|
|
157
158
|
_: 2
|
|
158
159
|
/* DYNAMIC */
|
|
@@ -168,5 +169,5 @@ const ee = ["value", "placeholder", "disabled", "readonly", "required", "onInput
|
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
export {
|
|
171
|
-
|
|
172
|
+
ce as default
|
|
172
173
|
};
|
|
@@ -19,6 +19,7 @@ declare const QDateTimePicker: {
|
|
|
19
19
|
locale?: string;
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
inline?: boolean;
|
|
22
|
+
closeOnSelect?: boolean;
|
|
22
23
|
icons?: typeof import('./types').DEFAULT_ICONS;
|
|
23
24
|
texts?: typeof import('./types').DEFAULT_TEXTS;
|
|
24
25
|
}> & Readonly<{
|
|
@@ -58,6 +59,7 @@ declare const QDateTimePicker: {
|
|
|
58
59
|
locale?: string;
|
|
59
60
|
placeholder?: string;
|
|
60
61
|
inline?: boolean;
|
|
62
|
+
closeOnSelect?: boolean;
|
|
61
63
|
icons?: typeof import('./types').DEFAULT_ICONS;
|
|
62
64
|
texts?: typeof import('./types').DEFAULT_TEXTS;
|
|
63
65
|
}> & Readonly<{
|
|
@@ -90,6 +92,7 @@ declare const QDateTimePicker: {
|
|
|
90
92
|
locale?: string;
|
|
91
93
|
placeholder?: string;
|
|
92
94
|
inline?: boolean;
|
|
95
|
+
closeOnSelect?: boolean;
|
|
93
96
|
icons?: typeof import('./types').DEFAULT_ICONS;
|
|
94
97
|
texts?: typeof import('./types').DEFAULT_TEXTS;
|
|
95
98
|
}> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDateTimePicker/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnD,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDateTimePicker/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAA;AAGzD,OAAO,EAAE,eAAe,EAAE,CAAA;AAG1B,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -41,6 +41,10 @@ export type QDateTimePickerProps = QFieldProps & {
|
|
|
41
41
|
* Whether to disable teleport.
|
|
42
42
|
*/
|
|
43
43
|
inline?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to close the popup when selecting the date.
|
|
46
|
+
*/
|
|
47
|
+
closeOnSelect?: boolean;
|
|
44
48
|
/**
|
|
45
49
|
* Custom icon configurations.
|
|
46
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QDateTimePicker/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;;;;CAOM,CAAA;AAGhC,eAAO,MAAM,aAAa;;CAEQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QDateTimePicker/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAChD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;;;;CAOM,CAAA;AAGhC,eAAO,MAAM,aAAa;;CAEQ,CAAA"}
|
|
@@ -5,7 +5,7 @@ declare function __VLS_template(): {
|
|
|
5
5
|
default?(_: {}): any;
|
|
6
6
|
};
|
|
7
7
|
refs: {
|
|
8
|
-
|
|
8
|
+
layer: HTMLDivElement;
|
|
9
9
|
};
|
|
10
10
|
rootEl: HTMLDivElement;
|
|
11
11
|
};
|
|
@@ -23,7 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {},
|
|
|
23
23
|
"onInteract-outside"?: ((event: PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
24
24
|
onDismiss?: ((event: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent) => any) | undefined;
|
|
25
25
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
26
|
-
|
|
26
|
+
layer: HTMLDivElement;
|
|
27
27
|
}, HTMLDivElement>;
|
|
28
28
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
29
29
|
export default _default;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as p, useTemplateRef as m, useId as v, onMounted as E, onUnmounted as w, createElementBlock as
|
|
2
|
-
import { useDismissibleLayerStackItem as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as p, useTemplateRef as m, useId as v, onMounted as E, onUnmounted as w, createElementBlock as h, openBlock as y, renderSlot as b } from "vue";
|
|
2
|
+
import { useDismissibleLayerStackItem as _ } from "../../composables/useDismissibleLayerStack/index.js";
|
|
3
|
+
const g = { ref: "layer" }, P = /* @__PURE__ */ p({
|
|
4
4
|
__name: "QDismissibleLayer",
|
|
5
5
|
emits: ["escape-key-down", "pointer-down-outside", "focus-outside", "interact-outside", "dismiss"],
|
|
6
6
|
setup(L, { emit: c }) {
|
|
7
|
-
const o = c,
|
|
8
|
-
let
|
|
7
|
+
const o = c, u = m("layer"), l = v(), e = _(l);
|
|
8
|
+
let i = [];
|
|
9
9
|
function r(t) {
|
|
10
10
|
t.key === "Escape" && (e != null && e.isTop()) && (o("escape-key-down", t), t.defaultPrevented || o("dismiss", t));
|
|
11
11
|
}
|
|
12
12
|
function d(t) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!u.value) return;
|
|
14
14
|
const s = t.target;
|
|
15
|
-
if (!
|
|
15
|
+
if (!u.value.contains(s) && (e != null && e.isTop())) {
|
|
16
16
|
const n = new CustomEvent("focus-outside", {
|
|
17
17
|
bubbles: !1,
|
|
18
18
|
cancelable: !0,
|
|
@@ -22,9 +22,9 @@ const C = /* @__PURE__ */ p({
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
function a(t) {
|
|
25
|
-
if (!
|
|
25
|
+
if (!u.value || !(e != null && e.isTop())) return;
|
|
26
26
|
const s = t.target;
|
|
27
|
-
if (!
|
|
27
|
+
if (!u.value.contains(s)) {
|
|
28
28
|
const n = new CustomEvent("pointer-down-outside", {
|
|
29
29
|
bubbles: !1,
|
|
30
30
|
cancelable: !0,
|
|
@@ -39,7 +39,7 @@ const C = /* @__PURE__ */ p({
|
|
|
39
39
|
passive: !0,
|
|
40
40
|
capture: !0
|
|
41
41
|
// Use capture phase to ensure we catch the event
|
|
42
|
-
}),
|
|
42
|
+
}), i.push(() => {
|
|
43
43
|
document.removeEventListener(s, a, {
|
|
44
44
|
capture: !0
|
|
45
45
|
});
|
|
@@ -47,21 +47,18 @@ const C = /* @__PURE__ */ p({
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
return E(() => {
|
|
50
|
-
e == null || e.register(), document.addEventListener("keydown", r),
|
|
50
|
+
e == null || e.register(), document.addEventListener("keydown", r), i.push(() => {
|
|
51
51
|
document.removeEventListener("keydown", r);
|
|
52
|
-
}), document.addEventListener("focusin", d),
|
|
52
|
+
}), document.addEventListener("focusin", d), i.push(() => {
|
|
53
53
|
document.removeEventListener("focusin", d);
|
|
54
54
|
}), f();
|
|
55
55
|
}), w(() => {
|
|
56
|
-
e == null || e.unregister(),
|
|
57
|
-
}), (t, s) => (
|
|
56
|
+
e == null || e.unregister(), i.forEach((t) => t()), i = [];
|
|
57
|
+
}), (t, s) => (y(), h(
|
|
58
58
|
"div",
|
|
59
|
-
|
|
60
|
-
ref_key: "layerRef",
|
|
61
|
-
ref: i
|
|
62
|
-
},
|
|
59
|
+
g,
|
|
63
60
|
[
|
|
64
|
-
|
|
61
|
+
b(t.$slots, "default")
|
|
65
62
|
],
|
|
66
63
|
512
|
|
67
64
|
/* NEED_PATCH */
|
|
@@ -69,5 +66,5 @@ const C = /* @__PURE__ */ p({
|
|
|
69
66
|
}
|
|
70
67
|
});
|
|
71
68
|
export {
|
|
72
|
-
|
|
69
|
+
P as default
|
|
73
70
|
};
|
|
@@ -13,7 +13,7 @@ declare const QDismissibleLayer: {
|
|
|
13
13
|
"interact-outside": (event: PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
14
14
|
dismiss: (event: KeyboardEvent | PointerDownOutsideEvent | FocusOutsideEvent) => any;
|
|
15
15
|
}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
16
|
-
|
|
16
|
+
layer: HTMLDivElement;
|
|
17
17
|
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
18
18
|
P: {};
|
|
19
19
|
B: {};
|
|
@@ -4,9 +4,9 @@ import F from "./QSidebarPanel.vue.js";
|
|
|
4
4
|
const K = /* @__PURE__ */ P({
|
|
5
5
|
__name: "QSidebar",
|
|
6
6
|
props: /* @__PURE__ */ z({
|
|
7
|
+
panels: {},
|
|
7
8
|
anchorWidth: { default: 50 },
|
|
8
9
|
showLabels: { type: Boolean },
|
|
9
|
-
panels: {},
|
|
10
10
|
position: { default: "left" }
|
|
11
11
|
}, {
|
|
12
12
|
modelValue: {},
|
|
@@ -22,18 +22,21 @@ const K = /* @__PURE__ */ P({
|
|
|
22
22
|
},
|
|
23
23
|
{ immediate: !0 }
|
|
24
24
|
);
|
|
25
|
-
const i = r(() =>
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const i = r(() => {
|
|
26
|
+
var e;
|
|
27
|
+
return (e = a.panels) == null ? void 0 : e.find((t) => t.id === m.value);
|
|
28
|
+
}), h = r(() => !!i.value), l = b(), q = r(() => {
|
|
29
|
+
if (l.value !== void 0)
|
|
30
|
+
return h.value ? typeof l.value == "number" ? `${a.anchorWidth + l.value}px` : `calc(${a.anchorWidth}px + ${l.value})` : `${a.anchorWidth}px`;
|
|
28
31
|
}), C = r(() => {
|
|
29
|
-
var e,
|
|
32
|
+
var e, t, d, v, p, c, $;
|
|
30
33
|
return [
|
|
31
34
|
"q-sidebar",
|
|
32
35
|
`q-sidebar--${((e = i.value) == null ? void 0 : e.initialWidth) ?? "small"}`,
|
|
33
36
|
`q-sidebar--${a.position}`,
|
|
34
37
|
{
|
|
35
38
|
"q-sidebar--expanded": h.value,
|
|
36
|
-
[`q-sidebar--min-${(
|
|
39
|
+
[`q-sidebar--min-${(t = i.value) == null ? void 0 : t.minWidth}`]: ((d = i.value) == null ? void 0 : d.resizable) && ((v = i.value) == null ? void 0 : v.minWidth) !== void 0,
|
|
37
40
|
[`q-sidebar--max-${(p = i.value) == null ? void 0 : p.maxWidth}`]: ((c = i.value) == null ? void 0 : c.resizable) && (($ = i.value) == null ? void 0 : $.maxWidth) !== void 0
|
|
38
41
|
}
|
|
39
42
|
];
|
|
@@ -42,10 +45,10 @@ const K = /* @__PURE__ */ P({
|
|
|
42
45
|
u("resize:start");
|
|
43
46
|
}
|
|
44
47
|
function g(e) {
|
|
45
|
-
|
|
48
|
+
l.value = e, u("resize", e);
|
|
46
49
|
}
|
|
47
50
|
function B() {
|
|
48
|
-
u("resize:end",
|
|
51
|
+
u("resize:end", l.value);
|
|
49
52
|
}
|
|
50
53
|
function L(e) {
|
|
51
54
|
u("click:item", e);
|
|
@@ -54,11 +57,11 @@ const K = /* @__PURE__ */ P({
|
|
|
54
57
|
n.value || (m.value = void 0);
|
|
55
58
|
}
|
|
56
59
|
function M() {
|
|
57
|
-
var
|
|
58
|
-
const e = (
|
|
59
|
-
typeof e == "number" ?
|
|
60
|
+
var t;
|
|
61
|
+
const e = (t = i.value) == null ? void 0 : t.initialWidth;
|
|
62
|
+
typeof e == "number" ? l.value = e : l.value = void 0;
|
|
60
63
|
}
|
|
61
|
-
return W([() => a.anchorWidth, i], M, { immediate: !0, deep: !0 }), (e,
|
|
64
|
+
return W([() => a.anchorWidth, i], M, { immediate: !0, deep: !0 }), (e, t) => (w(), A(
|
|
62
65
|
"div",
|
|
63
66
|
{
|
|
64
67
|
class: I(C.value),
|
|
@@ -67,7 +70,7 @@ const K = /* @__PURE__ */ P({
|
|
|
67
70
|
[
|
|
68
71
|
k(D, {
|
|
69
72
|
modelValue: n.value,
|
|
70
|
-
"onUpdate:modelValue":
|
|
73
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => n.value = d),
|
|
71
74
|
panels: a.panels,
|
|
72
75
|
"anchor-width": a.anchorWidth,
|
|
73
76
|
"show-labels": a.showLabels,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QSidebarAnchor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/QSidebarAnchor.vue"],"names":[],"mappings":"AA8BA;AA+HC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlD,OAAO,EAAE,QAAQ,EAAc,MAAM,KAAK,CAAA;AAE1C,KAAK,WAAW,GAAG,mBAAmB,CAAC;AAmFxC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAoFT,OAAO,IAA6B;;;UAZoC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"QSidebarAnchor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/QSidebarAnchor.vue"],"names":[],"mappings":"AA8BA;AA+HC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlD,OAAO,EAAE,QAAQ,EAAc,MAAM,KAAK,CAAA;AAE1C,KAAK,WAAW,GAAG,mBAAmB,CAAC;AAmFxC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAoFT,OAAO,IAA6B;;;UAZoC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAyD48e,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAxC1pf;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAwBghf,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;kBAfzpf,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"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { QIcon as
|
|
3
|
-
import { QToggle as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as C, mergeModels as d, useModel as L, ref as u, watch as q, nextTick as I, createElementBlock as f, openBlock as s, normalizeStyle as m, createElementVNode as p, Fragment as V, renderList as B, createBlock as h, unref as v, withCtx as S, renderSlot as $, createCommentVNode as E, mergeProps as M } from "vue";
|
|
2
|
+
import { QIcon as Q } from "../QIcon/index.js";
|
|
3
|
+
import { QToggle as T } from "../QToggle/index.js";
|
|
4
|
+
const H = { class: "q-sidebar__items" }, Y = /* @__PURE__ */ C({
|
|
5
5
|
__name: "QSidebarAnchor",
|
|
6
|
-
props: /* @__PURE__ */
|
|
6
|
+
props: /* @__PURE__ */ d({
|
|
7
|
+
panels: {},
|
|
7
8
|
anchorWidth: {},
|
|
8
|
-
showLabels: { type: Boolean }
|
|
9
|
-
panels: {}
|
|
9
|
+
showLabels: { type: Boolean }
|
|
10
10
|
}, {
|
|
11
11
|
modelValue: {},
|
|
12
12
|
modelModifiers: {}
|
|
13
13
|
}),
|
|
14
|
-
emits: /* @__PURE__ */
|
|
15
|
-
setup(r, { emit:
|
|
16
|
-
const i = r,
|
|
14
|
+
emits: /* @__PURE__ */ d(["click:item"], ["update:modelValue"]),
|
|
15
|
+
setup(r, { emit: _ }) {
|
|
16
|
+
const i = r, g = _, o = L(r, "modelValue"), a = u({
|
|
17
17
|
height: "0",
|
|
18
18
|
transform: "translateY(0)",
|
|
19
19
|
opacity: "0",
|
|
20
20
|
transition: "transform 0.3s ease, height 0.3s ease, opacity 0.2s ease"
|
|
21
|
-
}), l =
|
|
22
|
-
function
|
|
23
|
-
o.value = o.value === e ? void 0 : e,
|
|
21
|
+
}), l = u([]);
|
|
22
|
+
function b(e) {
|
|
23
|
+
o.value = o.value === e ? void 0 : e, g("click:item", e);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function k() {
|
|
26
|
+
var c;
|
|
26
27
|
if (!o.value) {
|
|
27
28
|
a.value = {
|
|
28
29
|
...a.value,
|
|
@@ -31,41 +32,41 @@ const T = { class: "q-sidebar__items" }, W = /* @__PURE__ */ w({
|
|
|
31
32
|
};
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
const e = i.panels.findIndex((
|
|
35
|
+
const e = ((c = i.panels) == null ? void 0 : c.findIndex((w) => w.id === o.value)) ?? -1;
|
|
35
36
|
if (e === -1 || !l.value[e])
|
|
36
37
|
return;
|
|
37
38
|
const n = l.value[e].$el || l.value[e];
|
|
38
39
|
if (!n) return;
|
|
39
|
-
const
|
|
40
|
+
const y = e === l.value.length - 1 ? n.offsetHeight : n.offsetHeight - 1, x = n.offsetTop;
|
|
40
41
|
a.value = {
|
|
41
42
|
...a.value,
|
|
42
|
-
height: `${
|
|
43
|
-
transform: `translateY(${
|
|
43
|
+
height: `${y}px`,
|
|
44
|
+
transform: `translateY(${x}px)`,
|
|
44
45
|
opacity: "1"
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
return
|
|
48
|
+
return q(o, () => I(k), { immediate: !0 }), (e, n) => (s(), f(
|
|
48
49
|
"div",
|
|
49
50
|
{
|
|
50
51
|
class: "q-sidebar-anchor",
|
|
51
|
-
style:
|
|
52
|
+
style: m({ width: i.anchorWidth + "px" })
|
|
52
53
|
},
|
|
53
54
|
[
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
p("div", H, [
|
|
56
|
+
p(
|
|
56
57
|
"div",
|
|
57
58
|
{
|
|
58
59
|
class: "q-sidebar__indicator",
|
|
59
|
-
style:
|
|
60
|
+
style: m(a.value)
|
|
60
61
|
},
|
|
61
62
|
null,
|
|
62
63
|
4
|
|
63
64
|
/* STYLE */
|
|
64
65
|
),
|
|
65
|
-
(s(!0),
|
|
66
|
-
|
|
66
|
+
(s(!0), f(
|
|
67
|
+
V,
|
|
67
68
|
null,
|
|
68
|
-
|
|
69
|
+
B(e.panels, (t) => (s(), h(v(T), {
|
|
69
70
|
key: t.id,
|
|
70
71
|
ref_for: !0,
|
|
71
72
|
ref_key: "itemRefs",
|
|
@@ -76,20 +77,20 @@ const T = { class: "q-sidebar__items" }, W = /* @__PURE__ */ w({
|
|
|
76
77
|
title: i.showLabels ? void 0 : t.title,
|
|
77
78
|
"icon-pos": "top",
|
|
78
79
|
class: "q-sidebar__item",
|
|
79
|
-
onClick: () =>
|
|
80
|
+
onClick: () => b(t.id)
|
|
80
81
|
}, {
|
|
81
|
-
default:
|
|
82
|
-
|
|
83
|
-
t.icon ? (s(),
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
default: S(() => [
|
|
83
|
+
$(e.$slots, t.id, { item: t }, () => [
|
|
84
|
+
t.icon ? (s(), h(
|
|
85
|
+
v(Q),
|
|
86
|
+
M({
|
|
86
87
|
key: 0,
|
|
87
88
|
ref_for: !0
|
|
88
89
|
}, t.icon),
|
|
89
90
|
null,
|
|
90
91
|
16
|
|
91
92
|
/* FULL_PROPS */
|
|
92
|
-
)) :
|
|
93
|
+
)) : E("v-if", !0)
|
|
93
94
|
])
|
|
94
95
|
]),
|
|
95
96
|
_: 2
|
|
@@ -106,5 +107,5 @@ const T = { class: "q-sidebar__items" }, W = /* @__PURE__ */ w({
|
|
|
106
107
|
}
|
|
107
108
|
});
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
Y as default
|
|
110
111
|
};
|
|
@@ -44,12 +44,12 @@ export type QSidebarPanelProps = Omit<QSidebarAnchorItemProps, 'id'> & {
|
|
|
44
44
|
* Includes the width of the anchor section and panel configurations.
|
|
45
45
|
*/
|
|
46
46
|
export type QSidebarAnchorProps = {
|
|
47
|
+
/** List of panels that can be anchored in the sidebar. */
|
|
48
|
+
panels?: QSidebarAnchorItemProps[];
|
|
47
49
|
/** Width of the anchor section (in pixels). */
|
|
48
50
|
anchorWidth?: number;
|
|
49
51
|
/** Whether to display labels alongside icons in anchor items. */
|
|
50
52
|
showLabels?: boolean;
|
|
51
|
-
/** List of panels that can be anchored in the sidebar. */
|
|
52
|
-
panels: QSidebarAnchorItemProps[];
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Complete set of props for the `QSidebar` component, combining anchor section props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC;;GAEG;AACH,KAAK,2BAA2B,GAAG;IAClC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,IAAI,CAAC,EAAE,IAAI,CAAA;CACX,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG;IACnE,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yDAAyD;IACzD,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,GAAG;IACtE,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACjC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSidebar/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC;;GAEG;AACH,KAAK,2BAA2B,GAAG;IAClC,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,IAAI,CAAC,EAAE,IAAI,CAAA;CACX,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG;IACnE,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yDAAyD;IACzD,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,GAAG;IACtE,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACjC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,uBAAuB,EAAE,CAAA;IAClC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IACjD,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B,CAAA"}
|