@quidgest/ui 0.16.7 → 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.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.16.7
2
+ * Quidgest UI v0.16.9
3
3
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -639,50 +639,60 @@ $transition-duration: 0.2s !default;
639
639
  background-color: var(--q-button-main-color);
640
640
  border-color: var(--q-button-main-color);
641
641
  color: var(--q-button-on-main-color);
642
- &:hover:not(:disabled) {
643
- background-color: var(--q-button-hover-color);
644
- border-color: var(--q-button-hover-color);
645
- color: var(--q-button-on-hover-color);
642
+ @media (hover: hover) {
643
+ &:hover:not(:disabled) {
644
+ background-color: var(--q-button-hover-color);
645
+ border-color: var(--q-button-hover-color);
646
+ color: var(--q-button-on-hover-color);
647
+ }
646
648
  }
647
649
  }
648
650
  &--tonal {
649
651
  background-color: rgb(var(--q-button-main-color-rgb) / 12%);
650
652
  border-color: transparent;
651
653
  color: var(--q-button-main-color);
652
- &:hover:not(:disabled) {
653
- background-color: var(--q-button-hover-color);
654
- border-color: var(--q-button-hover-color);
655
- color: var(--q-button-on-hover-color);
654
+ @media (hover: hover) {
655
+ &:hover:not(:disabled) {
656
+ background-color: var(--q-button-hover-color);
657
+ border-color: var(--q-button-hover-color);
658
+ color: var(--q-button-on-hover-color);
659
+ }
656
660
  }
657
661
  }
658
662
  &--outlined {
659
663
  background-color: transparent;
660
664
  border-color: var(--q-button-main-color);
661
665
  color: var(--q-button-main-color);
662
- &:hover:not(:disabled) {
663
- background-color: var(--q-button-hover-color);
664
- color: var(--q-button-on-hover-color);
665
- border-color: var(--q-button-hover-color);
666
+ @media (hover: hover) {
667
+ &:hover:not(:disabled) {
668
+ background-color: var(--q-button-hover-color);
669
+ color: var(--q-button-on-hover-color);
670
+ border-color: var(--q-button-hover-color);
671
+ }
666
672
  }
667
673
  }
668
674
  &--ghost {
669
675
  background-color: transparent;
670
676
  border-color: transparent;
671
677
  color: var(--q-button-main-color);
672
- &:hover:not(:disabled) {
673
- background-color: rgb(var(--q-button-hover-color-rgb) / 6%);
674
- border-color: transparent;
675
- color: var(--q-button-hover-color);
678
+ @media (hover: hover) {
679
+ &:hover:not(:disabled) {
680
+ background-color: rgb(var(--q-button-hover-color-rgb) / 6%);
681
+ border-color: transparent;
682
+ color: var(--q-button-hover-color);
683
+ }
676
684
  }
677
685
  }
678
686
  &--text {
679
687
  background-color: transparent;
680
688
  border-color: transparent;
681
689
  color: var(--q-button-main-color);
682
- &:hover:not(:disabled) {
683
- background-color: transparent;
684
- border-color: transparent;
685
- color: var(--q-button-hover-color);
690
+ @media (hover: hover) {
691
+ &:hover:not(:disabled) {
692
+ background-color: transparent;
693
+ border-color: transparent;
694
+ color: var(--q-button-hover-color);
695
+ }
686
696
  }
687
697
  }
688
698
  &--pill {
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, mergeModels as U, useModel as g, computed as t, ref as w, createBlock as D, openBlock as O, 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";
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"], pe = /* @__PURE__ */ F({
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__ */ U({
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 = g(d, "modelValue"), u = t({
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: !1
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)), _ = t(() => c(e.minTime)), A = t(() => c(e.maxTime)), B = t(() => i.value ? e.icons.clock : e.icons.calendar), M = t(() => ({
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
- })), p = w();
73
- R(p, M);
74
- function c(o) {
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) => (O(), D(r($), {
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" }, B.value),
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": _.value,
108
- "max-time": A.value,
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: q, onBlur: V, onFocus: C, onKeypress: f, onPaste: S }) => [
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: p,
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: q,
140
- onBlur: V,
141
- onFocus: C,
140
+ onInput: S,
141
+ onBlur: q,
142
+ onFocus: V,
142
143
  onKeypress: f,
143
144
  onKeydown: f,
144
- onPaste: S
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
- pe as default
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAA;AAGzD,OAAO,EAAE,eAAe,EAAE,CAAA;AAG1B,YAAY,EAAE,oBAAoB,EAAE,CAAA"}
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
- layerRef: HTMLDivElement;
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
- layerRef: HTMLDivElement;
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 +1 @@
1
- {"version":3,"file":"QDismissibleLayer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QDismissibleLayer/QDismissibleLayer.vue"],"names":[],"mappings":"AAKA;AAyIC,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAyH1E,iBAAS,cAAc;WA0BT,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;kBAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QDismissibleLayer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QDismissibleLayer/QDismissibleLayer.vue"],"names":[],"mappings":"AAKA;AAsKC,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAwJ1E,iBAAS,cAAc;WA0BT,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;kBAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,46 +1,64 @@
1
- import { defineComponent as a, ref as c, useId as f, onMounted as m, onUnmounted as p, createElementBlock as v, openBlock as E, renderSlot as y } from "vue";
2
- import { onClickOutside as b } from "../../vendors/@vueuse/core/index.js";
3
- import { useDismissibleLayerStackItem as w } from "../../composables/useDismissibleLayerStack/index.js";
4
- const h = /* @__PURE__ */ a({
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({
5
4
  __name: "QDismissibleLayer",
6
5
  emits: ["escape-key-down", "pointer-down-outside", "focus-outside", "interact-outside", "dismiss"],
7
- setup(_, { emit: u }) {
8
- const o = u, i = c(null), l = f(), e = w(l);
9
- function r(n) {
10
- n.key === "Escape" && (e != null && e.isTop()) && (o("escape-key-down", n), n.defaultPrevented || o("dismiss", n));
6
+ setup(L, { emit: c }) {
7
+ const o = c, u = m("layer"), l = v(), e = _(l);
8
+ let i = [];
9
+ function r(t) {
10
+ t.key === "Escape" && (e != null && e.isTop()) && (o("escape-key-down", t), t.defaultPrevented || o("dismiss", t));
11
11
  }
12
- function d(n) {
13
- if (!i.value) return;
14
- const t = n.target;
15
- if (!i.value.contains(t) && (e != null && e.isTop())) {
16
- const s = new CustomEvent("focus-outside", {
12
+ function d(t) {
13
+ if (!u.value) return;
14
+ const s = t.target;
15
+ if (!u.value.contains(s) && (e != null && e.isTop())) {
16
+ const n = new CustomEvent("focus-outside", {
17
17
  bubbles: !1,
18
18
  cancelable: !0,
19
- detail: { originalEvent: n }
19
+ detail: { originalEvent: t }
20
20
  });
21
- o("focus-outside", s), o("interact-outside", s), s.defaultPrevented || o("dismiss", s);
21
+ o("focus-outside", n), o("interact-outside", n), n.defaultPrevented || o("dismiss", n);
22
22
  }
23
23
  }
24
- return m(() => {
25
- e == null || e.register(), document.addEventListener("keydown", r), document.addEventListener("focusin", d), b(i, (n) => {
26
- if (!(e != null && e.isTop())) return;
27
- const t = new CustomEvent("pointer-down-outside", {
24
+ function a(t) {
25
+ if (!u.value || !(e != null && e.isTop())) return;
26
+ const s = t.target;
27
+ if (!u.value.contains(s)) {
28
+ const n = new CustomEvent("pointer-down-outside", {
28
29
  bubbles: !1,
29
30
  cancelable: !0,
30
- detail: { originalEvent: n }
31
+ detail: { originalEvent: t }
32
+ });
33
+ o("pointer-down-outside", n), o("interact-outside", n), n.defaultPrevented || o("dismiss", n);
34
+ }
35
+ }
36
+ function f() {
37
+ ["mousedown", "touchstart"].forEach((s) => {
38
+ document.addEventListener(s, a, {
39
+ passive: !0,
40
+ capture: !0
41
+ // Use capture phase to ensure we catch the event
42
+ }), i.push(() => {
43
+ document.removeEventListener(s, a, {
44
+ capture: !0
45
+ });
31
46
  });
32
- o("pointer-down-outside", t), o("interact-outside", t), t.defaultPrevented || o("dismiss", t);
33
47
  });
34
- }), p(() => {
35
- e == null || e.unregister(), document.removeEventListener("keydown", r), document.removeEventListener("focusin", d);
36
- }), (n, t) => (E(), v(
48
+ }
49
+ return E(() => {
50
+ e == null || e.register(), document.addEventListener("keydown", r), i.push(() => {
51
+ document.removeEventListener("keydown", r);
52
+ }), document.addEventListener("focusin", d), i.push(() => {
53
+ document.removeEventListener("focusin", d);
54
+ }), f();
55
+ }), w(() => {
56
+ e == null || e.unregister(), i.forEach((t) => t()), i = [];
57
+ }), (t, s) => (y(), h(
37
58
  "div",
38
- {
39
- ref_key: "layerRef",
40
- ref: i
41
- },
59
+ g,
42
60
  [
43
- y(n.$slots, "default")
61
+ b(t.$slots, "default")
44
62
  ],
45
63
  512
46
64
  /* NEED_PATCH */
@@ -48,5 +66,5 @@ const h = /* @__PURE__ */ a({
48
66
  }
49
67
  });
50
68
  export {
51
- h as default
69
+ P as default
52
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
- layerRef: HTMLDivElement;
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(() => a.panels.find((e) => e.id === m.value)), h = r(() => !!i.value), t = b(), q = r(() => {
26
- if (t.value !== void 0)
27
- return h.value ? typeof t.value == "number" ? `${a.anchorWidth + t.value}px` : `calc(${a.anchorWidth}px + ${t.value})` : `${a.anchorWidth}px`;
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, l, d, v, p, c, $;
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-${(l = i.value) == null ? void 0 : l.minWidth}`]: ((d = i.value) == null ? void 0 : d.resizable) && ((v = i.value) == null ? void 0 : v.minWidth) !== void 0,
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
- t.value = e, u("resize", e);
48
+ l.value = e, u("resize", e);
46
49
  }
47
50
  function B() {
48
- u("resize:end", t.value);
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 l;
58
- const e = (l = i.value) == null ? void 0 : l.initialWidth;
59
- typeof e == "number" ? t.value = e : t.value = void 0;
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, l) => (w(), A(
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": l[0] || (l[0] = (d) => n.value = d),
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAyD09e,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;EAxCxqf;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAwB8hf,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;kBAfvqf,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
+ {"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 w, mergeModels as c, useModel as C, ref as d, watch as L, nextTick as q, createElementBlock as u, openBlock as s, normalizeStyle as f, createElementVNode as m, Fragment as I, renderList as V, createBlock as p, unref as h, withCtx as B, renderSlot as S, createCommentVNode as $, mergeProps as E } from "vue";
2
- import { QIcon as M } from "../QIcon/index.js";
3
- import { QToggle as Q } from "../QToggle/index.js";
4
- const T = { class: "q-sidebar__items" }, W = /* @__PURE__ */ w({
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__ */ c({
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__ */ c(["click:item"], ["update:modelValue"]),
15
- setup(r, { emit: v }) {
16
- const i = r, _ = v, o = C(r, "modelValue"), a = d({
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 = d([]);
22
- function g(e) {
23
- o.value = o.value === e ? void 0 : e, _("click:item", 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 b() {
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((x) => x.id === o.value);
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 k = e === l.value.length - 1 ? n.offsetHeight : n.offsetHeight - 1, y = n.offsetTop;
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: `${k}px`,
43
- transform: `translateY(${y}px)`,
43
+ height: `${y}px`,
44
+ transform: `translateY(${x}px)`,
44
45
  opacity: "1"
45
46
  };
46
47
  }
47
- return L(o, () => q(b), { immediate: !0 }), (e, n) => (s(), u(
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: f({ width: i.anchorWidth + "px" })
52
+ style: m({ width: i.anchorWidth + "px" })
52
53
  },
53
54
  [
54
- m("div", T, [
55
- m(
55
+ p("div", H, [
56
+ p(
56
57
  "div",
57
58
  {
58
59
  class: "q-sidebar__indicator",
59
- style: f(a.value)
60
+ style: m(a.value)
60
61
  },
61
62
  null,
62
63
  4
63
64
  /* STYLE */
64
65
  ),
65
- (s(!0), u(
66
- I,
66
+ (s(!0), f(
67
+ V,
67
68
  null,
68
- V(e.panels, (t) => (s(), p(h(Q), {
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: () => g(t.id)
80
+ onClick: () => b(t.id)
80
81
  }, {
81
- default: B(() => [
82
- S(e.$slots, t.id, { item: t }, () => [
83
- t.icon ? (s(), p(
84
- h(M),
85
- E({
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
- )) : $("v-if", !0)
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
- W as default
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