@stonecrop/desktop 0.16.6 → 0.18.0

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/desktop.js CHANGED
@@ -1,97 +1,97 @@
1
- import { defineComponent as U, ref as R, onMounted as ce, openBlock as d, createElementBlock as h, normalizeClass as _, createElementVNode as c, Fragment as L, renderList as K, toDisplayString as N, createCommentVNode as F, withDirectives as P, vShow as X, useTemplateRef as ie, computed as k, watch as j, nextTick as ue, createBlock as de, Teleport as Te, createVNode as M, Transition as Ve, withCtx as B, withModifiers as ve, vModelText as fe, renderSlot as q, createTextVNode as H, resolveComponent as _e, withKeys as E, normalizeStyle as G, unref as J, provide as Q, onUnmounted as Me } from "vue";
2
- import { useStonecrop as Ee, useValidationStore as Fe } from "@stonecrop/stonecrop";
3
- import { AForm as Be } from "@stonecrop/aform";
4
- const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header" }, Ke = ["disabled", "onClick"], Pe = { key: 0 }, je = { class: "dropdown-header" }, He = ["onClick"], Ue = ["onClick"], ze = { class: "dropdown-container" }, We = { class: "dropdown" }, qe = ["onClick"], Ge = ["href"], Je = { class: "dropdown-item" }, Qe = /* @__PURE__ */ U({
1
+ import { defineComponent as W, ref as I, onMounted as ce, openBlock as p, createElementBlock as h, normalizeClass as E, createElementVNode as i, Fragment as L, renderList as H, toDisplayString as T, createCommentVNode as O, withDirectives as U, vShow as Y, useTemplateRef as ie, computed as C, watch as P, nextTick as ue, createBlock as de, Teleport as Ne, createVNode as B, Transition as Me, withCtx as j, withModifiers as ve, vModelText as pe, renderSlot as G, createTextVNode as z, resolveComponent as Ve, withKeys as F, normalizeStyle as J, unref as Q, provide as X, onUnmounted as Ee } from "vue";
2
+ import { useStonecrop as Oe, useValidationStore as Be, isDraftRecordId as Fe, DRAFT_RECORD_ID as Pe } from "@stonecrop/stonecrop";
3
+ import { AForm as je } from "@stonecrop/aform";
4
+ const Ke = { class: "action-menu-icon" }, Le = { class: "action-element-header" }, He = ["disabled", "onClick"], Ue = { key: 0 }, ze = { class: "dropdown-header" }, We = ["onClick"], qe = ["onClick"], Ge = { class: "dropdown-container" }, Je = { class: "dropdown" }, Qe = ["onClick"], Xe = ["href"], Ye = { class: "dropdown-item" }, Ze = /* @__PURE__ */ W({
5
5
  __name: "ActionSet",
6
6
  props: {
7
7
  elements: { default: () => [] }
8
8
  },
9
9
  emits: ["actionClick"],
10
- setup(s, { emit: b }) {
11
- const v = b, a = R({}), u = R(!0), x = R([]);
10
+ setup(c, { emit: A }) {
11
+ const y = A, a = I({}), u = I(!0), x = I([]);
12
12
  ce(() => {
13
- y();
13
+ m();
14
14
  });
15
- const y = () => {
15
+ const m = () => {
16
16
  a.value = {}, x.value = [];
17
- }, g = () => {
17
+ }, b = () => {
18
18
  u.value = !u.value;
19
- }, C = (n) => {
20
- const f = !a.value[n];
21
- y(), f && (a.value[n] = !0, x.value[n] = !0);
22
- }, $ = (n, f) => {
23
- v("actionClick", f, n);
19
+ }, R = (d) => {
20
+ const r = !a.value[d];
21
+ m(), r && (a.value[d] = !0, x.value[d] = !0);
22
+ }, D = (d, r) => {
23
+ y("actionClick", r, d);
24
24
  };
25
- return (n, f) => (d(), h("div", {
26
- class: _([{ collapsed: !u.value }, "action-set"])
25
+ return (d, r) => (p(), h("div", {
26
+ class: E([{ collapsed: !u.value }, "action-set"])
27
27
  }, [
28
- c("div", Oe, [
29
- c("div", {
28
+ i("div", Ke, [
29
+ i("div", {
30
30
  id: "cross",
31
- class: _({ rotated: u.value }),
32
- onClick: g
31
+ class: E({ rotated: u.value }),
32
+ onClick: b
33
33
  }, "×", 2)
34
34
  ]),
35
- f[0] || (f[0] = c("div", { style: { "margin-right": "30px" } }, null, -1)),
36
- (d(!0), h(L, null, K(s.elements, (o, i) => (d(), h("div", {
37
- key: o.label,
35
+ r[0] || (r[0] = i("div", { style: { "margin-right": "30px" } }, null, -1)),
36
+ (p(!0), h(L, null, H(c.elements, (s, o) => (p(), h("div", {
37
+ key: s.label,
38
38
  class: "action-element"
39
39
  }, [
40
- c("div", Le, [
41
- o.type == "button" ? (d(), h("button", {
40
+ i("div", Le, [
41
+ s.type == "button" ? (p(), h("button", {
42
42
  key: 0,
43
- disabled: o.disabled,
43
+ disabled: s.disabled,
44
44
  class: "button-default",
45
- onClick: (r) => $(o.action, o.label)
46
- }, N(o.label), 9, Ke)) : F("", !0)
45
+ onClick: (n) => D(s.action, s.label)
46
+ }, T(s.label), 9, He)) : O("", !0)
47
47
  ]),
48
- o.type == "dropdown" ? (d(), h("div", Pe, [
49
- c("div", je, [
50
- c("div", {
51
- class: _(["cross", { rotated: x.value[i] }]),
52
- onClick: (r) => C(i)
53
- }, "×", 10, He),
54
- c("button", {
48
+ s.type == "dropdown" ? (p(), h("div", Ue, [
49
+ i("div", ze, [
50
+ i("div", {
51
+ class: E(["cross", { rotated: x.value[o] }]),
52
+ onClick: (n) => R(o)
53
+ }, "×", 10, We),
54
+ i("button", {
55
55
  class: "button-default dropdown-title",
56
- onClick: (r) => C(i)
57
- }, N(o.label), 9, Ue)
56
+ onClick: (n) => R(o)
57
+ }, T(s.label), 9, qe)
58
58
  ]),
59
- P(c("div", ze, [
60
- c("div", We, [
61
- (d(!0), h(L, null, K(o.actions, (r) => (d(), h("div", {
62
- key: r.label
59
+ U(i("div", Ge, [
60
+ i("div", Je, [
61
+ (p(!0), h(L, null, H(s.actions, (n) => (p(), h("div", {
62
+ key: n.label
63
63
  }, [
64
- r.action != null ? (d(), h("button", {
64
+ n.action != null ? (p(), h("button", {
65
65
  key: 0,
66
66
  class: "dropdown-item",
67
- onClick: (z) => $(r.action, r.label)
68
- }, N(r.label), 9, qe)) : r.link != null ? (d(), h("a", {
67
+ onClick: (f) => D(n.action, n.label)
68
+ }, T(n.label), 9, Qe)) : n.link != null ? (p(), h("a", {
69
69
  key: 1,
70
- href: r.link
70
+ href: n.link
71
71
  }, [
72
- c("button", Je, N(r.label), 1)
73
- ], 8, Ge)) : F("", !0)
72
+ i("button", Ye, T(n.label), 1)
73
+ ], 8, Xe)) : O("", !0)
74
74
  ]))), 128))
75
75
  ])
76
76
  ], 512), [
77
- [X, a.value[i]]
77
+ [Y, a.value[o]]
78
78
  ])
79
- ])) : F("", !0)
79
+ ])) : O("", !0)
80
80
  ]))), 128))
81
81
  ], 2));
82
82
  }
83
- }), pe = (s, b) => {
84
- const v = s.__vccOpts || s;
85
- for (const [a, u] of b)
86
- v[a] = u;
87
- return v;
88
- }, me = /* @__PURE__ */ pe(Qe, [["__scopeId", "data-v-54797d4b"]]), Xe = { class: "command-palette-header" }, Ye = ["placeholder"], Ze = {
83
+ }), fe = (c, A) => {
84
+ const y = c.__vccOpts || c;
85
+ for (const [a, u] of A)
86
+ y[a] = u;
87
+ return y;
88
+ }, me = /* @__PURE__ */ fe(Ze, [["__scopeId", "data-v-54797d4b"]]), et = { class: "command-palette-header" }, tt = ["placeholder"], at = {
89
89
  key: 0,
90
90
  class: "command-palette-results"
91
- }, et = ["onClick", "onMouseover"], tt = { class: "result-title" }, ot = { class: "result-content" }, at = {
91
+ }, ot = ["onClick", "onMouseover"], rt = { class: "result-title" }, nt = { class: "result-content" }, lt = {
92
92
  key: 1,
93
93
  class: "command-palette-no-results"
94
- }, he = /* @__PURE__ */ U({
94
+ }, he = /* @__PURE__ */ W({
95
95
  __name: "CommandPalette",
96
96
  props: {
97
97
  search: { type: Function },
@@ -100,133 +100,133 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
100
100
  maxResults: { default: 10 }
101
101
  },
102
102
  emits: ["select", "close"],
103
- setup(s, { emit: b }) {
104
- const v = b, a = R(""), u = R(0), x = ie("input"), y = k(() => a.value ? s.search(a.value).slice(0, s.maxResults) : []);
105
- j(
106
- () => s.isOpen,
107
- async (n) => {
108
- n && (a.value = "", u.value = 0, await ue(), x.value?.focus());
103
+ setup(c, { emit: A }) {
104
+ const y = A, a = I(""), u = I(0), x = ie("input"), m = C(() => a.value ? c.search(a.value).slice(0, c.maxResults) : []);
105
+ P(
106
+ () => c.isOpen,
107
+ async (d) => {
108
+ d && (a.value = "", u.value = 0, await ue(), x.value?.focus());
109
109
  }
110
- ), j(y, () => {
110
+ ), P(m, () => {
111
111
  u.value = 0;
112
112
  });
113
- const g = () => {
114
- v("close");
115
- }, C = (n) => {
116
- switch (n.key) {
113
+ const b = () => {
114
+ y("close");
115
+ }, R = (d) => {
116
+ switch (d.key) {
117
117
  case "Escape":
118
- g();
118
+ b();
119
119
  break;
120
120
  case "ArrowDown":
121
- n.preventDefault(), y.value.length && (u.value = (u.value + 1) % y.value.length);
121
+ d.preventDefault(), m.value.length && (u.value = (u.value + 1) % m.value.length);
122
122
  break;
123
123
  case "ArrowUp":
124
- n.preventDefault(), y.value.length && (u.value = (u.value - 1 + y.value.length) % y.value.length);
124
+ d.preventDefault(), m.value.length && (u.value = (u.value - 1 + m.value.length) % m.value.length);
125
125
  break;
126
126
  case "Enter":
127
- y.value.length && u.value >= 0 && $(y.value[u.value]);
127
+ m.value.length && u.value >= 0 && D(m.value[u.value]);
128
128
  break;
129
129
  }
130
- }, $ = (n) => {
131
- v("select", n), g();
130
+ }, D = (d) => {
131
+ y("select", d), b();
132
132
  };
133
- return (n, f) => (d(), de(Te, { to: "body" }, [
134
- M(Ve, { name: "fade" }, {
135
- default: B(() => [
136
- s.isOpen ? (d(), h("div", {
133
+ return (d, r) => (p(), de(Ne, { to: "body" }, [
134
+ B(Me, { name: "fade" }, {
135
+ default: j(() => [
136
+ c.isOpen ? (p(), h("div", {
137
137
  key: 0,
138
138
  class: "command-palette-overlay",
139
- onClick: g
139
+ onClick: b
140
140
  }, [
141
- c("div", {
141
+ i("div", {
142
142
  class: "command-palette",
143
- onClick: f[1] || (f[1] = ve(() => {
143
+ onClick: r[1] || (r[1] = ve(() => {
144
144
  }, ["stop"]))
145
145
  }, [
146
- c("div", Xe, [
147
- P(c("input", {
146
+ i("div", et, [
147
+ U(i("input", {
148
148
  ref: "input",
149
- "onUpdate:modelValue": f[0] || (f[0] = (o) => a.value = o),
149
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => a.value = s),
150
150
  type: "text",
151
151
  class: "command-palette-input",
152
- placeholder: s.placeholder,
152
+ placeholder: c.placeholder,
153
153
  autofocus: "",
154
- onKeydown: C
155
- }, null, 40, Ye), [
156
- [fe, a.value]
154
+ onKeydown: R
155
+ }, null, 40, tt), [
156
+ [pe, a.value]
157
157
  ])
158
158
  ]),
159
- y.value.length ? (d(), h("div", Ze, [
160
- (d(!0), h(L, null, K(y.value, (o, i) => (d(), h("div", {
161
- key: i,
162
- class: _(["command-palette-result", { selected: i === u.value }]),
163
- onClick: (r) => $(o),
164
- onMouseover: (r) => u.value = i
159
+ m.value.length ? (p(), h("div", at, [
160
+ (p(!0), h(L, null, H(m.value, (s, o) => (p(), h("div", {
161
+ key: o,
162
+ class: E(["command-palette-result", { selected: o === u.value }]),
163
+ onClick: (n) => D(s),
164
+ onMouseover: (n) => u.value = o
165
165
  }, [
166
- c("div", tt, [
167
- q(n.$slots, "title", { result: o })
166
+ i("div", rt, [
167
+ G(d.$slots, "title", { result: s })
168
168
  ]),
169
- c("div", ot, [
170
- q(n.$slots, "content", { result: o })
169
+ i("div", nt, [
170
+ G(d.$slots, "content", { result: s })
171
171
  ])
172
- ], 42, et))), 128))
173
- ])) : a.value && !y.value.length ? (d(), h("div", at, [
174
- q(n.$slots, "empty", {}, () => [
175
- H(' No results found for "' + N(a.value) + '" ', 1)
172
+ ], 42, ot))), 128))
173
+ ])) : a.value && !m.value.length ? (p(), h("div", lt, [
174
+ G(d.$slots, "empty", {}, () => [
175
+ z(' No results found for "' + T(a.value) + '" ', 1)
176
176
  ])
177
- ])) : F("", !0)
177
+ ])) : O("", !0)
178
178
  ])
179
- ])) : F("", !0)
179
+ ])) : O("", !0)
180
180
  ]),
181
181
  _: 3
182
182
  })
183
183
  ]));
184
184
  }
185
- }), nt = { class: "tabs" }, rt = { tabindex: "0" }, lt = { tabindex: "0" }, st = /* @__PURE__ */ U({
185
+ }), st = { class: "tabs" }, ct = { tabindex: "0" }, it = { tabindex: "0" }, ut = /* @__PURE__ */ W({
186
186
  __name: "SheetNav",
187
187
  props: {
188
188
  breadcrumbs: { default: () => [] }
189
189
  },
190
- setup(s) {
191
- const b = R(!0), v = R(!1), a = R(""), u = ie("searchinput"), x = k(() => b.value ? "unrotated" : "rotated"), y = () => {
192
- b.value = !b.value;
193
- }, g = async () => {
194
- v.value = !v.value, await ue(() => {
190
+ setup(c) {
191
+ const A = I(!0), y = I(!1), a = I(""), u = ie("searchinput"), x = C(() => A.value ? "unrotated" : "rotated"), m = () => {
192
+ A.value = !A.value;
193
+ }, b = async () => {
194
+ y.value = !y.value, await ue(() => {
195
195
  u.value?.focus();
196
196
  });
197
- }, C = (f) => {
198
- f.preventDefault(), f.stopPropagation();
199
- }, $ = async (f) => {
200
- f.preventDefault(), f.stopPropagation(), await g();
201
- }, n = () => {
197
+ }, R = (r) => {
198
+ r.preventDefault(), r.stopPropagation();
199
+ }, D = async (r) => {
200
+ r.preventDefault(), r.stopPropagation(), await b();
201
+ }, d = () => {
202
202
  };
203
- return (f, o) => {
204
- const i = _e("router-link");
205
- return d(), h("footer", null, [
206
- c("ul", nt, [
207
- c("li", {
203
+ return (r, s) => {
204
+ const o = Ve("router-link");
205
+ return p(), h("footer", null, [
206
+ i("ul", st, [
207
+ i("li", {
208
208
  class: "hidebreadcrumbs",
209
- onClick: y,
210
- onKeydown: E(y, ["enter"])
209
+ onClick: m,
210
+ onKeydown: F(m, ["enter"])
211
211
  }, [
212
- c("a", rt, [
213
- c("div", {
214
- class: _(x.value)
212
+ i("a", ct, [
213
+ i("div", {
214
+ class: E(x.value)
215
215
  }, "×", 2)
216
216
  ])
217
217
  ], 32),
218
- c("li", {
218
+ i("li", {
219
219
  class: "hometab",
220
- style: G({ display: b.value ? "block" : "none" }),
221
- onClick: n,
222
- onKeydown: E(n, ["enter"])
220
+ style: J({ display: A.value ? "block" : "none" }),
221
+ onClick: d,
222
+ onKeydown: F(d, ["enter"])
223
223
  }, [
224
- M(i, {
224
+ B(o, {
225
225
  to: "/",
226
226
  tabindex: "0"
227
227
  }, {
228
- default: B(() => [...o[5] || (o[5] = [
229
- c("svg", {
228
+ default: j(() => [...s[5] || (s[5] = [
229
+ i("svg", {
230
230
  class: "icon",
231
231
  "aria-label": "Home",
232
232
  viewBox: "0 0 24 24",
@@ -234,19 +234,19 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
234
234
  stroke: "currentColor",
235
235
  "stroke-width": "2"
236
236
  }, [
237
- c("path", { d: "M3 12l9-9 9 9" }),
238
- c("path", { d: "M9 21V12h6v9" })
237
+ i("path", { d: "M3 12l9-9 9 9" }),
238
+ i("path", { d: "M9 21V12h6v9" })
239
239
  ], -1)
240
240
  ])]),
241
241
  _: 1
242
242
  })
243
243
  ], 36),
244
- c("li", {
245
- class: _(["searchtab", { "search-active": v.value }]),
246
- style: G({ display: b.value ? "block" : "none" })
244
+ i("li", {
245
+ class: E(["searchtab", { "search-active": y.value }]),
246
+ style: J({ display: A.value ? "block" : "none" })
247
247
  }, [
248
- c("a", lt, [
249
- P((d(), h("svg", {
248
+ i("a", it, [
249
+ U((p(), h("svg", {
250
250
  class: "icon search-icon",
251
251
  role: "button",
252
252
  "aria-label": "Search",
@@ -254,47 +254,47 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
254
254
  fill: "none",
255
255
  stroke: "currentColor",
256
256
  "stroke-width": "2",
257
- onClick: g,
258
- onKeydown: E(g, ["enter"])
259
- }, [...o[6] || (o[6] = [
260
- c("circle", {
257
+ onClick: b,
258
+ onKeydown: F(b, ["enter"])
259
+ }, [...s[6] || (s[6] = [
260
+ i("circle", {
261
261
  cx: "11",
262
262
  cy: "11",
263
263
  r: "7"
264
264
  }, null, -1),
265
- c("path", { d: "M21 21l-4.35-4.35" }, null, -1)
265
+ i("path", { d: "M21 21l-4.35-4.35" }, null, -1)
266
266
  ])], 544)), [
267
- [X, !v.value]
267
+ [Y, !y.value]
268
268
  ]),
269
- P(c("input", {
269
+ U(i("input", {
270
270
  ref: "searchinput",
271
- "onUpdate:modelValue": o[0] || (o[0] = (r) => a.value = r),
271
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => a.value = n),
272
272
  type: "text",
273
273
  placeholder: "Search...",
274
- onClick: o[1] || (o[1] = ve(() => {
274
+ onClick: s[1] || (s[1] = ve(() => {
275
275
  }, ["stop"])),
276
- onInput: o[2] || (o[2] = (r) => C(r)),
277
- onBlur: o[3] || (o[3] = (r) => $(r)),
276
+ onInput: s[2] || (s[2] = (n) => R(n)),
277
+ onBlur: s[3] || (s[3] = (n) => D(n)),
278
278
  onKeydown: [
279
- o[4] || (o[4] = E((r) => $(r), ["enter"])),
280
- E(g, ["escape"])
279
+ s[4] || (s[4] = F((n) => D(n), ["enter"])),
280
+ F(b, ["escape"])
281
281
  ]
282
282
  }, null, 544), [
283
- [X, v.value],
284
- [fe, a.value]
283
+ [Y, y.value],
284
+ [pe, a.value]
285
285
  ])
286
286
  ])
287
287
  ], 6),
288
- (d(!0), h(L, null, K(s.breadcrumbs, (r) => (d(), h("li", {
289
- key: r.title,
290
- style: G({ display: b.value ? "block" : "none" })
288
+ (p(!0), h(L, null, H(c.breadcrumbs, (n) => (p(), h("li", {
289
+ key: n.title,
290
+ style: J({ display: A.value ? "block" : "none" })
291
291
  }, [
292
- M(i, {
292
+ B(o, {
293
293
  tabindex: "0",
294
- to: r.to
294
+ to: n.to
295
295
  }, {
296
- default: B(() => [
297
- H(N(r.title), 1)
296
+ default: j(() => [
297
+ z(T(n.title), 1)
298
298
  ]),
299
299
  _: 2
300
300
  }, 1032, ["to"])
@@ -303,63 +303,69 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
303
303
  ]);
304
304
  };
305
305
  }
306
- }), ye = /* @__PURE__ */ pe(st, [["__scopeId", "data-v-0072260b"]]), ct = {
306
+ }), ye = /* @__PURE__ */ fe(ut, [["__scopeId", "data-v-0072260b"]]), dt = {
307
307
  key: 1,
308
308
  class: "loading"
309
- }, it = {
309
+ }, vt = {
310
310
  key: 2,
311
311
  class: "loading"
312
- }, ut = /* @__PURE__ */ U({
312
+ }, pt = {
313
+ key: 3,
314
+ class: "truncation-note"
315
+ }, ft = /* @__PURE__ */ W({
313
316
  __name: "Desktop",
314
317
  props: {
315
318
  availableDoctypes: { default: () => [] },
316
- routeAdapter: {},
317
- confirmFn: { type: Function },
318
- recordIdField: {}
319
+ routeAdapter: {}
319
320
  },
320
321
  emits: ["action", "navigate", "record:open", "load-records", "load-record"],
321
- setup(s, { emit: b }) {
322
- const v = b, { stonecrop: a } = Ee();
322
+ setup(c, { emit: A }) {
323
+ const y = A, { stonecrop: a } = Oe();
323
324
  let u = null;
324
325
  try {
325
- u = Fe();
326
+ u = Be();
326
327
  } catch {
327
328
  u = null;
328
329
  }
329
- const x = k(
330
- () => A.value === "record" ? u?.errorsByField ?? {} : {}
331
- ), y = R(!1), g = R(!1), C = k({
330
+ const x = C(
331
+ () => S.value === "record" ? u?.errorsByField ?? {} : {}
332
+ ), m = I(!1), b = I(!1), R = I({}), D = C({
332
333
  get() {
333
- if (A.value === "doctypes")
334
+ if (S.value === "doctypes")
334
335
  return {
335
- doctypes_table: s.availableDoctypes?.map((e) => ({
336
+ doctypes_table: c.availableDoctypes?.map((e) => ({
336
337
  id: e,
337
338
  doctype: e,
338
339
  display_name: V(e),
339
- record_count: De(e),
340
340
  actions: "View Records"
341
341
  })) ?? []
342
342
  };
343
- if (A.value === "records")
343
+ if (S.value === "records")
344
344
  return {
345
- records_table: te().map(
345
+ records_table: oe().map(
346
346
  (e) => Object.assign({}, e, {
347
347
  id: ne(e) ?? "",
348
- actions: "Edit | Delete"
348
+ // A list row is navigation. Actions live on the record view, where the Actions
349
+ // dropdown is built from what the doctype declares and what the record's
350
+ // current state allows. This cell used to also offer Delete, which dispatched
351
+ // an action named `DELETE` that Desktop invented — no doctype in a
352
+ // WorkflowMeta app declares it, so it failed on every click. Removal is a
353
+ // workflow outcome (`archive`, `cancel`) and belongs in the doctype.
354
+ actions: "Edit"
349
355
  })
350
356
  )
351
357
  };
352
- if (!a.value || !o.value || !r.value)
358
+ if (!a.value || !o.value || !f.value)
353
359
  return {};
354
360
  try {
355
- const t = { ...a.value.getRecordById(o.value, r.value)?.get("") }, l = a.value.registry.registry[o.value];
361
+ const t = { ...M.value ? R.value : a.value.getRecordById(o.value, f.value)?.get("") }, l = a.value.registry.registry[o.value];
356
362
  if (l) {
357
- for (const p of l.getSchemaArray())
358
- if (p.kind === "fieldset") {
359
- const m = {};
360
- for (const w of p.schema)
361
- w.fieldname && (m[w.fieldname] = t[w.fieldname]);
362
- t[p.fieldname] = m;
363
+ for (const v of l.getSchemaArray())
364
+ if (v.kind === "fieldset") {
365
+ const g = {};
366
+ for (const k of v.schema)
367
+ k.fieldname && (g[k.fieldname] = t[k.fieldname]);
368
+ t[v.fieldname] = g;
363
369
  }
364
370
  }
365
371
  return t;
@@ -368,92 +374,102 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
368
374
  }
369
375
  },
370
376
  set(e) {
371
- if (A.value === "record" && !(!a.value || !o.value || !r.value))
377
+ if (S.value === "record" && !(!a.value || !o.value || !f.value))
372
378
  try {
373
379
  const t = a.value.registry.registry[o.value], l = /* @__PURE__ */ new Set();
374
380
  if (t)
375
- for (const S of t.getSchemaArray())
376
- S.kind === "fieldset" && l.add(S.fieldname);
377
- const p = {}, m = [];
378
- for (const [S, I] of Object.entries(e))
379
- l.has(S) && I && typeof I == "object" && !Array.isArray(I) ? m.push(I) : p[S] = I;
380
- for (const S of m)
381
- Object.assign(p, S);
382
- const w = a.value.getStore(), D = [];
383
- for (const [S, I] of Object.entries(p)) {
384
- if (I === void 0) continue;
385
- const W = `${o.value}.${r.value}.${S}`;
386
- (w.has(W) ? w.get(W) : void 0) !== I && (w.set(W, I), D.push(S));
381
+ for (const w of t.getSchemaArray())
382
+ w.kind === "fieldset" && l.add(w.fieldname);
383
+ const v = {}, g = [];
384
+ for (const [w, $] of Object.entries(e))
385
+ l.has(w) && $ && typeof $ == "object" && !Array.isArray($) ? g.push($) : v[w] = $;
386
+ for (const w of g)
387
+ Object.assign(v, w);
388
+ const k = [];
389
+ if (M.value) {
390
+ const w = { ...R.value };
391
+ for (const [$, _] of Object.entries(v))
392
+ _ !== void 0 && w[$] !== _ && (w[$] = _, k.push($));
393
+ R.value = w;
394
+ } else {
395
+ const w = a.value.getStore();
396
+ for (const [$, _] of Object.entries(v)) {
397
+ if (_ === void 0) continue;
398
+ const q = `${o.value}.${f.value}.${$}`;
399
+ (w.has(q) ? w.get(q) : void 0) !== _ && (w.set(q, _), k.push($));
400
+ }
387
401
  }
388
- D.length > 0 && $(D);
402
+ k.length > 0 && d(k);
389
403
  } catch (t) {
390
404
  console.warn("HST update failed:", t);
391
405
  }
392
406
  }
393
407
  });
394
- function $(e) {
395
- if (!u || !a.value || !o.value || !r.value) return;
408
+ function d(e) {
409
+ if (!u || !a.value || !o.value || !f.value) return;
396
410
  const l = a.value.registry.getDoctype(o.value)?.getTriggers();
397
411
  if (!l || Object.keys(l).length === 0) return;
398
- const m = { ...a.value.getRecordById(o.value, r.value)?.get("") };
399
- for (const w of e)
400
- u.validateField(l, w, m);
412
+ const v = M.value ? { ...R.value } : {
413
+ ...a.value.getRecordById(o.value, f.value)?.get("")
414
+ };
415
+ for (const g of e)
416
+ u.validateField(l, g, v);
401
417
  }
402
- const n = k(() => s.routeAdapter ? null : J(a.value?.registry.router?.currentRoute)), f = k(() => s.routeAdapter ? null : a.value?.registry.router), o = k(() => {
403
- if (s.routeAdapter) return s.routeAdapter.getCurrentDoctype();
404
- if (!n.value) return "";
405
- if (n.value.meta?.actualDoctype)
406
- return n.value.meta.actualDoctype;
407
- if (n.value.params.doctype)
408
- return n.value.params.doctype.toString();
409
- const e = n.value.params.pathMatch;
418
+ const r = C(() => c.routeAdapter ? null : Q(a.value?.registry.router?.currentRoute)), s = C(() => c.routeAdapter ? null : a.value?.registry.router), o = C(() => {
419
+ if (c.routeAdapter) return c.routeAdapter.getCurrentDoctype();
420
+ if (!r.value) return "";
421
+ if (r.value.meta?.actualDoctype)
422
+ return r.value.meta.actualDoctype;
423
+ if (r.value.params.doctype)
424
+ return r.value.params.doctype.toString();
425
+ const e = r.value.params.pathMatch;
410
426
  return e && e.length > 0 ? e[0] : "";
411
- }), i = k(() => {
412
- if (s.routeAdapter) return s.routeAdapter.getCurrentDoctype();
413
- if (!n.value) return "";
414
- if (n.value.meta?.doctype)
415
- return n.value.meta.doctype;
416
- if (n.value.params.doctype)
417
- return n.value.params.doctype.toString();
418
- const e = n.value.params.pathMatch;
427
+ }), n = C(() => {
428
+ if (c.routeAdapter) return c.routeAdapter.getCurrentDoctype();
429
+ if (!r.value) return "";
430
+ if (r.value.meta?.doctype)
431
+ return r.value.meta.doctype;
432
+ if (r.value.params.doctype)
433
+ return r.value.params.doctype.toString();
434
+ const e = r.value.params.pathMatch;
419
435
  return e && e.length > 0 ? e[0] : "";
420
- }), r = k(() => {
421
- if (s.routeAdapter) return s.routeAdapter.getCurrentRecordId();
422
- if (!n.value) return "";
423
- if (n.value.params.recordId)
424
- return n.value.params.recordId.toString();
425
- const e = n.value.params.pathMatch;
436
+ }), f = C(() => {
437
+ if (c.routeAdapter) return c.routeAdapter.getCurrentRecordId();
438
+ if (!r.value) return "";
439
+ if (r.value.params.recordId)
440
+ return r.value.params.recordId.toString();
441
+ const e = r.value.params.pathMatch;
426
442
  return e && e.length > 1 ? e[1] : "";
427
- }), z = k(() => r.value?.startsWith("new-")), A = k(() => {
428
- if (s.routeAdapter) return s.routeAdapter.getCurrentView();
429
- if (!n.value || n.value.name === "home" || n.value.path === "/")
443
+ }), M = C(() => Fe(f.value)), S = C(() => {
444
+ if (c.routeAdapter) return c.routeAdapter.getCurrentView();
445
+ if (!r.value || r.value.name === "home" || r.value.path === "/")
430
446
  return "doctypes";
431
- if (n.value.name && n.value.name !== "catch-all") {
432
- const t = n.value.name;
433
- if (t.includes("form") || n.value.params.recordId)
447
+ if (r.value.name && r.value.name !== "catch-all") {
448
+ const t = r.value.name;
449
+ if (t.includes("form") || r.value.params.recordId)
434
450
  return "record";
435
- if (t.includes("list") || n.value.params.doctype)
451
+ if (t.includes("list") || r.value.params.doctype)
436
452
  return "records";
437
453
  }
438
- const e = n.value.params.pathMatch;
454
+ const e = r.value.params.pathMatch;
439
455
  return e && e.length > 0 ? e.length === 1 ? "records" : "record" : "doctypes";
440
456
  }), ge = () => {
441
- if (!a.value || !o.value || !r.value)
457
+ if (!a.value || !o.value || !f.value)
442
458
  return [];
443
459
  try {
444
460
  const e = a.value.registry.getDoctype(o.value);
445
461
  if (!e?.workflow) return [];
446
- const t = a.value.getRecordState(o.value, r.value), l = e.getAvailableTransitions(t), p = C.value || {};
447
- return l.map(({ name: m }) => ({
462
+ const t = a.value.getRecordState(o.value, f.value), l = e.getAvailableTransitions(t), v = D.value || {};
463
+ return l.map(({ name: g }) => ({
448
464
  // Prefer the workflow action's human-readable label (WorkflowMeta format);
449
465
  // fall back to the raw transition name for XState workflows with no action meta.
450
- label: e.getActionMeta(m)?.label ?? m,
466
+ label: e.getActionMeta(g)?.label ?? g,
451
467
  action: () => {
452
- v("action", {
453
- name: m,
468
+ y("action", {
469
+ name: g,
454
470
  doctype: o.value,
455
- recordId: r.value,
456
- data: p
471
+ recordId: f.value,
472
+ data: v
457
473
  });
458
474
  }
459
475
  }));
@@ -461,35 +477,35 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
461
477
  return console.warn("Error getting available transitions:", e), [];
462
478
  }
463
479
  }, we = () => {
464
- if (!a.value || !o.value || !r.value)
480
+ if (!a.value || !o.value || !f.value)
465
481
  return [];
466
482
  try {
467
483
  const e = a.value.registry.getDoctype(o.value);
468
484
  if (!e?.workflow) return [];
469
- const t = a.value.getRecordState(o.value, r.value), l = e.getAvailableCommands(t), p = C.value || {};
470
- return l.map(({ name: m }) => ({
471
- label: e.getActionMeta(m)?.label ?? m,
485
+ const t = a.value.getRecordState(o.value, f.value), l = e.getAvailableCommands(t), v = D.value || {};
486
+ return l.map(({ name: g }) => ({
487
+ label: e.getActionMeta(g)?.label ?? g,
472
488
  action: () => {
473
- v("action", {
474
- name: m,
489
+ y("action", {
490
+ name: g,
475
491
  doctype: o.value,
476
- recordId: r.value,
477
- data: p
492
+ recordId: f.value,
493
+ data: v
478
494
  });
479
495
  }
480
496
  }));
481
497
  } catch (e) {
482
498
  return console.warn("Error getting available commands:", e), [];
483
499
  }
484
- }, be = k(() => {
500
+ }, be = C(() => {
485
501
  const e = [];
486
- switch (A.value) {
502
+ switch (S.value) {
487
503
  case "records":
488
504
  e.push({
489
505
  type: "button",
490
506
  label: "New Record",
491
507
  action: () => {
492
- O();
508
+ K();
493
509
  }
494
510
  });
495
511
  break;
@@ -504,19 +520,19 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
504
520
  }
505
521
  }
506
522
  return e;
507
- }), ke = k(() => {
523
+ }), ke = C(() => {
508
524
  const e = [];
509
- if (A.value === "records" && i.value)
525
+ if (S.value === "records" && n.value)
510
526
  e.push(
511
527
  { title: "Home", to: "/" },
512
- { title: V(i.value), to: `/${i.value}` }
528
+ { title: V(n.value), to: `/${n.value}` }
513
529
  );
514
- else if (A.value === "record" && i.value) {
515
- const t = r.value ? `/${i.value}/${r.value}` : n.value?.fullPath ?? "";
530
+ else if (S.value === "record" && n.value) {
531
+ const t = f.value ? `/${n.value}/${f.value}` : r.value?.fullPath ?? "";
516
532
  e.push(
517
533
  { title: "Home", to: "/" },
518
- { title: V(i.value), to: `/${i.value}` },
519
- { title: z.value ? "New Record" : "Edit Record", to: t }
534
+ { title: V(n.value), to: `/${n.value}` },
535
+ { title: M.value ? "New Record" : "Edit Record", to: t }
520
536
  );
521
537
  }
522
538
  return e;
@@ -526,56 +542,55 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
526
542
  title: "Go Home",
527
543
  description: "Navigate to the home page",
528
544
  action: () => {
529
- T({ view: "doctypes" });
545
+ N({ view: "doctypes" });
530
546
  }
531
547
  },
532
548
  {
533
549
  title: "Toggle Command Palette",
534
550
  description: "Open/close the command palette",
535
- action: () => g.value = !g.value
551
+ action: () => b.value = !b.value
536
552
  }
537
553
  ];
538
- return i.value && (t.push({
539
- title: `View ${V(i.value)} Records`,
540
- description: `Navigate to ${i.value} list`,
554
+ return n.value && (t.push({
555
+ title: `View ${V(n.value)} Records`,
556
+ description: `Navigate to ${n.value} list`,
541
557
  action: () => {
542
- T({ view: "records", doctype: i.value });
558
+ N({ view: "records", doctype: n.value });
543
559
  }
544
560
  }), t.push({
545
- title: `Create New ${V(i.value)}`,
546
- description: `Create a new ${i.value} record`,
561
+ title: `Create New ${V(n.value)}`,
562
+ description: `Create a new ${n.value} record`,
547
563
  action: () => {
548
- O();
564
+ K();
549
565
  }
550
- })), s.availableDoctypes.forEach((l) => {
566
+ })), c.availableDoctypes.forEach((l) => {
551
567
  t.push({
552
568
  title: `View ${V(l)}`,
553
569
  description: `Navigate to ${l} list`,
554
570
  action: () => {
555
- T({ view: "records", doctype: l });
571
+ N({ view: "records", doctype: l });
556
572
  }
557
573
  });
558
574
  }), e ? t.filter(
559
575
  (l) => l.title.toLowerCase().includes(e.toLowerCase()) || l.description.toLowerCase().includes(e.toLowerCase())
560
576
  ) : t;
561
577
  }, Ae = (e) => {
562
- e.action(), g.value = !1;
563
- }, V = (e) => e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "), De = (e) => a.value ? a.value.getRecordIds(e).length : 0, T = async (e) => {
564
- v("navigate", e), s.routeAdapter ? await s.routeAdapter.navigate(e) : e.view === "doctypes" ? await f.value?.push("/") : e.view === "records" && e.doctype ? await f.value?.push(`/${e.doctype}`) : e.view === "record" && e.doctype && e.recordId && await f.value?.push(`/${e.doctype}/${e.recordId}`);
565
- }, Y = async (e) => {
566
- await T({ view: "records", doctype: e });
578
+ e.action(), b.value = !1;
579
+ }, V = (e) => e.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" "), De = C(() => S.value !== "records" || !o.value ? !1 : a.value?.getPageInfo(o.value)?.hasMore === !0), N = async (e) => {
580
+ y("navigate", e), c.routeAdapter ? await c.routeAdapter.navigate(e) : e.view === "doctypes" ? await s.value?.push("/") : e.view === "records" && e.doctype ? await s.value?.push(`/${e.doctype}`) : e.view === "record" && e.doctype && e.recordId && await s.value?.push(`/${e.doctype}/${e.recordId}`);
567
581
  }, Z = async (e) => {
568
- const t = i.value;
569
- v("record:open", { doctype: t, recordId: e }), await T({ view: "record", doctype: t, recordId: e });
570
- }, O = async () => {
571
- const e = `new-${Date.now()}`;
572
- await T({ view: "record", doctype: i.value, recordId: e });
573
- }, ee = (e) => {
582
+ await N({ view: "records", doctype: e });
583
+ }, ee = async (e) => {
584
+ const t = n.value;
585
+ y("record:open", { doctype: t, recordId: e }), await N({ view: "record", doctype: t, recordId: e });
586
+ }, K = async () => {
587
+ await N({ view: "record", doctype: n.value, recordId: Pe });
588
+ }, te = (e) => {
574
589
  const t = [];
575
590
  for (const l of e)
576
- l.kind === "fieldset" ? t.push(...ee(l.schema)) : t.push(l);
591
+ l.kind === "fieldset" ? t.push(...te(l.schema)) : t.push(l);
577
592
  return t;
578
- }, Ie = () => s.availableDoctypes?.length ? [
593
+ }, Re = () => c.availableDoctypes?.length ? [
579
594
  {
580
595
  kind: "table",
581
596
  fieldname: "doctypes_table",
@@ -598,14 +613,10 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
598
613
  edit: !1,
599
614
  width: "30ch"
600
615
  },
601
- {
602
- fieldname: "record_count",
603
- label: "Records",
604
- component: "ANumericInput",
605
- align: "center",
606
- edit: !1,
607
- width: "15ch"
608
- },
616
+ // No record count column. It read `getRecordIds(doctype).length`, which is how many
617
+ // records HST happens to hold — zero for a doctype never opened, and the page size
618
+ // for one that was. The real total belongs to the backend and Desktop never asks
619
+ // for it, so this shell cannot answer it. Same reason the `recordIdField` prop went.
609
620
  {
610
621
  fieldname: "actions",
611
622
  label: "Actions",
@@ -629,13 +640,13 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
629
640
  fieldname: "records_table",
630
641
  component: "ATable",
631
642
  schema: [
632
- ...ee(l),
643
+ ...te(l),
633
644
  { fieldname: "actions", label: "Actions", component: "ATextInput" }
634
645
  ],
635
646
  config: { view: "list", fullWidth: !0 }
636
647
  }
637
648
  ];
638
- }, $e = () => {
649
+ }, ae = () => {
639
650
  if (!o.value) return [];
640
651
  if (!a.value) return [];
641
652
  try {
@@ -644,110 +655,121 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
644
655
  } catch {
645
656
  return [];
646
657
  }
647
- }, te = () => {
658
+ }, oe = () => {
648
659
  if (!a.value || !o.value)
649
660
  return [];
650
661
  const t = a.value.records(o.value)?.get("");
651
662
  return t && typeof t == "object" && !Array.isArray(t) ? Object.values(t) : [];
652
- }, oe = k(() => {
653
- switch (A.value) {
663
+ }, re = C(() => {
664
+ switch (S.value) {
654
665
  case "doctypes":
655
- return Ie();
666
+ return Re();
656
667
  case "records":
657
668
  return Se();
658
669
  case "record":
659
- return $e();
670
+ return ae();
660
671
  default:
661
672
  return [];
662
673
  }
663
- }), Re = (e, t) => {
674
+ }), $e = (e, t) => {
664
675
  t && t();
665
- }, ae = async (e) => {
666
- const t = e || r.value;
667
- if (!t) return;
668
- (s.confirmFn ? await s.confirmFn("Are you sure you want to delete this record?") : confirm("Are you sure you want to delete this record?")) && v("action", {
669
- name: "DELETE",
670
- doctype: o.value,
671
- recordId: t,
672
- data: C.value || {}
673
- });
674
676
  }, ne = (e) => {
675
- if (s.recordIdField) {
676
- const t = e[s.recordIdField];
677
- if (typeof t == "number") return String(t);
678
- if (typeof t == "string" && t !== "") return t;
679
- }
680
677
  if (!(!a.value || !o.value))
681
678
  return a.value.registry.registry[o.value]?.getRecordId(e);
682
- }, re = (e) => {
679
+ }, Ie = (e) => {
683
680
  const t = e.querySelector("td[data-rowindex]");
684
681
  if (!t) return null;
685
682
  const l = t.getAttribute("data-rowindex");
686
683
  if (l === null) return null;
687
- const p = parseInt(l, 10);
688
- if (isNaN(p)) return null;
689
- const w = te()[p];
690
- return w ? ne(w) ?? null : null;
691
- }, xe = async (e) => {
684
+ const v = parseInt(l, 10);
685
+ if (isNaN(v)) return null;
686
+ const k = oe()[v];
687
+ return k ? ne(k) ?? null : null;
688
+ }, _e = async (e) => {
692
689
  const t = e.target;
693
- t.getAttribute("data-action") === "create" && await O();
694
- const p = t.closest("td, th");
695
- if (p) {
696
- const m = p.textContent?.trim(), w = p.closest("tr");
697
- if (m === "View Records" && w) {
698
- const D = w.querySelectorAll("td");
699
- if (D.length > 0) {
700
- const I = D[1].textContent?.trim();
701
- I && await Y(I);
690
+ t.getAttribute("data-action") === "create" && await K();
691
+ const v = t.closest("td, th");
692
+ if (v) {
693
+ const g = v.textContent?.trim(), k = v.closest("tr");
694
+ if (g === "View Records" && k) {
695
+ const w = k.querySelectorAll("td");
696
+ if (w.length > 0) {
697
+ const _ = w[1].textContent?.trim();
698
+ _ && await Z(_);
702
699
  }
703
- } else if (m?.includes("Edit") && w) {
704
- const D = re(w);
705
- D && await Z(D);
706
- } else if (m?.includes("Delete") && w) {
707
- const D = re(w);
708
- D && await ae(D);
700
+ } else if (g === "Edit" && k) {
701
+ const w = Ie(k);
702
+ w && await ee(w);
709
703
  }
710
704
  }
711
- }, Ne = async () => {
712
- if (!(!a.value || !o.value || z.value) && !a.value.getRecordById(o.value, r.value) && a.value.getClient()) {
713
- y.value = !0;
705
+ }, xe = async () => {
706
+ if (!(!a.value || !o.value || !a.value.getClient())) {
707
+ m.value = !0;
714
708
  try {
715
- await a.value.getRecord(o.value, r.value);
709
+ await a.value.getRecord(o.value, f.value);
716
710
  } catch (e) {
717
711
  console.warn("Error fetching record:", e);
718
712
  } finally {
719
- y.value = !1;
713
+ m.value = !1;
714
+ }
715
+ }
716
+ }, Te = async () => {
717
+ if (!a.value || !o.value || !a.value.getClient()) return;
718
+ const e = a.value.registry.getDoctype(o.value);
719
+ if (e) {
720
+ m.value = !0;
721
+ try {
722
+ await a.value.getRecords(e);
723
+ } catch (t) {
724
+ console.warn("Error fetching records:", t);
725
+ } finally {
726
+ m.value = !1;
720
727
  }
721
728
  }
722
729
  };
723
- j(
724
- [A, o, r],
730
+ P(
731
+ [S, o, f],
725
732
  () => {
726
- A.value === "records" && o.value ? v("load-records", { doctype: o.value }) : A.value === "record" && o.value && r.value && (v("load-record", { doctype: o.value, recordId: r.value }), Ne());
733
+ if (S.value === "records" && o.value)
734
+ y("load-records", { doctype: o.value }), Te();
735
+ else if (S.value === "record" && o.value && f.value) {
736
+ if (M.value) return;
737
+ y("load-record", { doctype: o.value, recordId: f.value }), xe();
738
+ }
727
739
  },
728
740
  { immediate: !0 }
729
- ), j([o, r], () => {
741
+ ), P([o, f], () => {
730
742
  u?.clearAll();
731
- }), Q("desktopMethods", {
732
- navigateToDoctype: Y,
733
- openRecord: Z,
734
- createNewRecord: O,
735
- handleDelete: ae,
743
+ }), P(
744
+ [o, f],
745
+ () => {
746
+ if (!M.value) {
747
+ R.value = {};
748
+ return;
749
+ }
750
+ const e = a.value?.registry;
751
+ R.value = e ? e.initializeRecord(ae()) : {};
752
+ },
753
+ { immediate: !0 }
754
+ ), X("desktopMethods", {
755
+ navigateToDoctype: Z,
756
+ openRecord: ee,
757
+ createNewRecord: K,
736
758
  /**
737
759
  * Convenience wrapper so child components (e.g. slot content) can emit
738
760
  * an action event without needing a direct reference to the emit function.
739
761
  */
740
762
  emitAction: (e, t) => {
741
- v("action", {
763
+ y("action", {
742
764
  name: e,
743
765
  doctype: o.value,
744
- recordId: r.value,
745
- data: t ?? C.value ?? {}
766
+ recordId: f.value,
767
+ data: t ?? D.value ?? {}
746
768
  });
747
769
  }
748
- }), Q("aformLinkNavigator", {
770
+ }), X("aformLinkNavigator", {
749
771
  navigate: (e, t) => {
750
- T({ view: "record", doctype: e, recordId: String(t) });
772
+ N({ view: "record", doctype: e, recordId: String(t) });
751
773
  }
752
774
  });
753
775
  function le(e) {
@@ -755,72 +777,73 @@ const Oe = { class: "action-menu-icon" }, Le = { class: "action-element-header"
755
777
  const t = e.name ?? e.title ?? e.displayText;
756
778
  return typeof t == "string" || typeof t == "number" ? String(t) : void 0;
757
779
  }
758
- Q("aformLinkResolver", async (e, t) => {
780
+ X("aformLinkResolver", async (e, t) => {
759
781
  if (a.value)
760
782
  try {
761
- const l = a.value.getRecordById(e, t)?.get(""), p = le(l);
762
- if (p != null) return p;
783
+ const l = a.value.getRecordById(e, t)?.get(""), v = le(l);
784
+ if (v != null) return v;
763
785
  await a.value.getRecord(e, t);
764
- const m = a.value.getRecordById(e, t)?.get("");
765
- return le(m);
786
+ const g = a.value.getRecordById(e, t)?.get("");
787
+ return le(g);
766
788
  } catch {
767
789
  return;
768
790
  }
769
791
  });
770
792
  const se = (e) => {
771
- (e.ctrlKey || e.metaKey) && e.key === "k" && (e.preventDefault(), g.value = !0), e.key === "Escape" && g.value && (g.value = !1);
793
+ (e.ctrlKey || e.metaKey) && e.key === "k" && (e.preventDefault(), b.value = !0), e.key === "Escape" && b.value && (b.value = !1);
772
794
  };
773
795
  return ce(() => {
774
796
  document.addEventListener("keydown", se);
775
- }), Me(() => {
797
+ }), Ee(() => {
776
798
  document.removeEventListener("keydown", se);
777
- }), (e, t) => (d(), h("div", {
799
+ }), (e, t) => (p(), h("div", {
778
800
  class: "desktop",
779
- onClick: xe
801
+ onClick: _e
780
802
  }, [
781
- M(me, {
803
+ B(me, {
782
804
  elements: be.value,
783
- onActionClick: Re
805
+ onActionClick: $e
784
806
  }, null, 8, ["elements"]),
785
- oe.value.length > 0 ? (d(), de(J(Be), {
807
+ re.value.length > 0 ? (p(), de(Q(je), {
786
808
  key: 0,
787
- data: C.value,
788
- "onUpdate:data": t[0] || (t[0] = (l) => C.value = l),
789
- schema: oe.value,
809
+ data: D.value,
810
+ "onUpdate:data": t[0] || (t[0] = (l) => D.value = l),
811
+ schema: re.value,
790
812
  errors: x.value
791
- }, null, 8, ["data", "schema", "errors"])) : J(a) ? (d(), h("div", it, [
792
- c("p", null, "Loading " + N(A.value) + " data...", 1)
793
- ])) : (d(), h("div", ct, [...t[2] || (t[2] = [
794
- c("p", null, "Initializing Stonecrop...", -1)
813
+ }, null, 8, ["data", "schema", "errors"])) : Q(a) ? (p(), h("div", vt, [
814
+ i("p", null, "Loading " + T(S.value) + " data...", 1)
815
+ ])) : (p(), h("div", dt, [...t[2] || (t[2] = [
816
+ i("p", null, "Initializing Stonecrop...", -1)
795
817
  ])])),
796
- M(ye, { breadcrumbs: ke.value }, null, 8, ["breadcrumbs"]),
797
- M(he, {
798
- "is-open": g.value,
818
+ De.value ? (p(), h("p", pt, "This is a partial list — more records exist on the server.")) : O("", !0),
819
+ B(ye, { breadcrumbs: ke.value }, null, 8, ["breadcrumbs"]),
820
+ B(he, {
821
+ "is-open": b.value,
799
822
  search: Ce,
800
823
  placeholder: "Type a command or search...",
801
824
  onSelect: Ae,
802
- onClose: t[1] || (t[1] = (l) => g.value = !1)
825
+ onClose: t[1] || (t[1] = (l) => b.value = !1)
803
826
  }, {
804
- title: B(({ result: l }) => [
805
- H(N(l.title), 1)
827
+ title: j(({ result: l }) => [
828
+ z(T(l.title), 1)
806
829
  ]),
807
- content: B(({ result: l }) => [
808
- H(N(l.description), 1)
830
+ content: j(({ result: l }) => [
831
+ z(T(l.description), 1)
809
832
  ]),
810
833
  _: 1
811
834
  }, 8, ["is-open"])
812
835
  ]));
813
836
  }
814
- }), ht = {
815
- install: (s) => {
816
- s.component("ActionSet", me), s.component("CommandPalette", he), s.component("Desktop", ut), s.component("SheetNav", ye);
837
+ }), bt = {
838
+ install: (c) => {
839
+ c.component("ActionSet", me), c.component("CommandPalette", he), c.component("Desktop", ft), c.component("SheetNav", ye);
817
840
  }
818
841
  };
819
842
  export {
820
843
  me as ActionSet,
821
844
  he as CommandPalette,
822
- ut as Desktop,
845
+ ft as Desktop,
823
846
  ye as SheetNav,
824
- ht as StonecropDesktop
847
+ bt as StonecropDesktop
825
848
  };
826
849
  //# sourceMappingURL=desktop.js.map