@quidgest/ui 0.16.35 → 0.16.36

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,7 +1,7 @@
1
- import { defineComponent as G, ref as c, computed as g, watch as Q, nextTick as S, createElementBlock as d, openBlock as i, normalizeClass as h, createElementVNode as a, createBlock as p, createCommentVNode as f, Fragment as y, renderList as _, unref as m, withCtx as k, renderSlot as C } from "vue";
2
- import { QPropertyListGroup as N, QPropertyListRow as O, QPropertyListPanel as V } from "./index.js";
3
- import { DEFAULT_TEXTS as $, DEFAULT_ICONS as D } from "./types.js";
4
- const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G({
1
+ import { defineComponent as A, ref as p, computed as g, watch as G, nextTick as Q, createElementBlock as u, openBlock as s, normalizeClass as h, createElementVNode as a, createBlock as f, createCommentVNode as c, Fragment as y, renderList as k, unref as m, withCtx as _, renderSlot as F } from "vue";
2
+ import { QPropertyListGroup as W, QPropertyListRow as N, QPropertyListPanel as O } from "./index.js";
3
+ import { DEFAULT_TEXTS as V, DEFAULT_ICONS as $ } from "./types.js";
4
+ const D = ["id"], U = { class: "q-property-list__table" }, j = /* @__PURE__ */ A({
5
5
  __name: "QPropertyList",
6
6
  props: {
7
7
  id: {},
@@ -13,14 +13,14 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
13
13
  noPanel: { type: Boolean },
14
14
  noToggle: { type: Boolean },
15
15
  readonly: { type: Boolean },
16
- icons: { default: () => D },
17
- texts: { default: () => $ }
16
+ icons: { default: () => $ },
17
+ texts: { default: () => V }
18
18
  },
19
19
  emits: ["field-change", "select-field"],
20
- setup(F, { emit: b }) {
21
- const t = F, v = b, u = c(t.groups.map((e) => e.id)), s = c(void 0), r = c(null), x = g(() => t.groups.length ? t.groups.filter(
20
+ setup(C, { emit: b }) {
21
+ const t = C, v = b, d = p(t.groups.map((e) => e.id)), n = p(void 0), r = p(null), x = g(() => t.groups.length ? t.groups.filter(
22
22
  (e) => t.fields.some((o) => o.group === e.id)
23
- ) : [{ id: "", title: "" }]), w = g(() => [
23
+ ) : [{ id: "", title: "" }]), P = g(() => [
24
24
  "q-property-list",
25
25
  {
26
26
  "q-property-list--side-panel": t.panelPosition === "right",
@@ -28,54 +28,52 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
28
28
  },
29
29
  t.class
30
30
  ]);
31
- function P() {
32
- if (!r.value) return;
33
- const e = r.value.offsetWidth;
34
- r.value.style.width = `${e}px`;
35
- }
36
- function q() {
31
+ function B() {
37
32
  var e;
38
- (e = r.value) != null && e.contains(document.activeElement) || (s.value = void 0);
39
- }
40
- function B(e) {
41
- return e ? t.fields.filter((o) => o.group === e) : t.fields;
33
+ (e = r.value) != null && e.contains(document.activeElement) || (n.value = void 0);
42
34
  }
43
35
  function L(e) {
44
- const o = u.value.indexOf(e);
45
- o === -1 ? u.value.push(e) : u.value.splice(o, 1);
36
+ return e ? t.fields.filter((o) => o.group === e) : t.fields;
46
37
  }
47
38
  function T(e) {
39
+ const o = d.value.indexOf(e);
40
+ o === -1 ? d.value.push(e) : d.value.splice(o, 1);
41
+ }
42
+ function q(e) {
48
43
  var l;
49
- const o = e.group && !u.value.includes(e.group), n = ((l = s.value) == null ? void 0 : l.id) === e.id;
50
44
  return [
51
45
  {
52
- "q-property-list__row--closed": o,
53
- "q-property-list__row--selected": n
46
+ "q-property-list__row--selected": ((l = n.value) == null ? void 0 : l.id) === e.id
54
47
  }
55
48
  ];
56
49
  }
57
- function E(e) {
58
- s.value = e, v("select-field", s.value.id);
50
+ function w(e) {
51
+ n.value = e, v("select-field", n.value.id);
59
52
  }
60
- function R(e, o) {
53
+ function E(e, o) {
61
54
  t.readonly || (e.props.readonly ?? !1) || v("field-change", e, o);
62
55
  }
63
- return Q(
56
+ function R() {
57
+ if (!r.value) return;
58
+ const e = r.value.offsetWidth;
59
+ r.value.style.minWidth = `${e}px`;
60
+ }
61
+ return G(
64
62
  () => t.block,
65
63
  async (e) => {
66
64
  var o;
67
- await S(), e ? (o = r.value) == null || o.removeAttribute("style") : P();
65
+ await Q(), e ? (o = r.value) == null || o.removeAttribute("style") : R();
68
66
  },
69
67
  { immediate: !0 }
70
- ), (e, o) => (i(), d("div", {
68
+ ), (e, o) => (s(), u("div", {
71
69
  id: t.id,
72
70
  ref_key: "componentRoot",
73
71
  ref: r,
74
72
  tabindex: "0",
75
- class: h(w.value),
76
- onFocusout: q
73
+ class: h(P.value),
74
+ onFocusout: B
77
75
  }, [
78
- a("table", W, [
76
+ a("table", U, [
79
77
  o[0] || (o[0] = a(
80
78
  "thead",
81
79
  { class: "q-property-list__header" },
@@ -88,44 +86,44 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
88
86
  /* HOISTED */
89
87
  )),
90
88
  a("tbody", null, [
91
- (i(!0), d(
89
+ (s(!0), u(
92
90
  y,
93
91
  null,
94
- _(x.value, (n) => (i(), d(
92
+ k(x.value, (l) => (s(), u(
95
93
  y,
96
94
  {
97
- key: n.id
95
+ key: l.id
98
96
  },
99
97
  [
100
- n.title ? (i(), p(m(N), {
98
+ l.title ? (s(), f(m(W), {
101
99
  key: 0,
102
- "data-key": n.id,
103
- title: n.title,
100
+ "data-key": l.id,
101
+ title: l.title,
104
102
  icons: t.icons,
105
103
  "no-toggle": t.noToggle,
106
- onClick: () => L(n.id)
107
- }, null, 8, ["data-key", "title", "icons", "no-toggle", "onClick"])) : f("v-if", !0),
108
- (i(!0), d(
104
+ onClick: () => T(l.id)
105
+ }, null, 8, ["data-key", "title", "icons", "no-toggle", "onClick"])) : c("v-if", !0),
106
+ l.id === "" || d.value.includes(l.id) ? (s(!0), u(
109
107
  y,
110
- null,
111
- _(B(n.id), (l) => (i(), p(m(O), {
112
- key: l.id,
113
- class: h(T(l)),
114
- field: l,
115
- "model-value": l.props.modelValue,
108
+ { key: 1 },
109
+ k(L(l.id), (i) => (s(), f(m(N), {
110
+ key: i.id,
111
+ class: h(q(i)),
112
+ field: i,
113
+ "model-value": i.props.modelValue,
116
114
  readonly: t.readonly,
117
- onFocus: E,
118
- onFieldChange: (A) => R(l, A)
115
+ onFocus: w,
116
+ onFieldChange: (S) => E(i, S)
119
117
  }, {
120
- default: k(() => [
121
- C(e.$slots, l.id, { field: l })
118
+ default: _(() => [
119
+ F(e.$slots, i.id, { field: i })
122
120
  ]),
123
121
  _: 2
124
122
  /* DYNAMIC */
125
123
  }, 1032, ["class", "field", "model-value", "readonly", "onFieldChange"]))),
126
124
  128
127
125
  /* KEYED_FRAGMENT */
128
- ))
126
+ )) : c("v-if", !0)
129
127
  ],
130
128
  64
131
129
  /* STABLE_FRAGMENT */
@@ -135,21 +133,21 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
135
133
  ))
136
134
  ])
137
135
  ]),
138
- t.noPanel ? f("v-if", !0) : (i(), p(m(V), {
136
+ t.noPanel ? c("v-if", !0) : (s(), f(m(O), {
139
137
  key: 0,
140
- field: s.value,
138
+ field: n.value,
141
139
  texts: t.texts
142
140
  }, {
143
- default: k(() => [
144
- s.value ? C(e.$slots, "panel", {
141
+ default: _(() => [
142
+ n.value ? F(e.$slots, "panel", {
145
143
  key: 0,
146
- field: s.value
147
- }) : f("v-if", !0)
144
+ field: n.value
145
+ }) : c("v-if", !0)
148
146
  ]),
149
147
  _: 3
150
148
  /* FORWARDED */
151
149
  }, 8, ["field", "texts"]))
152
- ], 42, U));
150
+ ], 42, D));
153
151
  }
154
152
  });
155
153
  export {
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.35",
4
+ "version": "0.16.36",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",