@thebes/cadmea 1.5.0 → 1.7.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/index/index.d.ts +8 -1
- package/dist/index/index.js +244 -224
- package/dist/index/index.js.map +1 -1
- package/dist/index/server.js +63 -54
- package/dist/index/server.js.map +1 -1
- package/dist/tanstack-start/index.d.ts +18 -0
- package/dist/tanstack-start/index.js +380 -237
- package/dist/tanstack-start/index.js.map +1 -1
- package/dist/tanstack-start/server.js +169 -70
- package/dist/tanstack-start/server.js.map +1 -1
- package/package.json +1 -1
package/dist/index/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { PREVIEW_VALUES_MESSAGE, VISUAL_EDIT_MESSAGE, validateDocument } from "@
|
|
|
4
4
|
import { For, Index, Show, Suspense, createEffect, createMemo, createSignal, lazy, onCleanup, onMount } from "solid-js";
|
|
5
5
|
import { createSolidTable, flexRender, getCoreRowModel } from "@tanstack/solid-table";
|
|
6
6
|
//#region src/CollectionEdit.tsx
|
|
7
|
-
var _tmpl$$4 = /*#__PURE__*/ template(`<p class="text-sm text-error"role=alert>`), _tmpl$2$3 = /*#__PURE__*/ template(`<span class="loading loading-spinner loading-sm">`), _tmpl$3$3 = /*#__PURE__*/ template(`<button type=button class="btn flex-1">`), _tmpl$4$3 = /*#__PURE__*/ template(`<button type=button class="btn btn-primary flex-1">`), _tmpl$5$2 = /*#__PURE__*/ template(`<button type=button class="btn btn-outline flex-1">`), _tmpl$6$2 = /*#__PURE__*/ template(`<span class="text-base-content/60 self-center px-1 text-xs"aria-live=polite>`), _tmpl$7$1 = /*#__PURE__*/ template(`<form class="flex flex-col gap-4"><div class="bg-base-100 sticky bottom-0 flex gap-2 border-t py-3">`), _tmpl$
|
|
7
|
+
var _tmpl$$4 = /*#__PURE__*/ template(`<p class="text-sm text-error"role=alert>`), _tmpl$2$3 = /*#__PURE__*/ template(`<span class="loading loading-spinner loading-sm">`), _tmpl$3$3 = /*#__PURE__*/ template(`<button type=button class="btn flex-1">`), _tmpl$4$3 = /*#__PURE__*/ template(`<button type=button class="btn btn-primary flex-1">`), _tmpl$5$2 = /*#__PURE__*/ template(`<button type=button class="btn btn-outline flex-1">`), _tmpl$6$2 = /*#__PURE__*/ template(`<span class="text-base-content/60 self-center px-1 text-xs"aria-live=polite>`), _tmpl$7$1 = /*#__PURE__*/ template(`<div class="modal modal-open"role=dialog aria-modal=true><div class=modal-box><h3 class="text-lg font-semibold">Publish changes?</h3><p class="text-base-content/70 py-2 text-sm">Your latest saved draft will go live on the site.</p><div class=modal-action><button type=button class="btn btn-ghost">Cancel</button><button type=button class="btn btn-primary">Publish</button></div></div><button type=button class=modal-backdrop aria-label=Cancel>`), _tmpl$8$1 = /*#__PURE__*/ template(`<form class="flex flex-col gap-4"><div class="bg-base-100 sticky bottom-0 flex gap-2 border-t py-3">`), _tmpl$9$1 = /*#__PURE__*/ template(`<fieldset class="border-base-300 rounded-box border p-4"><legend class="px-2 text-sm font-semibold">`), _tmpl$0$1 = /*#__PURE__*/ template(`<div class="grid grid-cols-1 gap-4 md:grid-cols-2">`), _tmpl$1$1 = /*#__PURE__*/ template(`<span class=text-error> *`), _tmpl$10$1 = /*#__PURE__*/ template(`<p class="text-base-content/60 mb-1 text-xs">`), _tmpl$11$1 = /*#__PURE__*/ template(`<p class="text-error mt-1 text-sm"role=alert>`), _tmpl$12$1 = /*#__PURE__*/ template(`<div><label class=label>`), _tmpl$13$1 = /*#__PURE__*/ template(`<input class=input type=text>`), _tmpl$14 = /*#__PURE__*/ template(`<select class=select>`), _tmpl$15 = /*#__PURE__*/ template(`<option>`), _tmpl$16 = /*#__PURE__*/ template(`<input class=input type=number>`), _tmpl$17 = /*#__PURE__*/ template(`<input class=input type=text readonly>`), _tmpl$18 = /*#__PURE__*/ template(`<input class=checkbox type=checkbox>`), _tmpl$19 = /*#__PURE__*/ template(`<p class="text-sm opacity-70 break-all">`), _tmpl$20 = /*#__PURE__*/ template(`<p class="text-sm text-error">`), _tmpl$21 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2"><input class=file-input type=file>`), _tmpl$22 = /*#__PURE__*/ template(`<div class="mb-1 flex flex-wrap gap-1">`), _tmpl$23 = /*#__PURE__*/ template(`<button type=button aria-label=Clear class="absolute top-2 right-2 cursor-pointer opacity-60">×`), _tmpl$24 = /*#__PURE__*/ template(`<div role=listbox class="bg-base-100 border-base-300 rounded-box absolute z-10 mt-1 flex max-h-56 w-full flex-col overflow-auto border p-1 shadow">`), _tmpl$25 = /*#__PURE__*/ template(`<div class=relative><input type=text role=combobox autocomplete=off class=input>`), _tmpl$26 = /*#__PURE__*/ template(`<span class="badge badge-primary gap-1"><button type=button class=cursor-pointer>×`), _tmpl$27 = /*#__PURE__*/ template(`<button type=button role=option class="rounded px-3 py-2 text-left">`), _tmpl$28 = /*#__PURE__*/ template(`<div role=menu class="bg-base-100 border-base-300 rounded-box absolute z-10 mt-1 flex flex-col border p-1 shadow">`), _tmpl$29 = /*#__PURE__*/ template(`<div class="relative self-start"><button type=button class="btn btn-outline btn-sm"aria-haspopup=menu>Add block`), _tmpl$30 = /*#__PURE__*/ template(`<div class="form-control md:col-span-2"><div class="label font-medium"></div><div class="flex flex-col gap-3">`), _tmpl$31 = /*#__PURE__*/ template(`<span class="text-base-content/60 truncate text-sm">`), _tmpl$32 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2">`), _tmpl$33 = /*#__PURE__*/ template(`<div class="card bg-base-200 flex flex-col gap-2 p-3"><div class="flex items-center gap-2"><button type=button class="btn btn-ghost btn-sm gap-2"><span aria-hidden=true></span><span class=font-semibold></span></button><div class="ml-auto flex gap-1"><button type=button class="btn btn-ghost btn-xs"aria-label="Move up">↑</button><button type=button class="btn btn-ghost btn-xs"aria-label="Move down">↓</button><button type=button class="btn btn-ghost btn-xs"aria-label=Duplicate>⧉</button><button type=button class="btn btn-ghost btn-xs text-error"aria-label=Remove>Remove`), _tmpl$34 = /*#__PURE__*/ template(`<button type=button class="btn btn-outline btn-sm self-start">Add `), _tmpl$35 = /*#__PURE__*/ template(`<i aria-hidden=true>`), _tmpl$36 = /*#__PURE__*/ template(`<button type=button role=menuitem class="flex items-center gap-2 rounded px-3 py-2 text-left">`);
|
|
8
8
|
const RichTextEditor = lazy(() => import("../RichTextEditor-ComcBFfl.js").then((mod) => ({ default: mod.RichTextEditor })));
|
|
9
9
|
function editableFields(config) {
|
|
10
10
|
return Object.entries(config.fields).filter(([key]) => key !== "id");
|
|
@@ -70,6 +70,11 @@ function CollectionEdit(props) {
|
|
|
70
70
|
const fieldGroups = groupFields(editableFields(props.config));
|
|
71
71
|
const versioned = () => props.config.versions?.drafts && props.draftActions;
|
|
72
72
|
const [autosaveStatus, setAutosaveStatus] = createSignal("idle");
|
|
73
|
+
const [confirmingPublish, setConfirmingPublish] = createSignal(false);
|
|
74
|
+
function requestPublish() {
|
|
75
|
+
if (props.draftActions?.confirmPublish) setConfirmingPublish(true);
|
|
76
|
+
else props.draftActions?.onPublish?.();
|
|
77
|
+
}
|
|
73
78
|
let autosaveTimer;
|
|
74
79
|
createEffect(() => {
|
|
75
80
|
const dirty = !isDefaultValue();
|
|
@@ -92,7 +97,7 @@ function CollectionEdit(props) {
|
|
|
92
97
|
});
|
|
93
98
|
onCleanup(() => clearTimeout(autosaveTimer));
|
|
94
99
|
return (() => {
|
|
95
|
-
var _el$ = _tmpl$
|
|
100
|
+
var _el$ = _tmpl$8$1(), _el$3 = _el$.firstChild;
|
|
96
101
|
_el$.addEventListener("submit", (event) => {
|
|
97
102
|
event.preventDefault();
|
|
98
103
|
form.handleSubmit();
|
|
@@ -124,9 +129,9 @@ function CollectionEdit(props) {
|
|
|
124
129
|
});
|
|
125
130
|
},
|
|
126
131
|
get children() {
|
|
127
|
-
var _el$
|
|
128
|
-
insert(_el$
|
|
129
|
-
insert(_el$
|
|
132
|
+
var _el$17 = _tmpl$9$1(), _el$18 = _el$17.firstChild;
|
|
133
|
+
insert(_el$18, () => group.name);
|
|
134
|
+
insert(_el$17, createComponent(FieldsGrid, {
|
|
130
135
|
form,
|
|
131
136
|
ctx,
|
|
132
137
|
get fields() {
|
|
@@ -134,7 +139,7 @@ function CollectionEdit(props) {
|
|
|
134
139
|
},
|
|
135
140
|
values: formValues
|
|
136
141
|
}), null);
|
|
137
|
-
return _el$
|
|
142
|
+
return _el$17;
|
|
138
143
|
}
|
|
139
144
|
})
|
|
140
145
|
}), _el$3);
|
|
@@ -148,9 +153,9 @@ function CollectionEdit(props) {
|
|
|
148
153
|
return props.capabilities?.canUpdate !== false;
|
|
149
154
|
},
|
|
150
155
|
get children() {
|
|
151
|
-
var _el$
|
|
152
|
-
_el$
|
|
153
|
-
insert(_el$
|
|
156
|
+
var _el$19 = _tmpl$4$3();
|
|
157
|
+
_el$19.$$click = () => void form.handleSubmit();
|
|
158
|
+
insert(_el$19, createComponent(Show, {
|
|
154
159
|
get when() {
|
|
155
160
|
return props.saving;
|
|
156
161
|
},
|
|
@@ -161,8 +166,8 @@ function CollectionEdit(props) {
|
|
|
161
166
|
return _tmpl$2$3();
|
|
162
167
|
}
|
|
163
168
|
}));
|
|
164
|
-
effect(() => _el$
|
|
165
|
-
return _el$
|
|
169
|
+
effect(() => _el$19.disabled = props.saving);
|
|
170
|
+
return _el$19;
|
|
166
171
|
}
|
|
167
172
|
});
|
|
168
173
|
},
|
|
@@ -187,7 +192,7 @@ function CollectionEdit(props) {
|
|
|
187
192
|
})(),
|
|
188
193
|
(() => {
|
|
189
194
|
var _el$6 = _tmpl$4$3();
|
|
190
|
-
_el$6.$$click =
|
|
195
|
+
_el$6.$$click = requestPublish;
|
|
191
196
|
insert(_el$6, createComponent(Show, {
|
|
192
197
|
get when() {
|
|
193
198
|
return props.draftActions?.publishing;
|
|
@@ -248,13 +253,28 @@ function CollectionEdit(props) {
|
|
|
248
253
|
];
|
|
249
254
|
}
|
|
250
255
|
}));
|
|
256
|
+
insert(_el$, createComponent(Show, {
|
|
257
|
+
get when() {
|
|
258
|
+
return confirmingPublish();
|
|
259
|
+
},
|
|
260
|
+
get children() {
|
|
261
|
+
var _el$1 = _tmpl$7$1(), _el$10 = _el$1.firstChild, _el$14 = _el$10.firstChild.nextSibling.nextSibling.firstChild, _el$15 = _el$14.nextSibling, _el$16 = _el$10.nextSibling;
|
|
262
|
+
_el$14.$$click = () => setConfirmingPublish(false);
|
|
263
|
+
_el$15.$$click = () => {
|
|
264
|
+
setConfirmingPublish(false);
|
|
265
|
+
props.draftActions?.onPublish?.();
|
|
266
|
+
};
|
|
267
|
+
_el$16.$$click = () => setConfirmingPublish(false);
|
|
268
|
+
return _el$1;
|
|
269
|
+
}
|
|
270
|
+
}), null);
|
|
251
271
|
return _el$;
|
|
252
272
|
})();
|
|
253
273
|
}
|
|
254
274
|
function FieldsGrid(props) {
|
|
255
275
|
return (() => {
|
|
256
|
-
var _el$
|
|
257
|
-
insert(_el$
|
|
276
|
+
var _el$21 = _tmpl$0$1();
|
|
277
|
+
insert(_el$21, createComponent(For, {
|
|
258
278
|
get each() {
|
|
259
279
|
return props.fields;
|
|
260
280
|
},
|
|
@@ -267,7 +287,7 @@ function FieldsGrid(props) {
|
|
|
267
287
|
}
|
|
268
288
|
})
|
|
269
289
|
}));
|
|
270
|
-
return _el$
|
|
290
|
+
return _el$21;
|
|
271
291
|
})();
|
|
272
292
|
}
|
|
273
293
|
function renderField(form, ctx, name, field, label) {
|
|
@@ -276,40 +296,40 @@ function renderField(form, ctx, name, field, label) {
|
|
|
276
296
|
return createComponent(form.Field, {
|
|
277
297
|
name,
|
|
278
298
|
children: (fieldApi) => (() => {
|
|
279
|
-
var _el$
|
|
280
|
-
className(_el$
|
|
281
|
-
setAttribute(_el$
|
|
282
|
-
insert(_el$
|
|
283
|
-
insert(_el$
|
|
299
|
+
var _el$22 = _tmpl$12$1(), _el$23 = _el$22.firstChild;
|
|
300
|
+
className(_el$22, `form-control ${spanClass}`);
|
|
301
|
+
setAttribute(_el$23, "for", name);
|
|
302
|
+
insert(_el$23, label, null);
|
|
303
|
+
insert(_el$23, createComponent(Show, {
|
|
284
304
|
get when() {
|
|
285
305
|
return field.required;
|
|
286
306
|
},
|
|
287
307
|
get children() {
|
|
288
|
-
return _tmpl$
|
|
308
|
+
return _tmpl$1$1();
|
|
289
309
|
}
|
|
290
310
|
}), null);
|
|
291
|
-
insert(_el$
|
|
311
|
+
insert(_el$22, createComponent(Show, {
|
|
292
312
|
get when() {
|
|
293
313
|
return field.admin?.description;
|
|
294
314
|
},
|
|
295
315
|
get children() {
|
|
296
|
-
var _el$
|
|
297
|
-
insert(_el$
|
|
298
|
-
return _el$
|
|
316
|
+
var _el$25 = _tmpl$10$1();
|
|
317
|
+
insert(_el$25, () => field.admin?.description);
|
|
318
|
+
return _el$25;
|
|
299
319
|
}
|
|
300
320
|
}), null);
|
|
301
|
-
insert(_el$
|
|
302
|
-
insert(_el$
|
|
321
|
+
insert(_el$22, () => renderControl(ctx, name, field, fieldApi), null);
|
|
322
|
+
insert(_el$22, createComponent(Show, {
|
|
303
323
|
get when() {
|
|
304
324
|
return (fieldApi().state.meta.errors?.length ?? 0) > 0;
|
|
305
325
|
},
|
|
306
326
|
get children() {
|
|
307
|
-
var _el$
|
|
308
|
-
insert(_el$
|
|
309
|
-
return _el$
|
|
327
|
+
var _el$26 = _tmpl$11$1();
|
|
328
|
+
insert(_el$26, () => fieldApi().state.meta.errors.filter(Boolean).join(", "));
|
|
329
|
+
return _el$26;
|
|
310
330
|
}
|
|
311
331
|
}), null);
|
|
312
|
-
return _el$
|
|
332
|
+
return _el$22;
|
|
313
333
|
})()
|
|
314
334
|
});
|
|
315
335
|
}
|
|
@@ -329,75 +349,75 @@ function renderControl(ctx, name, field, fieldApi) {
|
|
|
329
349
|
const change = (v) => fieldApi().handleChange(v);
|
|
330
350
|
switch (field.type) {
|
|
331
351
|
case "text": return (() => {
|
|
332
|
-
var _el$
|
|
333
|
-
_el$
|
|
334
|
-
_el$
|
|
335
|
-
setAttribute(_el$
|
|
336
|
-
_el$
|
|
352
|
+
var _el$27 = _tmpl$13$1();
|
|
353
|
+
_el$27.addEventListener("blur", () => fieldApi().handleBlur());
|
|
354
|
+
_el$27.$$input = (e) => change(e.currentTarget.value);
|
|
355
|
+
setAttribute(_el$27, "id", name);
|
|
356
|
+
_el$27.readOnly = readOnly;
|
|
337
357
|
effect((_p$) => {
|
|
338
358
|
var _v$ = field.admin?.placeholder, _v$2 = field.required;
|
|
339
|
-
_v$ !== _p$.e && setAttribute(_el$
|
|
340
|
-
_v$2 !== _p$.t && (_el$
|
|
359
|
+
_v$ !== _p$.e && setAttribute(_el$27, "placeholder", _p$.e = _v$);
|
|
360
|
+
_v$2 !== _p$.t && (_el$27.required = _p$.t = _v$2);
|
|
341
361
|
return _p$;
|
|
342
362
|
}, {
|
|
343
363
|
e: void 0,
|
|
344
364
|
t: void 0
|
|
345
365
|
});
|
|
346
|
-
effect(() => _el$
|
|
347
|
-
return _el$
|
|
366
|
+
effect(() => _el$27.value = fieldApi().state.value ?? "");
|
|
367
|
+
return _el$27;
|
|
348
368
|
})();
|
|
349
369
|
case "select": return (() => {
|
|
350
|
-
var _el$
|
|
351
|
-
_el$
|
|
352
|
-
_el$
|
|
353
|
-
setAttribute(_el$
|
|
354
|
-
_el$
|
|
355
|
-
insert(_el$
|
|
370
|
+
var _el$28 = _tmpl$14();
|
|
371
|
+
_el$28.addEventListener("blur", () => fieldApi().handleBlur());
|
|
372
|
+
_el$28.addEventListener("change", (e) => change(e.currentTarget.value));
|
|
373
|
+
setAttribute(_el$28, "id", name);
|
|
374
|
+
_el$28.disabled = readOnly;
|
|
375
|
+
insert(_el$28, createComponent(For, {
|
|
356
376
|
get each() {
|
|
357
377
|
return field.options;
|
|
358
378
|
},
|
|
359
379
|
children: (option) => (() => {
|
|
360
|
-
var _el$
|
|
361
|
-
_el$
|
|
362
|
-
insert(_el$
|
|
363
|
-
return _el$
|
|
380
|
+
var _el$29 = _tmpl$15();
|
|
381
|
+
_el$29.value = option;
|
|
382
|
+
insert(_el$29, option);
|
|
383
|
+
return _el$29;
|
|
364
384
|
})()
|
|
365
385
|
}));
|
|
366
|
-
effect(() => _el$
|
|
367
|
-
effect(() => _el$
|
|
368
|
-
return _el$
|
|
386
|
+
effect(() => _el$28.required = field.required);
|
|
387
|
+
effect(() => _el$28.value = fieldApi().state.value ?? "");
|
|
388
|
+
return _el$28;
|
|
369
389
|
})();
|
|
370
390
|
case "number": return (() => {
|
|
371
|
-
var _el$
|
|
372
|
-
_el$
|
|
373
|
-
_el$
|
|
374
|
-
setAttribute(_el$
|
|
375
|
-
_el$
|
|
391
|
+
var _el$30 = _tmpl$16();
|
|
392
|
+
_el$30.addEventListener("blur", () => fieldApi().handleBlur());
|
|
393
|
+
_el$30.$$input = (e) => change(e.currentTarget.valueAsNumber);
|
|
394
|
+
setAttribute(_el$30, "id", name);
|
|
395
|
+
_el$30.readOnly = readOnly;
|
|
376
396
|
effect((_p$) => {
|
|
377
397
|
var _v$3 = field.admin?.placeholder, _v$4 = field.required;
|
|
378
|
-
_v$3 !== _p$.e && setAttribute(_el$
|
|
379
|
-
_v$4 !== _p$.t && (_el$
|
|
398
|
+
_v$3 !== _p$.e && setAttribute(_el$30, "placeholder", _p$.e = _v$3);
|
|
399
|
+
_v$4 !== _p$.t && (_el$30.required = _p$.t = _v$4);
|
|
380
400
|
return _p$;
|
|
381
401
|
}, {
|
|
382
402
|
e: void 0,
|
|
383
403
|
t: void 0
|
|
384
404
|
});
|
|
385
|
-
effect(() => _el$
|
|
386
|
-
return _el$
|
|
405
|
+
effect(() => _el$30.value = fieldApi().state.value ?? "");
|
|
406
|
+
return _el$30;
|
|
387
407
|
})();
|
|
388
408
|
case "date": return (() => {
|
|
389
|
-
var _el$
|
|
390
|
-
setAttribute(_el$
|
|
391
|
-
effect(() => _el$
|
|
392
|
-
return _el$
|
|
409
|
+
var _el$31 = _tmpl$17();
|
|
410
|
+
setAttribute(_el$31, "id", name);
|
|
411
|
+
effect(() => _el$31.value = formatDateValue(fieldApi().state.value));
|
|
412
|
+
return _el$31;
|
|
393
413
|
})();
|
|
394
414
|
case "checkbox": return (() => {
|
|
395
|
-
var _el$
|
|
396
|
-
_el$
|
|
397
|
-
setAttribute(_el$
|
|
398
|
-
_el$
|
|
399
|
-
effect(() => _el$
|
|
400
|
-
return _el$
|
|
415
|
+
var _el$32 = _tmpl$18();
|
|
416
|
+
_el$32.addEventListener("change", (e) => change(e.currentTarget.checked));
|
|
417
|
+
setAttribute(_el$32, "id", name);
|
|
418
|
+
_el$32.disabled = readOnly;
|
|
419
|
+
effect(() => _el$32.checked = fieldApi().state.value ?? false);
|
|
420
|
+
return _el$32;
|
|
401
421
|
})();
|
|
402
422
|
case "upload": return createComponent(UploadControl, {
|
|
403
423
|
name,
|
|
@@ -456,19 +476,19 @@ function UploadControl(props) {
|
|
|
456
476
|
}
|
|
457
477
|
}
|
|
458
478
|
return (() => {
|
|
459
|
-
var _el$
|
|
460
|
-
insert(_el$
|
|
479
|
+
var _el$34 = _tmpl$21(), _el$36 = _el$34.firstChild;
|
|
480
|
+
insert(_el$34, createComponent(Show, {
|
|
461
481
|
get when() {
|
|
462
482
|
return value();
|
|
463
483
|
},
|
|
464
484
|
get children() {
|
|
465
|
-
var _el$
|
|
466
|
-
insert(_el$
|
|
467
|
-
return _el$
|
|
485
|
+
var _el$35 = _tmpl$19();
|
|
486
|
+
insert(_el$35, value);
|
|
487
|
+
return _el$35;
|
|
468
488
|
}
|
|
469
|
-
}), _el$
|
|
470
|
-
_el$
|
|
471
|
-
insert(_el$
|
|
489
|
+
}), _el$36);
|
|
490
|
+
_el$36.addEventListener("change", handleFileChange);
|
|
491
|
+
insert(_el$34, createComponent(Show, {
|
|
472
492
|
get when() {
|
|
473
493
|
return uploading();
|
|
474
494
|
},
|
|
@@ -476,28 +496,28 @@ function UploadControl(props) {
|
|
|
476
496
|
return _tmpl$2$3();
|
|
477
497
|
}
|
|
478
498
|
}), null);
|
|
479
|
-
insert(_el$
|
|
499
|
+
insert(_el$34, createComponent(Show, {
|
|
480
500
|
get when() {
|
|
481
501
|
return uploadError();
|
|
482
502
|
},
|
|
483
503
|
get children() {
|
|
484
|
-
var _el$
|
|
485
|
-
insert(_el$
|
|
486
|
-
return _el$
|
|
504
|
+
var _el$38 = _tmpl$20();
|
|
505
|
+
insert(_el$38, uploadError);
|
|
506
|
+
return _el$38;
|
|
487
507
|
}
|
|
488
508
|
}), null);
|
|
489
509
|
effect((_p$) => {
|
|
490
510
|
var _v$5 = props.name, _v$6 = props.field.required && !value(), _v$7 = uploading() || props.field.admin?.readOnly;
|
|
491
|
-
_v$5 !== _p$.e && setAttribute(_el$
|
|
492
|
-
_v$6 !== _p$.t && (_el$
|
|
493
|
-
_v$7 !== _p$.a && (_el$
|
|
511
|
+
_v$5 !== _p$.e && setAttribute(_el$36, "id", _p$.e = _v$5);
|
|
512
|
+
_v$6 !== _p$.t && (_el$36.required = _p$.t = _v$6);
|
|
513
|
+
_v$7 !== _p$.a && (_el$36.disabled = _p$.a = _v$7);
|
|
494
514
|
return _p$;
|
|
495
515
|
}, {
|
|
496
516
|
e: void 0,
|
|
497
517
|
t: void 0,
|
|
498
518
|
a: void 0
|
|
499
519
|
});
|
|
500
|
-
return _el$
|
|
520
|
+
return _el$34;
|
|
501
521
|
})();
|
|
502
522
|
}
|
|
503
523
|
function RelationshipField(props) {
|
|
@@ -552,86 +572,86 @@ function RelationshipField(props) {
|
|
|
552
572
|
}
|
|
553
573
|
}
|
|
554
574
|
return (() => {
|
|
555
|
-
var _el$
|
|
556
|
-
insert(_el$
|
|
575
|
+
var _el$39 = _tmpl$25(), _el$41 = _el$39.firstChild;
|
|
576
|
+
insert(_el$39, createComponent(Show, {
|
|
557
577
|
get when() {
|
|
558
578
|
return memo(() => !!isMulti())() && selectedOptions().length > 0;
|
|
559
579
|
},
|
|
560
580
|
get children() {
|
|
561
|
-
var _el$
|
|
562
|
-
insert(_el$
|
|
581
|
+
var _el$40 = _tmpl$22();
|
|
582
|
+
insert(_el$40, createComponent(For, {
|
|
563
583
|
get each() {
|
|
564
584
|
return selectedOptions();
|
|
565
585
|
},
|
|
566
586
|
children: (option) => (() => {
|
|
567
|
-
var _el$
|
|
568
|
-
insert(_el$
|
|
569
|
-
_el$
|
|
570
|
-
effect(() => setAttribute(_el$
|
|
571
|
-
return _el$
|
|
587
|
+
var _el$44 = _tmpl$26(), _el$45 = _el$44.firstChild;
|
|
588
|
+
insert(_el$44, () => option.label, _el$45);
|
|
589
|
+
_el$45.$$click = () => removeId(option.id);
|
|
590
|
+
effect(() => setAttribute(_el$45, "aria-label", `Remove ${option.label}`));
|
|
591
|
+
return _el$44;
|
|
572
592
|
})()
|
|
573
593
|
}));
|
|
574
|
-
return _el$
|
|
594
|
+
return _el$40;
|
|
575
595
|
}
|
|
576
|
-
}), _el$
|
|
577
|
-
_el$
|
|
578
|
-
_el$
|
|
579
|
-
_el$
|
|
580
|
-
_el$
|
|
596
|
+
}), _el$41);
|
|
597
|
+
_el$41.$$keydown = onKeyDown;
|
|
598
|
+
_el$41.addEventListener("blur", () => setTimeout(() => setOpen(false), 120));
|
|
599
|
+
_el$41.addEventListener("focus", () => setOpen(true));
|
|
600
|
+
_el$41.$$input = (e) => {
|
|
581
601
|
setQuery(e.currentTarget.value);
|
|
582
602
|
setOpen(true);
|
|
583
603
|
setActive(0);
|
|
584
604
|
};
|
|
585
|
-
setAttribute(_el$
|
|
586
|
-
insert(_el$
|
|
605
|
+
setAttribute(_el$41, "aria-controls", listId);
|
|
606
|
+
insert(_el$39, createComponent(Show, {
|
|
587
607
|
get when() {
|
|
588
608
|
return memo(() => !!(!isMulti() && value() != null))() && !props.field.required;
|
|
589
609
|
},
|
|
590
610
|
get children() {
|
|
591
|
-
var _el$
|
|
592
|
-
_el$
|
|
593
|
-
_el$
|
|
594
|
-
return _el$
|
|
611
|
+
var _el$42 = _tmpl$23();
|
|
612
|
+
_el$42.$$click = () => removeId(value());
|
|
613
|
+
_el$42.$$mousedown = (e) => e.preventDefault();
|
|
614
|
+
return _el$42;
|
|
595
615
|
}
|
|
596
616
|
}), null);
|
|
597
|
-
insert(_el$
|
|
617
|
+
insert(_el$39, createComponent(Show, {
|
|
598
618
|
get when() {
|
|
599
619
|
return memo(() => !!open())() && filtered().length > 0;
|
|
600
620
|
},
|
|
601
621
|
get children() {
|
|
602
|
-
var _el$
|
|
603
|
-
setAttribute(_el$
|
|
604
|
-
insert(_el$
|
|
622
|
+
var _el$43 = _tmpl$24();
|
|
623
|
+
setAttribute(_el$43, "id", listId);
|
|
624
|
+
insert(_el$43, createComponent(For, {
|
|
605
625
|
get each() {
|
|
606
626
|
return filtered();
|
|
607
627
|
},
|
|
608
628
|
children: (option, i) => (() => {
|
|
609
|
-
var _el$
|
|
610
|
-
_el$
|
|
611
|
-
_el$
|
|
612
|
-
insert(_el$
|
|
629
|
+
var _el$46 = _tmpl$27();
|
|
630
|
+
_el$46.$$click = () => choose(option);
|
|
631
|
+
_el$46.$$mousedown = (e) => e.preventDefault();
|
|
632
|
+
insert(_el$46, () => option.label);
|
|
613
633
|
effect((_p$) => {
|
|
614
634
|
var _v$11 = selectedIds().includes(option.id), _v$12 = !!(i() === active());
|
|
615
|
-
_v$11 !== _p$.e && setAttribute(_el$
|
|
616
|
-
_v$12 !== _p$.t && _el$
|
|
635
|
+
_v$11 !== _p$.e && setAttribute(_el$46, "aria-selected", _p$.e = _v$11);
|
|
636
|
+
_v$12 !== _p$.t && _el$46.classList.toggle("bg-base-200", _p$.t = _v$12);
|
|
617
637
|
return _p$;
|
|
618
638
|
}, {
|
|
619
639
|
e: void 0,
|
|
620
640
|
t: void 0
|
|
621
641
|
});
|
|
622
|
-
return _el$
|
|
642
|
+
return _el$46;
|
|
623
643
|
})()
|
|
624
644
|
}));
|
|
625
|
-
return _el$
|
|
645
|
+
return _el$43;
|
|
626
646
|
}
|
|
627
647
|
}), null);
|
|
628
648
|
effect((_p$) => {
|
|
629
649
|
var _v$8 = props.name, _v$9 = open(), _v$0 = props.field.required && selectedIds().length === 0, _v$1 = props.field.admin?.readOnly, _v$10 = props.field.admin?.placeholder ?? "Search…";
|
|
630
|
-
_v$8 !== _p$.e && setAttribute(_el$
|
|
631
|
-
_v$9 !== _p$.t && setAttribute(_el$
|
|
632
|
-
_v$0 !== _p$.a && (_el$
|
|
633
|
-
_v$1 !== _p$.o && (_el$
|
|
634
|
-
_v$10 !== _p$.i && setAttribute(_el$
|
|
650
|
+
_v$8 !== _p$.e && setAttribute(_el$41, "id", _p$.e = _v$8);
|
|
651
|
+
_v$9 !== _p$.t && setAttribute(_el$41, "aria-expanded", _p$.t = _v$9);
|
|
652
|
+
_v$0 !== _p$.a && (_el$41.required = _p$.a = _v$0);
|
|
653
|
+
_v$1 !== _p$.o && (_el$41.disabled = _p$.o = _v$1);
|
|
654
|
+
_v$10 !== _p$.i && setAttribute(_el$41, "placeholder", _p$.i = _v$10);
|
|
635
655
|
return _p$;
|
|
636
656
|
}, {
|
|
637
657
|
e: void 0,
|
|
@@ -640,8 +660,8 @@ function RelationshipField(props) {
|
|
|
640
660
|
o: void 0,
|
|
641
661
|
i: void 0
|
|
642
662
|
});
|
|
643
|
-
effect(() => _el$
|
|
644
|
-
return _el$
|
|
663
|
+
effect(() => _el$41.value = open() || isMulti() ? query() : singleLabel());
|
|
664
|
+
return _el$39;
|
|
645
665
|
})();
|
|
646
666
|
}
|
|
647
667
|
function renderArray(form, ctx, name, field, label) {
|
|
@@ -702,129 +722,129 @@ function BlockEditor(props) {
|
|
|
702
722
|
return "";
|
|
703
723
|
}
|
|
704
724
|
return (() => {
|
|
705
|
-
var _el$
|
|
706
|
-
insert(_el$
|
|
707
|
-
insert(_el$
|
|
725
|
+
var _el$47 = _tmpl$30(), _el$48 = _el$47.firstChild, _el$51 = _el$48.nextSibling;
|
|
726
|
+
insert(_el$48, () => props.label, null);
|
|
727
|
+
insert(_el$48, createComponent(Show, {
|
|
708
728
|
get when() {
|
|
709
729
|
return props.field.required;
|
|
710
730
|
},
|
|
711
731
|
get children() {
|
|
712
|
-
return _tmpl$
|
|
732
|
+
return _tmpl$1$1();
|
|
713
733
|
}
|
|
714
734
|
}), null);
|
|
715
|
-
insert(_el$
|
|
735
|
+
insert(_el$47, createComponent(Show, {
|
|
716
736
|
get when() {
|
|
717
737
|
return props.field.admin?.description;
|
|
718
738
|
},
|
|
719
739
|
get children() {
|
|
720
|
-
var _el$
|
|
721
|
-
insert(_el$
|
|
722
|
-
return _el$
|
|
740
|
+
var _el$50 = _tmpl$10$1();
|
|
741
|
+
insert(_el$50, () => props.field.admin?.description);
|
|
742
|
+
return _el$50;
|
|
723
743
|
}
|
|
724
|
-
}), _el$
|
|
725
|
-
insert(_el$
|
|
744
|
+
}), _el$51);
|
|
745
|
+
insert(_el$51, createComponent(Index, {
|
|
726
746
|
get each() {
|
|
727
747
|
return items();
|
|
728
748
|
},
|
|
729
749
|
children: (item, index) => {
|
|
730
750
|
const isCollapsed = () => collapsed().has(index);
|
|
731
751
|
return (() => {
|
|
732
|
-
var _el$
|
|
733
|
-
_el$
|
|
734
|
-
insert(_el$
|
|
735
|
-
insert(_el$
|
|
736
|
-
insert(_el$
|
|
752
|
+
var _el$55 = _tmpl$33(), _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild, _el$59 = _el$58.nextSibling, _el$61 = _el$57.nextSibling, _el$62 = _el$61.firstChild, _el$63 = _el$62.nextSibling, _el$64 = _el$63.nextSibling, _el$65 = _el$64.nextSibling;
|
|
753
|
+
_el$57.$$click = () => toggleCollapse(index);
|
|
754
|
+
insert(_el$58, () => isCollapsed() ? "▸" : "▾");
|
|
755
|
+
insert(_el$59, () => blockTitle(item()));
|
|
756
|
+
insert(_el$56, createComponent(Show, {
|
|
737
757
|
get when() {
|
|
738
758
|
return memo(() => !!isCollapsed())() && blockSummary(item());
|
|
739
759
|
},
|
|
740
760
|
get children() {
|
|
741
|
-
var _el$
|
|
742
|
-
insert(_el$
|
|
743
|
-
return _el$
|
|
761
|
+
var _el$60 = _tmpl$31();
|
|
762
|
+
insert(_el$60, () => blockSummary(item()));
|
|
763
|
+
return _el$60;
|
|
744
764
|
}
|
|
745
|
-
}), _el$
|
|
746
|
-
_el$
|
|
747
|
-
_el$
|
|
748
|
-
_el$
|
|
749
|
-
_el$
|
|
750
|
-
_el$
|
|
751
|
-
insert(_el$
|
|
765
|
+
}), _el$61);
|
|
766
|
+
_el$62.$$click = () => move(index, index - 1);
|
|
767
|
+
_el$62.disabled = index === 0;
|
|
768
|
+
_el$63.$$click = () => move(index, index + 1);
|
|
769
|
+
_el$64.$$click = () => duplicate(index);
|
|
770
|
+
_el$65.$$click = () => props.fieldApi().removeValue(index);
|
|
771
|
+
insert(_el$55, createComponent(Show, {
|
|
752
772
|
get when() {
|
|
753
773
|
return !isCollapsed();
|
|
754
774
|
},
|
|
755
775
|
get children() {
|
|
756
|
-
var _el$
|
|
757
|
-
insert(_el$
|
|
776
|
+
var _el$66 = _tmpl$32();
|
|
777
|
+
insert(_el$66, createComponent(For, {
|
|
758
778
|
get each() {
|
|
759
779
|
return fieldsForItem(props.field, item());
|
|
760
780
|
},
|
|
761
781
|
children: ([itemKey, itemField]) => renderField(props.form, props.ctx, `${props.name}[${index}].${itemKey}`, itemField, labelFor(itemKey, itemField))
|
|
762
782
|
}));
|
|
763
|
-
return _el$
|
|
783
|
+
return _el$66;
|
|
764
784
|
}
|
|
765
785
|
}), null);
|
|
766
786
|
effect((_p$) => {
|
|
767
787
|
var _v$13 = !isCollapsed(), _v$14 = index === items().length - 1;
|
|
768
|
-
_v$13 !== _p$.e && setAttribute(_el$
|
|
769
|
-
_v$14 !== _p$.t && (_el$
|
|
788
|
+
_v$13 !== _p$.e && setAttribute(_el$57, "aria-expanded", _p$.e = _v$13);
|
|
789
|
+
_v$14 !== _p$.t && (_el$63.disabled = _p$.t = _v$14);
|
|
770
790
|
return _p$;
|
|
771
791
|
}, {
|
|
772
792
|
e: void 0,
|
|
773
793
|
t: void 0
|
|
774
794
|
});
|
|
775
|
-
return _el$
|
|
795
|
+
return _el$55;
|
|
776
796
|
})();
|
|
777
797
|
}
|
|
778
798
|
}), null);
|
|
779
|
-
insert(_el$
|
|
799
|
+
insert(_el$51, createComponent(Show, {
|
|
780
800
|
get when() {
|
|
781
801
|
return disc && variants.length > 0;
|
|
782
802
|
},
|
|
783
803
|
get fallback() {
|
|
784
804
|
return (() => {
|
|
785
|
-
var _el$
|
|
786
|
-
_el$
|
|
787
|
-
_el$
|
|
788
|
-
insert(_el$
|
|
789
|
-
return _el$
|
|
805
|
+
var _el$67 = _tmpl$34();
|
|
806
|
+
_el$67.firstChild;
|
|
807
|
+
_el$67.$$click = () => addBlock();
|
|
808
|
+
insert(_el$67, () => props.label, null);
|
|
809
|
+
return _el$67;
|
|
790
810
|
})();
|
|
791
811
|
},
|
|
792
812
|
get children() {
|
|
793
|
-
var _el$
|
|
794
|
-
_el$
|
|
795
|
-
insert(_el$
|
|
813
|
+
var _el$52 = _tmpl$29(), _el$53 = _el$52.firstChild;
|
|
814
|
+
_el$53.$$click = () => setMenuOpen((o) => !o);
|
|
815
|
+
insert(_el$52, createComponent(Show, {
|
|
796
816
|
get when() {
|
|
797
817
|
return menuOpen();
|
|
798
818
|
},
|
|
799
819
|
get children() {
|
|
800
|
-
var _el$
|
|
801
|
-
insert(_el$
|
|
820
|
+
var _el$54 = _tmpl$28();
|
|
821
|
+
insert(_el$54, createComponent(For, {
|
|
802
822
|
each: variants,
|
|
803
823
|
children: (variant) => (() => {
|
|
804
|
-
var _el$
|
|
805
|
-
_el$
|
|
806
|
-
insert(_el$
|
|
824
|
+
var _el$69 = _tmpl$36();
|
|
825
|
+
_el$69.$$click = () => addBlock(variant);
|
|
826
|
+
insert(_el$69, createComponent(Show, {
|
|
807
827
|
get when() {
|
|
808
828
|
return disc?.variantsAdmin?.[variant]?.icon;
|
|
809
829
|
},
|
|
810
830
|
get children() {
|
|
811
|
-
var _el$
|
|
812
|
-
effect(() => className(_el$
|
|
813
|
-
return _el$
|
|
831
|
+
var _el$70 = _tmpl$35();
|
|
832
|
+
effect(() => className(_el$70, disc?.variantsAdmin?.[variant]?.icon));
|
|
833
|
+
return _el$70;
|
|
814
834
|
}
|
|
815
835
|
}), null);
|
|
816
|
-
insert(_el$
|
|
817
|
-
return _el$
|
|
836
|
+
insert(_el$69, () => variantLabel(disc, variant), null);
|
|
837
|
+
return _el$69;
|
|
818
838
|
})()
|
|
819
839
|
}));
|
|
820
|
-
return _el$
|
|
840
|
+
return _el$54;
|
|
821
841
|
}
|
|
822
842
|
}), null);
|
|
823
|
-
effect(() => setAttribute(_el$
|
|
824
|
-
return _el$
|
|
843
|
+
effect(() => setAttribute(_el$53, "aria-expanded", menuOpen()));
|
|
844
|
+
return _el$52;
|
|
825
845
|
}
|
|
826
846
|
}), null);
|
|
827
|
-
return _el$
|
|
847
|
+
return _el$47;
|
|
828
848
|
})();
|
|
829
849
|
}
|
|
830
850
|
function fieldsForItem(field, item) {
|
|
@@ -848,7 +868,7 @@ delegateEvents([
|
|
|
848
868
|
]);
|
|
849
869
|
//#endregion
|
|
850
870
|
//#region src/CollectionList.tsx
|
|
851
|
-
var _tmpl$$3 = /*#__PURE__*/ template(`<button type=button class="btn btn-outline btn-sm">`), _tmpl$2$2 = /*#__PURE__*/ template(`<div class=join><select aria-label="Sort by"class="select select-sm join-item"></select><select aria-label="Sort direction"class="select select-sm join-item"><option value=asc>Ascending</option><option value=desc>Descending`), _tmpl$3$2 = /*#__PURE__*/ template(`<table class="table hidden md:table"><thead></thead><tbody>`), _tmpl$4$2 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2 md:hidden">`), _tmpl$5$1 = /*#__PURE__*/ template(`<div class="bg-base-100 sticky bottom-0 flex items-center justify-between gap-2 border-t py-2"><button type=button class="btn btn-sm">Prev</button><span class="text-sm opacity-70">Page </span><button type=button class="btn btn-sm">Next`), _tmpl$6$1 = /*#__PURE__*/ template(`<div class="flex flex-col gap-3"><div class="flex flex-wrap items-center justify-between gap-2">`), _tmpl$7 = /*#__PURE__*/ template(`<option>`), _tmpl$8 = /*#__PURE__*/ template(`<p class="text-
|
|
871
|
+
var _tmpl$$3 = /*#__PURE__*/ template(`<button type=button class="btn btn-outline btn-sm">`), _tmpl$2$2 = /*#__PURE__*/ template(`<div class=join><select aria-label="Sort by"class="select select-sm join-item"></select><select aria-label="Sort direction"class="select select-sm join-item"><option value=asc>Ascending</option><option value=desc>Descending`), _tmpl$3$2 = /*#__PURE__*/ template(`<table class="table hidden md:table"><thead></thead><tbody>`), _tmpl$4$2 = /*#__PURE__*/ template(`<div class="flex flex-col gap-2 md:hidden">`), _tmpl$5$1 = /*#__PURE__*/ template(`<div class="bg-base-100 sticky bottom-0 flex items-center justify-between gap-2 border-t py-2"><button type=button class="btn btn-sm">Prev</button><span class="text-sm opacity-70">Page </span><button type=button class="btn btn-sm">Next`), _tmpl$6$1 = /*#__PURE__*/ template(`<div class="flex flex-col gap-3"><div class="flex flex-wrap items-center justify-between gap-2">`), _tmpl$7 = /*#__PURE__*/ template(`<option>`), _tmpl$8 = /*#__PURE__*/ template(`<div class="border-base-300 rounded-box flex flex-col items-center gap-1 border border-dashed py-12 text-center"><p class="text-base-content/70 m-0">No <!> yet.`), _tmpl$9 = /*#__PURE__*/ template(`<th>`), _tmpl$0 = /*#__PURE__*/ template(`<tr>`), _tmpl$1 = /*#__PURE__*/ template(`<td><input type=checkbox class="checkbox checkbox-sm">`), _tmpl$10 = /*#__PURE__*/ template(`<td>`), _tmpl$11 = /*#__PURE__*/ template(`<input type=checkbox class="checkbox checkbox-sm mt-1">`), _tmpl$12 = /*#__PURE__*/ template(`<div class="card bg-base-200 cursor-pointer p-3"role=button tabindex=0><div class="flex items-start gap-3"><div class="flex flex-1 flex-col gap-1">`), _tmpl$13 = /*#__PURE__*/ template(`<div class="flex justify-between gap-2 text-sm"><span class=opacity-60></span><span class=text-right>`);
|
|
852
872
|
function listableFields(config) {
|
|
853
873
|
const excluded = new Set([
|
|
854
874
|
"richText",
|
|
@@ -938,10 +958,10 @@ function CollectionList(props) {
|
|
|
938
958
|
return props.rows.length > 0;
|
|
939
959
|
},
|
|
940
960
|
get fallback() {
|
|
941
|
-
return (() => {
|
|
942
|
-
var _el$15 = _tmpl$8(), _el$
|
|
943
|
-
_el$
|
|
944
|
-
insert(_el$
|
|
961
|
+
return props.emptyState ?? (() => {
|
|
962
|
+
var _el$15 = _tmpl$8(), _el$16 = _el$15.firstChild, _el$19 = _el$16.firstChild.nextSibling;
|
|
963
|
+
_el$19.nextSibling;
|
|
964
|
+
insert(_el$16, () => props.config.slug, _el$19);
|
|
945
965
|
return _el$15;
|
|
946
966
|
})();
|
|
947
967
|
},
|
|
@@ -953,8 +973,8 @@ function CollectionList(props) {
|
|
|
953
973
|
return table.getHeaderGroups();
|
|
954
974
|
},
|
|
955
975
|
children: (headerGroup) => (() => {
|
|
956
|
-
var _el$
|
|
957
|
-
insert(_el$
|
|
976
|
+
var _el$20 = _tmpl$0();
|
|
977
|
+
insert(_el$20, createComponent(Show, {
|
|
958
978
|
get when() {
|
|
959
979
|
return selectMode();
|
|
960
980
|
},
|
|
@@ -962,17 +982,17 @@ function CollectionList(props) {
|
|
|
962
982
|
return _tmpl$9();
|
|
963
983
|
}
|
|
964
984
|
}), null);
|
|
965
|
-
insert(_el$
|
|
985
|
+
insert(_el$20, createComponent(For, {
|
|
966
986
|
get each() {
|
|
967
987
|
return headerGroup.headers;
|
|
968
988
|
},
|
|
969
989
|
children: (header) => (() => {
|
|
970
|
-
var _el$
|
|
971
|
-
insert(_el$
|
|
972
|
-
return _el$
|
|
990
|
+
var _el$22 = _tmpl$9();
|
|
991
|
+
insert(_el$22, () => flexRender(header.column.columnDef.header, header.getContext()));
|
|
992
|
+
return _el$22;
|
|
973
993
|
})()
|
|
974
994
|
}), null);
|
|
975
|
-
return _el$
|
|
995
|
+
return _el$20;
|
|
976
996
|
})()
|
|
977
997
|
}));
|
|
978
998
|
insert(_el$9, createComponent(For, {
|
|
@@ -980,35 +1000,35 @@ function CollectionList(props) {
|
|
|
980
1000
|
return table.getRowModel().rows;
|
|
981
1001
|
},
|
|
982
1002
|
children: (row) => (() => {
|
|
983
|
-
var _el$
|
|
984
|
-
_el$
|
|
985
|
-
insert(_el$
|
|
1003
|
+
var _el$23 = _tmpl$0();
|
|
1004
|
+
_el$23.$$click = () => handleRowActivate(row.original);
|
|
1005
|
+
insert(_el$23, createComponent(Show, {
|
|
986
1006
|
get when() {
|
|
987
1007
|
return selectMode();
|
|
988
1008
|
},
|
|
989
1009
|
get children() {
|
|
990
|
-
var _el$
|
|
991
|
-
_el$
|
|
1010
|
+
var _el$24 = _tmpl$1(), _el$25 = _el$24.firstChild;
|
|
1011
|
+
_el$25.addEventListener("change", () => {
|
|
992
1012
|
const id = rowId(row.original);
|
|
993
1013
|
if (id !== void 0) toggleSelected(id);
|
|
994
1014
|
});
|
|
995
|
-
_el$
|
|
996
|
-
effect(() => _el$
|
|
997
|
-
return _el$
|
|
1015
|
+
_el$25.$$click = (e) => e.stopPropagation();
|
|
1016
|
+
effect(() => _el$25.checked = rowId(row.original) !== void 0 && (props.selectedIds?.has(rowId(row.original)) ?? false));
|
|
1017
|
+
return _el$24;
|
|
998
1018
|
}
|
|
999
1019
|
}), null);
|
|
1000
|
-
insert(_el$
|
|
1020
|
+
insert(_el$23, createComponent(For, {
|
|
1001
1021
|
get each() {
|
|
1002
1022
|
return row.getVisibleCells();
|
|
1003
1023
|
},
|
|
1004
1024
|
children: (cell) => (() => {
|
|
1005
|
-
var _el$
|
|
1006
|
-
insert(_el$
|
|
1007
|
-
return _el$
|
|
1025
|
+
var _el$26 = _tmpl$10();
|
|
1026
|
+
insert(_el$26, () => flexRender(cell.column.columnDef.cell, cell.getContext()));
|
|
1027
|
+
return _el$26;
|
|
1008
1028
|
})()
|
|
1009
1029
|
}), null);
|
|
1010
|
-
effect(() => className(_el$
|
|
1011
|
-
return _el$
|
|
1030
|
+
effect(() => className(_el$23, props.onRowClick || selectMode() ? "cursor-pointer hover" : void 0));
|
|
1031
|
+
return _el$23;
|
|
1012
1032
|
})()
|
|
1013
1033
|
}));
|
|
1014
1034
|
return _el$7;
|
|
@@ -1019,41 +1039,41 @@ function CollectionList(props) {
|
|
|
1019
1039
|
return table.getRowModel().rows;
|
|
1020
1040
|
},
|
|
1021
1041
|
children: (row) => (() => {
|
|
1022
|
-
var _el$
|
|
1023
|
-
_el$
|
|
1042
|
+
var _el$27 = _tmpl$12(), _el$28 = _el$27.firstChild, _el$30 = _el$28.firstChild;
|
|
1043
|
+
_el$27.$$keydown = (e) => {
|
|
1024
1044
|
if (e.key === "Enter" || e.key === " ") {
|
|
1025
1045
|
e.preventDefault();
|
|
1026
1046
|
handleRowActivate(row.original);
|
|
1027
1047
|
}
|
|
1028
1048
|
};
|
|
1029
|
-
_el$
|
|
1030
|
-
insert(_el$
|
|
1049
|
+
_el$27.$$click = () => handleRowActivate(row.original);
|
|
1050
|
+
insert(_el$28, createComponent(Show, {
|
|
1031
1051
|
get when() {
|
|
1032
1052
|
return selectMode();
|
|
1033
1053
|
},
|
|
1034
1054
|
get children() {
|
|
1035
|
-
var _el$
|
|
1036
|
-
_el$
|
|
1055
|
+
var _el$29 = _tmpl$11();
|
|
1056
|
+
_el$29.addEventListener("change", () => {
|
|
1037
1057
|
const id = rowId(row.original);
|
|
1038
1058
|
if (id !== void 0) toggleSelected(id);
|
|
1039
1059
|
});
|
|
1040
|
-
_el$
|
|
1041
|
-
effect(() => _el$
|
|
1042
|
-
return _el$
|
|
1060
|
+
_el$29.$$click = (e) => e.stopPropagation();
|
|
1061
|
+
effect(() => _el$29.checked = rowId(row.original) !== void 0 && (props.selectedIds?.has(rowId(row.original)) ?? false));
|
|
1062
|
+
return _el$29;
|
|
1043
1063
|
}
|
|
1044
|
-
}), _el$
|
|
1045
|
-
insert(_el$
|
|
1064
|
+
}), _el$30);
|
|
1065
|
+
insert(_el$30, createComponent(For, {
|
|
1046
1066
|
get each() {
|
|
1047
1067
|
return row.getVisibleCells();
|
|
1048
1068
|
},
|
|
1049
1069
|
children: (cell) => (() => {
|
|
1050
|
-
var _el$
|
|
1051
|
-
insert(_el$
|
|
1052
|
-
insert(_el$
|
|
1053
|
-
return _el$
|
|
1070
|
+
var _el$31 = _tmpl$13(), _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling;
|
|
1071
|
+
insert(_el$32, () => cell.column.id);
|
|
1072
|
+
insert(_el$33, () => flexRender(cell.column.columnDef.cell, cell.getContext()));
|
|
1073
|
+
return _el$31;
|
|
1054
1074
|
})()
|
|
1055
1075
|
}));
|
|
1056
|
-
return _el$
|
|
1076
|
+
return _el$27;
|
|
1057
1077
|
})()
|
|
1058
1078
|
}));
|
|
1059
1079
|
return _el$0;
|