formanitor 0.1.8 → 0.1.10
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 +135 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.mjs +136 -68
- 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');
|
|
@@ -2098,6 +2099,10 @@ function fieldLabelClass(fieldDef, ...defaults) {
|
|
|
2098
2099
|
return cn(...defaults, fieldDef.style?.classNames?.label);
|
|
2099
2100
|
}
|
|
2100
2101
|
function fieldControlClass(fieldDef, ...defaults) {
|
|
2102
|
+
const controlClass = fieldDef.style?.classNames?.control;
|
|
2103
|
+
if (fieldDef.style?.fullControl && controlClass) {
|
|
2104
|
+
return cn(controlClass);
|
|
2105
|
+
}
|
|
2101
2106
|
return cn(...defaults, fieldDef.style?.classNames?.control);
|
|
2102
2107
|
}
|
|
2103
2108
|
function fieldDescriptionClass(fieldDef, ...defaults) {
|
|
@@ -2228,9 +2233,47 @@ function isEmptyHtml(html) {
|
|
|
2228
2233
|
const t = html.trim();
|
|
2229
2234
|
return t === "" || t === "<p></p>" || t === "<p><br></p>" || t === '<p><br class="ProseMirror-trailingBreak"></p>';
|
|
2230
2235
|
}
|
|
2236
|
+
function buildRichTextExtensions(placeholder, tables) {
|
|
2237
|
+
const base = [
|
|
2238
|
+
StarterKit__default.default.configure({
|
|
2239
|
+
// Disable headings entirely so the UI/content can't introduce H2/H3.
|
|
2240
|
+
heading: false,
|
|
2241
|
+
bulletList: {
|
|
2242
|
+
HTMLAttributes: {
|
|
2243
|
+
class: "list-disc pl-6 my-2"
|
|
2244
|
+
}
|
|
2245
|
+
},
|
|
2246
|
+
orderedList: {
|
|
2247
|
+
HTMLAttributes: {
|
|
2248
|
+
class: "list-decimal pl-6 my-2"
|
|
2249
|
+
}
|
|
2250
|
+
},
|
|
2251
|
+
listItem: {
|
|
2252
|
+
HTMLAttributes: {
|
|
2253
|
+
class: "my-1"
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
}),
|
|
2257
|
+
Underline__default.default,
|
|
2258
|
+
Placeholder__default.default.configure({
|
|
2259
|
+
placeholder
|
|
2260
|
+
})
|
|
2261
|
+
];
|
|
2262
|
+
if (!tables) return base;
|
|
2263
|
+
return [
|
|
2264
|
+
...base,
|
|
2265
|
+
extensionTable.Table.configure({
|
|
2266
|
+
resizable: false
|
|
2267
|
+
}),
|
|
2268
|
+
extensionTable.TableRow,
|
|
2269
|
+
extensionTable.TableHeader,
|
|
2270
|
+
extensionTable.TableCell
|
|
2271
|
+
];
|
|
2272
|
+
}
|
|
2231
2273
|
function RichTextToolbar({
|
|
2232
2274
|
editor,
|
|
2233
|
-
disabled
|
|
2275
|
+
disabled,
|
|
2276
|
+
tablesEnabled
|
|
2234
2277
|
}) {
|
|
2235
2278
|
const [, rerender] = React15.useReducer((n) => n + 1, 0);
|
|
2236
2279
|
React15.useEffect(() => {
|
|
@@ -2261,6 +2304,7 @@ function RichTextToolbar({
|
|
|
2261
2304
|
children: icon
|
|
2262
2305
|
}
|
|
2263
2306
|
);
|
|
2307
|
+
const inTable = tablesEnabled && editor.isActive("table");
|
|
2264
2308
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2265
2309
|
"div",
|
|
2266
2310
|
{
|
|
@@ -2305,6 +2349,46 @@ function RichTextToolbar({
|
|
|
2305
2349
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "h-4 w-4" }),
|
|
2306
2350
|
"Numbered list"
|
|
2307
2351
|
),
|
|
2352
|
+
tablesEnabled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2353
|
+
/* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mx-0.5 h-6" }),
|
|
2354
|
+
!inTable ? fmtBtn(
|
|
2355
|
+
false,
|
|
2356
|
+
() => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run(),
|
|
2357
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table, { className: "h-4 w-4" }),
|
|
2358
|
+
"Insert table"
|
|
2359
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2360
|
+
fmtBtn(
|
|
2361
|
+
false,
|
|
2362
|
+
() => editor.chain().focus().addRowAfter().run(),
|
|
2363
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Rows2, { className: "h-4 w-4" }),
|
|
2364
|
+
"Add row below"
|
|
2365
|
+
),
|
|
2366
|
+
fmtBtn(
|
|
2367
|
+
false,
|
|
2368
|
+
() => editor.chain().focus().addColumnAfter().run(),
|
|
2369
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns2, { className: "h-4 w-4" }),
|
|
2370
|
+
"Add column right"
|
|
2371
|
+
),
|
|
2372
|
+
fmtBtn(
|
|
2373
|
+
false,
|
|
2374
|
+
() => editor.chain().focus().deleteRow().run(),
|
|
2375
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TableRowsSplit, { className: "h-4 w-4" }),
|
|
2376
|
+
"Delete row"
|
|
2377
|
+
),
|
|
2378
|
+
fmtBtn(
|
|
2379
|
+
false,
|
|
2380
|
+
() => editor.chain().focus().deleteColumn().run(),
|
|
2381
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TableColumnsSplit, { className: "h-4 w-4" }),
|
|
2382
|
+
"Delete column"
|
|
2383
|
+
),
|
|
2384
|
+
fmtBtn(
|
|
2385
|
+
false,
|
|
2386
|
+
() => editor.chain().focus().deleteTable().run(),
|
|
2387
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" }),
|
|
2388
|
+
"Delete table"
|
|
2389
|
+
)
|
|
2390
|
+
] })
|
|
2391
|
+
] }),
|
|
2308
2392
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mx-0.5 h-6" }),
|
|
2309
2393
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2310
2394
|
Button,
|
|
@@ -2345,33 +2429,10 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2345
2429
|
const def = fieldDef;
|
|
2346
2430
|
const placeholder = def?.placeholder ?? "Start typing\u2026";
|
|
2347
2431
|
const minHeight = def?.minHeight ?? 160;
|
|
2432
|
+
const tablesEnabled = !!def?.tables;
|
|
2348
2433
|
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]
|
|
2434
|
+
() => buildRichTextExtensions(placeholder, tablesEnabled),
|
|
2435
|
+
[placeholder, tablesEnabled]
|
|
2375
2436
|
);
|
|
2376
2437
|
const stringValue = typeof value === "string" ? value : "";
|
|
2377
2438
|
const editor = react.useEditor(
|
|
@@ -2388,7 +2449,7 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2388
2449
|
editorProps: {
|
|
2389
2450
|
attributes: {
|
|
2390
2451
|
id: fieldId,
|
|
2391
|
-
class: "focus:outline-none",
|
|
2452
|
+
class: "tiptap focus:outline-none",
|
|
2392
2453
|
style: `min-height: ${minHeight}px`
|
|
2393
2454
|
}
|
|
2394
2455
|
}
|
|
@@ -2454,7 +2515,14 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2454
2515
|
)
|
|
2455
2516
|
),
|
|
2456
2517
|
children: [
|
|
2457
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2518
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2519
|
+
RichTextToolbar,
|
|
2520
|
+
{
|
|
2521
|
+
editor,
|
|
2522
|
+
disabled,
|
|
2523
|
+
tablesEnabled
|
|
2524
|
+
}
|
|
2525
|
+
),
|
|
2458
2526
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2459
2527
|
"div",
|
|
2460
2528
|
{
|
|
@@ -2480,6 +2548,9 @@ var RichTextWidget = ({ fieldId }) => {
|
|
|
2480
2548
|
showError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: fieldErrorClass(fieldDef, "text-xs text-red-500"), children: error })
|
|
2481
2549
|
] });
|
|
2482
2550
|
};
|
|
2551
|
+
function richTextHtmlClassName() {
|
|
2552
|
+
return cn("richtext-content prose prose-sm max-w-none");
|
|
2553
|
+
}
|
|
2483
2554
|
var Select = SelectPrimitive__namespace.Root;
|
|
2484
2555
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
2485
2556
|
var SelectTrigger = React15__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2763,7 +2834,7 @@ var MultiSelectWidget = ({ fieldId }) => {
|
|
|
2763
2834
|
showError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: fieldErrorClass(fieldDef, "text-xs text-red-500"), children: error })
|
|
2764
2835
|
] });
|
|
2765
2836
|
};
|
|
2766
|
-
var
|
|
2837
|
+
var Table2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2767
2838
|
"table",
|
|
2768
2839
|
{
|
|
2769
2840
|
ref,
|
|
@@ -2771,9 +2842,9 @@ var Table = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2771
2842
|
...props
|
|
2772
2843
|
}
|
|
2773
2844
|
) }));
|
|
2774
|
-
|
|
2775
|
-
var
|
|
2776
|
-
|
|
2845
|
+
Table2.displayName = "Table";
|
|
2846
|
+
var TableHeader2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
2847
|
+
TableHeader2.displayName = "TableHeader";
|
|
2777
2848
|
var TableBody = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2778
2849
|
"tbody",
|
|
2779
2850
|
{
|
|
@@ -2795,7 +2866,7 @@ var TableFooter = React15__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
2795
2866
|
}
|
|
2796
2867
|
));
|
|
2797
2868
|
TableFooter.displayName = "TableFooter";
|
|
2798
|
-
var
|
|
2869
|
+
var TableRow2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2799
2870
|
"tr",
|
|
2800
2871
|
{
|
|
2801
2872
|
ref,
|
|
@@ -2806,7 +2877,7 @@ var TableRow = React15__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
2806
2877
|
...props
|
|
2807
2878
|
}
|
|
2808
2879
|
));
|
|
2809
|
-
|
|
2880
|
+
TableRow2.displayName = "TableRow";
|
|
2810
2881
|
var TableHead = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
2882
|
"th",
|
|
2812
2883
|
{
|
|
@@ -2819,7 +2890,7 @@ var TableHead = React15__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
2819
2890
|
}
|
|
2820
2891
|
));
|
|
2821
2892
|
TableHead.displayName = "TableHead";
|
|
2822
|
-
var
|
|
2893
|
+
var TableCell2 = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2823
2894
|
"td",
|
|
2824
2895
|
{
|
|
2825
2896
|
ref,
|
|
@@ -2827,7 +2898,7 @@ var TableCell = React15__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
2827
2898
|
...props
|
|
2828
2899
|
}
|
|
2829
2900
|
));
|
|
2830
|
-
|
|
2901
|
+
TableCell2.displayName = "TableCell";
|
|
2831
2902
|
var TableCaption = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2832
2903
|
"caption",
|
|
2833
2904
|
{
|
|
@@ -2877,15 +2948,15 @@ var RepeatableWidget = ({
|
|
|
2877
2948
|
}
|
|
2878
2949
|
)
|
|
2879
2950
|
] }),
|
|
2880
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2881
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2951
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
2952
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableHeader2, { children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow2, { children: [
|
|
2882
2953
|
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: subDef.label }, subDef.id)),
|
|
2883
2954
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-[50px]" })
|
|
2884
2955
|
] }) }),
|
|
2885
2956
|
/* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
|
|
2886
2957
|
rows.map(
|
|
2887
|
-
(row, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2888
|
-
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2958
|
+
(row, index) => /* @__PURE__ */ jsxRuntime.jsxs(TableRow2, { children: [
|
|
2959
|
+
def.row.map((subDef) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { children: subDef.type === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2889
2960
|
"input",
|
|
2890
2961
|
{
|
|
2891
2962
|
type: "number",
|
|
@@ -2903,7 +2974,7 @@ var RepeatableWidget = ({
|
|
|
2903
2974
|
disabled
|
|
2904
2975
|
}
|
|
2905
2976
|
) }, subDef.id)),
|
|
2906
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2977
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableCell2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2907
2978
|
Button,
|
|
2908
2979
|
{
|
|
2909
2980
|
type: "button",
|
|
@@ -2917,8 +2988,8 @@ var RepeatableWidget = ({
|
|
|
2917
2988
|
) })
|
|
2918
2989
|
] }, index)
|
|
2919
2990
|
),
|
|
2920
|
-
rows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2921
|
-
|
|
2991
|
+
rows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2992
|
+
TableCell2,
|
|
2922
2993
|
{
|
|
2923
2994
|
colSpan: def.row.length + 1,
|
|
2924
2995
|
className: "h-24 text-center",
|
|
@@ -4002,13 +4073,7 @@ function Upload3({
|
|
|
4002
4073
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
4003
4074
|
"and medical records"
|
|
4004
4075
|
] }),
|
|
4005
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
|
-
lucideReact.Upload,
|
|
4007
|
-
{
|
|
4008
|
-
size: 20,
|
|
4009
|
-
className: "rotate-180 text-[#727272] mt-4"
|
|
4010
|
-
}
|
|
4011
|
-
),
|
|
4076
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { size: 20, className: "text-[#727272] mt-4" }),
|
|
4012
4077
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs mt-1 text-text-shades-2", children: placeholder }),
|
|
4013
4078
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 text-10px leading-[140%] text-[#989898]", children: [
|
|
4014
4079
|
"Supported formats - ",
|
|
@@ -4394,23 +4459,23 @@ var EditableTableWidget = ({
|
|
|
4394
4459
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { children: fieldDef.label }),
|
|
4395
4460
|
fieldDef.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: fieldDef.description })
|
|
4396
4461
|
] }),
|
|
4397
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4398
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4462
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
4463
|
+
/* @__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
4464
|
header.column.columnDef.header,
|
|
4400
4465
|
header.getContext()
|
|
4401
4466
|
) }, header.id)) }, headerGroup.id)) }),
|
|
4402
4467
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4403
|
-
|
|
4468
|
+
TableRow2,
|
|
4404
4469
|
{
|
|
4405
4470
|
"data-state": row.getIsSelected() && "selected",
|
|
4406
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4471
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell2, { className: "p-1", children: reactTable.flexRender(
|
|
4407
4472
|
cell.column.columnDef.cell,
|
|
4408
4473
|
cell.getContext()
|
|
4409
4474
|
) }, cell.id))
|
|
4410
4475
|
},
|
|
4411
4476
|
row.id
|
|
4412
|
-
)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4413
|
-
|
|
4477
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4478
|
+
TableCell2,
|
|
4414
4479
|
{
|
|
4415
4480
|
colSpan: columns.length,
|
|
4416
4481
|
className: "h-24 text-center",
|
|
@@ -15410,7 +15475,10 @@ var ReadOnlyText = ({ fieldDef, value }) => {
|
|
|
15410
15475
|
isRichText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15411
15476
|
"div",
|
|
15412
15477
|
{
|
|
15413
|
-
className:
|
|
15478
|
+
className: cn(
|
|
15479
|
+
richTextHtmlClassName(),
|
|
15480
|
+
"text-gray-900 border border-gray-200 rounded-md p-3 bg-gray-50"
|
|
15481
|
+
),
|
|
15414
15482
|
dangerouslySetInnerHTML: { __html: displayValue }
|
|
15415
15483
|
}
|
|
15416
15484
|
) : /* @__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 +15547,10 @@ var ReadOnlyRepeatable = ({ fieldDef, value }) => {
|
|
|
15479
15547
|
const rows = Array.isArray(value) ? value : [];
|
|
15480
15548
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15481
15549
|
/* @__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(
|
|
15550
|
+
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: [
|
|
15551
|
+
/* @__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
15552
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: rows.map(
|
|
15485
|
-
(row, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
15553
|
+
(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
15554
|
) })
|
|
15487
15555
|
] }) })
|
|
15488
15556
|
] });
|
|
@@ -15662,16 +15730,16 @@ var ReadOnlyTable = ({
|
|
|
15662
15730
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
15663
15731
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { children: fieldDef.label }),
|
|
15664
15732
|
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(
|
|
15733
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table2, { children: [
|
|
15734
|
+
/* @__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
15735
|
header.column.columnDef.header,
|
|
15668
15736
|
header.getContext()
|
|
15669
15737
|
) }, header.id)) }, headerGroup.id)) }),
|
|
15670
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
15738
|
+
/* @__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
15739
|
cell.column.columnDef.cell,
|
|
15672
15740
|
cell.getContext()
|
|
15673
|
-
) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
15674
|
-
|
|
15741
|
+
) }, cell.id)) }, row.id)) : /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15742
|
+
TableCell2,
|
|
15675
15743
|
{
|
|
15676
15744
|
colSpan: columns.length,
|
|
15677
15745
|
className: "h-16 text-center text-muted-foreground",
|
|
@@ -16412,6 +16480,7 @@ exports.fieldLabelClass = fieldLabelClass;
|
|
|
16412
16480
|
exports.fieldMetaRequestsMarMedicationOrdersButton = fieldMetaRequestsMarMedicationOrdersButton;
|
|
16413
16481
|
exports.fieldWrapperClass = fieldWrapperClass;
|
|
16414
16482
|
exports.isLabelVisible = isLabelVisible;
|
|
16483
|
+
exports.richTextHtmlClassName = richTextHtmlClassName;
|
|
16415
16484
|
exports.useField = useField;
|
|
16416
16485
|
exports.useFieldHandlers = useFieldHandlers;
|
|
16417
16486
|
exports.useForm = useForm;
|