formanitor 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +130 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +131 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/styles/index.css +28 -0
package/dist/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var react = require('@tiptap/react');
|
|
|
11
11
|
var StarterKit = require('@tiptap/starter-kit');
|
|
12
12
|
var Placeholder = require('@tiptap/extension-placeholder');
|
|
13
13
|
var Underline = require('@tiptap/extension-underline');
|
|
14
|
+
var extensionTable = require('@tiptap/extension-table');
|
|
14
15
|
var reactSlot = require('@radix-ui/react-slot');
|
|
15
16
|
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
16
17
|
var SelectPrimitive = require('@radix-ui/react-select');
|
|
@@ -2228,9 +2229,47 @@ function isEmptyHtml(html) {
|
|
|
2228
2229
|
const t = html.trim();
|
|
2229
2230
|
return t === "" || t === "<p></p>" || t === "<p><br></p>" || t === '<p><br class="ProseMirror-trailingBreak"></p>';
|
|
2230
2231
|
}
|
|
2232
|
+
function buildRichTextExtensions(placeholder, tables) {
|
|
2233
|
+
const base = [
|
|
2234
|
+
StarterKit__default.default.configure({
|
|
2235
|
+
// Disable headings entirely so the UI/content can't introduce H2/H3.
|
|
2236
|
+
heading: false,
|
|
2237
|
+
bulletList: {
|
|
2238
|
+
HTMLAttributes: {
|
|
2239
|
+
class: "list-disc pl-6 my-2"
|
|
2240
|
+
}
|
|
2241
|
+
},
|
|
2242
|
+
orderedList: {
|
|
2243
|
+
HTMLAttributes: {
|
|
2244
|
+
class: "list-decimal pl-6 my-2"
|
|
2245
|
+
}
|
|
2246
|
+
},
|
|
2247
|
+
listItem: {
|
|
2248
|
+
HTMLAttributes: {
|
|
2249
|
+
class: "my-1"
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
}),
|
|
2253
|
+
Underline__default.default,
|
|
2254
|
+
Placeholder__default.default.configure({
|
|
2255
|
+
placeholder
|
|
2256
|
+
})
|
|
2257
|
+
];
|
|
2258
|
+
if (!tables) return base;
|
|
2259
|
+
return [
|
|
2260
|
+
...base,
|
|
2261
|
+
extensionTable.Table.configure({
|
|
2262
|
+
resizable: false
|
|
2263
|
+
}),
|
|
2264
|
+
extensionTable.TableRow,
|
|
2265
|
+
extensionTable.TableHeader,
|
|
2266
|
+
extensionTable.TableCell
|
|
2267
|
+
];
|
|
2268
|
+
}
|
|
2231
2269
|
function RichTextToolbar({
|
|
2232
2270
|
editor,
|
|
2233
|
-
disabled
|
|
2271
|
+
disabled,
|
|
2272
|
+
tablesEnabled
|
|
2234
2273
|
}) {
|
|
2235
2274
|
const [, rerender] = React15.useReducer((n) => n + 1, 0);
|
|
2236
2275
|
React15.useEffect(() => {
|
|
@@ -2261,6 +2300,7 @@ function RichTextToolbar({
|
|
|
2261
2300
|
children: icon
|
|
2262
2301
|
}
|
|
2263
2302
|
);
|
|
2303
|
+
const inTable = tablesEnabled && editor.isActive("table");
|
|
2264
2304
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2265
2305
|
"div",
|
|
2266
2306
|
{
|
|
@@ -2305,6 +2345,46 @@ function RichTextToolbar({
|
|
|
2305
2345
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "h-4 w-4" }),
|
|
2306
2346
|
"Numbered list"
|
|
2307
2347
|
),
|
|
2348
|
+
tablesEnabled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2349
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mx-0.5 h-6" }),
|
|
2350
|
+
!inTable ? fmtBtn(
|
|
2351
|
+
false,
|
|
2352
|
+
() => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run(),
|
|
2353
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table, { className: "h-4 w-4" }),
|
|
2354
|
+
"Insert table"
|
|
2355
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2356
|
+
fmtBtn(
|
|
2357
|
+
false,
|
|
2358
|
+
() => editor.chain().focus().addRowAfter().run(),
|
|
2359
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Rows2, { className: "h-4 w-4" }),
|
|
2360
|
+
"Add row below"
|
|
2361
|
+
),
|
|
2362
|
+
fmtBtn(
|
|
2363
|
+
false,
|
|
2364
|
+
() => editor.chain().focus().addColumnAfter().run(),
|
|
2365
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns2, { className: "h-4 w-4" }),
|
|
2366
|
+
"Add column right"
|
|
2367
|
+
),
|
|
2368
|
+
fmtBtn(
|
|
2369
|
+
false,
|
|
2370
|
+
() => editor.chain().focus().deleteRow().run(),
|
|
2371
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TableRowsSplit, { className: "h-4 w-4" }),
|
|
2372
|
+
"Delete row"
|
|
2373
|
+
),
|
|
2374
|
+
fmtBtn(
|
|
2375
|
+
false,
|
|
2376
|
+
() => editor.chain().focus().deleteColumn().run(),
|
|
2377
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TableColumnsSplit, { className: "h-4 w-4" }),
|
|
2378
|
+
"Delete column"
|
|
2379
|
+
),
|
|
2380
|
+
fmtBtn(
|
|
2381
|
+
false,
|
|
2382
|
+
() => editor.chain().focus().deleteTable().run(),
|
|
2383
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" }),
|
|
2384
|
+
"Delete table"
|
|
2385
|
+
)
|
|
2386
|
+
] })
|
|
2387
|
+
] }),
|
|
2308
2388
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mx-0.5 h-6" }),
|
|
2309
2389
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2310
2390
|
Button,
|
|
@@ -2345,33 +2425,10 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2345
2425
|
const def = fieldDef;
|
|
2346
2426
|
const placeholder = def?.placeholder ?? "Start typing\u2026";
|
|
2347
2427
|
const minHeight = def?.minHeight ?? 160;
|
|
2428
|
+
const tablesEnabled = !!def?.tables;
|
|
2348
2429
|
const extensions = React15.useMemo(
|
|
2349
|
-
() =>
|
|
2350
|
-
|
|
2351
|
-
// Disable headings entirely so the UI/content can't introduce H2/H3.
|
|
2352
|
-
heading: false,
|
|
2353
|
-
bulletList: {
|
|
2354
|
-
HTMLAttributes: {
|
|
2355
|
-
class: "list-disc pl-6 my-2"
|
|
2356
|
-
}
|
|
2357
|
-
},
|
|
2358
|
-
orderedList: {
|
|
2359
|
-
HTMLAttributes: {
|
|
2360
|
-
class: "list-decimal pl-6 my-2"
|
|
2361
|
-
}
|
|
2362
|
-
},
|
|
2363
|
-
listItem: {
|
|
2364
|
-
HTMLAttributes: {
|
|
2365
|
-
class: "my-1"
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
}),
|
|
2369
|
-
Underline__default.default,
|
|
2370
|
-
Placeholder__default.default.configure({
|
|
2371
|
-
placeholder
|
|
2372
|
-
})
|
|
2373
|
-
],
|
|
2374
|
-
[placeholder]
|
|
2430
|
+
() => buildRichTextExtensions(placeholder, tablesEnabled),
|
|
2431
|
+
[placeholder, tablesEnabled]
|
|
2375
2432
|
);
|
|
2376
2433
|
const stringValue = typeof value === "string" ? value : "";
|
|
2377
2434
|
const editor = react.useEditor(
|
|
@@ -2388,7 +2445,7 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2388
2445
|
editorProps: {
|
|
2389
2446
|
attributes: {
|
|
2390
2447
|
id: fieldId,
|
|
2391
|
-
class: "focus:outline-none",
|
|
2448
|
+
class: "tiptap focus:outline-none",
|
|
2392
2449
|
style: `min-height: ${minHeight}px`
|
|
2393
2450
|
}
|
|
2394
2451
|
}
|
|
@@ -2454,7 +2511,14 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2454
2511
|
)
|
|
2455
2512
|
),
|
|
2456
2513
|
children: [
|
|
2457
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2514
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2515
|
+
RichTextToolbar,
|
|
2516
|
+
{
|
|
2517
|
+
editor,
|
|
2518
|
+
disabled,
|
|
2519
|
+
tablesEnabled
|
|
2520
|
+
}
|
|
2521
|
+
),
|
|
2458
2522
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2459
2523
|
"div",
|
|
2460
2524
|
{
|
|
@@ -2480,6 +2544,9 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2480
2544
|
showError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: fieldErrorClass(fieldDef, "text-xs text-red-500"), children: error })
|
|
2481
2545
|
] });
|
|
2482
2546
|
};
|
|
2547
|
+
function richTextHtmlClassName() {
|
|
2548
|
+
return cn("richtext-content prose prose-sm max-w-none");
|
|
2549
|
+
}
|
|
2483
2550
|
var Select = SelectPrimitive__namespace.Root;
|
|
2484
2551
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
2485
2552
|
var SelectTrigger = React15__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2763,7 +2830,7 @@ var MultiSelectWidget = ({ fieldId }) => {
|
|
|
2763
2830
|
showError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: fieldErrorClass(fieldDef, "text-xs text-red-500"), children: error })
|
|
2764
2831
|
] });
|
|
2765
2832
|
};
|
|
2766
|
-
var
|
|
2833
|
+
var Table2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2767
2834
|
"table",
|
|
2768
2835
|
{
|
|
2769
2836
|
ref,
|
|
@@ -2771,9 +2838,9 @@ var Table = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2771
2838
|
...props
|
|
2772
2839
|
}
|
|
2773
2840
|
) }));
|
|
2774
|
-
|
|
2775
|
-
var
|
|
2776
|
-
|
|
2841
|
+
Table2.displayName = "Table";
|
|
2842
|
+
var TableHeader2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
2843
|
+
TableHeader2.displayName = "TableHeader";
|
|
2777
2844
|
var TableBody = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2778
2845
|
"tbody",
|
|
2779
2846
|
{
|
|
@@ -2795,7 +2862,7 @@ var TableFooter = React15__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
2795
2862
|
}
|
|
2796
2863
|
));
|
|
2797
2864
|
TableFooter.displayName = "TableFooter";
|
|
2798
|
-
var
|
|
2865
|
+
var TableRow2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2799
2866
|
"tr",
|
|
2800
2867
|
{
|
|
2801
2868
|
ref,
|
|
@@ -2806,7 +2873,7 @@ var TableRow = React15__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
2806
2873
|
...props
|
|
2807
2874
|
}
|
|
2808
2875
|
));
|
|
2809
|
-
|
|
2876
|
+
TableRow2.displayName = "TableRow";
|
|
2810
2877
|
var TableHead = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
2878
|
"th",
|
|
2812
2879
|
{
|
|
@@ -2819,7 +2886,7 @@ var TableHead = React15__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
2819
2886
|
}
|
|
2820
2887
|
));
|
|
2821
2888
|
TableHead.displayName = "TableHead";
|
|
2822
|
-
var
|
|
2889
|
+
var TableCell2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2823
2890
|
"td",
|
|
2824
2891
|
{
|
|
2825
2892
|
ref,
|
|
@@ -2827,7 +2894,7 @@ var TableCell = React15__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
2827
2894
|
...props
|
|
2828
2895
|
}
|
|
2829
2896
|
));
|
|
2830
|
-
|
|
2897
|
+
TableCell2.displayName = "TableCell";
|
|
2831
2898
|
var TableCaption = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2832
2899
|
"caption",
|
|
2833
2900
|
{
|
|
@@ -2877,15 +2944,15 @@ var RepeatableWidget = ({
|
|
|
2877
2944
|
}
|
|
2878
2945
|
)
|
|
2879
2946
|
] }),
|
|
2880
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2881
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2947
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
2948
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader2, { children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow2, { children: [
|
|
2882
2949
|
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: subDef.label }, subDef.id)),
|
|
2883
2950
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-[50px]" })
|
|
2884
2951
|
] }) }),
|
|
2885
2952
|
/* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
|
|
2886
2953
|
rows.map(
|
|
2887
|
-
(row, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2888
|
-
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2954
|
+
(row, index) => /* @__PURE__ */ jsxRuntime.jsxs(TableRow2, { children: [
|
|
2955
|
+
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { children: subDef.type === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2889
2956
|
"input",
|
|
2890
2957
|
{
|
|
2891
2958
|
type: "number",
|
|
@@ -2903,7 +2970,7 @@ var RepeatableWidget = ({
|
|
|
2903
2970
|
disabled
|
|
2904
2971
|
}
|
|
2905
2972
|
) }, subDef.id)),
|
|
2906
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2973
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableCell2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2907
2974
|
Button,
|
|
2908
2975
|
{
|
|
2909
2976
|
type: "button",
|
|
@@ -2917,8 +2984,8 @@ var RepeatableWidget = ({
|
|
|
2917
2984
|
) })
|
|
2918
2985
|
] }, index)
|
|
2919
2986
|
),
|
|
2920
|
-
rows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2921
|
-
|
|
2987
|
+
rows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2988
|
+
TableCell2,
|
|
2922
2989
|
{
|
|
2923
2990
|
colSpan: def.row.length + 1,
|
|
2924
2991
|
className: "h-24 text-center",
|
|
@@ -4394,23 +4461,23 @@ var EditableTableWidget = ({
|
|
|
4394
4461
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { children: fieldDef.label }),
|
|
4395
4462
|
fieldDef.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: fieldDef.description })
|
|
4396
4463
|
] }),
|
|
4397
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4398
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4464
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
4465
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader2, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: header.isPlaceholder ? null : reactTable.flexRender(
|
|
4399
4466
|
header.column.columnDef.header,
|
|
4400
4467
|
header.getContext()
|
|
4401
4468
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4402
4469
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4403
|
-
|
|
4470
|
+
TableRow2,
|
|
4404
4471
|
{
|
|
4405
4472
|
"data-state": row.getIsSelected() && "selected",
|
|
4406
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4473
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { className: "p-1", children: reactTable.flexRender(
|
|
4407
4474
|
cell.column.columnDef.cell,
|
|
4408
4475
|
cell.getContext()
|
|
4409
4476
|
) }, cell.id))
|
|
4410
4477
|
},
|
|
4411
4478
|
row.id
|
|
4412
|
-
)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4413
|
-
|
|
4479
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4480
|
+
TableCell2,
|
|
4414
4481
|
{
|
|
4415
4482
|
colSpan: columns.length,
|
|
4416
4483
|
className: "h-24 text-center",
|
|
@@ -15410,7 +15477,10 @@ var ReadOnlyText = ({ fieldDef, value }) => {
|
|
|
15410
15477
|
isRichText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15411
15478
|
"div",
|
|
15412
15479
|
{
|
|
15413
|
-
className:
|
|
15480
|
+
className: cn(
|
|
15481
|
+
richTextHtmlClassName(),
|
|
15482
|
+
"text-gray-900 border border-gray-200 rounded-md p-3 bg-gray-50"
|
|
15483
|
+
),
|
|
15414
15484
|
dangerouslySetInnerHTML: { __html: displayValue }
|
|
15415
15485
|
}
|
|
15416
15486
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-900 border border-gray-200 rounded-md p-3 bg-gray-50 min-h-[2.5rem] whitespace-pre-wrap", children: displayValue || /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 italic", children: "No value" }) })
|
|
@@ -15479,10 +15549,10 @@ var ReadOnlyRepeatable = ({ fieldDef, value }) => {
|
|
|
15479
15549
|
const rows = Array.isArray(value) ? value : [];
|
|
15480
15550
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15481
15551
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-sm font-medium text-gray-700", children: fieldDef.label }),
|
|
15482
|
-
rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-400 italic border border-gray-200 rounded-md p-4 bg-gray-50 text-center", children: "No items" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-gray-200 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15552
|
+
rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-400 italic border border-gray-200 rounded-md p-4 bg-gray-50 text-center", children: "No items" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-gray-200 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
15553
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader2, { children: /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: fieldDef.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "bg-gray-50", children: subDef.label }, subDef.id)) }) }),
|
|
15484
15554
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: rows.map(
|
|
15485
|
-
(row, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
15555
|
+
(row, index) => /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: fieldDef.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { className: "text-gray-900", children: row[subDef.id] ?? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 italic", children: "\u2014" }) }, subDef.id)) }, index)
|
|
15486
15556
|
) })
|
|
15487
15557
|
] }) })
|
|
15488
15558
|
] });
|
|
@@ -15662,16 +15732,16 @@ var ReadOnlyTable = ({
|
|
|
15662
15732
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15663
15733
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { children: fieldDef.label }),
|
|
15664
15734
|
fieldDef.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: fieldDef.description }),
|
|
15665
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
15666
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15735
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
15736
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader2, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: header.isPlaceholder ? null : reactTable.flexRender(
|
|
15667
15737
|
header.column.columnDef.header,
|
|
15668
15738
|
header.getContext()
|
|
15669
15739
|
) }, header.id)) }, headerGroup.id)) }),
|
|
15670
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
15740
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { className: "p-2", children: reactTable.flexRender(
|
|
15671
15741
|
cell.column.columnDef.cell,
|
|
15672
15742
|
cell.getContext()
|
|
15673
|
-
) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15674
|
-
|
|
15743
|
+
) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15744
|
+
TableCell2,
|
|
15675
15745
|
{
|
|
15676
15746
|
colSpan: columns.length,
|
|
15677
15747
|
className: "h-16 text-center text-muted-foreground",
|
|
@@ -16412,6 +16482,7 @@ exports.fieldLabelClass = fieldLabelClass;
|
|
|
16412
16482
|
exports.fieldMetaRequestsMarMedicationOrdersButton = fieldMetaRequestsMarMedicationOrdersButton;
|
|
16413
16483
|
exports.fieldWrapperClass = fieldWrapperClass;
|
|
16414
16484
|
exports.isLabelVisible = isLabelVisible;
|
|
16485
|
+
exports.richTextHtmlClassName = richTextHtmlClassName;
|
|
16415
16486
|
exports.useField = useField;
|
|
16416
16487
|
exports.useFieldHandlers = useFieldHandlers;
|
|
16417
16488
|
exports.useForm = useForm;
|