@bettercms-ai/kit 3.0.2 → 3.1.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/brand/logo.js +18 -67
- package/dist/brand/logo.js.map +1 -1
- package/dist/context.js +3 -8
- package/dist/context.js.map +1 -1
- package/dist/controls/button.js +134 -451
- package/dist/controls/button.js.map +1 -1
- package/dist/controls/choice.js +95 -336
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/code.js +72 -245
- package/dist/controls/code.js.map +1 -1
- package/dist/controls/color.js +31 -108
- package/dist/controls/color.js.map +1 -1
- package/dist/controls/date.js +83 -268
- package/dist/controls/date.js.map +1 -1
- package/dist/controls/form-picker.js +9 -26
- package/dist/controls/form-picker.js.map +1 -1
- package/dist/controls/icon.js +100 -341
- package/dist/controls/icon.js.map +1 -1
- package/dist/controls/json.js +7 -20
- package/dist/controls/json.js.map +1 -1
- package/dist/controls/link.js +156 -561
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/location.js +35 -124
- package/dist/controls/location.js.map +1 -1
- package/dist/controls/media.js +267 -928
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/number.js +23 -80
- package/dist/controls/number.js.map +1 -1
- package/dist/controls/reference.js +155 -516
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/article-shell.js +86 -327
- package/dist/controls/rich-text/article-shell.js.map +1 -1
- package/dist/controls/rich-text/author.js +21 -78
- package/dist/controls/rich-text/author.js.map +1 -1
- package/dist/controls/rich-text/blocks.js +317 -1086
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/button.js +10 -31
- package/dist/controls/rich-text/button.js.map +1 -1
- package/dist/controls/rich-text/catalog.js +51 -168
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/columns.js +31 -104
- package/dist/controls/rich-text/columns.js.map +1 -1
- package/dist/controls/rich-text/component-card.js +209 -790
- package/dist/controls/rich-text/component-card.js.map +1 -1
- package/dist/controls/rich-text/component-panel.js +40 -102
- package/dist/controls/rich-text/component-panel.js.map +1 -1
- package/dist/controls/rich-text/control.js +32 -101
- package/dist/controls/rich-text/control.js.map +1 -1
- package/dist/controls/rich-text/editor.js +108 -369
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/embed.js +51 -184
- package/dist/controls/rich-text/embed.js.map +1 -1
- package/dist/controls/rich-text/floating.js +42 -171
- package/dist/controls/rich-text/floating.js.map +1 -1
- package/dist/controls/rich-text/footnote.js +28 -89
- package/dist/controls/rich-text/footnote.js.map +1 -1
- package/dist/controls/rich-text/gallery.js +27 -88
- package/dist/controls/rich-text/gallery.js.map +1 -1
- package/dist/controls/rich-text/link-form.d.ts +10 -0
- package/dist/controls/rich-text/link-form.js +16 -204
- package/dist/controls/rich-text/link-form.js.map +1 -1
- package/dist/controls/rich-text/plain.js +3 -8
- package/dist/controls/rich-text/plain.js.map +1 -1
- package/dist/controls/rich-text/related.js +25 -86
- package/dist/controls/rich-text/related.js.map +1 -1
- package/dist/controls/rich-text/toc.js +15 -48
- package/dist/controls/rich-text/toc.js.map +1 -1
- package/dist/controls/rich-text/toolbar.js +105 -402
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/scale.js +52 -169
- package/dist/controls/scale.js.map +1 -1
- package/dist/controls/slot.js +73 -238
- package/dist/controls/slot.js.map +1 -1
- package/dist/controls/table/table-editor.js +500 -1766
- package/dist/controls/table/table-editor.js.map +1 -1
- package/dist/controls/table/table-link.js +41 -121
- package/dist/controls/table/table-link.js.map +1 -1
- package/dist/controls/table/table.js +9 -26
- package/dist/controls/table/table.js.map +1 -1
- package/dist/controls/text.js +68 -221
- package/dist/controls/text.js.map +1 -1
- package/dist/controls/unknown-value.js +22 -79
- package/dist/controls/unknown-value.js.map +1 -1
- package/dist/engine/array.js +228 -821
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/bits.js +13 -38
- package/dist/engine/bits.js.map +1 -1
- package/dist/engine/breadcrumb.js +8 -25
- package/dist/engine/breadcrumb.js.map +1 -1
- package/dist/engine/expand.js +13 -38
- package/dist/engine/expand.js.map +1 -1
- package/dist/engine/field-list.js +5 -14
- package/dist/engine/field-list.js.map +1 -1
- package/dist/engine/field-shell.js +244 -849
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +78 -275
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.js +193 -630
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +50 -187
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +95 -320
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.js +32 -101
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/engine/slot.js +45 -146
- package/dist/engine/slot.js.map +1 -1
- package/dist/lib/icons.js +5 -14
- package/dist/lib/icons.js.map +1 -1
- package/dist/styles.css +1 -5821
- package/dist/table/table-view.js +16 -49
- package/dist/table/table-view.js.map +1 -1
- package/dist/testing/test-form.js +5 -14
- package/dist/testing/test-form.js.map +1 -1
- package/dist/theme.js +3 -8
- package/dist/theme.js.map +1 -1
- package/dist/ui/action-tray.js +24 -97
- package/dist/ui/action-tray.js.map +1 -1
- package/dist/ui/autocomplete.js +38 -135
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/button.js +31 -108
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/choice-switch.js +5 -14
- package/dist/ui/choice-switch.js.map +1 -1
- package/dist/ui/controls.js +86 -279
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/display.js +116 -401
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/expanded-editor-modal.js +27 -100
- package/dist/ui/expanded-editor-modal.js.map +1 -1
- package/dist/ui/floating-panel.js +37 -130
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/input.js +59 -196
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/mode-bar.js +11 -32
- package/dist/ui/mode-bar.js.map +1 -1
- package/dist/ui/overlay.js +176 -613
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/path-crumbs.js +113 -374
- package/dist/ui/path-crumbs.js.map +1 -1
- package/dist/ui/select.js +78 -311
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/shortcut-hint.js +6 -19
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/spinner.js +7 -20
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.js +10 -35
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/tab.js +17 -50
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.js +30 -107
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-root.js +7 -24
- package/dist/ui/tooltip-root.js.map +1 -1
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ import { ChoiceSwitch } from "../../ui/choice-switch.js";
|
|
|
16
16
|
import { LinkAddressButton, isScriptHref, tableLink } from "./table-link.js";
|
|
17
17
|
import { refLabel, useRefSearch } from "./refs.js";
|
|
18
18
|
import * as React from "react";
|
|
19
|
-
import { Fragment,
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import { IconAlignLeft, IconArrowDown, IconArrowUp, IconArrowsMaximize, IconCheck, IconChevronDown, IconCurrencyDollar, IconDots, IconFileDatabase, IconFolder, IconGripVertical, IconHash, IconLayoutColumns, IconLetterT, IconLink, IconList, IconPlus, IconStar, IconTable, IconToggleRight } from "@tabler/icons-react";
|
|
21
21
|
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
22
22
|
//#region src/controls/table/table-editor.tsx
|
|
@@ -38,7 +38,6 @@ import { ContextMenu } from "@base-ui/react/context-menu";
|
|
|
38
38
|
* across). The cell context menu is Base UI's ContextMenu. Toasts come from KitServices (absent → silent). Link cells use
|
|
39
39
|
* the table's own address editor (table-link.tsx) in the spreadsheet and the global LinkField in a drilled row (as V2); reference cells search through the host (refs.ts).
|
|
40
40
|
*/
|
|
41
|
-
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/table/table-editor.tsx";
|
|
42
41
|
var TYPE_UI = {
|
|
43
42
|
text: {
|
|
44
43
|
label: "Text",
|
|
@@ -88,15 +87,11 @@ var CURRENCIES = [
|
|
|
88
87
|
];
|
|
89
88
|
var TypeIcon = ({ type, className }) => {
|
|
90
89
|
const I = TYPE_UI[type].icon;
|
|
91
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ jsx(I, {
|
|
92
91
|
className: cn("size-3.5 shrink-0 text-kit-fg-4", className),
|
|
93
92
|
stroke: 1.75,
|
|
94
93
|
"aria-hidden": true
|
|
95
|
-
}
|
|
96
|
-
fileName: _jsxFileName,
|
|
97
|
-
lineNumber: 96,
|
|
98
|
-
columnNumber: 10
|
|
99
|
-
}, void 0);
|
|
94
|
+
});
|
|
100
95
|
};
|
|
101
96
|
var mapRow = (key, f) => (t) => ({
|
|
102
97
|
...t,
|
|
@@ -257,21 +252,13 @@ var copyColumn = (t, i) => {
|
|
|
257
252
|
};
|
|
258
253
|
/** CPO D49: the ONE way into the spreadsheet — opens it in the shared ExpandedEditorModal. Place it next to the title. */
|
|
259
254
|
function TableFullScreenButton({ onOpen, className }) {
|
|
260
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
261
256
|
size: "sm",
|
|
262
257
|
label: "Edit in full screen",
|
|
263
258
|
className,
|
|
264
259
|
onClick: onOpen,
|
|
265
|
-
children: /* @__PURE__ */
|
|
266
|
-
|
|
267
|
-
lineNumber: 199,
|
|
268
|
-
columnNumber: 7
|
|
269
|
-
}, this)
|
|
270
|
-
}, void 0, false, {
|
|
271
|
-
fileName: _jsxFileName,
|
|
272
|
-
lineNumber: 198,
|
|
273
|
-
columnNumber: 5
|
|
274
|
-
}, this);
|
|
260
|
+
children: /* @__PURE__ */ jsx(IconArrowsMaximize, { stroke: 1.5 })
|
|
261
|
+
});
|
|
275
262
|
}
|
|
276
263
|
function TableEditor(props) {
|
|
277
264
|
const { value, onChange, readOnly, actions, label, options = GENERAL_TABLE, developer, resolveRef, nav, fullScreen } = props;
|
|
@@ -290,19 +277,7 @@ function TableEditor(props) {
|
|
|
290
277
|
readOnly,
|
|
291
278
|
toast
|
|
292
279
|
});
|
|
293
|
-
|
|
294
|
-
className: "-my-1",
|
|
295
|
-
onOpen: () => setFull(true)
|
|
296
|
-
}, void 0, false, {
|
|
297
|
-
fileName: _jsxFileName,
|
|
298
|
-
lineNumber: 216,
|
|
299
|
-
columnNumber: 40
|
|
300
|
-
}, this), actions] }, void 0, true, {
|
|
301
|
-
fileName: _jsxFileName,
|
|
302
|
-
lineNumber: 215,
|
|
303
|
-
columnNumber: 5
|
|
304
|
-
}, this);
|
|
305
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
280
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
306
281
|
ref: root,
|
|
307
282
|
className: "flex min-w-0 flex-col",
|
|
308
283
|
"data-table-editor": "",
|
|
@@ -310,16 +285,15 @@ function TableEditor(props) {
|
|
|
310
285
|
onPaste: (e) => e.stopPropagation(),
|
|
311
286
|
onCut: (e) => e.stopPropagation(),
|
|
312
287
|
onCopy: (e) => e.stopPropagation(),
|
|
313
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ jsx(TableBody, {
|
|
314
289
|
ctx,
|
|
315
290
|
label,
|
|
316
291
|
nav,
|
|
317
|
-
head
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}, this), /* @__PURE__ */ jsxDEV(ExpandedEditorModal, {
|
|
292
|
+
head: /* @__PURE__ */ jsxs(Fragment, { children: [readOnly || fullScreen ? null : /* @__PURE__ */ jsx(TableFullScreenButton, {
|
|
293
|
+
className: "-my-1",
|
|
294
|
+
onOpen: () => setFull(true)
|
|
295
|
+
}), actions] })
|
|
296
|
+
}), /* @__PURE__ */ jsx(ExpandedEditorModal, {
|
|
323
297
|
open: full,
|
|
324
298
|
onOpenChange: setFull,
|
|
325
299
|
layout: "wide",
|
|
@@ -331,34 +305,18 @@ function TableEditor(props) {
|
|
|
331
305
|
meta: `${t.rows.length} ${t.rows.length === 1 ? "row" : "rows"} · ${t.columns.length} ${t.columns.length === 1 ? "column" : "columns"}`,
|
|
332
306
|
returnFocus: () => fullScreen?.returnFocus?.() ?? root.current?.querySelector("button[aria-label=\"Edit in full screen\"]") ?? null,
|
|
333
307
|
initialFocus: () => document.querySelector("[role=dialog] [data-cell=\"0:0\"], [role=dialog] [data-cell=\"-1:0\"]"),
|
|
334
|
-
children: full ? /* @__PURE__ */
|
|
308
|
+
children: full ? /* @__PURE__ */ jsx("div", {
|
|
335
309
|
"data-table-editor": "",
|
|
336
310
|
className: "flex min-h-0 flex-1 flex-col",
|
|
337
311
|
onPaste: (e) => e.stopPropagation(),
|
|
338
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ jsx(Grid, {
|
|
339
313
|
ctx,
|
|
340
314
|
label,
|
|
341
315
|
full: true
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}, this)
|
|
347
|
-
}, void 0, false, {
|
|
348
|
-
fileName: _jsxFileName,
|
|
349
|
-
lineNumber: 243,
|
|
350
|
-
columnNumber: 11
|
|
351
|
-
}, this) : null
|
|
352
|
-
}, void 0, false, {
|
|
353
|
-
fileName: _jsxFileName,
|
|
354
|
-
lineNumber: 233,
|
|
355
|
-
columnNumber: 7
|
|
356
|
-
}, this)]
|
|
357
|
-
}, void 0, true, {
|
|
358
|
-
fileName: _jsxFileName,
|
|
359
|
-
lineNumber: 221,
|
|
360
|
-
columnNumber: 5
|
|
361
|
-
}, this);
|
|
316
|
+
})
|
|
317
|
+
}) : null
|
|
318
|
+
})]
|
|
319
|
+
});
|
|
362
320
|
}
|
|
363
321
|
function makeCtx({ t, onChange, options = {}, developer, resolveRef, readOnly, toast }) {
|
|
364
322
|
const types = Object.keys(TYPE_UI).filter((ty) => options.columnTypes ? options.columnTypes.includes(ty) : !TYPE_UI[ty].dev || developer);
|
|
@@ -400,35 +358,19 @@ function TableItemEditor({ kind, index, value, onChange, options, developer, res
|
|
|
400
358
|
});
|
|
401
359
|
if (kind === "row") {
|
|
402
360
|
const row = t.rows[index];
|
|
403
|
-
return row ? /* @__PURE__ */
|
|
361
|
+
return row ? /* @__PURE__ */ jsx(RowFields, {
|
|
404
362
|
ctx,
|
|
405
363
|
row
|
|
406
|
-
}
|
|
407
|
-
fileName: _jsxFileName,
|
|
408
|
-
lineNumber: 295,
|
|
409
|
-
columnNumber: 18
|
|
410
|
-
}, this) : /* @__PURE__ */ jsxDEV(Gone, { kind: "row" }, void 0, false, {
|
|
411
|
-
fileName: _jsxFileName,
|
|
412
|
-
lineNumber: 295,
|
|
413
|
-
columnNumber: 54
|
|
414
|
-
}, this);
|
|
364
|
+
}) : /* @__PURE__ */ jsx(Gone, { kind: "row" });
|
|
415
365
|
}
|
|
416
366
|
const col = t.columns[index];
|
|
417
|
-
return col ? /* @__PURE__ */
|
|
367
|
+
return col ? /* @__PURE__ */ jsx(ColumnFields, {
|
|
418
368
|
ctx,
|
|
419
369
|
col
|
|
420
|
-
}
|
|
421
|
-
fileName: _jsxFileName,
|
|
422
|
-
lineNumber: 298,
|
|
423
|
-
columnNumber: 16
|
|
424
|
-
}, this) : /* @__PURE__ */ jsxDEV(Gone, { kind: "column" }, void 0, false, {
|
|
425
|
-
fileName: _jsxFileName,
|
|
426
|
-
lineNumber: 298,
|
|
427
|
-
columnNumber: 55
|
|
428
|
-
}, this);
|
|
370
|
+
}) : /* @__PURE__ */ jsx(Gone, { kind: "column" });
|
|
429
371
|
}
|
|
430
372
|
/** A frame restored onto a row or column that was deleted elsewhere says so, never an empty body. */
|
|
431
|
-
var Gone = ({ kind }) => /* @__PURE__ */
|
|
373
|
+
var Gone = ({ kind }) => /* @__PURE__ */ jsxs("p", {
|
|
432
374
|
role: "note",
|
|
433
375
|
className: "text-kit-sm text-kit-fg-3",
|
|
434
376
|
children: [
|
|
@@ -436,11 +378,7 @@ var Gone = ({ kind }) => /* @__PURE__ */ jsxDEV("p", {
|
|
|
436
378
|
kind,
|
|
437
379
|
" is no longer in the table."
|
|
438
380
|
]
|
|
439
|
-
}
|
|
440
|
-
fileName: _jsxFileName,
|
|
441
|
-
lineNumber: 301,
|
|
442
|
-
columnNumber: 56
|
|
443
|
-
}, void 0);
|
|
381
|
+
});
|
|
444
382
|
/** A column's minimum width: its longest header word + the type icon and ⋯ never break mid-word (≥ 96px, ≤ 240px). */
|
|
445
383
|
var colMinWidth = (c, full) => {
|
|
446
384
|
const longest = Math.max(0, ...c.label.split(/\s+/).map((w) => w.length));
|
|
@@ -570,26 +508,22 @@ function Grid({ ctx, label, full }) {
|
|
|
570
508
|
columns: moveItem(cols, d.i, i)
|
|
571
509
|
});
|
|
572
510
|
};
|
|
573
|
-
return /* @__PURE__ */
|
|
511
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
574
512
|
ref: host,
|
|
575
513
|
className: cn("min-w-0 overflow-x-auto rounded-kit-lg border border-kit-field-border bg-kit-surface", full && "max-h-full min-h-0 flex-1 overflow-auto"),
|
|
576
514
|
"data-full": full ? "" : void 0,
|
|
577
515
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ jsxs("table", {
|
|
579
517
|
role: "grid",
|
|
580
518
|
"aria-label": label || t.caption || "Table",
|
|
581
519
|
"aria-describedby": helpId,
|
|
582
520
|
className: "w-full border-separate border-spacing-0 text-kit-sm",
|
|
583
|
-
children: [/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
522
|
+
/* @__PURE__ */ jsx("th", {
|
|
585
523
|
className: cn("w-8 border-b border-kit-line bg-kit-subtle", full && "sticky left-0 top-0 z-[3]"),
|
|
586
524
|
"aria-hidden": true
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
lineNumber: 411,
|
|
590
|
-
columnNumber: 13
|
|
591
|
-
}, this),
|
|
592
|
-
cols.map((c, ci) => /* @__PURE__ */ jsxDEV("th", {
|
|
525
|
+
}),
|
|
526
|
+
cols.map((c, ci) => /* @__PURE__ */ jsx("th", {
|
|
593
527
|
scope: "col",
|
|
594
528
|
style: { minWidth: colMinWidth(c, full) },
|
|
595
529
|
className: cn("group/col relative border-b border-l border-kit-line bg-kit-subtle p-0 text-left align-bottom font-medium", full && "sticky top-0 z-[2]", full && ci === 0 && "left-8 z-[3]", over?.kind === "col" && over.i === ci && "shadow-[inset_2px_0_0_var(--kit-fg-2)]"),
|
|
@@ -598,13 +532,13 @@ function Grid({ ctx, label, full }) {
|
|
|
598
532
|
i: ci
|
|
599
533
|
})),
|
|
600
534
|
onDrop: () => drop("col", ci),
|
|
601
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ jsx(ColumnMenu, {
|
|
602
536
|
ctx,
|
|
603
537
|
col: c,
|
|
604
538
|
index: ci,
|
|
605
539
|
onInsert: (right) => addCol(right ? ci + 1 : ci),
|
|
606
|
-
children: (openMenu) => /* @__PURE__ */
|
|
607
|
-
lock ? null : /* @__PURE__ */
|
|
540
|
+
children: (openMenu) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
541
|
+
lock ? null : /* @__PURE__ */ jsx("span", {
|
|
608
542
|
draggable: true,
|
|
609
543
|
onDragStart: (e) => (drag.current = {
|
|
610
544
|
kind: "col",
|
|
@@ -612,25 +546,13 @@ function Grid({ ctx, label, full }) {
|
|
|
612
546
|
}, e.dataTransfer.setData("text/plain", c.label)),
|
|
613
547
|
className: "-ml-1 hidden cursor-grab text-kit-fg-4 group-hover/col:block",
|
|
614
548
|
"aria-hidden": true,
|
|
615
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ jsx(IconGripVertical, {
|
|
616
550
|
className: "size-3.5",
|
|
617
551
|
stroke: 1.5
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}, this)
|
|
623
|
-
}, void 0, false, {
|
|
624
|
-
fileName: _jsxFileName,
|
|
625
|
-
lineNumber: 430,
|
|
626
|
-
columnNumber: 25
|
|
627
|
-
}, this),
|
|
628
|
-
/* @__PURE__ */ jsxDEV(TypeIcon, { type: c.type }, void 0, false, {
|
|
629
|
-
fileName: _jsxFileName,
|
|
630
|
-
lineNumber: 434,
|
|
631
|
-
columnNumber: 23
|
|
632
|
-
}, this),
|
|
633
|
-
/* @__PURE__ */ jsxDEV(CellInput, {
|
|
552
|
+
})
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ jsx(TypeIcon, { type: c.type }),
|
|
555
|
+
/* @__PURE__ */ jsx(CellInput, {
|
|
634
556
|
cell: `-1:${ci}`,
|
|
635
557
|
value: c.label,
|
|
636
558
|
display: c.label,
|
|
@@ -651,73 +573,29 @@ function Grid({ ctx, label, full }) {
|
|
|
651
573
|
}, dir),
|
|
652
574
|
onMenu: openMenu,
|
|
653
575
|
onPaste: (e) => onPaste(e, -1, ci)
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
] }, void 0, true, {
|
|
660
|
-
fileName: _jsxFileName,
|
|
661
|
-
lineNumber: 428,
|
|
662
|
-
columnNumber: 21
|
|
663
|
-
}, this)
|
|
664
|
-
}, void 0, false, {
|
|
665
|
-
fileName: _jsxFileName,
|
|
666
|
-
lineNumber: 426,
|
|
667
|
-
columnNumber: 17
|
|
668
|
-
}, this)
|
|
669
|
-
}, c._key, false, {
|
|
670
|
-
fileName: _jsxFileName,
|
|
671
|
-
lineNumber: 413,
|
|
672
|
-
columnNumber: 15
|
|
673
|
-
}, this)),
|
|
674
|
-
/* @__PURE__ */ jsxDEV("th", {
|
|
576
|
+
})
|
|
577
|
+
] })
|
|
578
|
+
})
|
|
579
|
+
}, c._key)),
|
|
580
|
+
/* @__PURE__ */ jsx("th", {
|
|
675
581
|
className: "w-9 border-b border-l border-kit-line bg-kit-subtle p-0",
|
|
676
|
-
children: lock ? null : /* @__PURE__ */
|
|
582
|
+
children: lock ? null : /* @__PURE__ */ jsx(IconButton, {
|
|
677
583
|
size: "xs",
|
|
678
584
|
label: "Add column",
|
|
679
585
|
className: "mx-auto",
|
|
680
586
|
disabled: atMaxCols,
|
|
681
587
|
onClick: () => addCol(),
|
|
682
|
-
children: /* @__PURE__ */
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}, this)
|
|
687
|
-
}, void 0, false, {
|
|
688
|
-
fileName: _jsxFileName,
|
|
689
|
-
lineNumber: 455,
|
|
690
|
-
columnNumber: 17
|
|
691
|
-
}, this)
|
|
692
|
-
}, void 0, false, {
|
|
693
|
-
fileName: _jsxFileName,
|
|
694
|
-
lineNumber: 453,
|
|
695
|
-
columnNumber: 13
|
|
696
|
-
}, this)
|
|
697
|
-
] }, void 0, true, {
|
|
698
|
-
fileName: _jsxFileName,
|
|
699
|
-
lineNumber: 410,
|
|
700
|
-
columnNumber: 11
|
|
701
|
-
}, this) }, void 0, false, {
|
|
702
|
-
fileName: _jsxFileName,
|
|
703
|
-
lineNumber: 409,
|
|
704
|
-
columnNumber: 9
|
|
705
|
-
}, this), /* @__PURE__ */ jsxDEV("tbody", { children: rows.map(({ row, groupStart, footStart }, ri) => /* @__PURE__ */ jsxDEV(React.Fragment, { children: [groupStart || footStart ? /* @__PURE__ */ jsxDEV("tr", {
|
|
588
|
+
children: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.75 })
|
|
589
|
+
})
|
|
590
|
+
})
|
|
591
|
+
] }) }), /* @__PURE__ */ jsx("tbody", { children: rows.map(({ row, groupStart, footStart }, ri) => /* @__PURE__ */ jsxs(React.Fragment, { children: [groupStart || footStart ? /* @__PURE__ */ jsx("tr", {
|
|
706
592
|
"aria-hidden": true,
|
|
707
|
-
children: /* @__PURE__ */
|
|
593
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
708
594
|
colSpan: cols.length + 2,
|
|
709
595
|
className: "border-t border-kit-line bg-[var(--kit-subtle-2)] px-2 py-1 text-kit-2xs font-medium text-kit-fg-3",
|
|
710
596
|
children: groupStart ? groupStart.label || "Untitled group" : "Totals"
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
lineNumber: 467,
|
|
714
|
-
columnNumber: 19
|
|
715
|
-
}, this)
|
|
716
|
-
}, void 0, false, {
|
|
717
|
-
fileName: _jsxFileName,
|
|
718
|
-
lineNumber: 466,
|
|
719
|
-
columnNumber: 17
|
|
720
|
-
}, this) : null, /* @__PURE__ */ jsxDEV("tr", {
|
|
597
|
+
})
|
|
598
|
+
}) : null, /* @__PURE__ */ jsxs("tr", {
|
|
721
599
|
className: cn("group/row", over?.kind === "row" && over.i === ri && "shadow-[inset_0_2px_0_var(--kit-fg-2)]"),
|
|
722
600
|
onDragOver: (e) => drag.current?.kind === "row" && (e.preventDefault(), setOver({
|
|
723
601
|
kind: "row",
|
|
@@ -725,59 +603,35 @@ function Grid({ ctx, label, full }) {
|
|
|
725
603
|
})),
|
|
726
604
|
onDrop: () => drop("row", ri),
|
|
727
605
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ jsx("td", {
|
|
729
607
|
className: cn("w-8 border-t border-kit-line bg-[var(--kit-subtle-2)] p-0 align-middle", full && "sticky left-0 z-[1] bg-kit-subtle"),
|
|
730
|
-
children: readOnly ? /* @__PURE__ */
|
|
608
|
+
children: readOnly ? /* @__PURE__ */ jsx("div", {
|
|
731
609
|
className: "flex h-8 items-center justify-center text-kit-2xs text-kit-fg-4",
|
|
732
610
|
children: ri + 1
|
|
733
|
-
}
|
|
734
|
-
fileName: _jsxFileName,
|
|
735
|
-
lineNumber: 479,
|
|
736
|
-
columnNumber: 21
|
|
737
|
-
}, this) : /* @__PURE__ */ jsxDEV(RowMenu, {
|
|
611
|
+
}) : /* @__PURE__ */ jsx(RowMenu, {
|
|
738
612
|
ctx,
|
|
739
613
|
row,
|
|
740
614
|
index: ri,
|
|
741
615
|
count: rows.length,
|
|
742
616
|
onInsert: (below) => addRow(below ? ri + 1 : ri),
|
|
743
|
-
children: (trigger) => /* @__PURE__ */
|
|
617
|
+
children: (trigger) => /* @__PURE__ */ jsxs("div", {
|
|
744
618
|
draggable: true,
|
|
745
619
|
onDragStart: (e) => (drag.current = {
|
|
746
620
|
kind: "row",
|
|
747
621
|
i: ri
|
|
748
622
|
}, e.dataTransfer.setData("text/plain", String(ri))),
|
|
749
623
|
className: "flex h-8 cursor-grab items-center justify-center text-kit-2xs text-kit-fg-4",
|
|
750
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
751
625
|
className: "group-hover/row:hidden group-focus-within/row:hidden",
|
|
752
626
|
children: ri + 1
|
|
753
|
-
},
|
|
754
|
-
fileName: _jsxFileName,
|
|
755
|
-
lineNumber: 488,
|
|
756
|
-
columnNumber: 27
|
|
757
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
627
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
758
628
|
className: "hidden group-hover/row:flex group-focus-within/row:flex",
|
|
759
629
|
children: trigger
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}, void 0, true, {
|
|
766
|
-
fileName: _jsxFileName,
|
|
767
|
-
lineNumber: 483,
|
|
768
|
-
columnNumber: 25
|
|
769
|
-
}, this)
|
|
770
|
-
}, void 0, false, {
|
|
771
|
-
fileName: _jsxFileName,
|
|
772
|
-
lineNumber: 481,
|
|
773
|
-
columnNumber: 21
|
|
774
|
-
}, this)
|
|
775
|
-
}, void 0, false, {
|
|
776
|
-
fileName: _jsxFileName,
|
|
777
|
-
lineNumber: 477,
|
|
778
|
-
columnNumber: 17
|
|
779
|
-
}, this),
|
|
780
|
-
cols.map((c, ci) => /* @__PURE__ */ jsxDEV(GridCell, {
|
|
630
|
+
})]
|
|
631
|
+
})
|
|
632
|
+
})
|
|
633
|
+
}),
|
|
634
|
+
cols.map((c, ci) => /* @__PURE__ */ jsx(GridCell, {
|
|
781
635
|
full,
|
|
782
636
|
ctx,
|
|
783
637
|
row,
|
|
@@ -789,73 +643,33 @@ function Grid({ ctx, label, full }) {
|
|
|
789
643
|
c: ci
|
|
790
644
|
}, dir),
|
|
791
645
|
onPaste: (e) => onPaste(e, ri, ci)
|
|
792
|
-
}, c._key,
|
|
793
|
-
|
|
794
|
-
lineNumber: 496,
|
|
795
|
-
columnNumber: 19
|
|
796
|
-
}, this)),
|
|
797
|
-
/* @__PURE__ */ jsxDEV("td", { className: "border-l border-t border-kit-line" }, void 0, false, {
|
|
798
|
-
fileName: _jsxFileName,
|
|
799
|
-
lineNumber: 498,
|
|
800
|
-
columnNumber: 17
|
|
801
|
-
}, this)
|
|
646
|
+
}, c._key)),
|
|
647
|
+
/* @__PURE__ */ jsx("td", { className: "border-l border-t border-kit-line" })
|
|
802
648
|
]
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
columnNumber: 15
|
|
807
|
-
}, this)] }, row._key, true, {
|
|
808
|
-
fileName: _jsxFileName,
|
|
809
|
-
lineNumber: 464,
|
|
810
|
-
columnNumber: 13
|
|
811
|
-
}, this)) }, void 0, false, {
|
|
812
|
-
fileName: _jsxFileName,
|
|
813
|
-
lineNumber: 462,
|
|
814
|
-
columnNumber: 9
|
|
815
|
-
}, this)]
|
|
816
|
-
}, void 0, true, {
|
|
817
|
-
fileName: _jsxFileName,
|
|
818
|
-
lineNumber: 408,
|
|
819
|
-
columnNumber: 7
|
|
820
|
-
}, this),
|
|
821
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
649
|
+
})] }, row._key)) })]
|
|
650
|
+
}),
|
|
651
|
+
/* @__PURE__ */ jsx("p", {
|
|
822
652
|
id: helpId,
|
|
823
653
|
className: "sr-only",
|
|
824
654
|
children: "Tab and the arrow keys move between cells. Shift+F10 on a column, row or cell opens its options."
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
lineNumber: 504,
|
|
828
|
-
columnNumber: 7
|
|
829
|
-
}, this),
|
|
830
|
-
readOnly ? null : /* @__PURE__ */ jsxDEV("button", {
|
|
655
|
+
}),
|
|
656
|
+
readOnly ? null : /* @__PURE__ */ jsxs("button", {
|
|
831
657
|
type: "button",
|
|
832
658
|
onClick: () => addRow(),
|
|
833
659
|
disabled: atMaxRows,
|
|
834
660
|
className: "flex h-8 w-full items-center gap-1.5 border-t border-kit-line px-2.5 text-left text-kit-xs text-kit-fg-3 hover:bg-kit-subtle hover:text-kit-fg disabled:opacity-45",
|
|
835
661
|
children: [
|
|
836
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ jsx(IconPlus, {
|
|
837
663
|
className: "size-3.5",
|
|
838
664
|
stroke: 1.75,
|
|
839
665
|
"aria-hidden": true
|
|
840
|
-
},
|
|
841
|
-
fileName: _jsxFileName,
|
|
842
|
-
lineNumber: 512,
|
|
843
|
-
columnNumber: 11
|
|
844
|
-
}, this),
|
|
666
|
+
}),
|
|
845
667
|
" ",
|
|
846
668
|
atMaxRows ? `Add row · ${ctx.options.maxRows} at most` : "Add row"
|
|
847
669
|
]
|
|
848
|
-
}
|
|
849
|
-
fileName: _jsxFileName,
|
|
850
|
-
lineNumber: 506,
|
|
851
|
-
columnNumber: 9
|
|
852
|
-
}, this)
|
|
670
|
+
})
|
|
853
671
|
]
|
|
854
|
-
}
|
|
855
|
-
fileName: _jsxFileName,
|
|
856
|
-
lineNumber: 407,
|
|
857
|
-
columnNumber: 5
|
|
858
|
-
}, this);
|
|
672
|
+
});
|
|
859
673
|
}
|
|
860
674
|
/** A grid cell: always editable (no select-then-edit mode). Yes / No is a check toggle; links and references open a small editor. */
|
|
861
675
|
function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
@@ -881,7 +695,7 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
881
695
|
if (ty === "boolean") {
|
|
882
696
|
const b = toBool(v);
|
|
883
697
|
const { yes, no } = boolLabels(col);
|
|
884
|
-
body = /* @__PURE__ */
|
|
698
|
+
body = /* @__PURE__ */ jsx("button", {
|
|
885
699
|
type: "button",
|
|
886
700
|
role: "checkbox",
|
|
887
701
|
"aria-checked": b === true,
|
|
@@ -908,35 +722,19 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
908
722
|
},
|
|
909
723
|
onPaste: (e) => onPaste(e),
|
|
910
724
|
className: "flex h-8 w-full items-center px-2 outline-none focus-visible:shadow-[inset_0_0_0_2px_var(--kit-fg-3)]",
|
|
911
|
-
children: b == null ? /* @__PURE__ */
|
|
725
|
+
children: b == null ? /* @__PURE__ */ jsx("span", {
|
|
912
726
|
className: "text-kit-fg-4",
|
|
913
727
|
children: "—"
|
|
914
|
-
}
|
|
915
|
-
fileName: _jsxFileName,
|
|
916
|
-
lineNumber: 559,
|
|
917
|
-
columnNumber: 11
|
|
918
|
-
}, this) : /* @__PURE__ */ jsxDEV("span", {
|
|
728
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
919
729
|
className: cn("flex size-4 items-center justify-center rounded-kit-sm border", b ? "border-kit-inverse bg-kit-inverse text-kit-fg-inverse" : "border-kit-line-strong"),
|
|
920
|
-
children: b ? /* @__PURE__ */
|
|
730
|
+
children: b ? /* @__PURE__ */ jsx(IconCheck, {
|
|
921
731
|
className: "size-3",
|
|
922
732
|
stroke: 3,
|
|
923
733
|
"aria-hidden": true
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
}, this) : null
|
|
929
|
-
}, void 0, false, {
|
|
930
|
-
fileName: _jsxFileName,
|
|
931
|
-
lineNumber: 561,
|
|
932
|
-
columnNumber: 11
|
|
933
|
-
}, this)
|
|
934
|
-
}, void 0, false, {
|
|
935
|
-
fileName: _jsxFileName,
|
|
936
|
-
lineNumber: 539,
|
|
937
|
-
columnNumber: 7
|
|
938
|
-
}, this);
|
|
939
|
-
} else if (ty === "reference") body = /* @__PURE__ */ jsxDEV(RefCell, {
|
|
734
|
+
}) : null
|
|
735
|
+
})
|
|
736
|
+
});
|
|
737
|
+
} else if (ty === "reference") body = /* @__PURE__ */ jsx(RefCell, {
|
|
940
738
|
ctx,
|
|
941
739
|
cell,
|
|
942
740
|
col,
|
|
@@ -944,30 +742,22 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
944
742
|
name,
|
|
945
743
|
onWrite: write,
|
|
946
744
|
onMove
|
|
947
|
-
}
|
|
948
|
-
fileName: _jsxFileName,
|
|
949
|
-
lineNumber: 568,
|
|
950
|
-
columnNumber: 12
|
|
951
|
-
}, this);
|
|
745
|
+
});
|
|
952
746
|
else {
|
|
953
747
|
const draft = isEmptyCell(v) ? "" : NUMERIC.includes(ty) ? String(toNumber(v) ?? cellText(col, row, cell)) : ty === "link" && isObjLike(v) ? v.label : ty === "richtext-inline" ? String(v) : cellText(col, row, cell, resolveRef);
|
|
954
748
|
const link = ty === "link" ? isObjLike(v) && !("ref" in v) ? v : {
|
|
955
749
|
label: typeof v === "string" ? v : "",
|
|
956
750
|
href: ""
|
|
957
751
|
} : null;
|
|
958
|
-
body = /* @__PURE__ */
|
|
752
|
+
body = /* @__PURE__ */ jsxs("div", {
|
|
959
753
|
className: "relative flex items-start",
|
|
960
754
|
children: [
|
|
961
|
-
ty === "rating" && !isEmptyCell(v) ? /* @__PURE__ */
|
|
755
|
+
ty === "rating" && !isEmptyCell(v) ? /* @__PURE__ */ jsx(IconStar, {
|
|
962
756
|
className: "ml-2 mt-2 size-3 shrink-0 text-kit-warning",
|
|
963
757
|
stroke: 2,
|
|
964
758
|
"aria-hidden": true
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
lineNumber: 574,
|
|
968
|
-
columnNumber: 47
|
|
969
|
-
}, this) : null,
|
|
970
|
-
/* @__PURE__ */ jsxDEV(CellInput, {
|
|
759
|
+
}) : null,
|
|
760
|
+
/* @__PURE__ */ jsx(CellInput, {
|
|
971
761
|
cell: `${r}:${c}`,
|
|
972
762
|
value: draft,
|
|
973
763
|
display: isEmptyCell(v) ? "" : ty === "rating" ? draft : cellText(col, row, cell, resolveRef),
|
|
@@ -979,32 +769,20 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
979
769
|
onCommit: (raw) => raw !== draft && write(typedCell(cell, col, row, raw)),
|
|
980
770
|
onMove,
|
|
981
771
|
onPaste
|
|
982
|
-
},
|
|
983
|
-
|
|
984
|
-
lineNumber: 575,
|
|
985
|
-
columnNumber: 9
|
|
986
|
-
}, this),
|
|
987
|
-
link ? /* @__PURE__ */ jsxDEV(LinkAddressButton, {
|
|
772
|
+
}),
|
|
773
|
+
link ? /* @__PURE__ */ jsx(LinkAddressButton, {
|
|
988
774
|
className: "mr-1 mt-1.5",
|
|
989
775
|
link,
|
|
990
776
|
readOnly,
|
|
991
777
|
onSave: (l) => write(withValue(cell, l))
|
|
992
|
-
}
|
|
993
|
-
fileName: _jsxFileName,
|
|
994
|
-
lineNumber: 588,
|
|
995
|
-
columnNumber: 17
|
|
996
|
-
}, this) : null
|
|
778
|
+
}) : null
|
|
997
779
|
]
|
|
998
|
-
}
|
|
999
|
-
fileName: _jsxFileName,
|
|
1000
|
-
lineNumber: 573,
|
|
1001
|
-
columnNumber: 7
|
|
1002
|
-
}, this);
|
|
780
|
+
});
|
|
1003
781
|
}
|
|
1004
782
|
const cls = cn("relative border-l border-t border-kit-line p-0 align-top", head && "bg-[var(--kit-subtle-2)]", full && c === 0 && "sticky left-8 z-[1] bg-kit-surface", row.highlight && "bg-kit-accent-softer", col.highlight && "bg-kit-subtle");
|
|
1005
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ jsxs("td", {
|
|
1006
784
|
className: cls,
|
|
1007
|
-
children: [readOnly ? body : /* @__PURE__ */
|
|
785
|
+
children: [readOnly ? body : /* @__PURE__ */ jsx(CellMenu, {
|
|
1008
786
|
ctx,
|
|
1009
787
|
row,
|
|
1010
788
|
col,
|
|
@@ -1012,41 +790,25 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
1012
790
|
onWrite: write,
|
|
1013
791
|
onNote: () => window.setTimeout(() => setNoteOpen(true)),
|
|
1014
792
|
children: body
|
|
1015
|
-
},
|
|
1016
|
-
fileName: _jsxFileName,
|
|
1017
|
-
lineNumber: 601,
|
|
1018
|
-
columnNumber: 26
|
|
1019
|
-
}, this), /* @__PURE__ */ jsxDEV(Popover, {
|
|
793
|
+
}), /* @__PURE__ */ jsxs(Popover, {
|
|
1020
794
|
open: noteOpen && !!fn,
|
|
1021
795
|
onOpenChange: setNoteOpen,
|
|
1022
|
-
children: [/* @__PURE__ */
|
|
1023
|
-
render: n > 0 ? /* @__PURE__ */
|
|
796
|
+
children: [/* @__PURE__ */ jsx(PopoverAnchor, {
|
|
797
|
+
render: n > 0 ? /* @__PURE__ */ jsx("button", {
|
|
1024
798
|
type: "button",
|
|
1025
799
|
tabIndex: -1,
|
|
1026
800
|
"aria-label": `Footnote ${n}`,
|
|
1027
801
|
onClick: () => setNoteOpen(true),
|
|
1028
802
|
className: "absolute right-0.5 top-0.5 rounded-kit-xs px-0.5 text-kit-2xs leading-3 text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg"
|
|
1029
|
-
}
|
|
1030
|
-
fileName: _jsxFileName,
|
|
1031
|
-
lineNumber: 607,
|
|
1032
|
-
columnNumber: 15
|
|
1033
|
-
}, this) : /* @__PURE__ */ jsxDEV("span", {
|
|
803
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
1034
804
|
className: "pointer-events-none absolute right-1 top-1 size-0",
|
|
1035
805
|
"aria-hidden": true
|
|
1036
|
-
},
|
|
1037
|
-
fileName: _jsxFileName,
|
|
1038
|
-
lineNumber: 609,
|
|
1039
|
-
columnNumber: 15
|
|
1040
|
-
}, this),
|
|
806
|
+
}),
|
|
1041
807
|
children: n > 0 ? n : null
|
|
1042
|
-
},
|
|
1043
|
-
fileName: _jsxFileName,
|
|
1044
|
-
lineNumber: 604,
|
|
1045
|
-
columnNumber: 9
|
|
1046
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
808
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
1047
809
|
align: "end",
|
|
1048
810
|
className: "w-72 p-2",
|
|
1049
|
-
children: fn ? /* @__PURE__ */
|
|
811
|
+
children: fn ? /* @__PURE__ */ jsx(Input, {
|
|
1050
812
|
size: "sm",
|
|
1051
813
|
autoFocus: true,
|
|
1052
814
|
value: fn.text,
|
|
@@ -1061,26 +823,10 @@ function GridCell({ ctx, row, col, r, c, onMove, onPaste, full }) {
|
|
|
1061
823
|
} : x)
|
|
1062
824
|
}),
|
|
1063
825
|
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), setNoteOpen(false))
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}, this) : null
|
|
1069
|
-
}, void 0, false, {
|
|
1070
|
-
fileName: _jsxFileName,
|
|
1071
|
-
lineNumber: 615,
|
|
1072
|
-
columnNumber: 9
|
|
1073
|
-
}, this)]
|
|
1074
|
-
}, void 0, true, {
|
|
1075
|
-
fileName: _jsxFileName,
|
|
1076
|
-
lineNumber: 603,
|
|
1077
|
-
columnNumber: 7
|
|
1078
|
-
}, this)]
|
|
1079
|
-
}, void 0, true, {
|
|
1080
|
-
fileName: _jsxFileName,
|
|
1081
|
-
lineNumber: 600,
|
|
1082
|
-
columnNumber: 5
|
|
1083
|
-
}, this);
|
|
826
|
+
}) : null
|
|
827
|
+
})]
|
|
828
|
+
})]
|
|
829
|
+
});
|
|
1084
830
|
}
|
|
1085
831
|
/** One cell's text. Shows the written value at rest ("$39", "2.4 kg") and the raw value while typing; commits on leave. */
|
|
1086
832
|
function CellInput({ cell, value, display, onCommit, onMove, onMenu, onPaste, placeholder, numeric, className, ariaLabel, readOnly }) {
|
|
@@ -1094,7 +840,7 @@ function CellInput({ cell, value, display, onCommit, onMove, onMenu, onPaste, pl
|
|
|
1094
840
|
el.style.height = "0px";
|
|
1095
841
|
el.style.height = `${Math.max(32, el.scrollHeight)}px`;
|
|
1096
842
|
}, [shown]);
|
|
1097
|
-
return /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
1098
844
|
ref,
|
|
1099
845
|
rows: 1,
|
|
1100
846
|
"data-cell": cell,
|
|
@@ -1148,11 +894,7 @@ function CellInput({ cell, value, display, onCommit, onMove, onMenu, onPaste, pl
|
|
|
1148
894
|
}
|
|
1149
895
|
},
|
|
1150
896
|
className: cn("block min-h-8 w-full resize-none overflow-hidden bg-transparent px-2 py-1.5 text-kit-sm leading-5 text-kit-fg outline-none [overflow-wrap:normal] [word-break:normal] placeholder:text-kit-fg-4 focus:bg-kit-surface focus:shadow-[inset_0_0_0_2px_var(--kit-fg-3)]", className)
|
|
1151
|
-
}
|
|
1152
|
-
fileName: _jsxFileName,
|
|
1153
|
-
lineNumber: 652,
|
|
1154
|
-
columnNumber: 5
|
|
1155
|
-
}, this);
|
|
897
|
+
});
|
|
1156
898
|
}
|
|
1157
899
|
/**
|
|
1158
900
|
* A reference cell: a page or entry chosen from the host's search (refs.ts). Stores `{ ref, label, href? }`: the label and
|
|
@@ -1173,11 +915,11 @@ function RefCell({ ctx, cell, col, cellId, name, onWrite, onMove }) {
|
|
|
1173
915
|
}));
|
|
1174
916
|
setOpen(false);
|
|
1175
917
|
};
|
|
1176
|
-
return /* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
1177
919
|
open,
|
|
1178
920
|
onOpenChange: (o) => (setOpen(o), o || setQ("")),
|
|
1179
|
-
children: [/* @__PURE__ */
|
|
1180
|
-
render: /* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ jsx(PopoverAnchor, {
|
|
922
|
+
render: /* @__PURE__ */ jsx("button", {
|
|
1181
923
|
type: "button",
|
|
1182
924
|
"data-cell": cellId,
|
|
1183
925
|
"aria-label": `${name}: ${label || "not chosen"}`,
|
|
@@ -1195,153 +937,81 @@ function RefCell({ ctx, cell, col, cellId, name, onWrite, onMove }) {
|
|
|
1195
937
|
}
|
|
1196
938
|
},
|
|
1197
939
|
className: "flex min-h-8 w-full items-center px-2 text-left text-kit-sm text-kit-fg outline-none focus-visible:shadow-[inset_0_0_0_2px_var(--kit-fg-3)]"
|
|
1198
|
-
},
|
|
1199
|
-
|
|
1200
|
-
lineNumber: 720,
|
|
1201
|
-
columnNumber: 11
|
|
1202
|
-
}, this),
|
|
1203
|
-
children: label ? /* @__PURE__ */ jsxDEV("span", {
|
|
940
|
+
}),
|
|
941
|
+
children: label ? /* @__PURE__ */ jsx("span", {
|
|
1204
942
|
className: "truncate underline decoration-kit-fg-4 underline-offset-2",
|
|
1205
943
|
children: label
|
|
1206
|
-
}
|
|
1207
|
-
fileName: _jsxFileName,
|
|
1208
|
-
lineNumber: 736,
|
|
1209
|
-
columnNumber: 18
|
|
1210
|
-
}, this) : /* @__PURE__ */ jsxDEV("span", {
|
|
944
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
1211
945
|
className: "text-kit-fg-4",
|
|
1212
946
|
children: "Choose…"
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
lineNumber: 736,
|
|
1216
|
-
columnNumber: 111
|
|
1217
|
-
}, this)
|
|
1218
|
-
}, void 0, false, {
|
|
1219
|
-
fileName: _jsxFileName,
|
|
1220
|
-
lineNumber: 718,
|
|
1221
|
-
columnNumber: 7
|
|
1222
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
947
|
+
})
|
|
948
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
1223
949
|
align: "start",
|
|
1224
950
|
className: "w-72 p-1.5",
|
|
1225
951
|
children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ jsx(Input, {
|
|
1227
953
|
size: "sm",
|
|
1228
954
|
autoFocus: true,
|
|
1229
955
|
value: q,
|
|
1230
956
|
placeholder: "Search…",
|
|
1231
957
|
"aria-label": "Find a page or entry",
|
|
1232
958
|
onChange: (e) => setQ(e.target.value)
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
lineNumber: 739,
|
|
1236
|
-
columnNumber: 9
|
|
1237
|
-
}, this),
|
|
1238
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
959
|
+
}),
|
|
960
|
+
/* @__PURE__ */ jsx("div", {
|
|
1239
961
|
role: "status",
|
|
1240
962
|
className: "sr-only",
|
|
1241
963
|
children: search.status === "ready" ? `${search.options.length} results` : search.status === "loading" ? "Searching" : ""
|
|
1242
|
-
},
|
|
1243
|
-
|
|
1244
|
-
lineNumber: 740,
|
|
1245
|
-
columnNumber: 9
|
|
1246
|
-
}, this),
|
|
1247
|
-
/* @__PURE__ */ jsxDEV("ul", {
|
|
964
|
+
}),
|
|
965
|
+
/* @__PURE__ */ jsxs("ul", {
|
|
1248
966
|
className: "mt-1 max-h-56 overflow-auto",
|
|
1249
967
|
"aria-label": "Pages and entries",
|
|
1250
968
|
children: [
|
|
1251
|
-
search.status === "ready" ? search.options.map((o) => /* @__PURE__ */
|
|
969
|
+
search.status === "ready" ? search.options.map((o) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
1252
970
|
type: "button",
|
|
1253
971
|
className: "flex w-full flex-col rounded-kit-md px-2 py-1.5 text-left hover:bg-kit-hover",
|
|
1254
972
|
onClick: () => pick(o),
|
|
1255
|
-
children: [/* @__PURE__ */
|
|
973
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1256
974
|
className: "truncate text-kit-sm text-kit-fg",
|
|
1257
975
|
children: o.title
|
|
1258
|
-
},
|
|
1259
|
-
fileName: _jsxFileName,
|
|
1260
|
-
lineNumber: 748,
|
|
1261
|
-
columnNumber: 21
|
|
1262
|
-
}, this), o.subtitle ? /* @__PURE__ */ jsxDEV("span", {
|
|
976
|
+
}), o.subtitle ? /* @__PURE__ */ jsx("span", {
|
|
1263
977
|
className: "truncate text-kit-xs text-kit-fg-3",
|
|
1264
978
|
children: o.subtitle
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
columnNumber: 35
|
|
1269
|
-
}, this) : null]
|
|
1270
|
-
}, void 0, true, {
|
|
1271
|
-
fileName: _jsxFileName,
|
|
1272
|
-
lineNumber: 747,
|
|
1273
|
-
columnNumber: 19
|
|
1274
|
-
}, this) }, o.id, false, {
|
|
1275
|
-
fileName: _jsxFileName,
|
|
1276
|
-
lineNumber: 746,
|
|
1277
|
-
columnNumber: 17
|
|
1278
|
-
}, this)) : null,
|
|
1279
|
-
search.status === "ready" && !search.options.length ? /* @__PURE__ */ jsxDEV("li", {
|
|
979
|
+
}) : null]
|
|
980
|
+
}) }, o.id)) : null,
|
|
981
|
+
search.status === "ready" && !search.options.length ? /* @__PURE__ */ jsxs("li", {
|
|
1280
982
|
className: "px-2 py-1.5 text-kit-xs text-kit-fg-3",
|
|
1281
983
|
children: [
|
|
1282
984
|
"Nothing found",
|
|
1283
985
|
q.trim() ? ` for “${q.trim()}”` : "",
|
|
1284
986
|
"."
|
|
1285
987
|
]
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
lineNumber: 754,
|
|
1289
|
-
columnNumber: 66
|
|
1290
|
-
}, this) : null,
|
|
1291
|
-
search.status === "loading" ? /* @__PURE__ */ jsxDEV("li", {
|
|
988
|
+
}) : null,
|
|
989
|
+
search.status === "loading" ? /* @__PURE__ */ jsx("li", {
|
|
1292
990
|
className: "px-2 py-1.5 text-kit-xs text-kit-fg-3",
|
|
1293
991
|
children: "Searching…"
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
lineNumber: 755,
|
|
1297
|
-
columnNumber: 42
|
|
1298
|
-
}, this) : null,
|
|
1299
|
-
search.status === "error" ? /* @__PURE__ */ jsxDEV("li", {
|
|
992
|
+
}) : null,
|
|
993
|
+
search.status === "error" ? /* @__PURE__ */ jsxs("li", {
|
|
1300
994
|
role: "alert",
|
|
1301
995
|
className: "px-2 py-1.5 text-kit-xs text-kit-danger-fg",
|
|
1302
996
|
children: ["Couldn't search: ", search.message]
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
lineNumber: 756,
|
|
1306
|
-
columnNumber: 40
|
|
1307
|
-
}, this) : null,
|
|
1308
|
-
search.status === "unavailable" ? /* @__PURE__ */ jsxDEV("li", {
|
|
997
|
+
}) : null,
|
|
998
|
+
search.status === "unavailable" ? /* @__PURE__ */ jsx("li", {
|
|
1309
999
|
role: "note",
|
|
1310
1000
|
className: "px-2 py-1.5 text-kit-xs text-kit-fg-3",
|
|
1311
1001
|
children: "This view can't search pages or entries, so the cell can't change here."
|
|
1312
|
-
}
|
|
1313
|
-
fileName: _jsxFileName,
|
|
1314
|
-
lineNumber: 757,
|
|
1315
|
-
columnNumber: 46
|
|
1316
|
-
}, this) : null
|
|
1002
|
+
}) : null
|
|
1317
1003
|
]
|
|
1318
|
-
},
|
|
1319
|
-
|
|
1320
|
-
lineNumber: 743,
|
|
1321
|
-
columnNumber: 9
|
|
1322
|
-
}, this),
|
|
1323
|
-
r && !ctx.readOnly ? /* @__PURE__ */ jsxDEV(Button, {
|
|
1004
|
+
}),
|
|
1005
|
+
r && !ctx.readOnly ? /* @__PURE__ */ jsx(Button, {
|
|
1324
1006
|
size: "sm",
|
|
1325
1007
|
variant: "ghost",
|
|
1326
1008
|
className: "mt-1 w-full justify-start text-kit-fg-2",
|
|
1327
1009
|
onClick: () => (onWrite(withValue(cell, null)), setOpen(false)),
|
|
1328
1010
|
children: "Clear"
|
|
1329
|
-
}
|
|
1330
|
-
fileName: _jsxFileName,
|
|
1331
|
-
lineNumber: 760,
|
|
1332
|
-
columnNumber: 11
|
|
1333
|
-
}, this) : null
|
|
1011
|
+
}) : null
|
|
1334
1012
|
]
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
lineNumber: 738,
|
|
1338
|
-
columnNumber: 7
|
|
1339
|
-
}, this)]
|
|
1340
|
-
}, void 0, true, {
|
|
1341
|
-
fileName: _jsxFileName,
|
|
1342
|
-
lineNumber: 717,
|
|
1343
|
-
columnNumber: 5
|
|
1344
|
-
}, this);
|
|
1013
|
+
})]
|
|
1014
|
+
});
|
|
1345
1015
|
}
|
|
1346
1016
|
function ColumnMenu({ ctx, col, index, onInsert, children }) {
|
|
1347
1017
|
const { t, set, edit, lock, types, readOnly } = ctx;
|
|
@@ -1357,201 +1027,105 @@ function ColumnMenu({ ctx, col, index, onInsert, children }) {
|
|
|
1357
1027
|
};
|
|
1358
1028
|
const shownTypes = types.includes(col.type) ? types : [...types, col.type];
|
|
1359
1029
|
const hasDetails = !lock && (col.type === "number" || col.type === "money" || col.type === "boolean" || col.type === "rating");
|
|
1360
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
1361
1031
|
open: details,
|
|
1362
1032
|
onOpenChange: setDetails,
|
|
1363
|
-
children: [/* @__PURE__ */
|
|
1364
|
-
render: /* @__PURE__ */
|
|
1365
|
-
|
|
1366
|
-
lineNumber: 786,
|
|
1367
|
-
columnNumber: 30
|
|
1368
|
-
}, this),
|
|
1369
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
1033
|
+
children: [/* @__PURE__ */ jsxs(PopoverAnchor, {
|
|
1034
|
+
render: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 pl-1.5 pr-0.5" }),
|
|
1035
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1370
1036
|
className: "flex min-w-0 flex-1 items-center gap-1",
|
|
1371
1037
|
children: children(() => setOpen(true))
|
|
1372
|
-
},
|
|
1373
|
-
fileName: _jsxFileName,
|
|
1374
|
-
lineNumber: 787,
|
|
1375
|
-
columnNumber: 9
|
|
1376
|
-
}, this), readOnly ? null : /* @__PURE__ */ jsxDEV(Menu, {
|
|
1038
|
+
}), readOnly ? null : /* @__PURE__ */ jsxs(Menu, {
|
|
1377
1039
|
open,
|
|
1378
1040
|
onOpenChange: setOpen,
|
|
1379
|
-
children: [/* @__PURE__ */
|
|
1380
|
-
render: /* @__PURE__ */
|
|
1041
|
+
children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
1042
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
1381
1043
|
size: "xs",
|
|
1382
1044
|
tabIndex: -1,
|
|
1383
1045
|
label: `Options for column ${col.label || index + 1}`,
|
|
1384
1046
|
className: "shrink-0 opacity-0 focus-visible:opacity-100 group-hover/col:opacity-100 group-focus-within/col:opacity-100 data-[popup-open]:opacity-100 [@media(pointer:coarse)]:opacity-100"
|
|
1385
|
-
},
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
columnNumber: 17
|
|
1389
|
-
}, this),
|
|
1390
|
-
children: /* @__PURE__ */ jsxDEV(IconDots, { stroke: 1.5 }, void 0, false, {
|
|
1391
|
-
fileName: _jsxFileName,
|
|
1392
|
-
lineNumber: 800,
|
|
1393
|
-
columnNumber: 15
|
|
1394
|
-
}, this)
|
|
1395
|
-
}, void 0, false, {
|
|
1396
|
-
fileName: _jsxFileName,
|
|
1397
|
-
lineNumber: 790,
|
|
1398
|
-
columnNumber: 13
|
|
1399
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
1047
|
+
}),
|
|
1048
|
+
children: /* @__PURE__ */ jsx(IconDots, { stroke: 1.5 })
|
|
1049
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
1400
1050
|
align: "end",
|
|
1401
1051
|
className: "min-w-52",
|
|
1402
1052
|
children: [
|
|
1403
|
-
lock ? null : /* @__PURE__ */
|
|
1404
|
-
icon: /* @__PURE__ */
|
|
1053
|
+
lock ? null : /* @__PURE__ */ jsxs(MenuSub, { children: [/* @__PURE__ */ jsxs(MenuSubTrigger, {
|
|
1054
|
+
icon: /* @__PURE__ */ jsx(TypeIcon, {
|
|
1405
1055
|
type: col.type,
|
|
1406
1056
|
className: "text-kit-fg-2"
|
|
1407
|
-
},
|
|
1408
|
-
fileName: _jsxFileName,
|
|
1409
|
-
lineNumber: 805,
|
|
1410
|
-
columnNumber: 41
|
|
1411
|
-
}, this),
|
|
1057
|
+
}),
|
|
1412
1058
|
children: ["Type: ", TYPE_UI[col.type].label]
|
|
1413
|
-
},
|
|
1414
|
-
fileName: _jsxFileName,
|
|
1415
|
-
lineNumber: 805,
|
|
1416
|
-
columnNumber: 19
|
|
1417
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuSubContent, { children: /* @__PURE__ */ jsxDEV(MenuRadioGroup, {
|
|
1059
|
+
}), /* @__PURE__ */ jsx(MenuSubContent, { children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
1418
1060
|
value: col.type,
|
|
1419
1061
|
onValueChange: (v) => edit((x) => retype(x, col._key, v, ctx.resolveRef)),
|
|
1420
|
-
children: shownTypes.map((ty) => /* @__PURE__ */
|
|
1062
|
+
children: shownTypes.map((ty) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
1421
1063
|
value: ty,
|
|
1422
|
-
children: /* @__PURE__ */
|
|
1064
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1423
1065
|
className: "flex items-center gap-2",
|
|
1424
|
-
children: [/* @__PURE__ */
|
|
1066
|
+
children: [/* @__PURE__ */ jsx(TypeIcon, {
|
|
1425
1067
|
type: ty,
|
|
1426
1068
|
className: "text-kit-fg-2"
|
|
1427
|
-
},
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
}, void 0, true, {
|
|
1433
|
-
fileName: _jsxFileName,
|
|
1434
|
-
lineNumber: 810,
|
|
1435
|
-
columnNumber: 27
|
|
1436
|
-
}, this)
|
|
1437
|
-
}, ty, false, {
|
|
1438
|
-
fileName: _jsxFileName,
|
|
1439
|
-
lineNumber: 809,
|
|
1440
|
-
columnNumber: 25
|
|
1441
|
-
}, this))
|
|
1442
|
-
}, void 0, false, {
|
|
1443
|
-
fileName: _jsxFileName,
|
|
1444
|
-
lineNumber: 807,
|
|
1445
|
-
columnNumber: 21
|
|
1446
|
-
}, this) }, void 0, false, {
|
|
1447
|
-
fileName: _jsxFileName,
|
|
1448
|
-
lineNumber: 806,
|
|
1449
|
-
columnNumber: 19
|
|
1450
|
-
}, this)] }, void 0, true, {
|
|
1451
|
-
fileName: _jsxFileName,
|
|
1452
|
-
lineNumber: 804,
|
|
1453
|
-
columnNumber: 17
|
|
1454
|
-
}, this),
|
|
1455
|
-
hasDetails ? /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1069
|
+
}), TYPE_UI[ty].label]
|
|
1070
|
+
})
|
|
1071
|
+
}, ty))
|
|
1072
|
+
}) })] }),
|
|
1073
|
+
hasDetails ? /* @__PURE__ */ jsx(MenuItem, {
|
|
1456
1074
|
onClick: () => window.setTimeout(() => setDetails(true)),
|
|
1457
1075
|
children: col.type === "number" ? "Unit…" : col.type === "money" ? "Currency…" : col.type === "rating" ? "Scale…" : "Words for yes and no…"
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}, this) : null,
|
|
1463
|
-
lock ? null : /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
1464
|
-
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
1465
|
-
fileName: _jsxFileName,
|
|
1466
|
-
lineNumber: 824,
|
|
1467
|
-
columnNumber: 19
|
|
1468
|
-
}, this),
|
|
1469
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1076
|
+
}) : null,
|
|
1077
|
+
lock ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1078
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1079
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1470
1080
|
disabled: atMax,
|
|
1471
1081
|
onClick: () => onInsert(false),
|
|
1472
1082
|
children: "Insert column left"
|
|
1473
|
-
},
|
|
1474
|
-
|
|
1475
|
-
lineNumber: 825,
|
|
1476
|
-
columnNumber: 19
|
|
1477
|
-
}, this),
|
|
1478
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1083
|
+
}),
|
|
1084
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1479
1085
|
disabled: atMax,
|
|
1480
1086
|
onClick: () => onInsert(true),
|
|
1481
1087
|
children: "Insert column right"
|
|
1482
|
-
},
|
|
1483
|
-
|
|
1484
|
-
lineNumber: 826,
|
|
1485
|
-
columnNumber: 19
|
|
1486
|
-
}, this),
|
|
1487
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1088
|
+
}),
|
|
1089
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1488
1090
|
disabled: atMax,
|
|
1489
1091
|
onClick: () => set(copyColumn(t, index)),
|
|
1490
1092
|
children: "Duplicate column"
|
|
1491
|
-
},
|
|
1492
|
-
|
|
1493
|
-
lineNumber: 827,
|
|
1494
|
-
columnNumber: 19
|
|
1495
|
-
}, this),
|
|
1496
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1093
|
+
}),
|
|
1094
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1497
1095
|
disabled: index === 0,
|
|
1498
1096
|
onClick: () => set({
|
|
1499
1097
|
...t,
|
|
1500
1098
|
columns: moveItem(t.columns, index, index - 1)
|
|
1501
1099
|
}),
|
|
1502
1100
|
children: "Move left"
|
|
1503
|
-
},
|
|
1504
|
-
|
|
1505
|
-
lineNumber: 828,
|
|
1506
|
-
columnNumber: 19
|
|
1507
|
-
}, this),
|
|
1508
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1101
|
+
}),
|
|
1102
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1509
1103
|
disabled: index === n - 1,
|
|
1510
1104
|
onClick: () => set({
|
|
1511
1105
|
...t,
|
|
1512
1106
|
columns: moveItem(t.columns, index, index + 1)
|
|
1513
1107
|
}),
|
|
1514
1108
|
children: "Move right"
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
}, this)
|
|
1520
|
-
] }, void 0, true, {
|
|
1521
|
-
fileName: _jsxFileName,
|
|
1522
|
-
lineNumber: 823,
|
|
1523
|
-
columnNumber: 17
|
|
1524
|
-
}, this),
|
|
1525
|
-
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
1526
|
-
fileName: _jsxFileName,
|
|
1527
|
-
lineNumber: 832,
|
|
1528
|
-
columnNumber: 15
|
|
1529
|
-
}, this),
|
|
1530
|
-
/* @__PURE__ */ jsxDEV(MenuCheckItem, {
|
|
1109
|
+
})
|
|
1110
|
+
] }),
|
|
1111
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1112
|
+
/* @__PURE__ */ jsx(MenuCheckItem, {
|
|
1531
1113
|
checked: t.headerRow,
|
|
1532
1114
|
onCheckedChange: (v) => set({
|
|
1533
1115
|
...t,
|
|
1534
1116
|
headerRow: v
|
|
1535
1117
|
}),
|
|
1536
1118
|
children: "Show column names"
|
|
1537
|
-
},
|
|
1538
|
-
|
|
1539
|
-
lineNumber: 833,
|
|
1540
|
-
columnNumber: 15
|
|
1541
|
-
}, this),
|
|
1542
|
-
/* @__PURE__ */ jsxDEV(MenuCheckItem, {
|
|
1119
|
+
}),
|
|
1120
|
+
/* @__PURE__ */ jsx(MenuCheckItem, {
|
|
1543
1121
|
checked: t.headerColumn,
|
|
1544
1122
|
onCheckedChange: (v) => set({
|
|
1545
1123
|
...t,
|
|
1546
1124
|
headerColumn: v
|
|
1547
1125
|
}),
|
|
1548
1126
|
children: "First column names each row"
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1551
|
-
lineNumber: 834,
|
|
1552
|
-
columnNumber: 15
|
|
1553
|
-
}, this),
|
|
1554
|
-
/* @__PURE__ */ jsxDEV(MenuCheckItem, {
|
|
1127
|
+
}),
|
|
1128
|
+
/* @__PURE__ */ jsx(MenuCheckItem, {
|
|
1555
1129
|
checked: !!col.highlight,
|
|
1556
1130
|
onCheckedChange: (v) => set({
|
|
1557
1131
|
...t,
|
|
@@ -1561,68 +1135,28 @@ function ColumnMenu({ ctx, col, index, onInsert, children }) {
|
|
|
1561
1135
|
}))
|
|
1562
1136
|
}),
|
|
1563
1137
|
children: "Highlight this column"
|
|
1564
|
-
},
|
|
1565
|
-
|
|
1566
|
-
lineNumber: 835,
|
|
1567
|
-
columnNumber: 15
|
|
1568
|
-
}, this),
|
|
1569
|
-
lock ? null : /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
1570
|
-
fileName: _jsxFileName,
|
|
1571
|
-
lineNumber: 838,
|
|
1572
|
-
columnNumber: 19
|
|
1573
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1138
|
+
}),
|
|
1139
|
+
lock ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsx(MenuItem, {
|
|
1574
1140
|
danger: true,
|
|
1575
1141
|
disabled: n <= 1,
|
|
1576
1142
|
onClick: remove,
|
|
1577
1143
|
children: n <= 1 ? "Delete column · a table keeps one" : "Delete column"
|
|
1578
|
-
}
|
|
1579
|
-
fileName: _jsxFileName,
|
|
1580
|
-
lineNumber: 839,
|
|
1581
|
-
columnNumber: 19
|
|
1582
|
-
}, this)] }, void 0, true, {
|
|
1583
|
-
fileName: _jsxFileName,
|
|
1584
|
-
lineNumber: 837,
|
|
1585
|
-
columnNumber: 17
|
|
1586
|
-
}, this)
|
|
1144
|
+
})] })
|
|
1587
1145
|
]
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
columnNumber: 13
|
|
1592
|
-
}, this)]
|
|
1593
|
-
}, void 0, true, {
|
|
1594
|
-
fileName: _jsxFileName,
|
|
1595
|
-
lineNumber: 789,
|
|
1596
|
-
columnNumber: 11
|
|
1597
|
-
}, this)]
|
|
1598
|
-
}, void 0, true, {
|
|
1599
|
-
fileName: _jsxFileName,
|
|
1600
|
-
lineNumber: 786,
|
|
1601
|
-
columnNumber: 7
|
|
1602
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
1146
|
+
})]
|
|
1147
|
+
})]
|
|
1148
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
1603
1149
|
align: "end",
|
|
1604
1150
|
className: "w-64 p-3",
|
|
1605
|
-
children: /* @__PURE__ */
|
|
1151
|
+
children: /* @__PURE__ */ jsx(ColumnDetails, {
|
|
1606
1152
|
col,
|
|
1607
1153
|
onPatch: (p) => set({
|
|
1608
1154
|
...t,
|
|
1609
1155
|
columns: t.columns.map((c) => c._key === col._key ? withPatch(c, p) : c)
|
|
1610
1156
|
})
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
columnNumber: 9
|
|
1615
|
-
}, this)
|
|
1616
|
-
}, void 0, false, {
|
|
1617
|
-
fileName: _jsxFileName,
|
|
1618
|
-
lineNumber: 846,
|
|
1619
|
-
columnNumber: 7
|
|
1620
|
-
}, this)]
|
|
1621
|
-
}, void 0, true, {
|
|
1622
|
-
fileName: _jsxFileName,
|
|
1623
|
-
lineNumber: 785,
|
|
1624
|
-
columnNumber: 5
|
|
1625
|
-
}, this);
|
|
1157
|
+
})
|
|
1158
|
+
})]
|
|
1159
|
+
});
|
|
1626
1160
|
}
|
|
1627
1161
|
/** A stored TableLink as the global link field's value (V2 tableLinkValue). */
|
|
1628
1162
|
var tableLinkValue = (l) => ({
|
|
@@ -1642,37 +1176,25 @@ function withPatch(c, p) {
|
|
|
1642
1176
|
}
|
|
1643
1177
|
function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
1644
1178
|
const id = React.useId();
|
|
1645
|
-
const row = (key, label, node, help) => /* @__PURE__ */
|
|
1179
|
+
const row = (key, label, node, help) => /* @__PURE__ */ jsxs("label", {
|
|
1646
1180
|
htmlFor: `${id}-${key}`,
|
|
1647
1181
|
className: cn("flex flex-col", compact ? "gap-1" : "gap-1.5"),
|
|
1648
1182
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ jsx("span", {
|
|
1650
1184
|
className: cn("font-medium text-kit-fg-2", compact ? "text-kit-xs" : "text-kit-sm"),
|
|
1651
1185
|
children: label
|
|
1652
|
-
},
|
|
1653
|
-
fileName: _jsxFileName,
|
|
1654
|
-
lineNumber: 866,
|
|
1655
|
-
columnNumber: 7
|
|
1656
|
-
}, this),
|
|
1186
|
+
}),
|
|
1657
1187
|
node,
|
|
1658
|
-
help ? /* @__PURE__ */
|
|
1188
|
+
help ? /* @__PURE__ */ jsx("span", {
|
|
1659
1189
|
className: "text-kit-2xs leading-4 text-kit-fg-3",
|
|
1660
1190
|
children: help
|
|
1661
|
-
}
|
|
1662
|
-
fileName: _jsxFileName,
|
|
1663
|
-
lineNumber: 868,
|
|
1664
|
-
columnNumber: 15
|
|
1665
|
-
}, this) : null
|
|
1191
|
+
}) : null
|
|
1666
1192
|
]
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
lineNumber: 865,
|
|
1670
|
-
columnNumber: 5
|
|
1671
|
-
}, this);
|
|
1672
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1193
|
+
});
|
|
1194
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1673
1195
|
className: cn("flex flex-col", compact ? "gap-2.5" : "gap-4"),
|
|
1674
1196
|
children: [
|
|
1675
|
-
col.type === "number" ? row("unit", "Unit", /* @__PURE__ */
|
|
1197
|
+
col.type === "number" ? row("unit", "Unit", /* @__PURE__ */ jsx(Input, {
|
|
1676
1198
|
id: `${id}-unit`,
|
|
1677
1199
|
size: "sm",
|
|
1678
1200
|
autoFocus: compact,
|
|
@@ -1681,12 +1203,8 @@ function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
|
1681
1203
|
value: col.unit ?? "",
|
|
1682
1204
|
placeholder: "kg, %, min",
|
|
1683
1205
|
onChange: (e) => onPatch({ unit: e.target.value || void 0 })
|
|
1684
|
-
},
|
|
1685
|
-
|
|
1686
|
-
lineNumber: 874,
|
|
1687
|
-
columnNumber: 31
|
|
1688
|
-
}, this), "Written after every value.") : null,
|
|
1689
|
-
col.type === "money" ? row("currency", "Currency", /* @__PURE__ */ jsxDEV(Segmented, {
|
|
1206
|
+
}), "Written after every value.") : null,
|
|
1207
|
+
col.type === "money" ? row("currency", "Currency", /* @__PURE__ */ jsx(Segmented, {
|
|
1690
1208
|
size: "sm",
|
|
1691
1209
|
"aria-label": "Currency",
|
|
1692
1210
|
value: col.currency ?? "USD",
|
|
@@ -1695,12 +1213,8 @@ function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
|
1695
1213
|
value: c,
|
|
1696
1214
|
label: c
|
|
1697
1215
|
}))
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
lineNumber: 878,
|
|
1701
|
-
columnNumber: 37
|
|
1702
|
-
}, this)) : null,
|
|
1703
|
-
col.type === "rating" ? row("max", "Out of", /* @__PURE__ */ jsxDEV(Input, {
|
|
1216
|
+
})) : null,
|
|
1217
|
+
col.type === "rating" ? row("max", "Out of", /* @__PURE__ */ jsx(Input, {
|
|
1704
1218
|
id: `${id}-max`,
|
|
1705
1219
|
size: "sm",
|
|
1706
1220
|
autoFocus: compact,
|
|
@@ -1713,12 +1227,8 @@ function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
|
1713
1227
|
const n = Math.round(Number(e.target.value));
|
|
1714
1228
|
onPatch({ max: Number.isFinite(n) && n >= 1 ? Math.min(10, n) : void 0 });
|
|
1715
1229
|
}
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
lineNumber: 884,
|
|
1719
|
-
columnNumber: 13
|
|
1720
|
-
}, this)) : null,
|
|
1721
|
-
col.type === "boolean" ? /* @__PURE__ */ jsxDEV(Fragment, { children: [row("yes", "Yes says", /* @__PURE__ */ jsxDEV(Input, {
|
|
1230
|
+
})) : null,
|
|
1231
|
+
col.type === "boolean" ? /* @__PURE__ */ jsxs(Fragment, { children: [row("yes", "Yes says", /* @__PURE__ */ jsx(Input, {
|
|
1722
1232
|
id: `${id}-yes`,
|
|
1723
1233
|
size: "sm",
|
|
1724
1234
|
autoFocus: compact,
|
|
@@ -1727,11 +1237,7 @@ function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
|
1727
1237
|
value: col.trueLabel ?? "",
|
|
1728
1238
|
placeholder: "Included",
|
|
1729
1239
|
onChange: (e) => onPatch({ trueLabel: e.target.value || void 0 })
|
|
1730
|
-
},
|
|
1731
|
-
fileName: _jsxFileName,
|
|
1732
|
-
lineNumber: 903,
|
|
1733
|
-
columnNumber: 35
|
|
1734
|
-
}, this), "People who can't see the check mark hear these words."), row("no", "No says", /* @__PURE__ */ jsxDEV(Input, {
|
|
1240
|
+
}), "People who can't see the check mark hear these words."), row("no", "No says", /* @__PURE__ */ jsx(Input, {
|
|
1735
1241
|
id: `${id}-no`,
|
|
1736
1242
|
size: "sm",
|
|
1737
1243
|
readOnly,
|
|
@@ -1739,21 +1245,9 @@ function ColumnDetails({ col, onPatch, compact = true, readOnly }) {
|
|
|
1739
1245
|
value: col.falseLabel ?? "",
|
|
1740
1246
|
placeholder: "Not included",
|
|
1741
1247
|
onChange: (e) => onPatch({ falseLabel: e.target.value || void 0 })
|
|
1742
|
-
}
|
|
1743
|
-
fileName: _jsxFileName,
|
|
1744
|
-
lineNumber: 904,
|
|
1745
|
-
columnNumber: 33
|
|
1746
|
-
}, this))] }, void 0, true, {
|
|
1747
|
-
fileName: _jsxFileName,
|
|
1748
|
-
lineNumber: 902,
|
|
1749
|
-
columnNumber: 9
|
|
1750
|
-
}, this) : null
|
|
1248
|
+
}))] }) : null
|
|
1751
1249
|
]
|
|
1752
|
-
}
|
|
1753
|
-
fileName: _jsxFileName,
|
|
1754
|
-
lineNumber: 872,
|
|
1755
|
-
columnNumber: 5
|
|
1756
|
-
}, this);
|
|
1250
|
+
});
|
|
1757
1251
|
}
|
|
1758
1252
|
function RowMenu({ ctx, row, index, count, onInsert, children }) {
|
|
1759
1253
|
const { t, set, edit } = ctx;
|
|
@@ -1779,126 +1273,66 @@ function RowMenu({ ctx, row, index, count, onInsert, children }) {
|
|
|
1779
1273
|
ctx.undoable("Row deleted", prev);
|
|
1780
1274
|
};
|
|
1781
1275
|
const groups = offered(ctx.options).groups ? t.rowGroups ?? [] : [];
|
|
1782
|
-
const trigger = /* @__PURE__ */
|
|
1783
|
-
render: /* @__PURE__ */
|
|
1276
|
+
const trigger = /* @__PURE__ */ jsx(MenuTrigger, {
|
|
1277
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
1784
1278
|
size: "xs",
|
|
1785
1279
|
tabIndex: -1,
|
|
1786
1280
|
label: `Options for row ${index + 1}`
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
}, this),
|
|
1792
|
-
children: /* @__PURE__ */ jsxDEV(IconDots, { stroke: 1.5 }, void 0, false, {
|
|
1793
|
-
fileName: _jsxFileName,
|
|
1794
|
-
lineNumber: 927,
|
|
1795
|
-
columnNumber: 7
|
|
1796
|
-
}, this)
|
|
1797
|
-
}, void 0, false, {
|
|
1798
|
-
fileName: _jsxFileName,
|
|
1799
|
-
lineNumber: 926,
|
|
1800
|
-
columnNumber: 5
|
|
1801
|
-
}, this);
|
|
1802
|
-
return /* @__PURE__ */ jsxDEV(Menu, { children: [children(trigger), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
1281
|
+
}),
|
|
1282
|
+
children: /* @__PURE__ */ jsx(IconDots, { stroke: 1.5 })
|
|
1283
|
+
});
|
|
1284
|
+
return /* @__PURE__ */ jsxs(Menu, { children: [children(trigger), /* @__PURE__ */ jsxs(MenuContent, {
|
|
1803
1285
|
className: "min-w-52",
|
|
1804
1286
|
children: [
|
|
1805
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1806
1288
|
disabled: atMax,
|
|
1807
1289
|
onClick: () => onInsert(false),
|
|
1808
1290
|
children: "Insert row above"
|
|
1809
|
-
},
|
|
1810
|
-
|
|
1811
|
-
lineNumber: 934,
|
|
1812
|
-
columnNumber: 9
|
|
1813
|
-
}, this),
|
|
1814
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1291
|
+
}),
|
|
1292
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1815
1293
|
disabled: atMax,
|
|
1816
1294
|
onClick: () => onInsert(true),
|
|
1817
1295
|
children: "Insert row below"
|
|
1818
|
-
},
|
|
1819
|
-
|
|
1820
|
-
lineNumber: 935,
|
|
1821
|
-
columnNumber: 9
|
|
1822
|
-
}, this),
|
|
1823
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1296
|
+
}),
|
|
1297
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1824
1298
|
disabled: atMax,
|
|
1825
1299
|
onClick: duplicate,
|
|
1826
1300
|
children: "Duplicate row"
|
|
1827
|
-
},
|
|
1828
|
-
|
|
1829
|
-
lineNumber: 936,
|
|
1830
|
-
columnNumber: 9
|
|
1831
|
-
}, this),
|
|
1832
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1301
|
+
}),
|
|
1302
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1833
1303
|
disabled: index === 0,
|
|
1834
1304
|
onClick: () => set(moveRowTo(t, index, index - 1)),
|
|
1835
1305
|
children: "Move up"
|
|
1836
|
-
},
|
|
1837
|
-
|
|
1838
|
-
lineNumber: 937,
|
|
1839
|
-
columnNumber: 9
|
|
1840
|
-
}, this),
|
|
1841
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1306
|
+
}),
|
|
1307
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1842
1308
|
disabled: index === count - 1,
|
|
1843
1309
|
onClick: () => set(moveRowTo(t, index, index + 1)),
|
|
1844
1310
|
children: "Move down"
|
|
1845
|
-
},
|
|
1846
|
-
|
|
1847
|
-
lineNumber: 938,
|
|
1848
|
-
columnNumber: 9
|
|
1849
|
-
}, this),
|
|
1850
|
-
groups.length ? /* @__PURE__ */ jsxDEV(MenuSub, { children: [/* @__PURE__ */ jsxDEV(MenuSubTrigger, { children: "Move to group" }, void 0, false, {
|
|
1851
|
-
fileName: _jsxFileName,
|
|
1852
|
-
lineNumber: 941,
|
|
1853
|
-
columnNumber: 13
|
|
1854
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuSubContent, { children: /* @__PURE__ */ jsxDEV(MenuRadioGroup, {
|
|
1311
|
+
}),
|
|
1312
|
+
groups.length ? /* @__PURE__ */ jsxs(MenuSub, { children: [/* @__PURE__ */ jsx(MenuSubTrigger, { children: "Move to group" }), /* @__PURE__ */ jsx(MenuSubContent, { children: /* @__PURE__ */ jsxs(MenuRadioGroup, {
|
|
1855
1313
|
value: row.group ?? "",
|
|
1856
1314
|
onValueChange: (g) => edit(mapRow(row._key, (x) => clean({
|
|
1857
1315
|
...x,
|
|
1858
1316
|
group: g || void 0,
|
|
1859
1317
|
footer: void 0
|
|
1860
1318
|
}))),
|
|
1861
|
-
children: [/* @__PURE__ */
|
|
1319
|
+
children: [/* @__PURE__ */ jsx(MenuRadioItem, {
|
|
1862
1320
|
value: "",
|
|
1863
1321
|
children: "No group"
|
|
1864
|
-
},
|
|
1865
|
-
fileName: _jsxFileName,
|
|
1866
|
-
lineNumber: 944,
|
|
1867
|
-
columnNumber: 17
|
|
1868
|
-
}, this), groups.map((g) => /* @__PURE__ */ jsxDEV(MenuRadioItem, {
|
|
1322
|
+
}), groups.map((g) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
1869
1323
|
value: g._key,
|
|
1870
1324
|
children: g.label || "Untitled group"
|
|
1871
|
-
}, g._key
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
columnNumber: 19
|
|
1875
|
-
}, this))]
|
|
1876
|
-
}, void 0, true, {
|
|
1877
|
-
fileName: _jsxFileName,
|
|
1878
|
-
lineNumber: 943,
|
|
1879
|
-
columnNumber: 15
|
|
1880
|
-
}, this) }, void 0, false, {
|
|
1881
|
-
fileName: _jsxFileName,
|
|
1882
|
-
lineNumber: 942,
|
|
1883
|
-
columnNumber: 13
|
|
1884
|
-
}, this)] }, void 0, true, {
|
|
1885
|
-
fileName: _jsxFileName,
|
|
1886
|
-
lineNumber: 940,
|
|
1887
|
-
columnNumber: 11
|
|
1888
|
-
}, this) : null,
|
|
1889
|
-
offered(ctx.options).highlight ? /* @__PURE__ */ jsxDEV(MenuCheckItem, {
|
|
1325
|
+
}, g._key))]
|
|
1326
|
+
}) })] }) : null,
|
|
1327
|
+
offered(ctx.options).highlight ? /* @__PURE__ */ jsx(MenuCheckItem, {
|
|
1890
1328
|
checked: !!row.highlight,
|
|
1891
1329
|
onCheckedChange: (v) => edit(mapRow(row._key, (x) => clean({
|
|
1892
1330
|
...x,
|
|
1893
1331
|
highlight: v
|
|
1894
1332
|
}))),
|
|
1895
1333
|
children: "Highlight this row"
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
lineNumber: 952,
|
|
1899
|
-
columnNumber: 43
|
|
1900
|
-
}, this) : null,
|
|
1901
|
-
offered(ctx.options).totals ? /* @__PURE__ */ jsxDEV(MenuCheckItem, {
|
|
1334
|
+
}) : null,
|
|
1335
|
+
offered(ctx.options).totals ? /* @__PURE__ */ jsx(MenuCheckItem, {
|
|
1902
1336
|
checked: !!row.footer,
|
|
1903
1337
|
onCheckedChange: (v) => edit(mapRow(row._key, (x) => clean({
|
|
1904
1338
|
...x,
|
|
@@ -1906,35 +1340,15 @@ function RowMenu({ ctx, row, index, count, onInsert, children }) {
|
|
|
1906
1340
|
group: void 0
|
|
1907
1341
|
}))),
|
|
1908
1342
|
children: "Totals row"
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
columnNumber: 40
|
|
1913
|
-
}, this) : null,
|
|
1914
|
-
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
1915
|
-
fileName: _jsxFileName,
|
|
1916
|
-
lineNumber: 954,
|
|
1917
|
-
columnNumber: 9
|
|
1918
|
-
}, this),
|
|
1919
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1343
|
+
}) : null,
|
|
1344
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1345
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
1920
1346
|
danger: true,
|
|
1921
1347
|
onClick: remove,
|
|
1922
1348
|
children: "Delete row"
|
|
1923
|
-
}
|
|
1924
|
-
fileName: _jsxFileName,
|
|
1925
|
-
lineNumber: 955,
|
|
1926
|
-
columnNumber: 9
|
|
1927
|
-
}, this)
|
|
1349
|
+
})
|
|
1928
1350
|
]
|
|
1929
|
-
}
|
|
1930
|
-
fileName: _jsxFileName,
|
|
1931
|
-
lineNumber: 933,
|
|
1932
|
-
columnNumber: 7
|
|
1933
|
-
}, this)] }, void 0, true, {
|
|
1934
|
-
fileName: _jsxFileName,
|
|
1935
|
-
lineNumber: 931,
|
|
1936
|
-
columnNumber: 5
|
|
1937
|
-
}, this);
|
|
1351
|
+
})] });
|
|
1938
1352
|
}
|
|
1939
1353
|
/** Right-click (or Shift+F10 / the menu key) on a cell: words instead of the column's type, a footnote, clear. */
|
|
1940
1354
|
function CellMenu({ ctx, row, col, cell, onWrite, onNote, children }) {
|
|
@@ -1970,86 +1384,42 @@ function CellMenu({ ctx, row, col, cell, onWrite, onNote, children }) {
|
|
|
1970
1384
|
rows: order
|
|
1971
1385
|
});
|
|
1972
1386
|
};
|
|
1973
|
-
return /* @__PURE__ */
|
|
1974
|
-
render: /* @__PURE__ */
|
|
1975
|
-
fileName: _jsxFileName,
|
|
1976
|
-
lineNumber: 982,
|
|
1977
|
-
columnNumber: 36
|
|
1978
|
-
}, this),
|
|
1387
|
+
return /* @__PURE__ */ jsxs(ContextMenu.Root, { children: [/* @__PURE__ */ jsx(ContextMenu.Trigger, {
|
|
1388
|
+
render: /* @__PURE__ */ jsx("div", {}),
|
|
1979
1389
|
children
|
|
1980
|
-
},
|
|
1981
|
-
fileName: _jsxFileName,
|
|
1982
|
-
lineNumber: 982,
|
|
1983
|
-
columnNumber: 7
|
|
1984
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
1390
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
1985
1391
|
className: "min-w-52",
|
|
1986
1392
|
children: [
|
|
1987
|
-
colType !== "text" && colType !== "reference" && colType !== "richtext-inline" ? /* @__PURE__ */
|
|
1393
|
+
colType !== "text" && colType !== "reference" && colType !== "richtext-inline" ? /* @__PURE__ */ jsx(MenuItem, {
|
|
1988
1394
|
onClick: () => setOwn(asText ? void 0 : "text"),
|
|
1989
1395
|
children: asText ? `Use ${TYPE_UI[colType].label} like the column` : "Write words in this cell instead"
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
lineNumber: 985,
|
|
1993
|
-
columnNumber: 11
|
|
1994
|
-
}, this) : null,
|
|
1995
|
-
offered(ctx.options).footnotes ? note ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1396
|
+
}) : null,
|
|
1397
|
+
offered(ctx.options).footnotes ? note ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1996
1398
|
onClick: onNote,
|
|
1997
1399
|
children: "Edit footnote"
|
|
1998
|
-
},
|
|
1999
|
-
fileName: _jsxFileName,
|
|
2000
|
-
lineNumber: 990,
|
|
2001
|
-
columnNumber: 15
|
|
2002
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1400
|
+
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
2003
1401
|
onClick: () => set(unlinkNote(t, row._key, col._key)),
|
|
2004
1402
|
children: "Remove footnote"
|
|
2005
|
-
}
|
|
2006
|
-
fileName: _jsxFileName,
|
|
2007
|
-
lineNumber: 991,
|
|
2008
|
-
columnNumber: 15
|
|
2009
|
-
}, this)] }, void 0, true, {
|
|
2010
|
-
fileName: _jsxFileName,
|
|
2011
|
-
lineNumber: 989,
|
|
2012
|
-
columnNumber: 13
|
|
2013
|
-
}, this) : /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1403
|
+
})] }) : /* @__PURE__ */ jsx(MenuItem, {
|
|
2014
1404
|
onClick: () => (set(linkNote(t, row._key, col._key)[0]), onNote()),
|
|
2015
1405
|
children: "Add a footnote"
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
columnNumber: 13
|
|
2020
|
-
}, this) : null,
|
|
2021
|
-
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
2022
|
-
fileName: _jsxFileName,
|
|
2023
|
-
lineNumber: 997,
|
|
2024
|
-
columnNumber: 9
|
|
2025
|
-
}, this),
|
|
2026
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1406
|
+
}) : null,
|
|
1407
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
1408
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2027
1409
|
disabled: atMax,
|
|
2028
1410
|
onClick: () => insertRow(true),
|
|
2029
1411
|
children: "Insert row below"
|
|
2030
|
-
},
|
|
2031
|
-
|
|
2032
|
-
lineNumber: 998,
|
|
2033
|
-
columnNumber: 9
|
|
2034
|
-
}, this),
|
|
2035
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1412
|
+
}),
|
|
1413
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2036
1414
|
disabled: atMax,
|
|
2037
1415
|
onClick: () => insertRow(false),
|
|
2038
1416
|
children: "Insert row above"
|
|
2039
|
-
},
|
|
2040
|
-
|
|
2041
|
-
lineNumber: 999,
|
|
2042
|
-
columnNumber: 9
|
|
2043
|
-
}, this),
|
|
2044
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1417
|
+
}),
|
|
1418
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2045
1419
|
onClick: () => onWrite(withValue(cell, null)),
|
|
2046
1420
|
children: "Clear cell"
|
|
2047
|
-
},
|
|
2048
|
-
|
|
2049
|
-
lineNumber: 1e3,
|
|
2050
|
-
columnNumber: 9
|
|
2051
|
-
}, this),
|
|
2052
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
1421
|
+
}),
|
|
1422
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2053
1423
|
danger: true,
|
|
2054
1424
|
onClick: () => {
|
|
2055
1425
|
const prev = t;
|
|
@@ -2060,21 +1430,9 @@ function CellMenu({ ctx, row, col, cell, onWrite, onNote, children }) {
|
|
|
2060
1430
|
ctx.undoable("Row deleted", prev);
|
|
2061
1431
|
},
|
|
2062
1432
|
children: "Delete row"
|
|
2063
|
-
}
|
|
2064
|
-
fileName: _jsxFileName,
|
|
2065
|
-
lineNumber: 1001,
|
|
2066
|
-
columnNumber: 9
|
|
2067
|
-
}, this)
|
|
1433
|
+
})
|
|
2068
1434
|
]
|
|
2069
|
-
}
|
|
2070
|
-
fileName: _jsxFileName,
|
|
2071
|
-
lineNumber: 983,
|
|
2072
|
-
columnNumber: 7
|
|
2073
|
-
}, this)] }, void 0, true, {
|
|
2074
|
-
fileName: _jsxFileName,
|
|
2075
|
-
lineNumber: 981,
|
|
2076
|
-
columnNumber: 5
|
|
2077
|
-
}, this);
|
|
1435
|
+
})] });
|
|
2078
1436
|
}
|
|
2079
1437
|
var hasName = (t, r) => !!t.columns[0] && !isEmptyCell(cellValue(r.cells[t.columns[0]._key]));
|
|
2080
1438
|
/** The row that was open when its drill closed, per table: focus lands back on it (form frames and the local drill). */
|
|
@@ -2211,9 +1569,9 @@ function TableBody({ ctx, label, nav, head }) {
|
|
|
2211
1569
|
};
|
|
2212
1570
|
const list = open ? open.kind === "rows" ? t.rows : t.columns : [];
|
|
2213
1571
|
const at = open ? list.findIndex((x) => x._key === open.key) : -1;
|
|
2214
|
-
if (open && at >= 0) return /* @__PURE__ */
|
|
1572
|
+
if (open && at >= 0) return /* @__PURE__ */ jsx("div", {
|
|
2215
1573
|
className: TABLE_GROUP,
|
|
2216
|
-
children: /* @__PURE__ */
|
|
1574
|
+
children: /* @__PURE__ */ jsx(LocalDrill, {
|
|
2217
1575
|
ctx,
|
|
2218
1576
|
label,
|
|
2219
1577
|
open,
|
|
@@ -2223,59 +1581,35 @@ function TableBody({ ctx, label, nav, head }) {
|
|
|
2223
1581
|
kind: open.kind,
|
|
2224
1582
|
key
|
|
2225
1583
|
})
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
lineNumber: 1118,
|
|
2229
|
-
columnNumber: 9
|
|
2230
|
-
}, this)
|
|
2231
|
-
}, void 0, false, {
|
|
2232
|
-
fileName: _jsxFileName,
|
|
2233
|
-
lineNumber: 1117,
|
|
2234
|
-
columnNumber: 7
|
|
2235
|
-
}, this);
|
|
1584
|
+
})
|
|
1585
|
+
});
|
|
2236
1586
|
const base = nav?.basePath ?? [];
|
|
2237
1587
|
const titleId = `${id}-title`;
|
|
2238
1588
|
const noteId = `${id}-note`;
|
|
2239
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2240
1590
|
ref: host,
|
|
2241
1591
|
role: "group",
|
|
2242
1592
|
"aria-label": label || "Table",
|
|
2243
1593
|
className: cn(TABLE_GROUP, "flex flex-col gap-4 @max-[360px]:gap-3", !readOnly && "mb-2"),
|
|
2244
1594
|
children: [
|
|
2245
|
-
/* @__PURE__ */
|
|
1595
|
+
/* @__PURE__ */ jsxs("div", {
|
|
2246
1596
|
className: "group/part flex flex-col gap-1.5",
|
|
2247
|
-
children: [/* @__PURE__ */
|
|
1597
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2248
1598
|
className: "flex min-h-5 items-center gap-1.5",
|
|
2249
1599
|
children: [
|
|
2250
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx("label", {
|
|
2251
1601
|
htmlFor: titleId,
|
|
2252
1602
|
className: PART_LABEL,
|
|
2253
1603
|
children: "Title"
|
|
2254
|
-
},
|
|
2255
|
-
|
|
2256
|
-
lineNumber: 1129,
|
|
2257
|
-
columnNumber: 11
|
|
2258
|
-
}, this),
|
|
2259
|
-
options.requireCaption !== false && !t.caption.trim() ? /* @__PURE__ */ jsxDEV("span", {
|
|
1604
|
+
}),
|
|
1605
|
+
options.requireCaption !== false && !t.caption.trim() ? /* @__PURE__ */ jsx("span", {
|
|
2260
1606
|
className: "text-kit-xs text-kit-fg-3",
|
|
2261
1607
|
children: "Required"
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
lineNumber: 1130,
|
|
2265
|
-
columnNumber: 68
|
|
2266
|
-
}, this) : null,
|
|
2267
|
-
/* @__PURE__ */ jsxDEV("span", { className: "flex-1" }, void 0, false, {
|
|
2268
|
-
fileName: _jsxFileName,
|
|
2269
|
-
lineNumber: 1131,
|
|
2270
|
-
columnNumber: 11
|
|
2271
|
-
}, this),
|
|
1608
|
+
}) : null,
|
|
1609
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
2272
1610
|
head
|
|
2273
1611
|
]
|
|
2274
|
-
},
|
|
2275
|
-
fileName: _jsxFileName,
|
|
2276
|
-
lineNumber: 1128,
|
|
2277
|
-
columnNumber: 9
|
|
2278
|
-
}, this), /* @__PURE__ */ jsxDEV(Textarea, {
|
|
1612
|
+
}), /* @__PURE__ */ jsx(Textarea, {
|
|
2279
1613
|
id: titleId,
|
|
2280
1614
|
rows: 1,
|
|
2281
1615
|
maxLength: 300,
|
|
@@ -2287,45 +1621,25 @@ function TableBody({ ctx, label, nav, head }) {
|
|
|
2287
1621
|
caption: e.target.value.replace(/\n/g, " ")
|
|
2288
1622
|
}),
|
|
2289
1623
|
className: "min-h-8 resize-none py-1.5"
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
columnNumber: 9
|
|
2294
|
-
}, this)]
|
|
2295
|
-
}, void 0, true, {
|
|
2296
|
-
fileName: _jsxFileName,
|
|
2297
|
-
lineNumber: 1127,
|
|
2298
|
-
columnNumber: 7
|
|
2299
|
-
}, this),
|
|
2300
|
-
/* @__PURE__ */ jsxDEV(ColumnsPart, {
|
|
1624
|
+
})]
|
|
1625
|
+
}),
|
|
1626
|
+
/* @__PURE__ */ jsx(ColumnsPart, {
|
|
2301
1627
|
ctx,
|
|
2302
1628
|
basePath: base,
|
|
2303
1629
|
onOpen: (i, key) => go("columns", i, key)
|
|
2304
|
-
},
|
|
2305
|
-
|
|
2306
|
-
lineNumber: 1136,
|
|
2307
|
-
columnNumber: 7
|
|
2308
|
-
}, this),
|
|
2309
|
-
/* @__PURE__ */ jsxDEV(RowsPart, {
|
|
1630
|
+
}),
|
|
1631
|
+
/* @__PURE__ */ jsx(RowsPart, {
|
|
2310
1632
|
ctx,
|
|
2311
1633
|
basePath: base,
|
|
2312
1634
|
onOpen: (i, key) => go("rows", i, key)
|
|
2313
|
-
},
|
|
2314
|
-
|
|
2315
|
-
lineNumber: 1137,
|
|
2316
|
-
columnNumber: 7
|
|
2317
|
-
}, this),
|
|
2318
|
-
offered(options).note ? /* @__PURE__ */ jsxDEV("div", {
|
|
1635
|
+
}),
|
|
1636
|
+
offered(options).note ? /* @__PURE__ */ jsxs("div", {
|
|
2319
1637
|
className: "group/part flex flex-col gap-1.5",
|
|
2320
|
-
children: [/* @__PURE__ */
|
|
1638
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
2321
1639
|
htmlFor: noteId,
|
|
2322
1640
|
className: PART_LABEL,
|
|
2323
1641
|
children: "Note under the table"
|
|
2324
|
-
},
|
|
2325
|
-
fileName: _jsxFileName,
|
|
2326
|
-
lineNumber: 1140,
|
|
2327
|
-
columnNumber: 11
|
|
2328
|
-
}, this), /* @__PURE__ */ jsxDEV(Textarea, {
|
|
1642
|
+
}), /* @__PURE__ */ jsx(Textarea, {
|
|
2329
1643
|
id: noteId,
|
|
2330
1644
|
rows: 2,
|
|
2331
1645
|
maxLength: 2e3,
|
|
@@ -2336,27 +1650,11 @@ function TableBody({ ctx, label, nav, head }) {
|
|
|
2336
1650
|
...t,
|
|
2337
1651
|
notes: e.target.value || void 0
|
|
2338
1652
|
})
|
|
2339
|
-
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
columnNumber: 11
|
|
2343
|
-
}, this)]
|
|
2344
|
-
}, void 0, true, {
|
|
2345
|
-
fileName: _jsxFileName,
|
|
2346
|
-
lineNumber: 1139,
|
|
2347
|
-
columnNumber: 9
|
|
2348
|
-
}, this) : null,
|
|
2349
|
-
readOnly ? null : /* @__PURE__ */ jsxDEV(TableSettings, { ctx }, void 0, false, {
|
|
2350
|
-
fileName: _jsxFileName,
|
|
2351
|
-
lineNumber: 1144,
|
|
2352
|
-
columnNumber: 26
|
|
2353
|
-
}, this)
|
|
1653
|
+
})]
|
|
1654
|
+
}) : null,
|
|
1655
|
+
readOnly ? null : /* @__PURE__ */ jsx(TableSettings, { ctx })
|
|
2354
1656
|
]
|
|
2355
|
-
}
|
|
2356
|
-
fileName: _jsxFileName,
|
|
2357
|
-
lineNumber: 1126,
|
|
2358
|
-
columnNumber: 5
|
|
2359
|
-
}, this);
|
|
1657
|
+
});
|
|
2360
1658
|
}
|
|
2361
1659
|
/** Columns: an array list like any other (type icon, name, "Yes / No" summary, ⋯, ›). */
|
|
2362
1660
|
function ColumnsPart({ ctx, basePath, onOpen }) {
|
|
@@ -2407,18 +1705,14 @@ function ColumnsPart({ ctx, basePath, onOpen }) {
|
|
|
2407
1705
|
empty: !c.label
|
|
2408
1706
|
}
|
|
2409
1707
|
}));
|
|
2410
|
-
return /* @__PURE__ */
|
|
1708
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2411
1709
|
role: "group",
|
|
2412
1710
|
"aria-label": "Columns",
|
|
2413
1711
|
className: "group/part flex flex-col gap-1.5",
|
|
2414
|
-
children: [/* @__PURE__ */
|
|
1712
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2415
1713
|
className: PART_LABEL,
|
|
2416
1714
|
children: "Columns"
|
|
2417
|
-
},
|
|
2418
|
-
fileName: _jsxFileName,
|
|
2419
|
-
lineNumber: 1185,
|
|
2420
|
-
columnNumber: 7
|
|
2421
|
-
}, this), /* @__PURE__ */ jsxDEV(RowList, {
|
|
1715
|
+
}), /* @__PURE__ */ jsx(RowList, {
|
|
2422
1716
|
field: {
|
|
2423
1717
|
...COLUMNS_FIELD,
|
|
2424
1718
|
validation: { min: 1 }
|
|
@@ -2433,48 +1727,24 @@ function ColumnsPart({ ctx, basePath, onOpen }) {
|
|
|
2433
1727
|
ops,
|
|
2434
1728
|
renderInline: () => null,
|
|
2435
1729
|
emptyLabel: "No columns yet.",
|
|
2436
|
-
leading: (r) => /* @__PURE__ */
|
|
1730
|
+
leading: (r) => /* @__PURE__ */ jsx("span", {
|
|
2437
1731
|
className: "flex size-7 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2",
|
|
2438
|
-
children: /* @__PURE__ */
|
|
1732
|
+
children: /* @__PURE__ */ jsx(TypeIcon, {
|
|
2439
1733
|
type: r.item.type,
|
|
2440
1734
|
className: "size-4 text-kit-fg-2"
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
columnNumber: 13
|
|
2445
|
-
}, this)
|
|
2446
|
-
}, void 0, false, {
|
|
2447
|
-
fileName: _jsxFileName,
|
|
2448
|
-
lineNumber: 1199,
|
|
2449
|
-
columnNumber: 11
|
|
2450
|
-
}, this),
|
|
2451
|
-
addButton: /* @__PURE__ */ jsxDEV(Button, {
|
|
1735
|
+
})
|
|
1736
|
+
}),
|
|
1737
|
+
addButton: /* @__PURE__ */ jsx(Button, {
|
|
2452
1738
|
size: "sm",
|
|
2453
1739
|
variant: "ghost",
|
|
2454
1740
|
className: "text-kit-fg-2",
|
|
2455
|
-
leftIcon: /* @__PURE__ */
|
|
2456
|
-
fileName: _jsxFileName,
|
|
2457
|
-
lineNumber: 1204,
|
|
2458
|
-
columnNumber: 81
|
|
2459
|
-
}, this),
|
|
1741
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
2460
1742
|
disabled: atMax,
|
|
2461
1743
|
onClick: add,
|
|
2462
1744
|
children: atMax ? `Add column · ${options.maxColumns} at most` : "Add column"
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
columnNumber: 11
|
|
2467
|
-
}, this)
|
|
2468
|
-
}, void 0, false, {
|
|
2469
|
-
fileName: _jsxFileName,
|
|
2470
|
-
lineNumber: 1186,
|
|
2471
|
-
columnNumber: 7
|
|
2472
|
-
}, this)]
|
|
2473
|
-
}, void 0, true, {
|
|
2474
|
-
fileName: _jsxFileName,
|
|
2475
|
-
lineNumber: 1184,
|
|
2476
|
-
columnNumber: 5
|
|
2477
|
-
}, this);
|
|
1745
|
+
})
|
|
1746
|
+
})]
|
|
1747
|
+
});
|
|
2478
1748
|
}
|
|
2479
1749
|
/**
|
|
2480
1750
|
* Rows (D52): groups live in the row list itself. Loose rows first, then each group under a heading you rename in place
|
|
@@ -2625,93 +1895,53 @@ function RowsPart({ ctx, basePath, onOpen }) {
|
|
|
2625
1895
|
}] : []
|
|
2626
1896
|
];
|
|
2627
1897
|
if (!places.some((p) => p.value !== here)) return null;
|
|
2628
|
-
return /* @__PURE__ */
|
|
2629
|
-
icon: /* @__PURE__ */
|
|
2630
|
-
fileName: _jsxFileName,
|
|
2631
|
-
lineNumber: 1307,
|
|
2632
|
-
columnNumber: 31
|
|
2633
|
-
}, this),
|
|
1898
|
+
return /* @__PURE__ */ jsxs(MenuSub, { children: [/* @__PURE__ */ jsx(MenuSubTrigger, {
|
|
1899
|
+
icon: /* @__PURE__ */ jsx(IconFolder, { stroke: 1.5 }),
|
|
2634
1900
|
children: "Move to group"
|
|
2635
|
-
},
|
|
2636
|
-
fileName: _jsxFileName,
|
|
2637
|
-
lineNumber: 1307,
|
|
2638
|
-
columnNumber: 9
|
|
2639
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuSubContent, {
|
|
1901
|
+
}), /* @__PURE__ */ jsx(MenuSubContent, {
|
|
2640
1902
|
className: "min-w-44",
|
|
2641
|
-
children: /* @__PURE__ */
|
|
1903
|
+
children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
2642
1904
|
value: here,
|
|
2643
1905
|
onValueChange: (v) => v !== here && moveTo(row, v === "totals" ? { totals: true } : { group: v || void 0 }),
|
|
2644
|
-
children: places.map((p) => /* @__PURE__ */
|
|
1906
|
+
children: places.map((p) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
2645
1907
|
value: p.value,
|
|
2646
1908
|
children: p.label
|
|
2647
|
-
}, p.value || "none"
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
columnNumber: 15
|
|
2651
|
-
}, this))
|
|
2652
|
-
}, void 0, false, {
|
|
2653
|
-
fileName: _jsxFileName,
|
|
2654
|
-
lineNumber: 1309,
|
|
2655
|
-
columnNumber: 11
|
|
2656
|
-
}, this)
|
|
2657
|
-
}, void 0, false, {
|
|
2658
|
-
fileName: _jsxFileName,
|
|
2659
|
-
lineNumber: 1308,
|
|
2660
|
-
columnNumber: 9
|
|
2661
|
-
}, this)] }, void 0, true, {
|
|
2662
|
-
fileName: _jsxFileName,
|
|
2663
|
-
lineNumber: 1306,
|
|
2664
|
-
columnNumber: 7
|
|
2665
|
-
}, this);
|
|
1909
|
+
}, p.value || "none"))
|
|
1910
|
+
})
|
|
1911
|
+
})] });
|
|
2666
1912
|
};
|
|
2667
1913
|
const sharedSort = useSharedSort();
|
|
2668
1914
|
const unnamed = t.rows.find((r) => !hasName(t, r) && t.columns.slice(1).some((c) => !isEmptyCell(cellValue(r.cells[c._key]))));
|
|
2669
|
-
const addRowButton = (ri) => /* @__PURE__ */
|
|
1915
|
+
const addRowButton = (ri) => /* @__PURE__ */ jsx(Button, {
|
|
2670
1916
|
size: "sm",
|
|
2671
1917
|
variant: "ghost",
|
|
2672
1918
|
className: "text-kit-fg-2",
|
|
2673
|
-
leftIcon: /* @__PURE__ */
|
|
2674
|
-
fileName: _jsxFileName,
|
|
2675
|
-
lineNumber: 1323,
|
|
2676
|
-
columnNumber: 75
|
|
2677
|
-
}, this),
|
|
1919
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
2678
1920
|
disabled: atMax && !runs[ri].totals,
|
|
2679
1921
|
onClick: () => add(ri),
|
|
2680
1922
|
children: atMax && !runs[ri].totals ? `Add row · ${options.maxRows} at most` : "Add row"
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2683
|
-
lineNumber: 1323,
|
|
2684
|
-
columnNumber: 5
|
|
2685
|
-
}, this);
|
|
2686
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1923
|
+
});
|
|
1924
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2687
1925
|
role: "group",
|
|
2688
1926
|
"aria-label": "Rows",
|
|
2689
1927
|
className: "group/part flex flex-col gap-1.5",
|
|
2690
1928
|
children: [
|
|
2691
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx("span", {
|
|
2692
1930
|
className: PART_LABEL,
|
|
2693
1931
|
children: "Rows"
|
|
2694
|
-
},
|
|
2695
|
-
|
|
2696
|
-
lineNumber: 1329,
|
|
2697
|
-
columnNumber: 7
|
|
2698
|
-
}, this),
|
|
2699
|
-
unnamed && !readOnly ? /* @__PURE__ */ jsxDEV("button", {
|
|
1932
|
+
}),
|
|
1933
|
+
unnamed && !readOnly ? /* @__PURE__ */ jsx("button", {
|
|
2700
1934
|
type: "button",
|
|
2701
1935
|
onClick: () => onOpen(t.rows.indexOf(unnamed), unnamed._key),
|
|
2702
1936
|
className: "self-start text-left text-kit-xs text-kit-warning-fg underline-offset-2 hover:underline",
|
|
2703
1937
|
children: "A row has values but no name. Open it"
|
|
2704
|
-
}
|
|
2705
|
-
|
|
2706
|
-
lineNumber: 1331,
|
|
2707
|
-
columnNumber: 9
|
|
2708
|
-
}, this) : null,
|
|
2709
|
-
/* @__PURE__ */ jsxDEV(SharedSortProvider, {
|
|
1938
|
+
}) : null,
|
|
1939
|
+
/* @__PURE__ */ jsx(SharedSortProvider, {
|
|
2710
1940
|
value: sharedSort.value,
|
|
2711
|
-
children: /* @__PURE__ */
|
|
1941
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2712
1942
|
className: "flex flex-col gap-3",
|
|
2713
1943
|
children: runs.map((run, ri) => {
|
|
2714
|
-
const list = /* @__PURE__ */
|
|
1944
|
+
const list = /* @__PURE__ */ jsx(RowList, {
|
|
2715
1945
|
field: ROWS_FIELD,
|
|
2716
1946
|
rows: run.items.map(model),
|
|
2717
1947
|
readOnly,
|
|
@@ -2724,98 +1954,46 @@ function RowsPart({ ctx, basePath, onOpen }) {
|
|
|
2724
1954
|
renderInline: () => null,
|
|
2725
1955
|
menuExtra: moveMenu,
|
|
2726
1956
|
emptyLabel: run.totals ? "No totals yet." : run.group ? "No rows in this group yet." : "No rows yet.",
|
|
2727
|
-
addButton: ri === lastBody && can.groups ? /* @__PURE__ */
|
|
1957
|
+
addButton: ri === lastBody && can.groups ? /* @__PURE__ */ jsxs("span", {
|
|
2728
1958
|
className: "flex flex-wrap items-center gap-1",
|
|
2729
|
-
children: [addRowButton(ri), /* @__PURE__ */
|
|
1959
|
+
children: [addRowButton(ri), /* @__PURE__ */ jsx(Button, {
|
|
2730
1960
|
size: "sm",
|
|
2731
1961
|
variant: "ghost",
|
|
2732
1962
|
className: "text-kit-fg-2",
|
|
2733
|
-
leftIcon: /* @__PURE__ */
|
|
2734
|
-
fileName: _jsxFileName,
|
|
2735
|
-
lineNumber: 1356,
|
|
2736
|
-
columnNumber: 91
|
|
2737
|
-
}, this),
|
|
1963
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
2738
1964
|
onClick: addGroup,
|
|
2739
1965
|
children: "Add group"
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
}, void 0, true, {
|
|
2746
|
-
fileName: _jsxFileName,
|
|
2747
|
-
lineNumber: 1354,
|
|
2748
|
-
columnNumber: 19
|
|
2749
|
-
}, this) : addRowButton(ri)
|
|
2750
|
-
}, void 0, false, {
|
|
2751
|
-
fileName: _jsxFileName,
|
|
2752
|
-
lineNumber: 1339,
|
|
2753
|
-
columnNumber: 13
|
|
2754
|
-
}, this);
|
|
2755
|
-
if (!run.group && !run.totals) return /* @__PURE__ */ jsxDEV("div", { children: list }, run.key, false, {
|
|
2756
|
-
fileName: _jsxFileName,
|
|
2757
|
-
lineNumber: 1366,
|
|
2758
|
-
columnNumber: 49
|
|
2759
|
-
}, this);
|
|
2760
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1966
|
+
})]
|
|
1967
|
+
}) : addRowButton(ri)
|
|
1968
|
+
});
|
|
1969
|
+
if (!run.group && !run.totals) return /* @__PURE__ */ jsx("div", { children: list }, run.key);
|
|
1970
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2761
1971
|
role: "group",
|
|
2762
1972
|
"aria-label": run.totals ? "Totals" : run.group.label || "Untitled group",
|
|
2763
1973
|
className: "flex flex-col gap-1.5",
|
|
2764
|
-
children: [/* @__PURE__ */
|
|
1974
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2765
1975
|
className: "rounded-kit-md transition-colors",
|
|
2766
|
-
children: run.totals ? /* @__PURE__ */
|
|
1976
|
+
children: run.totals ? /* @__PURE__ */ jsx("span", {
|
|
2767
1977
|
className: "flex h-7 items-center px-0.5 text-kit-sm font-medium text-kit-fg-2",
|
|
2768
1978
|
children: "Totals"
|
|
2769
|
-
}
|
|
2770
|
-
fileName: _jsxFileName,
|
|
2771
|
-
lineNumber: 1372,
|
|
2772
|
-
columnNumber: 19
|
|
2773
|
-
}, this) : /* @__PURE__ */ jsxDEV(GroupHeading, {
|
|
1979
|
+
}) : /* @__PURE__ */ jsx(GroupHeading, {
|
|
2774
1980
|
ctx,
|
|
2775
1981
|
group: run.group,
|
|
2776
1982
|
index: groups.indexOf(run.group),
|
|
2777
1983
|
count: groups.length,
|
|
2778
1984
|
rows: run.items.length
|
|
2779
|
-
}
|
|
2780
|
-
|
|
2781
|
-
lineNumber: 1374,
|
|
2782
|
-
columnNumber: 19
|
|
2783
|
-
}, this)
|
|
2784
|
-
}, void 0, false, {
|
|
2785
|
-
fileName: _jsxFileName,
|
|
2786
|
-
lineNumber: 1370,
|
|
2787
|
-
columnNumber: 15
|
|
2788
|
-
}, this), /* @__PURE__ */ jsxDEV("div", {
|
|
1985
|
+
})
|
|
1986
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2789
1987
|
className: "ml-1.5 border-l border-kit-line pl-3",
|
|
2790
1988
|
children: list
|
|
2791
|
-
}
|
|
2792
|
-
|
|
2793
|
-
lineNumber: 1377,
|
|
2794
|
-
columnNumber: 15
|
|
2795
|
-
}, this)]
|
|
2796
|
-
}, run.key, true, {
|
|
2797
|
-
fileName: _jsxFileName,
|
|
2798
|
-
lineNumber: 1368,
|
|
2799
|
-
columnNumber: 13
|
|
2800
|
-
}, this);
|
|
1989
|
+
})]
|
|
1990
|
+
}, run.key);
|
|
2801
1991
|
})
|
|
2802
|
-
}
|
|
2803
|
-
|
|
2804
|
-
lineNumber: 1336,
|
|
2805
|
-
columnNumber: 7
|
|
2806
|
-
}, this)
|
|
2807
|
-
}, void 0, false, {
|
|
2808
|
-
fileName: _jsxFileName,
|
|
2809
|
-
lineNumber: 1335,
|
|
2810
|
-
columnNumber: 7
|
|
2811
|
-
}, this),
|
|
1992
|
+
})
|
|
1993
|
+
}),
|
|
2812
1994
|
sharedSort.a11y
|
|
2813
1995
|
]
|
|
2814
|
-
}
|
|
2815
|
-
fileName: _jsxFileName,
|
|
2816
|
-
lineNumber: 1328,
|
|
2817
|
-
columnNumber: 5
|
|
2818
|
-
}, this);
|
|
1996
|
+
});
|
|
2819
1997
|
}
|
|
2820
1998
|
/** A row group's heading, renamed in place. It reads as a label at rest; its ⋯ moves or removes the group. */
|
|
2821
1999
|
function GroupHeading({ ctx, group, index, count, rows }) {
|
|
@@ -2849,9 +2027,9 @@ function GroupHeading({ ctx, group, index, count, rows }) {
|
|
|
2849
2027
|
});
|
|
2850
2028
|
ctx.undoable(`“${group.label || "Untitled group"}” removed`, prev, rows ? `Its ${rows === 1 ? "row stays" : `${rows} rows stay`} in the table.` : void 0);
|
|
2851
2029
|
};
|
|
2852
|
-
return /* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2853
2031
|
className: "group/gh flex min-w-0 items-center gap-1",
|
|
2854
|
-
children: [/* @__PURE__ */
|
|
2032
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
2855
2033
|
"data-group-name": group._key,
|
|
2856
2034
|
value: draft,
|
|
2857
2035
|
readOnly,
|
|
@@ -2871,90 +2049,38 @@ function GroupHeading({ ctx, group, index, count, rows }) {
|
|
|
2871
2049
|
}
|
|
2872
2050
|
},
|
|
2873
2051
|
className: "-mx-0.5 h-7 min-w-0 flex-1 truncate rounded-kit-md bg-transparent px-0.5 text-[13px] font-medium text-kit-fg-2 outline-none transition-colors placeholder:font-normal placeholder:text-kit-fg-4 hover:bg-kit-hover focus:bg-kit-surface focus:px-2 focus:text-kit-fg focus:shadow-[inset_0_0_0_1px_var(--kit-line-strong)]"
|
|
2874
|
-
},
|
|
2875
|
-
|
|
2876
|
-
lineNumber: 1407,
|
|
2877
|
-
columnNumber: 7
|
|
2878
|
-
}, this), readOnly ? null : /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
|
|
2879
|
-
render: /* @__PURE__ */ jsxDEV(IconButton, {
|
|
2052
|
+
}), readOnly ? null : /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
2053
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
2880
2054
|
size: "xs",
|
|
2881
2055
|
label: `Options for ${group.label || "this group"}`,
|
|
2882
2056
|
className: "opacity-0 focus-visible:opacity-100 group-hover/gh:opacity-100 group-focus-within/gh:opacity-100 data-[popup-open]:opacity-100 [@media(pointer:coarse)]:opacity-100"
|
|
2883
|
-
},
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
columnNumber: 15
|
|
2887
|
-
}, this),
|
|
2888
|
-
children: /* @__PURE__ */ jsxDEV(IconDots, { stroke: 1.5 }, void 0, false, {
|
|
2889
|
-
fileName: _jsxFileName,
|
|
2890
|
-
lineNumber: 1433,
|
|
2891
|
-
columnNumber: 13
|
|
2892
|
-
}, this)
|
|
2893
|
-
}, void 0, false, {
|
|
2894
|
-
fileName: _jsxFileName,
|
|
2895
|
-
lineNumber: 1424,
|
|
2896
|
-
columnNumber: 11
|
|
2897
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
2057
|
+
}),
|
|
2058
|
+
children: /* @__PURE__ */ jsx(IconDots, { stroke: 1.5 })
|
|
2059
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
2898
2060
|
align: "end",
|
|
2899
2061
|
className: "min-w-44",
|
|
2900
2062
|
children: [
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
icon: /* @__PURE__ */
|
|
2903
|
-
fileName: _jsxFileName,
|
|
2904
|
-
lineNumber: 1436,
|
|
2905
|
-
columnNumber: 29
|
|
2906
|
-
}, this),
|
|
2063
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2064
|
+
icon: /* @__PURE__ */ jsx(IconArrowUp, { stroke: 1.5 }),
|
|
2907
2065
|
disabled: index === 0,
|
|
2908
2066
|
onClick: () => moveGroup(-1),
|
|
2909
2067
|
children: "Move up"
|
|
2910
|
-
},
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
columnNumber: 13
|
|
2914
|
-
}, this),
|
|
2915
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
2916
|
-
icon: /* @__PURE__ */ jsxDEV(IconArrowDown, { stroke: 1.5 }, void 0, false, {
|
|
2917
|
-
fileName: _jsxFileName,
|
|
2918
|
-
lineNumber: 1437,
|
|
2919
|
-
columnNumber: 29
|
|
2920
|
-
}, this),
|
|
2068
|
+
}),
|
|
2069
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2070
|
+
icon: /* @__PURE__ */ jsx(IconArrowDown, { stroke: 1.5 }),
|
|
2921
2071
|
disabled: index >= count - 1,
|
|
2922
2072
|
onClick: () => moveGroup(1),
|
|
2923
2073
|
children: "Move down"
|
|
2924
|
-
},
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
columnNumber: 13
|
|
2928
|
-
}, this),
|
|
2929
|
-
/* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
2930
|
-
fileName: _jsxFileName,
|
|
2931
|
-
lineNumber: 1438,
|
|
2932
|
-
columnNumber: 13
|
|
2933
|
-
}, this),
|
|
2934
|
-
/* @__PURE__ */ jsxDEV(MenuItem, {
|
|
2074
|
+
}),
|
|
2075
|
+
/* @__PURE__ */ jsx(MenuSeparator, {}),
|
|
2076
|
+
/* @__PURE__ */ jsx(MenuItem, {
|
|
2935
2077
|
danger: true,
|
|
2936
2078
|
onClick: remove,
|
|
2937
2079
|
children: "Remove group"
|
|
2938
|
-
}
|
|
2939
|
-
fileName: _jsxFileName,
|
|
2940
|
-
lineNumber: 1439,
|
|
2941
|
-
columnNumber: 13
|
|
2942
|
-
}, this)
|
|
2080
|
+
})
|
|
2943
2081
|
]
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
lineNumber: 1435,
|
|
2947
|
-
columnNumber: 11
|
|
2948
|
-
}, this)] }, void 0, true, {
|
|
2949
|
-
fileName: _jsxFileName,
|
|
2950
|
-
lineNumber: 1423,
|
|
2951
|
-
columnNumber: 9
|
|
2952
|
-
}, this)]
|
|
2953
|
-
}, void 0, true, {
|
|
2954
|
-
fileName: _jsxFileName,
|
|
2955
|
-
lineNumber: 1406,
|
|
2956
|
-
columnNumber: 5
|
|
2957
|
-
}, this);
|
|
2082
|
+
})] })]
|
|
2083
|
+
});
|
|
2958
2084
|
}
|
|
2959
2085
|
/**
|
|
2960
2086
|
* Height of the sticky bars pinned above a table in its scroll area: the rich-text editor publishes
|
|
@@ -2987,150 +2113,78 @@ function LocalDrill({ ctx, label, open, index, onBack, onGo }) {
|
|
|
2987
2113
|
return () => cancelAnimationFrame(raf);
|
|
2988
2114
|
}, [index]);
|
|
2989
2115
|
const step = (d) => list[index + d] && onGo(list[index + d]._key);
|
|
2990
|
-
return /* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2991
2117
|
ref: rootRef,
|
|
2992
2118
|
className: "flex flex-col gap-4",
|
|
2993
2119
|
style: { scrollMarginTop: `calc(${STICKY_TOP} + 8px)` },
|
|
2994
2120
|
onKeyDown: (e) => e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), onBack()),
|
|
2995
2121
|
children: [
|
|
2996
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ jsx("div", {
|
|
2997
2123
|
className: "sticky z-[2] -my-1 bg-kit-surface py-1",
|
|
2998
2124
|
style: { top: STICKY_TOP },
|
|
2999
|
-
children: /* @__PURE__ */
|
|
2125
|
+
children: /* @__PURE__ */ jsx(PathCrumbs, {
|
|
3000
2126
|
size: "sm",
|
|
3001
2127
|
label: "Table path",
|
|
3002
2128
|
items: [
|
|
3003
2129
|
{
|
|
3004
2130
|
id: "table",
|
|
3005
2131
|
label: label || "Table",
|
|
3006
|
-
icon: /* @__PURE__ */
|
|
3007
|
-
fileName: _jsxFileName,
|
|
3008
|
-
lineNumber: 1493,
|
|
3009
|
-
columnNumber: 59
|
|
3010
|
-
}, this),
|
|
2132
|
+
icon: /* @__PURE__ */ jsx(IconTable, {}),
|
|
3011
2133
|
onSelect: onBack
|
|
3012
2134
|
},
|
|
3013
2135
|
...group ? [{
|
|
3014
2136
|
id: "group",
|
|
3015
2137
|
label: group.label || "Untitled group",
|
|
3016
|
-
icon: /* @__PURE__ */
|
|
3017
|
-
fileName: _jsxFileName,
|
|
3018
|
-
lineNumber: 1494,
|
|
3019
|
-
columnNumber: 87
|
|
3020
|
-
}, this),
|
|
2138
|
+
icon: /* @__PURE__ */ jsx(IconFolder, {}),
|
|
3021
2139
|
onSelect: onBack
|
|
3022
2140
|
}] : [],
|
|
3023
2141
|
{
|
|
3024
2142
|
id: "current",
|
|
3025
2143
|
label: title,
|
|
3026
|
-
icon: rows ? /* @__PURE__ */
|
|
3027
|
-
fileName: _jsxFileName,
|
|
3028
|
-
lineNumber: 1495,
|
|
3029
|
-
columnNumber: 57
|
|
3030
|
-
}, this) : /* @__PURE__ */ jsxDEV(IconLayoutColumns, {}, void 0, false, {
|
|
3031
|
-
fileName: _jsxFileName,
|
|
3032
|
-
lineNumber: 1495,
|
|
3033
|
-
columnNumber: 72
|
|
3034
|
-
}, this)
|
|
2144
|
+
icon: rows ? /* @__PURE__ */ jsx(IconList, {}) : /* @__PURE__ */ jsx(IconLayoutColumns, {})
|
|
3035
2145
|
}
|
|
3036
2146
|
]
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
columnNumber: 9
|
|
3041
|
-
}, this)
|
|
3042
|
-
}, void 0, false, {
|
|
3043
|
-
fileName: _jsxFileName,
|
|
3044
|
-
lineNumber: 1488,
|
|
3045
|
-
columnNumber: 7
|
|
3046
|
-
}, this),
|
|
3047
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
2147
|
+
})
|
|
2148
|
+
}),
|
|
2149
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3048
2150
|
ref: headRef,
|
|
3049
2151
|
tabIndex: -1,
|
|
3050
2152
|
className: "flex items-start gap-2.5 outline-none",
|
|
3051
|
-
children: [/* @__PURE__ */
|
|
2153
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
3052
2154
|
className: "min-w-0 flex-1",
|
|
3053
|
-
children: [/* @__PURE__ */
|
|
2155
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
3054
2156
|
className: "truncate text-kit-base font-semibold leading-6 text-kit-fg",
|
|
3055
2157
|
children: title
|
|
3056
|
-
},
|
|
3057
|
-
fileName: _jsxFileName,
|
|
3058
|
-
lineNumber: 1501,
|
|
3059
|
-
columnNumber: 11
|
|
3060
|
-
}, this), /* @__PURE__ */ jsxDEV("p", {
|
|
2158
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
3061
2159
|
className: "truncate text-kit-xs leading-4 text-kit-fg-3",
|
|
3062
2160
|
children: `${rows ? "Row" : "Column"} ${index + 1} of ${list.length} in ${label || "the table"}`
|
|
3063
|
-
}
|
|
3064
|
-
|
|
3065
|
-
lineNumber: 1502,
|
|
3066
|
-
columnNumber: 11
|
|
3067
|
-
}, this)]
|
|
3068
|
-
}, void 0, true, {
|
|
3069
|
-
fileName: _jsxFileName,
|
|
3070
|
-
lineNumber: 1500,
|
|
3071
|
-
columnNumber: 9
|
|
3072
|
-
}, this), /* @__PURE__ */ jsxDEV("div", {
|
|
2161
|
+
})]
|
|
2162
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
3073
2163
|
className: "-mr-1 flex shrink-0 items-center gap-0.5 pt-0.5",
|
|
3074
|
-
children: [/* @__PURE__ */
|
|
2164
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
3075
2165
|
size: "sm",
|
|
3076
2166
|
label: index > 0 ? `Previous ${noun}: ${titleAt(index - 1)}` : `First ${noun}`,
|
|
3077
2167
|
disabled: index === 0,
|
|
3078
2168
|
onClick: () => step(-1),
|
|
3079
|
-
children: /* @__PURE__ */
|
|
3080
|
-
|
|
3081
|
-
lineNumber: 1506,
|
|
3082
|
-
columnNumber: 13
|
|
3083
|
-
}, this)
|
|
3084
|
-
}, void 0, false, {
|
|
3085
|
-
fileName: _jsxFileName,
|
|
3086
|
-
lineNumber: 1505,
|
|
3087
|
-
columnNumber: 11
|
|
3088
|
-
}, this), /* @__PURE__ */ jsxDEV(IconButton, {
|
|
2169
|
+
children: /* @__PURE__ */ jsx(IconArrowUp, { stroke: 1.5 })
|
|
2170
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
3089
2171
|
size: "sm",
|
|
3090
2172
|
label: index < list.length - 1 ? `Next ${noun}: ${titleAt(index + 1)}` : `Last ${noun}`,
|
|
3091
2173
|
disabled: index >= list.length - 1,
|
|
3092
2174
|
onClick: () => step(1),
|
|
3093
|
-
children: /* @__PURE__ */
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
}, void 0, false, {
|
|
3099
|
-
fileName: _jsxFileName,
|
|
3100
|
-
lineNumber: 1508,
|
|
3101
|
-
columnNumber: 11
|
|
3102
|
-
}, this)]
|
|
3103
|
-
}, void 0, true, {
|
|
3104
|
-
fileName: _jsxFileName,
|
|
3105
|
-
lineNumber: 1504,
|
|
3106
|
-
columnNumber: 9
|
|
3107
|
-
}, this)]
|
|
3108
|
-
}, void 0, true, {
|
|
3109
|
-
fileName: _jsxFileName,
|
|
3110
|
-
lineNumber: 1499,
|
|
3111
|
-
columnNumber: 7
|
|
3112
|
-
}, this),
|
|
3113
|
-
rows ? /* @__PURE__ */ jsxDEV(RowFields, {
|
|
2175
|
+
children: /* @__PURE__ */ jsx(IconArrowDown, { stroke: 1.5 })
|
|
2176
|
+
})]
|
|
2177
|
+
})]
|
|
2178
|
+
}),
|
|
2179
|
+
rows ? /* @__PURE__ */ jsx(RowFields, {
|
|
3114
2180
|
ctx,
|
|
3115
2181
|
row: t.rows[index]
|
|
3116
|
-
}
|
|
3117
|
-
fileName: _jsxFileName,
|
|
3118
|
-
lineNumber: 1513,
|
|
3119
|
-
columnNumber: 15
|
|
3120
|
-
}, this) : /* @__PURE__ */ jsxDEV(ColumnFields, {
|
|
2182
|
+
}) : /* @__PURE__ */ jsx(ColumnFields, {
|
|
3121
2183
|
ctx,
|
|
3122
2184
|
col: t.columns[index]
|
|
3123
|
-
}
|
|
3124
|
-
fileName: _jsxFileName,
|
|
3125
|
-
lineNumber: 1513,
|
|
3126
|
-
columnNumber: 61
|
|
3127
|
-
}, this)
|
|
2185
|
+
})
|
|
3128
2186
|
]
|
|
3129
|
-
}
|
|
3130
|
-
fileName: _jsxFileName,
|
|
3131
|
-
lineNumber: 1482,
|
|
3132
|
-
columnNumber: 5
|
|
3133
|
-
}, this);
|
|
2187
|
+
});
|
|
3134
2188
|
}
|
|
3135
2189
|
function RowFields({ ctx, row }) {
|
|
3136
2190
|
const { t, edit, readOnly, options } = ctx;
|
|
@@ -3142,36 +2196,24 @@ function RowFields({ ctx, row }) {
|
|
|
3142
2196
|
}
|
|
3143
2197
|
})));
|
|
3144
2198
|
const named = hasName(t, row);
|
|
3145
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3146
2200
|
className: "flex flex-col gap-4",
|
|
3147
|
-
children: [t.columns.map((col, ci) => /* @__PURE__ */
|
|
2201
|
+
children: [t.columns.map((col, ci) => /* @__PURE__ */ jsx(CellField, {
|
|
3148
2202
|
ctx,
|
|
3149
2203
|
row,
|
|
3150
2204
|
col,
|
|
3151
2205
|
ci,
|
|
3152
2206
|
needsName: ci === 0 && !named,
|
|
3153
2207
|
onWrite: (c) => write(col, c)
|
|
3154
|
-
}, col._key,
|
|
3155
|
-
fileName: _jsxFileName,
|
|
3156
|
-
lineNumber: 1526,
|
|
3157
|
-
columnNumber: 9
|
|
3158
|
-
}, this)), readOnly || !offered(options).highlight ? null : /* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2208
|
+
}, col._key)), readOnly || !offered(options).highlight ? null : /* @__PURE__ */ jsx(SwitchRow, {
|
|
3159
2209
|
label: "Highlight this row",
|
|
3160
2210
|
checked: !!row.highlight,
|
|
3161
2211
|
onChange: (v) => edit(mapRow(row._key, (x) => clean({
|
|
3162
2212
|
...x,
|
|
3163
2213
|
highlight: v
|
|
3164
2214
|
})))
|
|
3165
|
-
}
|
|
3166
|
-
|
|
3167
|
-
lineNumber: 1529,
|
|
3168
|
-
columnNumber: 9
|
|
3169
|
-
}, this)]
|
|
3170
|
-
}, void 0, true, {
|
|
3171
|
-
fileName: _jsxFileName,
|
|
3172
|
-
lineNumber: 1524,
|
|
3173
|
-
columnNumber: 5
|
|
3174
|
-
}, this);
|
|
2215
|
+
})]
|
|
2216
|
+
});
|
|
3175
2217
|
}
|
|
3176
2218
|
/**
|
|
3177
2219
|
* One cell as a field. Per-cell exceptions are quiet: a ⋯ by the label (shown on hover or focus) offers "Write words
|
|
@@ -3212,9 +2254,9 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3212
2254
|
};
|
|
3213
2255
|
const b = toBool(v);
|
|
3214
2256
|
let control;
|
|
3215
|
-
if (ty === "boolean") control = /* @__PURE__ */
|
|
2257
|
+
if (ty === "boolean") control = /* @__PURE__ */ jsxs("label", {
|
|
3216
2258
|
className: "flex h-8 items-center gap-2.5",
|
|
3217
|
-
children: [/* @__PURE__ */
|
|
2259
|
+
children: [/* @__PURE__ */ jsx(Switch, {
|
|
3218
2260
|
id,
|
|
3219
2261
|
size: "sm",
|
|
3220
2262
|
"aria-labelledby": `${id}-name`,
|
|
@@ -3222,27 +2264,15 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3222
2264
|
disabled: readOnly,
|
|
3223
2265
|
checked: b === true,
|
|
3224
2266
|
onCheckedChange: (x) => onWrite(withValue(cell, x))
|
|
3225
|
-
},
|
|
3226
|
-
fileName: _jsxFileName,
|
|
3227
|
-
lineNumber: 1572,
|
|
3228
|
-
columnNumber: 9
|
|
3229
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
2267
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
3230
2268
|
id: `${id}-says`,
|
|
3231
2269
|
className: cn("text-kit-sm", b == null ? "text-kit-fg-4" : "text-kit-fg-2"),
|
|
3232
2270
|
children: b == null ? "Not set" : b ? boolLabels(col).yes : boolLabels(col).no
|
|
3233
|
-
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
columnNumber: 9
|
|
3237
|
-
}, this)]
|
|
3238
|
-
}, void 0, true, {
|
|
3239
|
-
fileName: _jsxFileName,
|
|
3240
|
-
lineNumber: 1571,
|
|
3241
|
-
columnNumber: 7
|
|
3242
|
-
}, this);
|
|
3243
|
-
else if (ty === "reference") control = /* @__PURE__ */ jsxDEV("div", {
|
|
2271
|
+
})]
|
|
2272
|
+
});
|
|
2273
|
+
else if (ty === "reference") control = /* @__PURE__ */ jsx("div", {
|
|
3244
2274
|
className: "rounded-kit-md border border-kit-field-border bg-kit-field-bg",
|
|
3245
|
-
children: /* @__PURE__ */
|
|
2275
|
+
children: /* @__PURE__ */ jsx(RefCell, {
|
|
3246
2276
|
ctx,
|
|
3247
2277
|
cell,
|
|
3248
2278
|
col,
|
|
@@ -3250,22 +2280,14 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3250
2280
|
name,
|
|
3251
2281
|
onWrite,
|
|
3252
2282
|
onMove: noop
|
|
3253
|
-
}
|
|
3254
|
-
|
|
3255
|
-
lineNumber: 1579,
|
|
3256
|
-
columnNumber: 9
|
|
3257
|
-
}, this)
|
|
3258
|
-
}, void 0, false, {
|
|
3259
|
-
fileName: _jsxFileName,
|
|
3260
|
-
lineNumber: 1578,
|
|
3261
|
-
columnNumber: 7
|
|
3262
|
-
}, this);
|
|
2283
|
+
})
|
|
2284
|
+
});
|
|
3263
2285
|
else if (ty === "link") {
|
|
3264
2286
|
const l = isObjLike(v) && !("ref" in v) ? v : {
|
|
3265
2287
|
label: typeof v === "string" ? v : "",
|
|
3266
2288
|
href: ""
|
|
3267
2289
|
};
|
|
3268
|
-
control = /* @__PURE__ */
|
|
2290
|
+
control = /* @__PURE__ */ jsxs(FieldUnit, { children: [/* @__PURE__ */ jsx(FieldUnitRow, { children: /* @__PURE__ */ jsx("input", {
|
|
3269
2291
|
id,
|
|
3270
2292
|
className: "h-9 w-full min-w-0 bg-transparent px-2 text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-4",
|
|
3271
2293
|
readOnly,
|
|
@@ -3276,15 +2298,7 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3276
2298
|
...l,
|
|
3277
2299
|
label: e.target.value
|
|
3278
2300
|
}))
|
|
3279
|
-
}, `l${l.label}
|
|
3280
|
-
fileName: _jsxFileName,
|
|
3281
|
-
lineNumber: 1589,
|
|
3282
|
-
columnNumber: 11
|
|
3283
|
-
}, this) }, void 0, false, {
|
|
3284
|
-
fileName: _jsxFileName,
|
|
3285
|
-
lineNumber: 1588,
|
|
3286
|
-
columnNumber: 9
|
|
3287
|
-
}, this), /* @__PURE__ */ jsxDEV(FieldUnitRow, { children: /* @__PURE__ */ jsxDEV(LinkField, {
|
|
2301
|
+
}, `l${l.label}`) }), /* @__PURE__ */ jsx(FieldUnitRow, { children: /* @__PURE__ */ jsx(LinkField, {
|
|
3288
2302
|
"aria-label": `${name} link`,
|
|
3289
2303
|
value: tableLinkValue(l),
|
|
3290
2304
|
readOnly,
|
|
@@ -3297,20 +2311,8 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3297
2311
|
href: ""
|
|
3298
2312
|
}));
|
|
3299
2313
|
}
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
lineNumber: 1592,
|
|
3303
|
-
columnNumber: 11
|
|
3304
|
-
}, this) }, void 0, false, {
|
|
3305
|
-
fileName: _jsxFileName,
|
|
3306
|
-
lineNumber: 1591,
|
|
3307
|
-
columnNumber: 9
|
|
3308
|
-
}, this)] }, void 0, true, {
|
|
3309
|
-
fileName: _jsxFileName,
|
|
3310
|
-
lineNumber: 1587,
|
|
3311
|
-
columnNumber: 7
|
|
3312
|
-
}, this);
|
|
3313
|
-
} else control = /* @__PURE__ */ jsxDEV(FormText, {
|
|
2314
|
+
}) })] });
|
|
2315
|
+
} else control = /* @__PURE__ */ jsx(FormText, {
|
|
3314
2316
|
id,
|
|
3315
2317
|
readOnly,
|
|
3316
2318
|
autoFocus: needsName,
|
|
@@ -3318,129 +2320,61 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3318
2320
|
suffix: ty === "number" ? col.unit : ty === "money" ? col.currency ?? "USD" : ty === "rating" ? `/ ${col.max ?? 5}` : void 0,
|
|
3319
2321
|
numeric: NUMERIC.includes(ty),
|
|
3320
2322
|
onCommit: (raw) => onWrite(typedCell(cell, col, row, raw))
|
|
3321
|
-
}
|
|
3322
|
-
|
|
3323
|
-
lineNumber: 1609,
|
|
3324
|
-
columnNumber: 7
|
|
3325
|
-
}, this);
|
|
3326
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
2323
|
+
});
|
|
2324
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3327
2325
|
className: "group/cell flex min-w-0 flex-col gap-1.5",
|
|
3328
2326
|
children: [
|
|
3329
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3330
2328
|
className: "flex min-h-5 min-w-0 items-center gap-1.5",
|
|
3331
2329
|
children: [
|
|
3332
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ jsx("label", {
|
|
3333
2331
|
id: `${id}-name`,
|
|
3334
2332
|
htmlFor: id,
|
|
3335
2333
|
className: "truncate text-kit-sm font-medium text-kit-fg-2 transition-colors group-focus-within/cell:text-kit-fg",
|
|
3336
2334
|
children: name
|
|
3337
|
-
},
|
|
3338
|
-
|
|
3339
|
-
lineNumber: 1623,
|
|
3340
|
-
columnNumber: 9
|
|
3341
|
-
}, this),
|
|
3342
|
-
needsName ? /* @__PURE__ */ jsxDEV("span", {
|
|
2335
|
+
}),
|
|
2336
|
+
needsName ? /* @__PURE__ */ jsx("span", {
|
|
3343
2337
|
className: "shrink-0 text-kit-xs text-kit-warning-fg",
|
|
3344
2338
|
children: "Needs a name"
|
|
3345
|
-
}
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
}, this) : null,
|
|
3350
|
-
/* @__PURE__ */ jsxDEV("span", { className: "flex-1" }, void 0, false, {
|
|
3351
|
-
fileName: _jsxFileName,
|
|
3352
|
-
lineNumber: 1625,
|
|
3353
|
-
columnNumber: 9
|
|
3354
|
-
}, this),
|
|
3355
|
-
canWords || canNote || !readOnly && !isEmptyCell(v) ? /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
|
|
3356
|
-
render: /* @__PURE__ */ jsxDEV(IconButton, {
|
|
2339
|
+
}) : null,
|
|
2340
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
2341
|
+
canWords || canNote || !readOnly && !isEmptyCell(v) ? /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
2342
|
+
render: /* @__PURE__ */ jsx(IconButton, {
|
|
3357
2343
|
size: "xs",
|
|
3358
2344
|
label: `Options for ${name}`,
|
|
3359
2345
|
className: "-my-1 opacity-0 focus-visible:opacity-100 group-hover/cell:opacity-100 group-focus-within/cell:opacity-100 data-[popup-open]:opacity-100 [@media(pointer:coarse)]:opacity-100"
|
|
3360
|
-
},
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
columnNumber: 17
|
|
3364
|
-
}, this),
|
|
3365
|
-
children: /* @__PURE__ */ jsxDEV(IconDots, { stroke: 1.5 }, void 0, false, {
|
|
3366
|
-
fileName: _jsxFileName,
|
|
3367
|
-
lineNumber: 1637,
|
|
3368
|
-
columnNumber: 15
|
|
3369
|
-
}, this)
|
|
3370
|
-
}, void 0, false, {
|
|
3371
|
-
fileName: _jsxFileName,
|
|
3372
|
-
lineNumber: 1628,
|
|
3373
|
-
columnNumber: 13
|
|
3374
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
2346
|
+
}),
|
|
2347
|
+
children: /* @__PURE__ */ jsx(IconDots, { stroke: 1.5 })
|
|
2348
|
+
}), /* @__PURE__ */ jsxs(MenuContent, {
|
|
3375
2349
|
align: "end",
|
|
3376
2350
|
className: "min-w-52",
|
|
3377
2351
|
children: [
|
|
3378
|
-
canWords ? /* @__PURE__ */
|
|
2352
|
+
canWords ? /* @__PURE__ */ jsx(MenuItem, {
|
|
3379
2353
|
onClick: () => setWords(!asWords),
|
|
3380
2354
|
children: asWords ? `Use ${TYPE_UI[colType].label} like the column` : "Write words instead"
|
|
3381
|
-
}
|
|
3382
|
-
|
|
3383
|
-
lineNumber: 1640,
|
|
3384
|
-
columnNumber: 27
|
|
3385
|
-
}, this) : null,
|
|
3386
|
-
canNote ? note ? /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
2355
|
+
}) : null,
|
|
2356
|
+
canNote ? note ? /* @__PURE__ */ jsx(MenuItem, {
|
|
3387
2357
|
onClick: () => set(unlinkNote(t, row._key, col._key)),
|
|
3388
2358
|
children: "Remove footnote"
|
|
3389
|
-
}
|
|
3390
|
-
fileName: _jsxFileName,
|
|
3391
|
-
lineNumber: 1641,
|
|
3392
|
-
columnNumber: 33
|
|
3393
|
-
}, this) : /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
2359
|
+
}) : /* @__PURE__ */ jsx(MenuItem, {
|
|
3394
2360
|
onClick: addNote,
|
|
3395
2361
|
children: "Add a footnote"
|
|
3396
|
-
}
|
|
3397
|
-
|
|
3398
|
-
lineNumber: 1641,
|
|
3399
|
-
columnNumber: 127
|
|
3400
|
-
}, this) : null,
|
|
3401
|
-
!isEmptyCell(v) ? /* @__PURE__ */ jsxDEV(Fragment, { children: [canWords || canNote ? /* @__PURE__ */ jsxDEV(MenuSeparator, {}, void 0, false, {
|
|
3402
|
-
fileName: _jsxFileName,
|
|
3403
|
-
lineNumber: 1644,
|
|
3404
|
-
columnNumber: 42
|
|
3405
|
-
}, this) : null, /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
2362
|
+
}) : null,
|
|
2363
|
+
!isEmptyCell(v) ? /* @__PURE__ */ jsxs(Fragment, { children: [canWords || canNote ? /* @__PURE__ */ jsx(MenuSeparator, {}) : null, /* @__PURE__ */ jsx(MenuItem, {
|
|
3406
2364
|
onClick: () => onWrite(withValue(cell, null)),
|
|
3407
2365
|
children: "Clear"
|
|
3408
|
-
}
|
|
3409
|
-
fileName: _jsxFileName,
|
|
3410
|
-
lineNumber: 1645,
|
|
3411
|
-
columnNumber: 19
|
|
3412
|
-
}, this)] }, void 0, true, {
|
|
3413
|
-
fileName: _jsxFileName,
|
|
3414
|
-
lineNumber: 1643,
|
|
3415
|
-
columnNumber: 17
|
|
3416
|
-
}, this) : null
|
|
2366
|
+
})] }) : null
|
|
3417
2367
|
]
|
|
3418
|
-
}
|
|
3419
|
-
fileName: _jsxFileName,
|
|
3420
|
-
lineNumber: 1639,
|
|
3421
|
-
columnNumber: 13
|
|
3422
|
-
}, this)] }, void 0, true, {
|
|
3423
|
-
fileName: _jsxFileName,
|
|
3424
|
-
lineNumber: 1627,
|
|
3425
|
-
columnNumber: 11
|
|
3426
|
-
}, this) : null
|
|
2368
|
+
})] }) : null
|
|
3427
2369
|
]
|
|
3428
|
-
},
|
|
3429
|
-
fileName: _jsxFileName,
|
|
3430
|
-
lineNumber: 1622,
|
|
3431
|
-
columnNumber: 7
|
|
3432
|
-
}, this),
|
|
2370
|
+
}),
|
|
3433
2371
|
control,
|
|
3434
|
-
fn ? /* @__PURE__ */
|
|
2372
|
+
fn ? /* @__PURE__ */ jsxs("div", {
|
|
3435
2373
|
className: "flex items-center gap-2",
|
|
3436
|
-
children: [/* @__PURE__ */
|
|
2374
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
3437
2375
|
className: "shrink-0 text-kit-xs text-kit-fg-3",
|
|
3438
2376
|
children: ["Footnote ", fi + 1]
|
|
3439
|
-
},
|
|
3440
|
-
fileName: _jsxFileName,
|
|
3441
|
-
lineNumber: 1655,
|
|
3442
|
-
columnNumber: 11
|
|
3443
|
-
}, this), /* @__PURE__ */ jsxDEV(Input, {
|
|
2377
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
3444
2378
|
size: "sm",
|
|
3445
2379
|
"data-footnote": fn._key,
|
|
3446
2380
|
value: fn.text,
|
|
@@ -3455,42 +2389,22 @@ function CellField({ ctx, row, col, ci, needsName, onWrite }) {
|
|
|
3455
2389
|
text: e.target.value
|
|
3456
2390
|
} : x)
|
|
3457
2391
|
})
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
lineNumber: 1656,
|
|
3461
|
-
columnNumber: 11
|
|
3462
|
-
}, this)]
|
|
3463
|
-
}, void 0, true, {
|
|
3464
|
-
fileName: _jsxFileName,
|
|
3465
|
-
lineNumber: 1654,
|
|
3466
|
-
columnNumber: 9
|
|
3467
|
-
}, this) : null
|
|
2392
|
+
})]
|
|
2393
|
+
}) : null
|
|
3468
2394
|
]
|
|
3469
|
-
}
|
|
3470
|
-
fileName: _jsxFileName,
|
|
3471
|
-
lineNumber: 1621,
|
|
3472
|
-
columnNumber: 5
|
|
3473
|
-
}, this);
|
|
2395
|
+
});
|
|
3474
2396
|
}
|
|
3475
2397
|
function SwitchRow({ label, checked, onChange, disabled }) {
|
|
3476
|
-
return /* @__PURE__ */
|
|
2398
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
3477
2399
|
className: "flex min-h-8 items-center justify-between gap-2 text-kit-sm text-kit-fg-2",
|
|
3478
|
-
children: [label, /* @__PURE__ */
|
|
2400
|
+
children: [label, /* @__PURE__ */ jsx(Switch, {
|
|
3479
2401
|
size: "sm",
|
|
3480
2402
|
checked,
|
|
3481
2403
|
disabled,
|
|
3482
2404
|
onCheckedChange: onChange,
|
|
3483
2405
|
"aria-label": label
|
|
3484
|
-
}
|
|
3485
|
-
|
|
3486
|
-
lineNumber: 1677,
|
|
3487
|
-
columnNumber: 7
|
|
3488
|
-
}, this)]
|
|
3489
|
-
}, void 0, true, {
|
|
3490
|
-
fileName: _jsxFileName,
|
|
3491
|
-
lineNumber: 1675,
|
|
3492
|
-
columnNumber: 5
|
|
3493
|
-
}, this);
|
|
2406
|
+
})]
|
|
2407
|
+
});
|
|
3494
2408
|
}
|
|
3495
2409
|
function ColumnFields({ ctx, col }) {
|
|
3496
2410
|
const { t, set, lock, types, readOnly } = ctx;
|
|
@@ -3499,22 +2413,18 @@ function ColumnFields({ ctx, col }) {
|
|
|
3499
2413
|
...t,
|
|
3500
2414
|
columns: t.columns.map((c) => c._key === col._key ? withPatch(c, p) : c)
|
|
3501
2415
|
});
|
|
3502
|
-
return /* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3503
2417
|
className: "flex flex-col gap-4",
|
|
3504
2418
|
children: [
|
|
3505
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3506
2420
|
className: "flex flex-col gap-1.5",
|
|
3507
2421
|
children: [
|
|
3508
|
-
/* @__PURE__ */
|
|
2422
|
+
/* @__PURE__ */ jsx("label", {
|
|
3509
2423
|
htmlFor: id,
|
|
3510
2424
|
className: "text-kit-sm font-medium text-kit-fg-2",
|
|
3511
2425
|
children: "Name"
|
|
3512
|
-
},
|
|
3513
|
-
|
|
3514
|
-
lineNumber: 1690,
|
|
3515
|
-
columnNumber: 9
|
|
3516
|
-
}, this),
|
|
3517
|
-
/* @__PURE__ */ jsxDEV(Input, {
|
|
2426
|
+
}),
|
|
2427
|
+
/* @__PURE__ */ jsx(Input, {
|
|
3518
2428
|
id,
|
|
3519
2429
|
size: "sm",
|
|
3520
2430
|
autoFocus: !col.label && !lock,
|
|
@@ -3523,146 +2433,66 @@ function ColumnFields({ ctx, col }) {
|
|
|
3523
2433
|
value: col.label,
|
|
3524
2434
|
placeholder: "Column name",
|
|
3525
2435
|
onChange: (e) => patch({ label: e.target.value })
|
|
3526
|
-
},
|
|
3527
|
-
|
|
3528
|
-
lineNumber: 1691,
|
|
3529
|
-
columnNumber: 9
|
|
3530
|
-
}, this),
|
|
3531
|
-
lock && !readOnly ? /* @__PURE__ */ jsxDEV("span", {
|
|
2436
|
+
}),
|
|
2437
|
+
lock && !readOnly ? /* @__PURE__ */ jsx("span", {
|
|
3532
2438
|
className: "text-kit-2xs leading-4 text-kit-fg-3",
|
|
3533
2439
|
children: "This table's columns are set by its developer."
|
|
3534
|
-
}
|
|
3535
|
-
fileName: _jsxFileName,
|
|
3536
|
-
lineNumber: 1692,
|
|
3537
|
-
columnNumber: 30
|
|
3538
|
-
}, this) : null
|
|
2440
|
+
}) : null
|
|
3539
2441
|
]
|
|
3540
|
-
},
|
|
3541
|
-
|
|
3542
|
-
lineNumber: 1689,
|
|
3543
|
-
columnNumber: 7
|
|
3544
|
-
}, this),
|
|
3545
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
2442
|
+
}),
|
|
2443
|
+
/* @__PURE__ */ jsxs("div", {
|
|
3546
2444
|
className: "flex flex-col gap-1.5",
|
|
3547
|
-
children: [/* @__PURE__ */
|
|
2445
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3548
2446
|
className: "text-kit-sm font-medium text-kit-fg-2",
|
|
3549
2447
|
children: "Type"
|
|
3550
|
-
},
|
|
3551
|
-
fileName: _jsxFileName,
|
|
3552
|
-
lineNumber: 1695,
|
|
3553
|
-
columnNumber: 9
|
|
3554
|
-
}, this), lock ? /* @__PURE__ */ jsxDEV("span", {
|
|
2448
|
+
}), lock ? /* @__PURE__ */ jsxs("span", {
|
|
3555
2449
|
className: "flex h-8 items-center gap-2 text-kit-sm text-kit-fg-2",
|
|
3556
|
-
children: [/* @__PURE__ */
|
|
2450
|
+
children: [/* @__PURE__ */ jsx(TypeIcon, {
|
|
3557
2451
|
type: col.type,
|
|
3558
2452
|
className: "text-kit-fg-2"
|
|
3559
|
-
},
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
columnNumber: 83
|
|
3563
|
-
}, this), TYPE_UI[col.type].label]
|
|
3564
|
-
}, void 0, true, {
|
|
3565
|
-
fileName: _jsxFileName,
|
|
3566
|
-
lineNumber: 1697,
|
|
3567
|
-
columnNumber: 11
|
|
3568
|
-
}, this) : /* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
|
|
3569
|
-
render: /* @__PURE__ */ jsxDEV(Button, {
|
|
2453
|
+
}), TYPE_UI[col.type].label]
|
|
2454
|
+
}) : /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
2455
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
3570
2456
|
size: "sm",
|
|
3571
2457
|
variant: "secondary",
|
|
3572
2458
|
className: "justify-between",
|
|
3573
|
-
leftIcon: /* @__PURE__ */
|
|
2459
|
+
leftIcon: /* @__PURE__ */ jsx(TypeIcon, {
|
|
3574
2460
|
type: col.type,
|
|
3575
2461
|
className: "text-kit-fg-2"
|
|
3576
|
-
},
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
}, this),
|
|
3581
|
-
rightIcon: /* @__PURE__ */ jsxDEV(IconChevronDown, { stroke: 1.5 }, void 0, false, {
|
|
3582
|
-
fileName: _jsxFileName,
|
|
3583
|
-
lineNumber: 1700,
|
|
3584
|
-
columnNumber: 177
|
|
3585
|
-
}, this)
|
|
3586
|
-
}, void 0, false, {
|
|
3587
|
-
fileName: _jsxFileName,
|
|
3588
|
-
lineNumber: 1700,
|
|
3589
|
-
columnNumber: 34
|
|
3590
|
-
}, this),
|
|
3591
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
2462
|
+
}),
|
|
2463
|
+
rightIcon: /* @__PURE__ */ jsx(IconChevronDown, { stroke: 1.5 })
|
|
2464
|
+
}),
|
|
2465
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
3592
2466
|
className: "flex-1 text-left",
|
|
3593
2467
|
children: TYPE_UI[col.type].label
|
|
3594
|
-
}
|
|
3595
|
-
|
|
3596
|
-
lineNumber: 1701,
|
|
3597
|
-
columnNumber: 15
|
|
3598
|
-
}, this)
|
|
3599
|
-
}, void 0, false, {
|
|
3600
|
-
fileName: _jsxFileName,
|
|
3601
|
-
lineNumber: 1700,
|
|
3602
|
-
columnNumber: 13
|
|
3603
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
2468
|
+
})
|
|
2469
|
+
}), /* @__PURE__ */ jsx(MenuContent, {
|
|
3604
2470
|
align: "start",
|
|
3605
2471
|
className: "min-w-52",
|
|
3606
|
-
children: /* @__PURE__ */
|
|
2472
|
+
children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
3607
2473
|
value: col.type,
|
|
3608
2474
|
onValueChange: (v) => ctx.edit((x) => retype(x, col._key, v, ctx.resolveRef)),
|
|
3609
|
-
children: (types.includes(col.type) ? types : [...types, col.type]).map((ty) => /* @__PURE__ */
|
|
2475
|
+
children: (types.includes(col.type) ? types : [...types, col.type]).map((ty) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
3610
2476
|
value: ty,
|
|
3611
|
-
children: /* @__PURE__ */
|
|
2477
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
3612
2478
|
className: "flex items-center gap-2",
|
|
3613
|
-
children: [/* @__PURE__ */
|
|
2479
|
+
children: [/* @__PURE__ */ jsx(TypeIcon, {
|
|
3614
2480
|
type: ty,
|
|
3615
2481
|
className: "text-kit-fg-2"
|
|
3616
|
-
},
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
lineNumber: 1707,
|
|
3624
|
-
columnNumber: 21
|
|
3625
|
-
}, this)
|
|
3626
|
-
}, ty, false, {
|
|
3627
|
-
fileName: _jsxFileName,
|
|
3628
|
-
lineNumber: 1706,
|
|
3629
|
-
columnNumber: 19
|
|
3630
|
-
}, this))
|
|
3631
|
-
}, void 0, false, {
|
|
3632
|
-
fileName: _jsxFileName,
|
|
3633
|
-
lineNumber: 1704,
|
|
3634
|
-
columnNumber: 15
|
|
3635
|
-
}, this)
|
|
3636
|
-
}, void 0, false, {
|
|
3637
|
-
fileName: _jsxFileName,
|
|
3638
|
-
lineNumber: 1703,
|
|
3639
|
-
columnNumber: 13
|
|
3640
|
-
}, this)] }, void 0, true, {
|
|
3641
|
-
fileName: _jsxFileName,
|
|
3642
|
-
lineNumber: 1699,
|
|
3643
|
-
columnNumber: 11
|
|
3644
|
-
}, this)]
|
|
3645
|
-
}, void 0, true, {
|
|
3646
|
-
fileName: _jsxFileName,
|
|
3647
|
-
lineNumber: 1694,
|
|
3648
|
-
columnNumber: 7
|
|
3649
|
-
}, this),
|
|
3650
|
-
/* @__PURE__ */ jsxDEV(ColumnDetails, {
|
|
2482
|
+
}), TYPE_UI[ty].label]
|
|
2483
|
+
})
|
|
2484
|
+
}, ty))
|
|
2485
|
+
})
|
|
2486
|
+
})] })]
|
|
2487
|
+
}),
|
|
2488
|
+
/* @__PURE__ */ jsx(ColumnDetails, {
|
|
3651
2489
|
col,
|
|
3652
2490
|
onPatch: patch,
|
|
3653
2491
|
compact: false,
|
|
3654
2492
|
readOnly: lock
|
|
3655
|
-
}
|
|
3656
|
-
fileName: _jsxFileName,
|
|
3657
|
-
lineNumber: 1715,
|
|
3658
|
-
columnNumber: 7
|
|
3659
|
-
}, this)
|
|
2493
|
+
})
|
|
3660
2494
|
]
|
|
3661
|
-
}
|
|
3662
|
-
fileName: _jsxFileName,
|
|
3663
|
-
lineNumber: 1688,
|
|
3664
|
-
columnNumber: 5
|
|
3665
|
-
}, this);
|
|
2495
|
+
});
|
|
3666
2496
|
}
|
|
3667
2497
|
function FormText({ id, value, onCommit, suffix, numeric, readOnly, autoFocus }) {
|
|
3668
2498
|
const [draft, setDraft] = React.useState(value);
|
|
@@ -3671,9 +2501,9 @@ function FormText({ id, value, onCommit, suffix, numeric, readOnly, autoFocus })
|
|
|
3671
2501
|
setSeen(value);
|
|
3672
2502
|
setDraft(value);
|
|
3673
2503
|
}
|
|
3674
|
-
return /* @__PURE__ */
|
|
2504
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3675
2505
|
className: "relative",
|
|
3676
|
-
children: [/* @__PURE__ */
|
|
2506
|
+
children: [/* @__PURE__ */ jsx(Textarea, {
|
|
3677
2507
|
id,
|
|
3678
2508
|
rows: 1,
|
|
3679
2509
|
value: draft,
|
|
@@ -3684,23 +2514,11 @@ function FormText({ id, value, onCommit, suffix, numeric, readOnly, autoFocus })
|
|
|
3684
2514
|
onChange: (e) => setDraft(e.target.value),
|
|
3685
2515
|
onBlur: () => draft !== value && onCommit(draft),
|
|
3686
2516
|
className: cn("min-h-8 resize-none py-1.5", suffix && "pr-12")
|
|
3687
|
-
},
|
|
3688
|
-
fileName: _jsxFileName,
|
|
3689
|
-
lineNumber: 1729,
|
|
3690
|
-
columnNumber: 7
|
|
3691
|
-
}, this), suffix ? /* @__PURE__ */ jsxDEV("span", {
|
|
2517
|
+
}), suffix ? /* @__PURE__ */ jsx("span", {
|
|
3692
2518
|
className: "pointer-events-none absolute right-2.5 top-1.5 text-kit-xs text-kit-fg-3",
|
|
3693
2519
|
children: suffix
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
|
-
lineNumber: 1741,
|
|
3697
|
-
columnNumber: 17
|
|
3698
|
-
}, this) : null]
|
|
3699
|
-
}, void 0, true, {
|
|
3700
|
-
fileName: _jsxFileName,
|
|
3701
|
-
lineNumber: 1728,
|
|
3702
|
-
columnNumber: 5
|
|
3703
|
-
}, this);
|
|
2520
|
+
}) : null]
|
|
2521
|
+
});
|
|
3704
2522
|
}
|
|
3705
2523
|
var SEARCH = [
|
|
3706
2524
|
{
|
|
@@ -3760,78 +2578,50 @@ function TableSettings({ ctx }) {
|
|
|
3760
2578
|
can.highlight && highlighted ? `${highlighted.label || "A column"} highlighted` : "",
|
|
3761
2579
|
can.totals && totals ? "Totals row" : ""
|
|
3762
2580
|
].filter(Boolean).join(" · ");
|
|
3763
|
-
const pick = (label, node) => /* @__PURE__ */
|
|
2581
|
+
const pick = (label, node) => /* @__PURE__ */ jsxs("div", {
|
|
3764
2582
|
className: "flex flex-col gap-1.5",
|
|
3765
|
-
children: [/* @__PURE__ */
|
|
2583
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3766
2584
|
className: "text-kit-sm font-medium text-kit-fg-2",
|
|
3767
2585
|
children: label
|
|
3768
|
-
},
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
columnNumber: 7
|
|
3772
|
-
}, this), node]
|
|
3773
|
-
}, void 0, true, {
|
|
3774
|
-
fileName: _jsxFileName,
|
|
3775
|
-
lineNumber: 1781,
|
|
3776
|
-
columnNumber: 5
|
|
3777
|
-
}, this);
|
|
3778
|
-
return /* @__PURE__ */ jsxDEV(FieldSection, {
|
|
2586
|
+
}), node]
|
|
2587
|
+
});
|
|
2588
|
+
return /* @__PURE__ */ jsxs(FieldSection, {
|
|
3779
2589
|
title: "Table settings",
|
|
3780
2590
|
defaultOpen: false,
|
|
3781
2591
|
summary,
|
|
3782
2592
|
className: "before:hidden",
|
|
3783
2593
|
children: [
|
|
3784
|
-
can.headers ? /* @__PURE__ */
|
|
2594
|
+
can.headers ? /* @__PURE__ */ jsxs("div", {
|
|
3785
2595
|
className: "flex flex-col",
|
|
3786
2596
|
children: [
|
|
3787
|
-
/* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
3788
2598
|
label: "Show column names",
|
|
3789
2599
|
checked: t.headerRow,
|
|
3790
2600
|
onChange: (v) => set({
|
|
3791
2601
|
...t,
|
|
3792
2602
|
headerRow: v
|
|
3793
2603
|
})
|
|
3794
|
-
},
|
|
3795
|
-
|
|
3796
|
-
lineNumber: 1791,
|
|
3797
|
-
columnNumber: 11
|
|
3798
|
-
}, this),
|
|
3799
|
-
/* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2604
|
+
}),
|
|
2605
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
3800
2606
|
label: "First column names each row",
|
|
3801
2607
|
checked: t.headerColumn,
|
|
3802
2608
|
onChange: (v) => set({
|
|
3803
2609
|
...t,
|
|
3804
2610
|
headerColumn: v
|
|
3805
2611
|
})
|
|
3806
|
-
},
|
|
3807
|
-
|
|
3808
|
-
lineNumber: 1792,
|
|
3809
|
-
columnNumber: 11
|
|
3810
|
-
}, this),
|
|
3811
|
-
can.totals ? /* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2612
|
+
}),
|
|
2613
|
+
can.totals ? /* @__PURE__ */ jsx(SwitchRow, {
|
|
3812
2614
|
label: "Totals row",
|
|
3813
2615
|
checked: totals,
|
|
3814
2616
|
onChange: (v) => set(setTotals(t, v))
|
|
3815
|
-
}
|
|
3816
|
-
fileName: _jsxFileName,
|
|
3817
|
-
lineNumber: 1793,
|
|
3818
|
-
columnNumber: 25
|
|
3819
|
-
}, this) : null
|
|
2617
|
+
}) : null
|
|
3820
2618
|
]
|
|
3821
|
-
}
|
|
3822
|
-
fileName: _jsxFileName,
|
|
3823
|
-
lineNumber: 1790,
|
|
3824
|
-
columnNumber: 9
|
|
3825
|
-
}, this) : can.totals ? /* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2619
|
+
}) : can.totals ? /* @__PURE__ */ jsx(SwitchRow, {
|
|
3826
2620
|
label: "Totals row",
|
|
3827
2621
|
checked: totals,
|
|
3828
2622
|
onChange: (v) => set(setTotals(t, v))
|
|
3829
|
-
}
|
|
3830
|
-
|
|
3831
|
-
lineNumber: 1796,
|
|
3832
|
-
columnNumber: 9
|
|
3833
|
-
}, this) : null,
|
|
3834
|
-
can.highlight ? pick("Highlight column", /* @__PURE__ */ jsxDEV(Select, {
|
|
2623
|
+
}) : null,
|
|
2624
|
+
can.highlight ? pick("Highlight column", /* @__PURE__ */ jsx(Select, {
|
|
3835
2625
|
"aria-label": "Highlight column",
|
|
3836
2626
|
value: highlighted?._key ?? NO_COLUMN,
|
|
3837
2627
|
onValueChange: (k) => set({
|
|
@@ -3845,52 +2635,32 @@ function TableSettings({ ctx }) {
|
|
|
3845
2635
|
value: c._key,
|
|
3846
2636
|
label: c.label || "Untitled column"
|
|
3847
2637
|
}))]
|
|
3848
|
-
}
|
|
3849
|
-
|
|
3850
|
-
lineNumber: 1801,
|
|
3851
|
-
columnNumber: 13
|
|
3852
|
-
}, this)) : null,
|
|
3853
|
-
can.phones.length ? pick("On phones", /* @__PURE__ */ jsxDEV(ChoiceSwitch, {
|
|
2638
|
+
})) : null,
|
|
2639
|
+
can.phones.length ? pick("On phones", /* @__PURE__ */ jsx(ChoiceSwitch, {
|
|
3854
2640
|
"aria-label": "On phones",
|
|
3855
2641
|
value: phones,
|
|
3856
2642
|
onChange: (responsive) => design({ responsive }),
|
|
3857
2643
|
items: can.phones
|
|
3858
|
-
}
|
|
3859
|
-
|
|
3860
|
-
lineNumber: 1809,
|
|
3861
|
-
columnNumber: 46
|
|
3862
|
-
}, this)) : null,
|
|
3863
|
-
can.sort || can.search ? /* @__PURE__ */ jsxDEV("div", {
|
|
2644
|
+
})) : null,
|
|
2645
|
+
can.sort || can.search ? /* @__PURE__ */ jsxs("div", {
|
|
3864
2646
|
className: "flex flex-col",
|
|
3865
|
-
children: [can.sort ? /* @__PURE__ */
|
|
2647
|
+
children: [can.sort ? /* @__PURE__ */ jsx(SwitchRow, {
|
|
3866
2648
|
label: "Visitors can sort columns",
|
|
3867
2649
|
checked: sortable,
|
|
3868
2650
|
onChange: (v) => set({
|
|
3869
2651
|
...t,
|
|
3870
2652
|
columns: t.columns.map((c, i) => withPatch(c, { sortable: v && !(t.headerColumn && i === 0) ? true : void 0 }))
|
|
3871
2653
|
})
|
|
3872
|
-
}
|
|
3873
|
-
fileName: _jsxFileName,
|
|
3874
|
-
lineNumber: 1813,
|
|
3875
|
-
columnNumber: 13
|
|
3876
|
-
}, this) : null, can.search ? /* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2654
|
+
}) : null, can.search ? /* @__PURE__ */ jsx(SwitchRow, {
|
|
3877
2655
|
label: "Visitors can search rows",
|
|
3878
2656
|
checked: !!t.filterable,
|
|
3879
2657
|
onChange: (v) => set(dropUndefined({
|
|
3880
2658
|
...t,
|
|
3881
2659
|
filterable: v || void 0
|
|
3882
2660
|
}))
|
|
3883
|
-
}
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
columnNumber: 25
|
|
3887
|
-
}, this) : null]
|
|
3888
|
-
}, void 0, true, {
|
|
3889
|
-
fileName: _jsxFileName,
|
|
3890
|
-
lineNumber: 1811,
|
|
3891
|
-
columnNumber: 9
|
|
3892
|
-
}, this) : null,
|
|
3893
|
-
showJson ? /* @__PURE__ */ jsxDEV(Fragment, { children: [pick("Help search engines read this as", /* @__PURE__ */ jsxDEV(ChoiceSwitch, {
|
|
2661
|
+
}) : null]
|
|
2662
|
+
}) : null,
|
|
2663
|
+
showJson ? /* @__PURE__ */ jsxs(Fragment, { children: [pick("Help search engines read this as", /* @__PURE__ */ jsx(ChoiceSwitch, {
|
|
3894
2664
|
"aria-label": "Help search engines read this as",
|
|
3895
2665
|
value: t.jsonLd?.type ?? "none",
|
|
3896
2666
|
onChange: (type) => set(dropUndefined({
|
|
@@ -3902,11 +2672,7 @@ function TableSettings({ ctx }) {
|
|
|
3902
2672
|
}
|
|
3903
2673
|
})),
|
|
3904
2674
|
items: jsonOffered
|
|
3905
|
-
},
|
|
3906
|
-
fileName: _jsxFileName,
|
|
3907
|
-
lineNumber: 1822,
|
|
3908
|
-
columnNumber: 13
|
|
3909
|
-
}, this)), t.jsonLd?.type === "ItemList" && developer ? pick("The things compared are the", /* @__PURE__ */ jsxDEV(ChoiceSwitch, {
|
|
2675
|
+
})), t.jsonLd?.type === "ItemList" && developer ? pick("The things compared are the", /* @__PURE__ */ jsx(ChoiceSwitch, {
|
|
3910
2676
|
"aria-label": "The things compared are the",
|
|
3911
2677
|
value: t.jsonLd.axis ?? "rows",
|
|
3912
2678
|
onChange: (axis) => set({
|
|
@@ -3923,66 +2689,34 @@ function TableSettings({ ctx }) {
|
|
|
3923
2689
|
value: "columns",
|
|
3924
2690
|
label: "Columns"
|
|
3925
2691
|
}]
|
|
3926
|
-
}
|
|
3927
|
-
|
|
3928
|
-
lineNumber: 1832,
|
|
3929
|
-
columnNumber: 17
|
|
3930
|
-
}, this)) : null] }, void 0, true, {
|
|
3931
|
-
fileName: _jsxFileName,
|
|
3932
|
-
lineNumber: 1819,
|
|
3933
|
-
columnNumber: 9
|
|
3934
|
-
}, this) : null,
|
|
3935
|
-
developer ? /* @__PURE__ */ jsxDEV("div", {
|
|
2692
|
+
})) : null] }) : null,
|
|
2693
|
+
developer ? /* @__PURE__ */ jsxs("div", {
|
|
3936
2694
|
className: "flex flex-col",
|
|
3937
2695
|
children: [
|
|
3938
|
-
/* @__PURE__ */
|
|
2696
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
3939
2697
|
label: "Hide the title on the page",
|
|
3940
2698
|
checked: !!d.hideCaption,
|
|
3941
2699
|
onChange: (v) => design({ hideCaption: v || void 0 })
|
|
3942
|
-
},
|
|
3943
|
-
|
|
3944
|
-
lineNumber: 1847,
|
|
3945
|
-
columnNumber: 11
|
|
3946
|
-
}, this),
|
|
3947
|
-
can.sticky ? /* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2700
|
+
}),
|
|
2701
|
+
can.sticky ? /* @__PURE__ */ jsx(SwitchRow, {
|
|
3948
2702
|
label: "Keep column names in view",
|
|
3949
2703
|
checked: !!d.sticky,
|
|
3950
2704
|
onChange: (v) => design({ sticky: v || void 0 })
|
|
3951
|
-
}
|
|
3952
|
-
|
|
3953
|
-
lineNumber: 1848,
|
|
3954
|
-
columnNumber: 25
|
|
3955
|
-
}, this) : null,
|
|
3956
|
-
/* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2705
|
+
}) : null,
|
|
2706
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
3957
2707
|
label: "Striped rows",
|
|
3958
2708
|
checked: !!d.striped,
|
|
3959
2709
|
onChange: (v) => design({ striped: v || void 0 })
|
|
3960
|
-
},
|
|
3961
|
-
|
|
3962
|
-
lineNumber: 1849,
|
|
3963
|
-
columnNumber: 11
|
|
3964
|
-
}, this),
|
|
3965
|
-
/* @__PURE__ */ jsxDEV(SwitchRow, {
|
|
2710
|
+
}),
|
|
2711
|
+
/* @__PURE__ */ jsx(SwitchRow, {
|
|
3966
2712
|
label: "Compact",
|
|
3967
2713
|
checked: d.density === "compact",
|
|
3968
2714
|
onChange: (v) => design({ density: v ? "compact" : void 0 })
|
|
3969
|
-
}
|
|
3970
|
-
fileName: _jsxFileName,
|
|
3971
|
-
lineNumber: 1850,
|
|
3972
|
-
columnNumber: 11
|
|
3973
|
-
}, this)
|
|
2715
|
+
})
|
|
3974
2716
|
]
|
|
3975
|
-
}
|
|
3976
|
-
fileName: _jsxFileName,
|
|
3977
|
-
lineNumber: 1846,
|
|
3978
|
-
columnNumber: 9
|
|
3979
|
-
}, this) : null
|
|
2717
|
+
}) : null
|
|
3980
2718
|
]
|
|
3981
|
-
}
|
|
3982
|
-
fileName: _jsxFileName,
|
|
3983
|
-
lineNumber: 1788,
|
|
3984
|
-
columnNumber: 5
|
|
3985
|
-
}, this);
|
|
2719
|
+
});
|
|
3986
2720
|
}
|
|
3987
2721
|
var dropUndefined = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
|
|
3988
2722
|
//#endregion
|