@quidgest/ui 0.16.61 → 0.16.64

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,31 +1,31 @@
1
- import { defineComponent as A, ref as h, computed as k, createBlock as c, openBlock as t, unref as a, normalizeClass as g, withCtx as p, createElementVNode as B, createElementBlock as i, createCommentVNode as s, renderSlot as n, toDisplayString as v, createVNode as m, normalizeProps as V, guardReactiveProps as b, createTextVNode as L, Fragment as U, renderList as w, mergeProps as $ } from "vue";
2
- import { DEFAULT_ICONS as E, DEFAULT_BUTTONS as Q, DEFAULT_ICON as M } from "./constants.js";
1
+ import { defineComponent as E, ref as h, computed as k, createBlock as d, openBlock as t, unref as a, normalizeClass as g, withCtx as p, createElementVNode as B, createElementBlock as i, createCommentVNode as s, renderSlot as n, toDisplayString as m, createVNode as _, normalizeProps as V, guardReactiveProps as b, createTextVNode as L, Fragment as U, renderList as w, mergeProps as $ } from "vue";
2
+ import { DEFAULT_ICONS as Q, DEFAULT_BUTTONS as M, DEFAULT_ICON as S } from "./constants.js";
3
3
  import { QButton as q } from "../QButton/index.js";
4
4
  import { QIcon as f } from "../QIcon/index.js";
5
- import { QOverlay as S } from "../QOverlay/index.js";
6
- import { QTextField as W } from "../QTextField/index.js";
7
- const I = {
5
+ import { QOverlay as W } from "../QOverlay/index.js";
6
+ import { QTextField as I } from "../QTextField/index.js";
7
+ const P = {
8
8
  key: 0,
9
9
  class: "q-dialog__header"
10
- }, P = {
10
+ }, H = {
11
11
  key: 0,
12
12
  class: "q-dialog__header-title"
13
- }, H = {
13
+ }, x = {
14
14
  key: 1,
15
15
  class: "q-dialog__body"
16
- }, x = {
16
+ }, R = {
17
17
  key: 0,
18
18
  class: "q-dialog__body-icon"
19
- }, R = { class: "q-dialog__body-text" }, j = ["innerHTML"], G = { key: 1 }, J = {
19
+ }, j = { class: "q-dialog__body-text" }, G = ["innerHTML"], J = { key: 1 }, K = {
20
20
  key: 0,
21
21
  class: "q-dialog__input"
22
- }, K = {
22
+ }, X = {
23
23
  key: 2,
24
24
  class: "q-dialog__footer"
25
- }, X = {
25
+ }, Y = {
26
26
  key: 0,
27
27
  class: "q-dialog__footer-buttons"
28
- }, ae = /* @__PURE__ */ A({
28
+ }, ie = /* @__PURE__ */ E({
29
29
  __name: "QDialog",
30
30
  props: {
31
31
  id: {},
@@ -33,8 +33,8 @@ const I = {
33
33
  modelValue: { type: Boolean },
34
34
  title: {},
35
35
  text: {},
36
- icon: { default: () => M },
37
- buttons: { default: () => Q },
36
+ icon: { default: () => S },
37
+ buttons: { default: () => M },
38
38
  backdropBlur: { type: Boolean, default: !0 },
39
39
  size: { default: "small" },
40
40
  centerVertically: { type: Boolean },
@@ -48,27 +48,30 @@ const I = {
48
48
  dismissible: { type: Boolean },
49
49
  html: { type: Boolean, default: !0 },
50
50
  input: {},
51
- icons: { default: () => E }
51
+ icons: { default: () => Q }
52
52
  },
53
53
  emits: ["update:modelValue"],
54
54
  setup(C, { emit: F }) {
55
55
  const e = C, T = F, u = h(""), r = h(""), D = k(() => ["q-dialog", e.class]), O = k(() => `q-overlay--${e.size}`);
56
- function _() {
57
- y(!1);
56
+ function N() {
57
+ v(!0);
58
+ }
59
+ function y() {
60
+ v(!1);
58
61
  }
59
- function N(o) {
60
- var d, l;
62
+ function z(o) {
63
+ var c, l;
61
64
  if (o.action) {
62
- if ((d = e.input) != null && d.validator && (r.value = e.input.validator(a(u)), a(r)))
65
+ if ((c = e.input) != null && c.validator && (r.value = e.input.validator(a(u)), a(r)))
63
66
  return;
64
67
  (l = o.action) == null || l.call(o, a(u));
65
68
  }
66
- _();
69
+ y();
67
70
  }
68
- function y(o) {
71
+ function v(o) {
69
72
  T("update:modelValue", o);
70
73
  }
71
- return (o, d) => (t(), c(a(S), {
74
+ return (o, c) => (t(), d(a(W), {
72
75
  id: e.id,
73
76
  "model-value": e.modelValue,
74
77
  "backdrop-class": "q-dialog__underlay",
@@ -84,7 +87,8 @@ const I = {
84
87
  "closing-focus": e.closingFocus,
85
88
  "return-focus-on-deactivate": e.returnFocusOnDeactivate,
86
89
  class: g(O.value),
87
- "onUpdate:modelValue": y
90
+ onEnter: N,
91
+ "onUpdate:modelValue": v
88
92
  }, {
89
93
  default: p(() => [
90
94
  B(
@@ -93,26 +97,26 @@ const I = {
93
97
  class: g(D.value)
94
98
  },
95
99
  [
96
- e.title || o.$slots.header || o.$slots["header.prepend"] || o.$slots["header.append"] ? (t(), i("div", I, [
100
+ e.title || o.$slots.header || o.$slots["header.prepend"] || o.$slots["header.append"] ? (t(), i("div", P, [
97
101
  n(o.$slots, "header", {}, () => [
98
102
  n(o.$slots, "header.prepend"),
99
103
  e.title ? (t(), i(
100
104
  "span",
101
- P,
102
- v(e.title),
105
+ H,
106
+ m(e.title),
103
107
  1
104
108
  /* TEXT */
105
109
  )) : s("v-if", !0),
106
110
  n(o.$slots, "header.append")
107
111
  ])
108
112
  ])) : s("v-if", !0),
109
- e.icon || e.text || o.$slots.body ? (t(), i("div", H, [
113
+ e.icon || e.text || o.$slots.body ? (t(), i("div", x, [
110
114
  n(o.$slots, "body", {}, () => {
111
115
  var l;
112
116
  return [
113
117
  n(o.$slots, "body.icon", {}, () => [
114
- e.icon ? (t(), i("span", x, [
115
- m(
118
+ e.icon ? (t(), i("span", R, [
119
+ _(
116
120
  a(f),
117
121
  V(b(e.icon)),
118
122
  null,
@@ -121,33 +125,33 @@ const I = {
121
125
  )
122
126
  ])) : s("v-if", !0)
123
127
  ]),
124
- B("div", R, [
128
+ B("div", j, [
125
129
  e.html ? (t(), i("div", {
126
130
  key: 0,
127
131
  innerHTML: e.text
128
- }, null, 8, j)) : (t(), i(
132
+ }, null, 8, G)) : (t(), i(
129
133
  "div",
130
- G,
131
- v(e.text),
134
+ J,
135
+ m(e.text),
132
136
  1
133
137
  /* TEXT */
134
138
  ))
135
139
  ]),
136
- e.input ? (t(), i("div", J, [
137
- m(a(W), {
140
+ e.input ? (t(), i("div", K, [
141
+ _(a(I), {
138
142
  modelValue: u.value,
139
- "onUpdate:modelValue": d[0] || (d[0] = (z) => u.value = z),
143
+ "onUpdate:modelValue": c[0] || (c[0] = (A) => u.value = A),
140
144
  invalid: !!r.value,
141
145
  placeholder: (l = e.input) == null ? void 0 : l.placeholder,
142
146
  size: "block"
143
147
  }, {
144
148
  extras: p(() => [
145
- r.value ? (t(), c(a(f), {
149
+ r.value ? (t(), d(a(f), {
146
150
  key: 0,
147
151
  icon: "exclamation-sign"
148
152
  })) : s("v-if", !0),
149
153
  L(
150
- " " + v(r.value),
154
+ " " + m(r.value),
151
155
  1
152
156
  /* TEXT */
153
157
  )
@@ -160,17 +164,17 @@ const I = {
160
164
  ];
161
165
  })
162
166
  ])) : s("v-if", !0),
163
- e.buttons || o.$slots["footer.append"] ? (t(), i("div", K, [
164
- e.buttons ? (t(), i("span", X, [
167
+ e.buttons || o.$slots["footer.append"] ? (t(), i("div", X, [
168
+ e.buttons ? (t(), i("span", Y, [
165
169
  (t(!0), i(
166
170
  U,
167
171
  null,
168
- w(e.buttons, (l) => (t(), c(a(q), $({ ref_for: !0 }, l.props, {
172
+ w(e.buttons, (l) => (t(), d(a(q), $({ ref_for: !0 }, l.props, {
169
173
  key: l.id,
170
- onClick: () => N(l)
174
+ onClick: () => z(l)
171
175
  }), {
172
176
  default: p(() => [
173
- l.icon ? (t(), c(
177
+ l.icon ? (t(), d(
174
178
  a(f),
175
179
  $({
176
180
  key: 0,
@@ -190,14 +194,14 @@ const I = {
190
194
  ])) : s("v-if", !0),
191
195
  n(o.$slots, "footer.append")
192
196
  ])) : s("v-if", !0),
193
- e.dismissible ? (t(), c(a(q), {
197
+ e.dismissible ? (t(), d(a(q), {
194
198
  key: 3,
195
199
  class: "q-dialog__close",
196
200
  variant: "text",
197
- onClick: _
201
+ onClick: y
198
202
  }, {
199
203
  default: p(() => [
200
- m(
204
+ _(
201
205
  a(f),
202
206
  V(b(e.icons.close)),
203
207
  null,
@@ -219,5 +223,5 @@ const I = {
219
223
  }
220
224
  });
221
225
  export {
222
- ae as default
226
+ ie as default
223
227
  };
@@ -1 +1 @@
1
- {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAKhD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAGrF"}
1
+ {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAMhD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAGrF"}
@@ -1,8 +1,9 @@
1
1
  import { toValue as e, ref as t } from "vue";
2
- function n(o) {
2
+ import u from "../vendors/uuid/dist/v4.js";
3
+ function i(o) {
3
4
  const r = e(o);
4
- return t(r ?? `uid-${crypto.randomUUID()}`);
5
+ return t(r ?? `uid-${u()}`);
5
6
  }
6
7
  export {
7
- n as useId
8
+ i as useId
8
9
  };
@@ -0,0 +1,4 @@
1
+ const o = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), t = { randomUUID: o };
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,13 @@
1
+ let t;
2
+ const e = new Uint8Array(16);
3
+ function o() {
4
+ if (!t) {
5
+ if (typeof crypto > "u" || !crypto.getRandomValues)
6
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
7
+ t = crypto.getRandomValues.bind(crypto);
8
+ }
9
+ return t(e);
10
+ }
11
+ export {
12
+ o as default
13
+ };
@@ -0,0 +1,9 @@
1
+ const i = [];
2
+ for (let n = 0; n < 256; ++n)
3
+ i.push((n + 256).toString(16).slice(1));
4
+ function c(n, u = 0) {
5
+ return (i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]]).toLowerCase();
6
+ }
7
+ export {
8
+ c as unsafeStringify
9
+ };
@@ -0,0 +1,17 @@
1
+ import t from "./native.js";
2
+ import m from "./rng.js";
3
+ import { unsafeStringify as a } from "./stringify.js";
4
+ function d(r, n, u) {
5
+ var e;
6
+ r = r || {};
7
+ const f = r.random ?? ((e = r.rng) == null ? void 0 : e.call(r)) ?? m();
8
+ if (f.length < 16)
9
+ throw new Error("Random bytes length must be >= 16");
10
+ return f[6] = f[6] & 15 | 64, f[8] = f[8] & 63 | 128, a(f);
11
+ }
12
+ function o(r, n, u) {
13
+ return t.randomUUID ? t.randomUUID() : d(r);
14
+ }
15
+ export {
16
+ o as default
17
+ };
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.61",
4
+ "version": "0.16.64",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",
@@ -74,7 +74,8 @@
74
74
  "@vuepic/vue-datepicker": "^11.0.3",
75
75
  "@vueuse/core": "^13.0.0",
76
76
  "@vueuse/integrations": "^13.0.0",
77
- "maska": "^3.1.0"
77
+ "maska": "^3.1.0",
78
+ "uuid": "^13.0.0"
78
79
  },
79
80
  "scripts": {
80
81
  "clean": "rimraf dist esm coverage storybook-static",