@quidgest/ui 0.16.37 → 0.16.38

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as Q, mergeModels as g, useModel as A, ref as V, computed as b, createBlock as c, openBlock as l, unref as a, normalizeClass as B, withCtx as p, createElementVNode as $, createElementBlock as i, createCommentVNode as s, renderSlot as r, toDisplayString as v, createVNode as _, normalizeProps as q, guardReactiveProps as C, createTextVNode as O, Fragment as S, renderList as I, mergeProps as T } from "vue";
1
+ import { defineComponent as Q, mergeModels as g, useModel as A, ref as V, computed as b, createBlock as c, openBlock as l, unref as a, normalizeClass as B, withCtx as p, createElementVNode as $, createElementBlock as s, createCommentVNode as i, renderSlot as n, toDisplayString as v, createVNode as _, normalizeProps as q, guardReactiveProps as C, createTextVNode as O, Fragment as S, renderList as I, mergeProps as T } from "vue";
2
2
  import { DEFAULT_ICONS as P, DEFAULT_BUTTONS as H, DEFAULT_ICON as w } from "./constants.js";
3
3
  import { QButton as L } from "../QButton/index.js";
4
4
  import { QIcon as f } from "../QIcon/index.js";
@@ -25,7 +25,7 @@ const j = {
25
25
  }, oe = {
26
26
  key: 0,
27
27
  class: "q-dialog__footer-buttons"
28
- }, re = /* @__PURE__ */ Q({
28
+ }, ne = /* @__PURE__ */ Q({
29
29
  __name: "QDialog",
30
30
  props: /* @__PURE__ */ g({
31
31
  id: {},
@@ -39,6 +39,7 @@ const j = {
39
39
  centerVertically: { type: Boolean },
40
40
  attach: { default: "body" },
41
41
  inline: { type: Boolean },
42
+ focusTrap: { type: Boolean, default: !0 },
42
43
  dismissible: { type: Boolean },
43
44
  html: { type: Boolean, default: !0 },
44
45
  input: {},
@@ -54,9 +55,9 @@ const j = {
54
55
  m.value = !1;
55
56
  }
56
57
  function E(o) {
57
- var n, t;
58
+ var r, t;
58
59
  if (o.action) {
59
- if ((n = e.input) != null && n.validator && (d.value = e.input.validator(a(u)), a(d)))
60
+ if ((r = e.input) != null && r.validator && (d.value = e.input.validator(a(u)), a(d)))
60
61
  return;
61
62
  (t = o.action) == null || t.call(o, a(u));
62
63
  }
@@ -68,10 +69,10 @@ const j = {
68
69
  function U() {
69
70
  k("leave");
70
71
  }
71
- return (o, n) => (l(), c(a(x), {
72
+ return (o, r) => (l(), c(a(x), {
72
73
  id: e.id,
73
74
  modelValue: m.value,
74
- "onUpdate:modelValue": n[1] || (n[1] = (t) => m.value = t),
75
+ "onUpdate:modelValue": r[1] || (r[1] = (t) => m.value = t),
75
76
  "backdrop-class": "q-dialog__underlay",
76
77
  "scroll-lock": "",
77
78
  persistent: "",
@@ -79,6 +80,7 @@ const j = {
79
80
  attach: e.attach,
80
81
  "backdrop-blur": e.backdropBlur,
81
82
  "center-vertically": e.centerVertically,
83
+ "focus-trap": e.focusTrap,
82
84
  class: B(D.value),
83
85
  onEnter: M,
84
86
  onLeave: U
@@ -90,25 +92,25 @@ const j = {
90
92
  class: B(z.value)
91
93
  },
92
94
  [
93
- e.title || o.$slots.header || o.$slots["header.prepend"] || o.$slots["header.append"] ? (l(), i("div", j, [
94
- r(o.$slots, "header", {}, () => [
95
- r(o.$slots, "header.prepend"),
96
- e.title ? (l(), i(
95
+ e.title || o.$slots.header || o.$slots["header.prepend"] || o.$slots["header.append"] ? (l(), s("div", j, [
96
+ n(o.$slots, "header", {}, () => [
97
+ n(o.$slots, "header.prepend"),
98
+ e.title ? (l(), s(
97
99
  "span",
98
100
  G,
99
101
  v(e.title),
100
102
  1
101
103
  /* TEXT */
102
- )) : s("v-if", !0),
103
- r(o.$slots, "header.append")
104
+ )) : i("v-if", !0),
105
+ n(o.$slots, "header.append")
104
106
  ])
105
- ])) : s("v-if", !0),
106
- e.icon || e.text || o.$slots.body ? (l(), i("div", J, [
107
- r(o.$slots, "body", {}, () => {
107
+ ])) : i("v-if", !0),
108
+ e.icon || e.text || o.$slots.body ? (l(), s("div", J, [
109
+ n(o.$slots, "body", {}, () => {
108
110
  var t;
109
111
  return [
110
- r(o.$slots, "body.icon", {}, () => [
111
- e.icon ? (l(), i("span", K, [
112
+ n(o.$slots, "body.icon", {}, () => [
113
+ e.icon ? (l(), s("span", K, [
112
114
  _(
113
115
  a(f),
114
116
  q(C(e.icon)),
@@ -116,13 +118,13 @@ const j = {
116
118
  16
117
119
  /* FULL_PROPS */
118
120
  )
119
- ])) : s("v-if", !0)
121
+ ])) : i("v-if", !0)
120
122
  ]),
121
123
  $("div", W, [
122
- e.html ? (l(), i("div", {
124
+ e.html ? (l(), s("div", {
123
125
  key: 0,
124
126
  innerHTML: e.text
125
- }, null, 8, X)) : (l(), i(
127
+ }, null, 8, X)) : (l(), s(
126
128
  "div",
127
129
  Y,
128
130
  v(e.text),
@@ -130,10 +132,10 @@ const j = {
130
132
  /* TEXT */
131
133
  ))
132
134
  ]),
133
- e.input ? (l(), i("div", Z, [
135
+ e.input ? (l(), s("div", Z, [
134
136
  _(a(R), {
135
137
  modelValue: u.value,
136
- "onUpdate:modelValue": n[0] || (n[0] = (F) => u.value = F),
138
+ "onUpdate:modelValue": r[0] || (r[0] = (F) => u.value = F),
137
139
  invalid: !!d.value,
138
140
  placeholder: (t = e.input) == null ? void 0 : t.placeholder,
139
141
  size: "block"
@@ -142,7 +144,7 @@ const j = {
142
144
  d.value ? (l(), c(a(f), {
143
145
  key: 0,
144
146
  icon: "exclamation-sign"
145
- })) : s("v-if", !0),
147
+ })) : i("v-if", !0),
146
148
  O(
147
149
  " " + v(d.value),
148
150
  1
@@ -152,14 +154,14 @@ const j = {
152
154
  _: 1
153
155
  /* STABLE */
154
156
  }, 8, ["modelValue", "invalid", "placeholder"])
155
- ])) : s("v-if", !0),
156
- r(o.$slots, "body.append")
157
+ ])) : i("v-if", !0),
158
+ n(o.$slots, "body.append")
157
159
  ];
158
160
  })
159
- ])) : s("v-if", !0),
160
- e.buttons || o.$slots["footer.append"] ? (l(), i("div", ee, [
161
- e.buttons ? (l(), i("span", oe, [
162
- (l(!0), i(
161
+ ])) : i("v-if", !0),
162
+ e.buttons || o.$slots["footer.append"] ? (l(), s("div", ee, [
163
+ e.buttons ? (l(), s("span", oe, [
164
+ (l(!0), s(
163
165
  S,
164
166
  null,
165
167
  I(e.buttons, (t) => (l(), c(a(L), T({ ref_for: !0 }, t.props, {
@@ -176,7 +178,7 @@ const j = {
176
178
  null,
177
179
  16
178
180
  /* FULL_PROPS */
179
- )) : s("v-if", !0)
181
+ )) : i("v-if", !0)
180
182
  ]),
181
183
  _: 2
182
184
  /* DYNAMIC */
@@ -184,9 +186,9 @@ const j = {
184
186
  128
185
187
  /* KEYED_FRAGMENT */
186
188
  ))
187
- ])) : s("v-if", !0),
188
- r(o.$slots, "footer.append")
189
- ])) : s("v-if", !0),
189
+ ])) : i("v-if", !0),
190
+ n(o.$slots, "footer.append")
191
+ ])) : i("v-if", !0),
190
192
  e.dismissible ? (l(), c(a(L), {
191
193
  key: 3,
192
194
  class: "q-dialog__close",
@@ -204,7 +206,7 @@ const j = {
204
206
  ]),
205
207
  _: 1
206
208
  /* STABLE */
207
- })) : s("v-if", !0)
209
+ })) : i("v-if", !0)
208
210
  ],
209
211
  2
210
212
  /* CLASS */
@@ -212,9 +214,9 @@ const j = {
212
214
  ]),
213
215
  _: 3
214
216
  /* FORWARDED */
215
- }, 8, ["id", "modelValue", "inline", "attach", "backdrop-blur", "center-vertically", "class"]));
217
+ }, 8, ["id", "modelValue", "inline", "attach", "backdrop-blur", "center-vertically", "focus-trap", "class"]));
216
218
  }
217
219
  });
218
220
  export {
219
- re as default
221
+ ne as default
220
222
  };
@@ -11,6 +11,7 @@ declare const QDialog: {
11
11
  centerVertically?: boolean;
12
12
  attach?: string;
13
13
  inline?: boolean;
14
+ focusTrap?: boolean;
14
15
  dismissible?: boolean;
15
16
  html?: boolean;
16
17
  input?: import('./types').QDialogInputOption;
@@ -31,6 +32,7 @@ declare const QDialog: {
31
32
  icons: typeof import('./constants').DEFAULT_ICONS;
32
33
  backdropBlur: boolean;
33
34
  attach: string;
35
+ focusTrap: boolean;
34
36
  buttons: import('./types').DialogButton[];
35
37
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
36
38
  P: {};
@@ -51,6 +53,7 @@ declare const QDialog: {
51
53
  centerVertically?: boolean;
52
54
  attach?: string;
53
55
  inline?: boolean;
56
+ focusTrap?: boolean;
54
57
  dismissible?: boolean;
55
58
  html?: boolean;
56
59
  input?: import('./types').QDialogInputOption;
@@ -66,6 +69,7 @@ declare const QDialog: {
66
69
  icons: typeof import('./constants').DEFAULT_ICONS;
67
70
  backdropBlur: boolean;
68
71
  attach: string;
72
+ focusTrap: boolean;
69
73
  buttons: import('./types').DialogButton[];
70
74
  }>;
71
75
  __isFragment?: never;
@@ -83,6 +87,7 @@ declare const QDialog: {
83
87
  centerVertically?: boolean;
84
88
  attach?: string;
85
89
  inline?: boolean;
90
+ focusTrap?: boolean;
86
91
  dismissible?: boolean;
87
92
  html?: boolean;
88
93
  input?: import('./types').QDialogInputOption;
@@ -103,6 +108,7 @@ declare const QDialog: {
103
108
  icons: typeof import('./constants').DEFAULT_ICONS;
104
109
  backdropBlur: boolean;
105
110
  attach: string;
111
+ focusTrap: boolean;
106
112
  buttons: import('./types').DialogButton[];
107
113
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
108
114
  $slots: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDialog/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AACzC,QAAA,MAAM,eAAe;;;;kFAAoC,CAAA;AAGzD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA;AAGnC,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QDialog/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AACzC,QAAA,MAAM,eAAe;;;;kFAAoC,CAAA;AAGzD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA;AAGnC,cAAc,SAAS,CAAA"}
@@ -60,6 +60,13 @@ export type QDialogProps = QBaseComponentProps & {
60
60
  * @category Behavior
61
61
  */
62
62
  inline?: boolean;
63
+ /**
64
+ * Whether to enable focus trapping within the dialog.
65
+ * When enabled, focus will be constrained to elements within the dialog.
66
+ *
67
+ * @category Behavior
68
+ */
69
+ focusTrap?: boolean;
63
70
  /**
64
71
  * True if the dialog window can be closed, false otherwise.
65
72
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QDialog/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEjE,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAA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5B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IAEX;;OAEG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;IAEnC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;CACjD,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IAClC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA"}
@@ -266,7 +266,7 @@ const Te = ["id"], Ce = ["role"], $e = /* @__PURE__ */ ue({
266
266
  default: L(() => [
267
267
  E.value ? (u(), B(C(ke), {
268
268
  key: 0,
269
- disabled: t.nonModal || !r.value,
269
+ disabled: t.nonModal || !r.value || !t.focusTrap,
270
270
  options: { fallbackFocus: E.value }
271
271
  }, {
272
272
  default: L(() => [
@@ -56,6 +56,7 @@ export declare function useDialog(): {
56
56
  centerVertically?: boolean | undefined;
57
57
  attach?: string | undefined;
58
58
  inline?: boolean | undefined;
59
+ focusTrap?: boolean | undefined;
59
60
  dismissible?: boolean | undefined;
60
61
  html?: boolean | undefined;
61
62
  input?: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASrF;;;;GAIG;AACH,wBAAgB,SAAS;uBASE,YAAY,OAAO,MAAM,YAAY,cAAc;uBAgBnD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAaoc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADre"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASrF;;;;GAIG;AACH,wBAAgB,SAAS;uBASE,YAAY,OAAO,MAAM,YAAY,cAAc;uBAgBnD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAakoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADnqB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.16.37",
4
+ "version": "0.16.38",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",