@flanksource/clicky-ui 0.3.81 → 0.3.83
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/components/json-schema-form-connection.cjs +31 -2
- package/dist/components/json-schema-form-connection.cjs.map +1 -1
- package/dist/components/json-schema-form-connection.d.ts.map +1 -1
- package/dist/components/json-schema-form-connection.js +32 -3
- package/dist/components/json-schema-form-connection.js.map +1 -1
- package/dist/components/json-schema-form-date-math.cjs +48 -0
- package/dist/components/json-schema-form-date-math.cjs.map +1 -0
- package/dist/components/json-schema-form-date-math.d.ts +9 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -0
- package/dist/components/json-schema-form-date-math.js +48 -0
- package/dist/components/json-schema-form-date-math.js.map +1 -0
- package/dist/components/json-schema-form-fields.cjs +11 -2
- package/dist/components/json-schema-form-fields.cjs.map +1 -1
- package/dist/components/json-schema-form-fields.d.ts.map +1 -1
- package/dist/components/json-schema-form-fields.js +11 -2
- package/dist/components/json-schema-form-fields.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +1 -1
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +1 -1
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -1
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-types.d.ts +1 -1
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/data/data-table-filter-values.cjs +28 -7
- package/dist/data/data-table-filter-values.cjs.map +1 -1
- package/dist/data/data-table-filter-values.d.ts.map +1 -1
- package/dist/data/data-table-filter-values.js +29 -8
- package/dist/data/data-table-filter-values.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +1 -6
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +1 -6
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.cjs +5 -2
- package/dist/data/traces/otel/OtelTraceTable.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceTable.js +5 -2
- package/dist/data/traces/otel/OtelTraceTable.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/devtools/ExecutionDetail.cjs +5 -2
- package/dist/devtools/ExecutionDetail.cjs.map +1 -1
- package/dist/devtools/ExecutionDetail.js +5 -2
- package/dist/devtools/ExecutionDetail.js.map +1 -1
- package/dist/profiles/editor/profileEditor.cjs +1 -2
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +2 -3
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +21 -5
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +22 -6
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/spanColumns.cjs +0 -8
- package/dist/profiles/editor/spanColumns.cjs.map +1 -1
- package/dist/profiles/editor/spanColumns.d.ts +0 -1
- package/dist/profiles/editor/spanColumns.d.ts.map +1 -1
- package/dist/profiles/editor/spanColumns.js +1 -8
- package/dist/profiles/editor/spanColumns.js.map +1 -1
- package/dist/rpc/ExplorerNav.cjs +13 -0
- package/dist/rpc/ExplorerNav.cjs.map +1 -1
- package/dist/rpc/ExplorerNav.d.ts.map +1 -1
- package/dist/rpc/ExplorerNav.js +14 -1
- package/dist/rpc/ExplorerNav.js.map +1 -1
- package/dist/runtime/barrels.json +1567 -1567
- package/dist/runtime/importmap.json +2170 -2169
- package/package.json +1 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
const require_ConnectionPicker = require("../connections/ConnectionPicker.cjs");
|
|
2
|
+
const require_ErrorDetails = require("../data/diagnostics/ErrorDetails.cjs");
|
|
3
|
+
const require_Modal = require("../overlay/Modal.cjs");
|
|
4
|
+
const require_ErrorWrapper = require("./ErrorWrapper.cjs");
|
|
2
5
|
const require_form_connection_context = require("./form-connection-context.cjs");
|
|
3
6
|
const require_json_schema_form_utils = require("./json-schema-form-utils.cjs");
|
|
4
7
|
let react = require("react");
|
|
5
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
6
10
|
// src/components/json-schema-form-connection.tsx
|
|
7
11
|
var LazyCreateConnectionDialog = (0, react.lazy)(async () => {
|
|
8
12
|
return { default: (await Promise.resolve().then(() => require("../connections/CreateConnectionDialog.cjs"))).CreateConnectionDialog };
|
|
@@ -34,8 +38,8 @@ function ConnectionLookupControl({ field, fieldId, readOnly, size, options, load
|
|
|
34
38
|
onClear: () => field.onChange(null)
|
|
35
39
|
} : {},
|
|
36
40
|
...require_json_schema_form_utils.comboboxAriaProps(field, fieldId)
|
|
37
|
-
}), creating && apiBase ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
38
|
-
|
|
41
|
+
}), creating && apiBase ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CreateConnectionHost, {
|
|
42
|
+
onClose: () => setCreating(void 0),
|
|
39
43
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LazyCreateConnectionDialog, {
|
|
40
44
|
apiBase,
|
|
41
45
|
existing: options.map((option) => option.value),
|
|
@@ -49,6 +53,31 @@ function ConnectionLookupControl({ field, fieldId, readOnly, size, options, load
|
|
|
49
53
|
})
|
|
50
54
|
}) : null] });
|
|
51
55
|
}
|
|
56
|
+
function CreateConnectionHost({ onClose, children }) {
|
|
57
|
+
const hostClient = (0, react.useContext)(_tanstack_react_query.QueryClientContext);
|
|
58
|
+
const [ownClient] = (0, react.useState)(() => hostClient ? void 0 : new _tanstack_react_query.QueryClient());
|
|
59
|
+
const dialog = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ErrorWrapper.ErrorWrapper, {
|
|
60
|
+
renderFallback: ({ diagnostics }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Modal.Modal, {
|
|
61
|
+
open: true,
|
|
62
|
+
onClose,
|
|
63
|
+
title: "New connection failed",
|
|
64
|
+
size: "lg",
|
|
65
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ErrorDetails.ErrorDetails, {
|
|
66
|
+
diagnostics,
|
|
67
|
+
title: "The new connection form failed to load",
|
|
68
|
+
announce: true
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
72
|
+
fallback: null,
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
return ownClient ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {
|
|
77
|
+
client: ownClient,
|
|
78
|
+
children: dialog
|
|
79
|
+
}) : dialog;
|
|
80
|
+
}
|
|
52
81
|
exports.ConnectionLookupControl = ConnectionLookupControl;
|
|
53
82
|
|
|
54
83
|
//# sourceMappingURL=json-schema-form-connection.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-connection.cjs","names":["lazy","useConnectionApiBase","useState","_Fragment","ConnectionPicker","toText","comboboxAriaProps","Suspense"],"sources":["../../src/components/json-schema-form-connection.tsx"],"sourcesContent":["import { lazy, Suspense, useState } from \"react\";\nimport { ConnectionPicker, type ConnectionCreateRequest } from \"../connections/ConnectionPicker\";\nimport { useConnectionApiBase } from \"./form-connection-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport { comboboxAriaProps, toText } from \"./json-schema-form-utils\";\nimport type { FormSize } from \"./json-schema-form-size\";\n\n// The create dialog pulls in the whole schema form; it loads when first opened.\n// Besides keeping the dialog out of every form's bundle, the dynamic import\n// keeps the module graph one-directional: the form never statically imports\n// something that imports the form.\nconst LazyCreateConnectionDialog = lazy(async () => {\n const mod = await import(\"../connections/CreateConnectionDialog\");\n return { default: mod.CreateConnectionDialog };\n});\n\n// connectionTypes reads `x-connection-types` off a `format: \"connection\"`\n// property: absent means any type, present must be a non-empty list of names.\nfunction connectionTypes(field: FieldControl): string[] | undefined {\n const raw = field.schema[\"x-connection-types\"];\n if (raw === undefined) return undefined;\n if (!Array.isArray(raw) || raw.length === 0 || raw.some((type) => typeof type !== \"string\" || type === \"\")) {\n throw new Error(\n `${field.key}: x-connection-types must be a non-empty list of connection type names, got ${JSON.stringify(raw)}`,\n );\n }\n return raw as string[];\n}\n\n// ConnectionLookupControl is the picker for a `format: \"connection\"` lookup\n// field: the lookup's options in a ConnectionPicker whose value is the\n// `connection://` ref. When the form was given a `connectionApiBase` the menu\n// ends with \"New {type} connection…\", which creates one and selects it.\nexport function ConnectionLookupControl({\n field,\n fieldId,\n readOnly,\n size,\n options,\n loading,\n onSearch,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n options: FieldOption[];\n loading: boolean;\n onSearch: (query: string) => void;\n}) {\n const apiBase = useConnectionApiBase();\n const [creating, setCreating] = useState<ConnectionCreateRequest>();\n const types = connectionTypes(field);\n\n return (\n <>\n <ConnectionPicker\n id={fieldId}\n options={options}\n value={toText(field.value)}\n onChange={(ref) => field.onChange(ref)}\n disabled={readOnly}\n size={size}\n loading={loading}\n onSearch={onSearch}\n {...(types ? { types } : {})}\n {...(apiBase ? { onCreate: setCreating } : {})}\n {...(field.nullable\n ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) }\n : {})}\n {...comboboxAriaProps(field, fieldId)}\n />\n {creating && apiBase ? (\n <
|
|
1
|
+
{"version":3,"file":"json-schema-form-connection.cjs","names":["lazy","useConnectionApiBase","useState","_Fragment","ConnectionPicker","toText","comboboxAriaProps","useContext","QueryClientContext","QueryClient","ErrorWrapper","Modal","ErrorDetails","Suspense","QueryClientProvider"],"sources":["../../src/components/json-schema-form-connection.tsx"],"sourcesContent":["import { QueryClient, QueryClientContext, QueryClientProvider } from \"@tanstack/react-query\";\nimport { lazy, Suspense, useContext, useState, type ReactNode } from \"react\";\nimport { ConnectionPicker, type ConnectionCreateRequest } from \"../connections/ConnectionPicker\";\nimport { ErrorDetails } from \"../data/diagnostics/ErrorDetails\";\nimport { Modal } from \"../overlay/Modal\";\nimport { ErrorWrapper } from \"./ErrorWrapper\";\nimport { useConnectionApiBase } from \"./form-connection-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport { comboboxAriaProps, toText } from \"./json-schema-form-utils\";\nimport type { FormSize } from \"./json-schema-form-size\";\n\n// The create dialog pulls in the whole schema form; it loads when first opened.\n// Besides keeping the dialog out of every form's bundle, the dynamic import\n// keeps the module graph one-directional: the form never statically imports\n// something that imports the form.\nconst LazyCreateConnectionDialog = lazy(async () => {\n const mod = await import(\"../connections/CreateConnectionDialog\");\n return { default: mod.CreateConnectionDialog };\n});\n\n// connectionTypes reads `x-connection-types` off a `format: \"connection\"`\n// property: absent means any type, present must be a non-empty list of names.\nfunction connectionTypes(field: FieldControl): string[] | undefined {\n const raw = field.schema[\"x-connection-types\"];\n if (raw === undefined) return undefined;\n if (!Array.isArray(raw) || raw.length === 0 || raw.some((type) => typeof type !== \"string\" || type === \"\")) {\n throw new Error(\n `${field.key}: x-connection-types must be a non-empty list of connection type names, got ${JSON.stringify(raw)}`,\n );\n }\n return raw as string[];\n}\n\n// ConnectionLookupControl is the picker for a `format: \"connection\"` lookup\n// field: the lookup's options in a ConnectionPicker whose value is the\n// `connection://` ref. When the form was given a `connectionApiBase` the menu\n// ends with \"New {type} connection…\", which creates one and selects it.\nexport function ConnectionLookupControl({\n field,\n fieldId,\n readOnly,\n size,\n options,\n loading,\n onSearch,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n options: FieldOption[];\n loading: boolean;\n onSearch: (query: string) => void;\n}) {\n const apiBase = useConnectionApiBase();\n const [creating, setCreating] = useState<ConnectionCreateRequest>();\n const types = connectionTypes(field);\n\n return (\n <>\n <ConnectionPicker\n id={fieldId}\n options={options}\n value={toText(field.value)}\n onChange={(ref) => field.onChange(ref)}\n disabled={readOnly}\n size={size}\n loading={loading}\n onSearch={onSearch}\n {...(types ? { types } : {})}\n {...(apiBase ? { onCreate: setCreating } : {})}\n {...(field.nullable\n ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) }\n : {})}\n {...comboboxAriaProps(field, fieldId)}\n />\n {creating && apiBase ? (\n <CreateConnectionHost onClose={() => setCreating(undefined)}>\n <LazyCreateConnectionDialog\n apiBase={apiBase}\n existing={options.map((option) => option.value)}\n {...(creating.type ? { type: creating.type } : {})}\n onClose={() => setCreating(undefined)}\n onCreated={(ref) => {\n field.onChange(ref);\n setCreating(undefined);\n onSearch(\"\");\n }}\n />\n </CreateConnectionHost>\n ) : null}\n </>\n );\n}\n\n// CreateConnectionHost gives the create dialog what it needs in any host form:\n// the host's react-query client, or one of its own when the host has none, and\n// a boundary that shows a dialog failure as a closable error instead of\n// unmounting the form around it.\nfunction CreateConnectionHost({ onClose, children }: { onClose: () => void; children: ReactNode }) {\n const hostClient = useContext(QueryClientContext);\n const [ownClient] = useState(() => (hostClient ? undefined : new QueryClient()));\n const dialog = (\n <ErrorWrapper\n renderFallback={({ diagnostics }) => (\n <Modal open onClose={onClose} title=\"New connection failed\" size=\"lg\">\n <ErrorDetails diagnostics={diagnostics} title=\"The new connection form failed to load\" announce />\n </Modal>\n )}\n >\n <Suspense fallback={null}>{children}</Suspense>\n </ErrorW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oot":"","sources":["../../src/components/json-schema-form-connection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-schema-form-connection.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-connection.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AA4BxD,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,+BAwCA"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ConnectionPicker } from "../connections/ConnectionPicker.js";
|
|
2
|
+
import { ErrorDetails } from "../data/diagnostics/ErrorDetails.js";
|
|
3
|
+
import { Modal } from "../overlay/Modal.js";
|
|
4
|
+
import { ErrorWrapper } from "./ErrorWrapper.js";
|
|
2
5
|
import { useConnectionApiBase } from "./form-connection-context.js";
|
|
3
6
|
import { comboboxAriaProps, toText } from "./json-schema-form-utils.js";
|
|
4
|
-
import { Suspense, lazy, useState } from "react";
|
|
7
|
+
import { Suspense, lazy, useContext, useState } from "react";
|
|
5
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { QueryClient, QueryClientContext, QueryClientProvider } from "@tanstack/react-query";
|
|
6
10
|
// src/components/json-schema-form-connection.tsx
|
|
7
11
|
var LazyCreateConnectionDialog = lazy(async () => {
|
|
8
12
|
return { default: (await import("../connections/CreateConnectionDialog.js")).CreateConnectionDialog };
|
|
@@ -34,8 +38,8 @@ function ConnectionLookupControl({ field, fieldId, readOnly, size, options, load
|
|
|
34
38
|
onClear: () => field.onChange(null)
|
|
35
39
|
} : {},
|
|
36
40
|
...comboboxAriaProps(field, fieldId)
|
|
37
|
-
}), creating && apiBase ? /* @__PURE__ */ jsx(
|
|
38
|
-
|
|
41
|
+
}), creating && apiBase ? /* @__PURE__ */ jsx(CreateConnectionHost, {
|
|
42
|
+
onClose: () => setCreating(void 0),
|
|
39
43
|
children: /* @__PURE__ */ jsx(LazyCreateConnectionDialog, {
|
|
40
44
|
apiBase,
|
|
41
45
|
existing: options.map((option) => option.value),
|
|
@@ -49,6 +53,31 @@ function ConnectionLookupControl({ field, fieldId, readOnly, size, options, load
|
|
|
49
53
|
})
|
|
50
54
|
}) : null] });
|
|
51
55
|
}
|
|
56
|
+
function CreateConnectionHost({ onClose, children }) {
|
|
57
|
+
const hostClient = useContext(QueryClientContext);
|
|
58
|
+
const [ownClient] = useState(() => hostClient ? void 0 : new QueryClient());
|
|
59
|
+
const dialog = /* @__PURE__ */ jsx(ErrorWrapper, {
|
|
60
|
+
renderFallback: ({ diagnostics }) => /* @__PURE__ */ jsx(Modal, {
|
|
61
|
+
open: true,
|
|
62
|
+
onClose,
|
|
63
|
+
title: "New connection failed",
|
|
64
|
+
size: "lg",
|
|
65
|
+
children: /* @__PURE__ */ jsx(ErrorDetails, {
|
|
66
|
+
diagnostics,
|
|
67
|
+
title: "The new connection form failed to load",
|
|
68
|
+
announce: true
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
children: /* @__PURE__ */ jsx(Suspense, {
|
|
72
|
+
fallback: null,
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
return ownClient ? /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
77
|
+
client: ownClient,
|
|
78
|
+
children: dialog
|
|
79
|
+
}) : dialog;
|
|
80
|
+
}
|
|
52
81
|
export { ConnectionLookupControl };
|
|
53
82
|
|
|
54
83
|
//# sourceMappingURL=json-schema-form-connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-connection.js","names":["_Fragment"],"sources":["../../src/components/json-schema-form-connection.tsx"],"sourcesContent":["import { lazy, Suspense, useState } from \"react\";\nimport { ConnectionPicker, type ConnectionCreateRequest } from \"../connections/ConnectionPicker\";\nimport { useConnectionApiBase } from \"./form-connection-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport { comboboxAriaProps, toText } from \"./json-schema-form-utils\";\nimport type { FormSize } from \"./json-schema-form-size\";\n\n// The create dialog pulls in the whole schema form; it loads when first opened.\n// Besides keeping the dialog out of every form's bundle, the dynamic import\n// keeps the module graph one-directional: the form never statically imports\n// something that imports the form.\nconst LazyCreateConnectionDialog = lazy(async () => {\n const mod = await import(\"../connections/CreateConnectionDialog\");\n return { default: mod.CreateConnectionDialog };\n});\n\n// connectionTypes reads `x-connection-types` off a `format: \"connection\"`\n// property: absent means any type, present must be a non-empty list of names.\nfunction connectionTypes(field: FieldControl): string[] | undefined {\n const raw = field.schema[\"x-connection-types\"];\n if (raw === undefined) return undefined;\n if (!Array.isArray(raw) || raw.length === 0 || raw.some((type) => typeof type !== \"string\" || type === \"\")) {\n throw new Error(\n `${field.key}: x-connection-types must be a non-empty list of connection type names, got ${JSON.stringify(raw)}`,\n );\n }\n return raw as string[];\n}\n\n// ConnectionLookupControl is the picker for a `format: \"connection\"` lookup\n// field: the lookup's options in a ConnectionPicker whose value is the\n// `connection://` ref. When the form was given a `connectionApiBase` the menu\n// ends with \"New {type} connection…\", which creates one and selects it.\nexport function ConnectionLookupControl({\n field,\n fieldId,\n readOnly,\n size,\n options,\n loading,\n onSearch,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n options: FieldOption[];\n loading: boolean;\n onSearch: (query: string) => void;\n}) {\n const apiBase = useConnectionApiBase();\n const [creating, setCreating] = useState<ConnectionCreateRequest>();\n const types = connectionTypes(field);\n\n return (\n <>\n <ConnectionPicker\n id={fieldId}\n options={options}\n value={toText(field.value)}\n onChange={(ref) => field.onChange(ref)}\n disabled={readOnly}\n size={size}\n loading={loading}\n onSearch={onSearch}\n {...(types ? { types } : {})}\n {...(apiBase ? { onCreate: setCreating } : {})}\n {...(field.nullable\n ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) }\n : {})}\n {...comboboxAriaProps(field, fieldId)}\n />\n {creating && apiBase ? (\n <
|
|
1
|
+
{"version":3,"file":"json-schema-form-connection.js","names":["_Fragment"],"sources":["../../src/components/json-schema-form-connection.tsx"],"sourcesContent":["import { QueryClient, QueryClientContext, QueryClientProvider } from \"@tanstack/react-query\";\nimport { lazy, Suspense, useContext, useState, type ReactNode } from \"react\";\nimport { ConnectionPicker, type ConnectionCreateRequest } from \"../connections/ConnectionPicker\";\nimport { ErrorDetails } from \"../data/diagnostics/ErrorDetails\";\nimport { Modal } from \"../overlay/Modal\";\nimport { ErrorWrapper } from \"./ErrorWrapper\";\nimport { useConnectionApiBase } from \"./form-connection-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport { comboboxAriaProps, toText } from \"./json-schema-form-utils\";\nimport type { FormSize } from \"./json-schema-form-size\";\n\n// The create dialog pulls in the whole schema form; it loads when first opened.\n// Besides keeping the dialog out of every form's bundle, the dynamic import\n// keeps the module graph one-directional: the form never statically imports\n// something that imports the form.\nconst LazyCreateConnectionDialog = lazy(async () => {\n const mod = await import(\"../connections/CreateConnectionDialog\");\n return { default: mod.CreateConnectionDialog };\n});\n\n// connectionTypes reads `x-connection-types` off a `format: \"connection\"`\n// property: absent means any type, present must be a non-empty list of names.\nfunction connectionTypes(field: FieldControl): string[] | undefined {\n const raw = field.schema[\"x-connection-types\"];\n if (raw === undefined) return undefined;\n if (!Array.isArray(raw) || raw.length === 0 || raw.some((type) => typeof type !== \"string\" || type === \"\")) {\n throw new Error(\n `${field.key}: x-connection-types must be a non-empty list of connection type names, got ${JSON.stringify(raw)}`,\n );\n }\n return raw as string[];\n}\n\n// ConnectionLookupControl is the picker for a `format: \"connection\"` lookup\n// field: the lookup's options in a ConnectionPicker whose value is the\n// `connection://` ref. When the form was given a `connectionApiBase` the menu\n// ends with \"New {type} connection…\", which creates one and selects it.\nexport function ConnectionLookupControl({\n field,\n fieldId,\n readOnly,\n size,\n options,\n loading,\n onSearch,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n options: FieldOption[];\n loading: boolean;\n onSearch: (query: string) => void;\n}) {\n const apiBase = useConnectionApiBase();\n const [creating, setCreating] = useState<ConnectionCreateRequest>();\n const types = connectionTypes(field);\n\n return (\n <>\n <ConnectionPicker\n id={fieldId}\n options={options}\n value={toText(field.value)}\n onChange={(ref) => field.onChange(ref)}\n disabled={readOnly}\n size={size}\n loading={loading}\n onSearch={onSearch}\n {...(types ? { types } : {})}\n {...(apiBase ? { onCreate: setCreating } : {})}\n {...(field.nullable\n ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) }\n : {})}\n {...comboboxAriaProps(field, fieldId)}\n />\n {creating && apiBase ? (\n <CreateConnectionHost onClose={() => setCreating(undefined)}>\n <LazyCreateConnectionDialog\n apiBase={apiBase}\n existing={options.map((option) => option.value)}\n {...(creating.type ? { type: creating.type } : {})}\n onClose={() => setCreating(undefined)}\n onCreated={(ref) => {\n field.onChange(ref);\n setCreating(undefined);\n onSearch(\"\");\n }}\n />\n </CreateConnectionHost>\n ) : null}\n </>\n );\n}\n\n// CreateConnectionHost gives the create dialog what it needs in any host form:\n// the host's react-query client, or one of its own when the host has none, and\n// a boundary that shows a dialog failure as a closable error instead of\n// unmounting the form around it.\nfunction CreateConnectionHost({ onClose, children }: { onClose: () => void; children: ReactNode }) {\n const hostClient = useContext(QueryClientContext);\n const [ownClient] = useState(() => (hostClient ? undefined : new QueryClient()));\n const dialog = (\n <ErrorWrapper\n renderFallback={({ diagnostics }) => (\n <Modal open onClose={onClose} title=\"New connection failed\" size=\"lg\">\n <ErrorDetails diagnostics={diagnostics} title=\"The new connection form failed to load\" announce />\n </Modal>\n )}\n >\n <Suspense fallback={null}>{children}</Suspense>\n </ErrorWrapper>\n );\n return ownClient ? <QueryClientProvider client={ownClient}>{dialog}</QueryClientProvider> : dialog;\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAM,6BAA6B,KAAK,YAAY;CAElD,OAAO,EAAE,UAAS,MADA,OAAO,4CAAA,CACH,uBAAuB;AAC/C,CAAC;AAID,SAAS,gBAAgB,OAA2C;CAClE,MAAM,MAAM,MAAM,OAAO;CACzB,IAAI,QAAQ,KAAA,GAAW,OAAO,KAAA;CAC9B,IAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,WAAW,KAAK,IAAI,MAAM,SAAS,OAAO,SAAS,YAAY,SAAS,EAAE,GACvG,MAAM,IAAI,MACR,GAAG,MAAM,IAAI,8EAA8E,KAAK,UAAU,GAAG,GAC/G;CAEF,OAAO;AACT;AAMA,SAAgB,wBAAwB,EACtC,OACA,SACA,UACA,MACA,SACA,SACA,YASC;CACD,MAAM,UAAU,qBAAqB;CACrC,MAAM,CAAC,UAAU,eAAe,SAAkC;CAClE,MAAM,QAAQ,gBAAgB,KAAK;CAEnC,OACE,qBAAAA,YAAA,EAAA,UAAA,CACE,oBAAC,kBAAD;EACE,IAAI;EACK;EACT,OAAO,OAAO,MAAM,KAAK;EACzB,WAAW,QAAQ,MAAM,SAAS,GAAG;EACrC,UAAU;EACJ;EACG;EACC;EACV,GAAK,QAAQ,EAAE,MAAM,IAAI,CAAC;EAC1B,GAAK,UAAU,EAAE,UAAU,YAAY,IAAI,CAAC;EAC5C,GAAK,MAAM,WACP;GAAE,WAAW;GAAM,YAAY,SAAS,MAAM,MAAM;GAAW,eAAe,MAAM,SAAS,IAAI;EAAE,IACnG,CAAC;EACL,GAAI,kBAAkB,OAAO,OAAO;CACrC,CAAA,GACA,YAAY,UACX,oBAAC,sBAAD;EAAsB,eAAe,YAAY,KAAA,CAAS;EACxD,UAAA,oBAAC,4BAAD;GACW;GACT,UAAU,QAAQ,KAAK,WAAW,OAAO,KAAK;GAC9C,GAAK,SAAS,OAAO,EAAE,MAAM,SAAS,KAAK,IAAI,CAAC;GAChD,eAAe,YAAY,KAAA,CAAS;GACpC,YAAY,QAAQ;IAClB,MAAM,SAAS,GAAG;IAClB,YAAY,KAAA,CAAS;IACrB,SAAS,EAAE;GACb;EACD,CAAA;CACmB,CAAA,IACpB,IACJ,EAAA,CAAA;AAEN;AAMA,SAAS,qBAAqB,EAAE,SAAS,YAA0D;CACjG,MAAM,aAAa,WAAW,kBAAkB;CAChD,MAAM,CAAC,aAAa,eAAgB,aAAa,KAAA,IAAY,IAAI,YAAY,CAAE;CAC/E,MAAM,SACJ,oBAAC,cAAD;EACE,iBAAiB,EAAE,kBACjB,oBAAC,OAAD;GAAO,MAAA;GAAc;GAAS,OAAM;GAAwB,MAAK;GAC/D,UAAA,oBAAC,cAAD;IAA2B;IAAa,OAAM;IAAyC,UAAA;GAAU,CAAA;EAC5F,CAAA;EAGT,UAAA,oBAAC,UAAD;GAAU,UAAU;GAAO;EAAmB,CAAA;CAClC,CAAA;CAEhB,OAAO,YAAY,oBAAC,qBAAD;EAAqB,QAAQ;EAAY,UAAA;CAA4B,CAAA,IAAI;AAC9F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_timestamp_format = require("../data/cells/timestamp-format.cjs");
|
|
2
|
+
const require_button = require("./button.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
// src/components/json-schema-form-date-math.tsx
|
|
5
|
+
var DATE_MATH_PRESETS = [
|
|
6
|
+
"now-15m",
|
|
7
|
+
"now-1h",
|
|
8
|
+
"now-24h",
|
|
9
|
+
"now-7d",
|
|
10
|
+
"now-30d",
|
|
11
|
+
"now"
|
|
12
|
+
];
|
|
13
|
+
function DateMathControl({ label, value, readOnly, onChange, children }) {
|
|
14
|
+
const resolved = value ? require_timestamp_format.resolveDateMath(value) : null;
|
|
15
|
+
const relative = resolved !== null && require_timestamp_format.parseTimestamp(value) === null;
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
17
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
18
|
+
children: [
|
|
19
|
+
children,
|
|
20
|
+
readOnly ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
21
|
+
role: "group",
|
|
22
|
+
"aria-label": `${label} presets`,
|
|
23
|
+
className: "flex flex-wrap items-center gap-1",
|
|
24
|
+
children: DATE_MATH_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
25
|
+
type: "button",
|
|
26
|
+
size: "xs",
|
|
27
|
+
variant: value === preset ? "secondary" : "ghost",
|
|
28
|
+
"aria-pressed": value === preset,
|
|
29
|
+
className: "font-mono",
|
|
30
|
+
onClick: () => onChange(preset),
|
|
31
|
+
children: preset
|
|
32
|
+
}, preset))
|
|
33
|
+
}),
|
|
34
|
+
relative ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
35
|
+
"data-testid": "date-math-resolved",
|
|
36
|
+
className: "text-xs text-muted-foreground",
|
|
37
|
+
children: ["= ", resolved.toLocaleString()]
|
|
38
|
+
}) : null,
|
|
39
|
+
value && resolved === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
40
|
+
className: "text-xs text-destructive",
|
|
41
|
+
children: "Not a date or date-math expression (e.g. now-24h)"
|
|
42
|
+
}) : null
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.DateMathControl = DateMathControl;
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=json-schema-form-date-math.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-date-math.cjs","names":["resolveDateMath","parseTimestamp","Button"],"sources":["../../src/components/json-schema-form-date-math.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { parseTimestamp, resolveDateMath } from \"../data/cells/timestamp-format\";\nimport { Button } from \"./button\";\n\n// The date-math presets a `format: date-math` field offers: each one\n// resolveDateMath understands, so the hint beside the field can show it.\nconst DATE_MATH_PRESETS = [\"now-15m\", \"now-1h\", \"now-24h\", \"now-7d\", \"now-30d\", \"now\"] as const;\n\n// DateMathControl wraps a date-time input (free text, with a calendar) in the\n// preset chips and a line naming the instant a relative expression resolves to\n// now — or that the text is neither a date nor date math.\nexport function DateMathControl({\n label,\n value,\n readOnly,\n onChange,\n children,\n}: {\n label: string;\n value: string;\n readOnly: boolean;\n onChange: (next: string) => void;\n children: ReactNode;\n}) {\n const resolved = value ? resolveDateMath(value) : null;\n const relative = resolved !== null && parseTimestamp(value) === null;\n return (\n <div className=\"flex min-w-0 flex-col gap-1\">\n {children}\n {readOnly ? null : (\n <div role=\"group\" aria-label={`${label} presets`} className=\"flex flex-wrap items-center gap-1\">\n {DATE_MATH_PRESETS.map((preset) => (\n <Button\n key={preset}\n type=\"button\"\n size=\"xs\"\n variant={value === preset ? \"secondary\" : \"ghost\"}\n aria-pressed={value === preset}\n className=\"font-mono\"\n onClick={() => onChange(preset)}\n >\n {preset}\n </Button>\n ))}\n </div>\n )}\n {relative ? (\n <span data-testid=\"date-math-resolved\" className=\"text-xs text-muted-foreground\">\n = {resolved.toLocaleString()}\n </span>\n ) : null}\n {value && resolved === null ? (\n <span className=\"text-xs text-destructive\">Not a date or date-math expression (e.g. now-24h)</span>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;AAMA,IAAM,oBAAoB;CAAC;CAAW;CAAU;CAAW;CAAU;CAAW;AAAK;AAKrF,SAAgB,gBAAgB,EAC9B,OACA,OACA,UACA,UACA,YAOC;CACD,MAAM,WAAW,QAAQA,yBAAAA,gBAAgB,KAAK,IAAI;CAClD,MAAM,WAAW,aAAa,QAAQC,yBAAAA,eAAe,KAAK,MAAM;CAChE,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG;GACA,WAAW,OACV,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,MAAK;IAAQ,cAAY,GAAG,MAAM;IAAW,WAAU;IACzD,UAAA,kBAAkB,KAAK,WACtB,iBAAA,GAAA,kBAAA,IAAA,CAACC,eAAAA,QAAD;KAEE,MAAK;KACL,MAAK;KACL,SAAS,UAAU,SAAS,cAAc;KAC1C,gBAAc,UAAU;KACxB,WAAU;KACV,eAAe,SAAS,MAAM;KAE7B,UAAA;IACK,GATD,MASC,CACT;GACE,CAAA;GAEN,WACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;IAAM,eAAY;IAAqB,WAAU;IAAjD,UAAA,CAAiF,MAC5E,SAAS,eAAe,CACvB;GACJ,CAAA,IAAA;GACH,SAAS,aAAa,OACrB,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAU;IAA2B,UAAA;GAAuD,CAAA,IAChG;EACD;;AAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare function DateMathControl({ label, value, readOnly, onChange, children, }: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
readOnly: boolean;
|
|
6
|
+
onChange: (next: string) => void;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=json-schema-form-date-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-date-math.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-date-math.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAiCA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { parseTimestamp, resolveDateMath } from "../data/cells/timestamp-format.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/json-schema-form-date-math.tsx
|
|
5
|
+
var DATE_MATH_PRESETS = [
|
|
6
|
+
"now-15m",
|
|
7
|
+
"now-1h",
|
|
8
|
+
"now-24h",
|
|
9
|
+
"now-7d",
|
|
10
|
+
"now-30d",
|
|
11
|
+
"now"
|
|
12
|
+
];
|
|
13
|
+
function DateMathControl({ label, value, readOnly, onChange, children }) {
|
|
14
|
+
const resolved = value ? resolveDateMath(value) : null;
|
|
15
|
+
const relative = resolved !== null && parseTimestamp(value) === null;
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
18
|
+
children: [
|
|
19
|
+
children,
|
|
20
|
+
readOnly ? null : /* @__PURE__ */ jsx("div", {
|
|
21
|
+
role: "group",
|
|
22
|
+
"aria-label": `${label} presets`,
|
|
23
|
+
className: "flex flex-wrap items-center gap-1",
|
|
24
|
+
children: DATE_MATH_PRESETS.map((preset) => /* @__PURE__ */ jsx(Button, {
|
|
25
|
+
type: "button",
|
|
26
|
+
size: "xs",
|
|
27
|
+
variant: value === preset ? "secondary" : "ghost",
|
|
28
|
+
"aria-pressed": value === preset,
|
|
29
|
+
className: "font-mono",
|
|
30
|
+
onClick: () => onChange(preset),
|
|
31
|
+
children: preset
|
|
32
|
+
}, preset))
|
|
33
|
+
}),
|
|
34
|
+
relative ? /* @__PURE__ */ jsxs("span", {
|
|
35
|
+
"data-testid": "date-math-resolved",
|
|
36
|
+
className: "text-xs text-muted-foreground",
|
|
37
|
+
children: ["= ", resolved.toLocaleString()]
|
|
38
|
+
}) : null,
|
|
39
|
+
value && resolved === null ? /* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: "text-xs text-destructive",
|
|
41
|
+
children: "Not a date or date-math expression (e.g. now-24h)"
|
|
42
|
+
}) : null
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export { DateMathControl };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=json-schema-form-date-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-form-date-math.js","names":[],"sources":["../../src/components/json-schema-form-date-math.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { parseTimestamp, resolveDateMath } from \"../data/cells/timestamp-format\";\nimport { Button } from \"./button\";\n\n// The date-math presets a `format: date-math` field offers: each one\n// resolveDateMath understands, so the hint beside the field can show it.\nconst DATE_MATH_PRESETS = [\"now-15m\", \"now-1h\", \"now-24h\", \"now-7d\", \"now-30d\", \"now\"] as const;\n\n// DateMathControl wraps a date-time input (free text, with a calendar) in the\n// preset chips and a line naming the instant a relative expression resolves to\n// now — or that the text is neither a date nor date math.\nexport function DateMathControl({\n label,\n value,\n readOnly,\n onChange,\n children,\n}: {\n label: string;\n value: string;\n readOnly: boolean;\n onChange: (next: string) => void;\n children: ReactNode;\n}) {\n const resolved = value ? resolveDateMath(value) : null;\n const relative = resolved !== null && parseTimestamp(value) === null;\n return (\n <div className=\"flex min-w-0 flex-col gap-1\">\n {children}\n {readOnly ? null : (\n <div role=\"group\" aria-label={`${label} presets`} className=\"flex flex-wrap items-center gap-1\">\n {DATE_MATH_PRESETS.map((preset) => (\n <Button\n key={preset}\n type=\"button\"\n size=\"xs\"\n variant={value === preset ? \"secondary\" : \"ghost\"}\n aria-pressed={value === preset}\n className=\"font-mono\"\n onClick={() => onChange(preset)}\n >\n {preset}\n </Button>\n ))}\n </div>\n )}\n {relative ? (\n <span data-testid=\"date-math-resolved\" className=\"text-xs text-muted-foreground\">\n = {resolved.toLocaleString()}\n </span>\n ) : null}\n {value && resolved === null ? (\n <span className=\"text-xs text-destructive\">Not a date or date-math expression (e.g. now-24h)</span>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;AAMA,IAAM,oBAAoB;CAAC;CAAW;CAAU;CAAW;CAAU;CAAW;AAAK;AAKrF,SAAgB,gBAAgB,EAC9B,OACA,OACA,UACA,UACA,YAOC;CACD,MAAM,WAAW,QAAQ,gBAAgB,KAAK,IAAI;CAClD,MAAM,WAAW,aAAa,QAAQ,eAAe,KAAK,MAAM;CAChE,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG;GACA,WAAW,OACV,oBAAC,OAAD;IAAK,MAAK;IAAQ,cAAY,GAAG,MAAM;IAAW,WAAU;IACzD,UAAA,kBAAkB,KAAK,WACtB,oBAAC,QAAD;KAEE,MAAK;KACL,MAAK;KACL,SAAS,UAAU,SAAS,cAAc;KAC1C,gBAAc,UAAU;KACxB,WAAU;KACV,eAAe,SAAS,MAAM;KAE7B,UAAA;IACK,GATD,MASC,CACT;GACE,CAAA;GAEN,WACC,qBAAC,QAAD;IAAM,eAAY;IAAqB,WAAU;IAAjD,UAAA,CAAiF,MAC5E,SAAS,eAAe,CACvB;GACJ,CAAA,IAAA;GACH,SAAS,aAAa,OACrB,oBAAC,QAAD;IAAM,WAAU;IAA2B,UAAA;GAAuD,CAAA,IAChG;EACD;;AAET"}
|
|
@@ -2,6 +2,7 @@ const require_utils = require("../lib/utils.cjs");
|
|
|
2
2
|
const require_timestamp_format = require("../data/cells/timestamp-format.cjs");
|
|
3
3
|
const require_Combobox = require("./Combobox.cjs");
|
|
4
4
|
const require_DateField = require("./DateField.cjs");
|
|
5
|
+
const require_json_schema_form_date_math = require("./json-schema-form-date-math.cjs");
|
|
5
6
|
const require_json_schema_form_color = require("./json-schema-form-color.cjs");
|
|
6
7
|
const require_InputField = require("./InputField.cjs");
|
|
7
8
|
const require_Switch = require("./Switch.cjs");
|
|
@@ -178,12 +179,12 @@ function DateControl({ field, fieldId, readOnly, size }) {
|
|
|
178
179
|
children: "—"
|
|
179
180
|
})
|
|
180
181
|
});
|
|
181
|
-
|
|
182
|
+
const input = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DateField.DateField, {
|
|
182
183
|
clearable: field.nullable === true,
|
|
183
184
|
clearLabel: `Clear ${field.label} to null`,
|
|
184
185
|
onClear: () => field.onChange(null),
|
|
185
186
|
disabled: readOnly,
|
|
186
|
-
mode: field.dateFormat === "date
|
|
187
|
+
mode: field.dateFormat === "date" ? "date" : "datetime",
|
|
187
188
|
id: fieldId,
|
|
188
189
|
"aria-label": field.label,
|
|
189
190
|
"data-jsf-input": true,
|
|
@@ -195,6 +196,14 @@ function DateControl({ field, fieldId, readOnly, size }) {
|
|
|
195
196
|
prefix: field.prefix,
|
|
196
197
|
suffix: field.suffix
|
|
197
198
|
});
|
|
199
|
+
if (field.dateFormat !== "date-math") return input;
|
|
200
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_date_math.DateMathControl, {
|
|
201
|
+
label: field.label,
|
|
202
|
+
value: text,
|
|
203
|
+
readOnly,
|
|
204
|
+
onChange: (next) => field.onChange(next),
|
|
205
|
+
children: input
|
|
206
|
+
});
|
|
198
207
|
}
|
|
199
208
|
function BooleanControl({ field, fieldId, readOnly, size }) {
|
|
200
209
|
if (typeof field.value === "boolean" || field.value === void 0 || field.value === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-fields.cjs","names":["lazy","toText","formatDateTimeRelative","cn","controlHeightClass","labelSizeClass","ColorSwatch","InputField","fieldAriaProps","defaultPlaceholder","NumberStepperControl","ClearableFieldGroup","DateField","inputClass","Switch","withSyntheticValue","GridControl","RadioGroupControl","SegmentedEnumControl","Combobox","comboboxAriaProps","useState","_Fragment","useLookupFetcher","useRef","useCallback","resolveLookupScope","LookupTreeControl","TagsComboboxControl","ConnectionLookupControl","fieldOptionToComboboxOption","Suspense"],"sources":["../../src/components/json-schema-form-fields.tsx"],"sourcesContent":["import { lazy, Suspense, useCallback, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { formatDateTimeRelative } from \"../data/cells/timestamp-format\";\nimport { Combobox } from \"./Combobox\";\nimport { DateField } from \"./DateField\";\nimport { ColorSwatch } from \"./json-schema-form-color\";\nimport { InputField } from \"./InputField\";\nimport { Switch } from \"./Switch\";\nimport { ClearableFieldGroup } from \"./clearable-field-group\";\nimport { NumberStepperControl } from \"./json-schema-form-number-stepper\";\nimport { RadioGroupControl, SegmentedEnumControl } from \"./json-schema-form-enum-choice\";\nimport { GridControl } from \"./json-schema-form-grid\";\nimport { ConnectionLookupControl } from \"./json-schema-form-connection\";\nimport { LookupTreeControl } from \"./json-schema-form-lookup-tree\";\nimport { fieldOptionToComboboxOption } from \"./lookup-option-view\";\nimport { TagsComboboxControl } from \"./json-schema-form-tags-combobox\";\nimport { resolveLookupScope, useLookupFetcher } from \"./form-lookup-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport {\n comboboxAriaProps,\n defaultPlaceholder,\n fieldAriaProps,\n inputClass,\n toText,\n withSyntheticValue,\n} from \"./json-schema-form-utils\";\nimport {\n controlHeightClass,\n labelSizeClass,\n type FormSize,\n} from \"./json-schema-form-size\";\n\nconst LazyMdxEditorField = lazy(async () => {\n const mod = await import(\"./MdxEditorField\");\n return { default: mod.MdxEditorField };\n});\n\n// ReadOnlyValue renders a `readOnly` field's current value as static text — no\n// input, no border, just the value (date/date-time formatted human-readably).\n// An empty value shows an em-dash. Carries the same id + data-jsf-input as the\n// editable controls so layout and queries stay uniform.\nexport function ReadOnlyValue({ field, fieldId, size }: { field: FieldControl; fieldId: string; size: FormSize }) {\n const text = toText(field.value);\n const secret = field.schema.format === \"password\";\n const display = secret && text ? \"••••••••\" : field.kind === \"date\" && text ? formatDateTimeRelative(text) : text;\n return (\n <span\n id={fieldId}\n data-jsf-input\n data-jsf-readonly\n className={cn(\"flex items-center text-foreground\", controlHeightClass[size], labelSizeClass[size])}\n title={secret ? undefined : text || undefined}\n >\n {display || <span className=\"text-muted-foreground\">—</span>}\n </span>\n );\n}\n\nexport function StringControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // format:\"color\" prefixes the text input with a native color picker bound to the\n // same value; a consumer-set `prefix` wins if both are present.\n const prefix =\n field.prefix ??\n (field.schema.format === \"color\" ? (\n <ColorSwatch label={field.label} value={toText(field.value)} disabled={readOnly} onPick={field.onChange} />\n ) : undefined);\n return (\n <InputField\n prefix={prefix}\n suffix={field.suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n // format:\"password\" masks secret material (API keys, client secrets);\n // autoComplete new-password stops browsers from offering saved logins.\n type={field.schema.format === \"password\" ? \"password\" : \"text\"}\n autoComplete={field.schema.format === \"password\" ? \"new-password\" : undefined}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n className={controlHeightClass[size]}\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(value) => field.onChange(value)}\n />\n );\n}\n\nexport function NumberControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // A bounded number can opt into a single-thumb progress slider.\n if (field.schema[\"x-number-display\"] === \"slider\" && typeof field.schema.maximum === \"number\") {\n return <NumberSliderControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n if (field.schema[\"x-number-display\"] === \"stepper\") {\n return <NumberStepperControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n // Default type=\"text\" (not number) so non-numeric values a consumer permits —\n // e.g. template tokens — are not silently dropped by the browser. A schema that\n // declares `multipleOf` opts into a real `<input type=\"number\">` (native step,\n // spin buttons, min/max), matching a hand-built numeric field.\n const coerce = field.coerceNumber !== false;\n const step = typeof field.schema.multipleOf === \"number\" ? field.schema.multipleOf : undefined;\n const native = step !== undefined && !(field.allowCustomValue && typeof field.value === \"string\" && field.value.includes(\"{{\"));\n // A static unit (e.g. \"%\") rides the right edge of the input as a display-only\n // suffix; a consumer-set `suffix` (e.g. an insert-snippet button) wins if both\n // are present (number insert triggers mount on the left as `prefix`).\n const suffix = field.suffix ?? (field.unit ? (\n <span className=\"pointer-events-none select-none text-muted-foreground\">{field.unit}</span>\n ) : undefined);\n return (\n <InputField\n prefix={field.prefix}\n suffix={suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n type={native ? \"number\" : \"text\"}\n inputMode=\"decimal\"\n {...(native\n ? {\n step,\n ...(typeof field.schema.minimum === \"number\" ? { min: field.schema.minimum } : {}),\n ...(typeof field.schema.maximum === \"number\" ? { max: field.schema.maximum } : {}),\n }\n : {})}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n className={controlHeightClass[size]}\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(raw) => {\n // Coerce mid-typing ONLY when the parse round-trips to the same text\n // (e.g. \"100\", \"33.5\") — so an in-progress decimal like \"33.\" or a\n // trailing-zero \"33.30\" keeps its raw text instead of collapsing to a\n // number and stranding the caret. Non-numeric tokens fall through to\n // the raw string. Blur finalizes any still-uncoerced numeric text.\n if (coerce && raw.trim() !== \"\" && String(Number(raw)) === raw.trim()) {\n field.onChange(Number(raw));\n } else {\n field.onChange(raw);\n }\n }}\n onBlur={(e) => {\n const raw = e.target.value;\n if (coerce && raw.trim() !== \"\" && Number.isFinite(Number(raw))) {\n field.onChange(Number(raw));\n }\n }}\n />\n );\n}\n\n// A single-thumb range input styled with a progress-filled track. The input sits\n// above the track/fill divs; only its thumb is painted.\nconst SLIDER_INPUT_CLASS =\n \"absolute inset-0 h-6 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent [&::-webkit-slider-thumb]:size-3.5 [&::-webkit-slider-thumb]:-mt-[5px] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-background/80 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm [&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent [&::-moz-range-thumb]:size-3.5 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm\";\n\n// NumberSliderControl renders a bounded number (`x-number-display: \"slider\"`) as\n// a single-thumb slider whose fill grows with the value, with the live value\n// shown to the right.\nexport function NumberSliderControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const min = typeof field.schema.minimum === \"number\" ? field.schema.minimum : 0;\n const max = typeof field.schema.maximum === \"number\" ? field.schema.maximum : 100;\n const step = typeof field.schema.multipleOf === \"number\" ? field.schema.multipleOf : 1;\n const raw = typeof field.value === \"number\" ? field.value : Number(toText(field.value));\n const hasValue = Number.isFinite(raw);\n const value = hasValue ? Math.min(max, Math.max(min, raw)) : min;\n const percent = max > min ? ((value - min) / (max - min)) * 100 : 0;\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}>\n <div className=\"flex items-center gap-3\">\n <div className=\"relative h-6 min-w-0 flex-1\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border\" />\n <div\n className=\"absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary/70\"\n style={{ width: `${percent}%` }}\n />\n <input\n id={fieldId}\n data-jsf-input\n type=\"range\"\n aria-label={field.label}\n {...fieldAriaProps(field, fieldId)}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={readOnly}\n className={cn(SLIDER_INPUT_CLASS, field.inputClassName)}\n onChange={(event) => field.onChange(Number(event.target.value))}\n />\n </div>\n <span className={cn(\"w-16 shrink-0 text-right tabular-nums\", labelSizeClass[size])}>\n {hasValue ? value.toLocaleString() : \"—\"}\n </span>\n </div>\n </ClearableFieldGroup>\n );\n}\n\n// DateControl edits a `format: date`/`date-time` string. Read-only, it shows the\n// human-readable absolute + relative form (e.g. \"Apr 15, 2026, 12:00 PM (2h\n// ago)\"); editable, a DateField in the schema's date or datetime mode. The raw\n// string is committed unchanged so a\n// consumer-permitted template token in the field is preserved.\nexport function DateControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const text = toText(field.value);\n if (!readOnly && field.allowCustomValue && text.includes(\"{{\")) {\n return <StringControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n if (readOnly) {\n return (\n <div\n id={fieldId}\n data-jsf-input\n className={cn(\"flex items-center text-foreground\", controlHeightClass[size], labelSizeClass[size])}\n title={text || undefined}\n >\n {text ? formatDateTimeRelative(text) : <span className=\"text-muted-foreground\">—</span>}\n </div>\n );\n }\n return (\n <DateField\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n disabled={readOnly}\n mode={field.dateFormat === \"date-time\" ? \"datetime\" : \"date\"}\n id={fieldId}\n aria-label={field.label}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n inputClassName={cn(inputClass(size), field.prefix && \"pl-8\", field.suffix ? \"pr-14\" : \"pr-8\")}\n value={text}\n onChange={(next) => field.onChange(next)}\n placeholder={defaultPlaceholder(field.schema)}\n prefix={field.prefix}\n suffix={field.suffix}\n />\n );\n}\n\nexport function BooleanControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // Only render a switch when the value is genuinely boolean (or unset).\n // A non-boolean value (e.g. a token a consumer left in place) renders as text\n // so it is preserved and editable.\n if (typeof field.value === \"boolean\" || field.value === undefined || field.value === null) {\n return (\n <div className={cn(\"flex items-center gap-1\", controlHeightClass[size])}>\n {field.prefix}\n <Switch\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n checked={field.value === true}\n disabled={readOnly}\n onChange={field.onChange}\n />\n </div>\n );\n }\n return <StringControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n}\n\nexport function EnumControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const value = toText(field.value);\n const options = withSyntheticValue(field.options ?? [], value);\n if (field.display === \"grid\") {\n return <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><GridControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} /></ClearableFieldGroup>;\n }\n if (field.display === \"radio\") {\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><RadioGroupControl field={field} fieldId={fieldId} readOnly={readOnly} options={options} value={value} size={size} /></ClearableFieldGroup>\n );\n }\n if (field.display === \"segmented\") {\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><SegmentedEnumControl field={field} fieldId={fieldId} readOnly={readOnly} options={options} value={value} size={size} /></ClearableFieldGroup>\n );\n }\n return (\n <Combobox\n id={fieldId}\n options={options}\n value={value}\n disabled={readOnly}\n size={size}\n allowCustomValue={field.allowCustomValue ?? false}\n {...(field.nullable ? { clearable: true } : {})}\n clearLabel={`Clear ${field.label} to null`}\n {...(field.nullable ? { onClear: () => field.onChange(null) } : {})}\n onChange={(v) => field.onChange(v)}\n prefix={field.prefix}\n suffix={field.suffix}\n {...comboboxAriaProps(field, fieldId)}\n {...(field.inputClassName ? { className: field.inputClassName } : {})}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n}\n\n// LookupControl is the async entity-reference picker for an `x-clicky-lookup`\n// field. It wraps Combobox and fetches options lazily through the form's\n// LookupFetcher (from context): the head set loads when the menu opens and the\n// (debounced) typed query drives server-side search. Single-select keeps\n// allowCustomValue on so a value outside the option set still commits (e.g. an\n// inline DSN). When no fetcher is wired it degrades to a free-text combobox.\nexport function LookupControl(props: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n rootValue?: Record<string, unknown>;\n}) {\n // A failed lookup is shown under the control until the next one succeeds; the\n // options already loaded stay as they were.\n const [error, setError] = useState<string>();\n const errorId = `${props.fieldId}-lookup-error`;\n return (\n <>\n <LookupInput {...props} onError={setError} {...(error ? { errorId } : {})} />\n {error && (\n <p id={errorId} role=\"alert\" data-jsf-lookup-error className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </>\n );\n}\n\nfunction LookupInput({\n field,\n fieldId,\n readOnly,\n size,\n rootValue,\n onError,\n errorId,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n rootValue?: Record<string, unknown>;\n onError: (message: string | undefined) => void;\n errorId?: string;\n}) {\n const descriptor = field.lookup;\n const fetcher = useLookupFetcher(descriptor);\n const value = toText(field.value);\n const [options, setOptions] = useState<FieldOption[]>([]);\n const [loading, setLoading] = useState(false);\n\n // rootValue is read through a ref so onSearch stays referentially stable: a new\n // onSearch each render would retrigger Combobox's search effect on every\n // setOptions, looping. The scopeKey effect below re-fetches when scope changes.\n const rootRef = useRef(rootValue);\n rootRef.current = rootValue;\n\n const onSearch = useCallback(\n (query: string) => {\n if (!descriptor || !fetcher) return;\n setLoading(true);\n const root = rootRef.current;\n fetcher({ descriptor, query, ...(root ? { rootValue: root } : {}) })\n .then((next) => {\n setOptions(next);\n onError(undefined);\n })\n .catch((cause: unknown) => onError(cause instanceof Error ? cause.message : String(cause)))\n .finally(() => setLoading(false));\n },\n [descriptor, fetcher, onError],\n );\n\n // Re-fetch the head set when the scope (a sibling field, e.g. provider type)\n // changes so the out-of-scope set is replaced rather than shown stale.\n const scopeKey = descriptor ? JSON.stringify(resolveLookupScope(descriptor, rootValue)) : \"\";\n useEffect(() => {\n if (descriptor && fetcher) onSearch(\"\");\n else setOptions([]);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scopeKey, onSearch]);\n\n // A descriptor that declares a hierarchy browses its options as a tree rather\n // than scrolling one flat list. It owns the multi-value case too, since the\n // committed value is then an array rather than a single string.\n if (descriptor?.hierarchy) {\n return (\n <LookupTreeControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n hierarchy={descriptor.hierarchy}\n />\n );\n }\n\n // A multi lookup commits an ARRAY, so it takes the tags picker rather than the\n // single-value combobox below — which would render the array as an empty box\n // and then overwrite it with a bare string. Without a fetcher the same control\n // renders the already-committed values with an empty option set.\n if (descriptor?.multi) {\n return (\n <TagsComboboxControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n {...(fetcher ? { onSearch } : {})}\n />\n );\n }\n\n if (!descriptor || !fetcher) {\n return (\n <Combobox\n id={fieldId}\n options={withSyntheticValue([], value)}\n {...(field.nullable ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) } : {})}\n value={value}\n disabled={readOnly}\n size={size}\n allowCustomValue\n onChange={(v) => field.onChange(v)}\n {...comboboxAriaProps(field, fieldId)}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n }\n\n // A `format: \"connection\"` field is picked by its `connection://` ref from a\n // typed, grouped picker that can create the connection it is missing.\n if (field.schema.format === \"connection\") {\n return (\n <ConnectionLookupControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n onSearch={onSearch}\n />\n );\n }\n\n return (\n <Combobox\n id={fieldId}\n options={withSyntheticValue(options, value).map(fieldOptionToComboboxOption)}\n {...(field.nullable ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) } : {})}\n value={value}\n disabled={readOnly}\n size={size}\n loading={loading}\n allowCustomValue={field.allowCustomValue ?? false}\n onSearch={onSearch}\n onChange={(v) => field.onChange(v)}\n {...comboboxAriaProps(field, fieldId)}\n {...(errorId ? { invalid: true as const, describedBy: errorId } : {})}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n}\n\n// TextareaControl edits a long-form string in a multi-line box. Read-only, it\n// shows the value with line breaks preserved; editable, a resizable <textarea>.\n// The raw string is committed unchanged so a consumer-permitted template token\n// survives.\nexport function TextareaControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const text = toText(field.value);\n if (readOnly) {\n return (\n <span\n id={fieldId}\n data-jsf-input\n data-jsf-readonly\n className={cn(\"block whitespace-pre-wrap break-words text-foreground\", labelSizeClass[size])}\n title={text || undefined}\n >\n {text || <span className=\"text-muted-foreground\">—</span>}\n </span>\n );\n }\n return (\n <InputField\n as=\"textarea\"\n prefix={field.prefix}\n suffix={field.suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n rows={4}\n className=\"h-auto min-h-[5rem]\"\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={text}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(value) => field.onChange(value)}\n />\n );\n}\n\nexport function MarkdownControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const fallback = (\n <textarea\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n rows={6}\n className={cn(inputClass(size), \"h-auto resize-y font-mono\", field.prefix && \"pl-8\", field.suffix && \"pr-8\")}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(e) => field.onChange(e.target.value)}\n />\n );\n\n return (\n <Suspense fallback={fallback}>\n <LazyMdxEditorField\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n value={toText(field.value)}\n readOnly={readOnly}\n size={size}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(next) => field.onChange(next)}\n {...field.markdownOptions}\n />\n </Suspense>\n );\n}\n\n// DisplayControl renders a static, non-editable presentation element:\n// Label/Title (heading), Message (info text), Line (divider), or Blank/Filler\n// (spacer). It never collects a value; the heading/text source is the field's\n// title (label) and, for \"text\", its description. Rendered identically in the\n// form and the read-only Viewer.\nexport function DisplayControl({ field, size }: { field: FieldControl; size: FormSize }) {\n const variant = field.displayVariant ?? \"text\";\n if (variant === \"divider\") {\n return <hr data-jsf-input className=\"my-1 w-full border-t border-border\" />;\n }\n if (variant === \"spacer\") {\n return <div data-jsf-input aria-hidden className=\"h-2\" />;\n }\n if (variant === \"heading\") {\n return (\n <div\n data-jsf-input\n className={cn(\"border-b border-border pb-1 font-semibold text-foreground\", labelSizeClass[size])}\n >\n {field.label}\n </div>\n );\n }\n const text = field.description ?? toText(field.value) ?? field.label;\n return (\n <p data-jsf-input className={cn(\"text-muted-foreground\", labelSizeClass[size])}>\n {text || field.label}\n </p>\n );\n}\n\n// LinkControl renders a read-only external hyperlink. The\n// href is field.href, falling back to the value when it is an absolute URL; with\n// neither it degrades to a plain read-only value.\nexport function LinkControl({ field, fieldId, size }: { field: FieldControl; fieldId: string; size: FormSize }) {\n const text = toText(field.value);\n const href = field.href ?? (/^https?:\\/\\//i.test(text) ? text : undefined);\n if (!href) {\n return <ReadOnlyValue field={field} fieldId={fieldId} size={size} />;\n }\n return (\n <a\n id={fieldId}\n data-jsf-input\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className={cn(\"inline-flex items-center text-primary underline underline-offset-2\", controlHeightClass[size], labelSizeClass[size])}\n >\n {text || field.label || href}\n </a>\n );\n}\n\n// HMR probe\n// HMR probe 2\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,sBAAA,GAAqBA,MAAAA,KAAAA,CAAK,YAAY;CAE1C,OAAO,EAAE,UAAS,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADA,sBAAA,CAAA,EAAA,CACI,eAAe;AACvC,CAAC;AAMD,SAAgB,cAAc,EAAE,OAAO,SAAS,QAAkE;CAChH,MAAM,OAAOC,+BAAAA,OAAO,MAAM,KAAK;CAC/B,MAAM,SAAS,MAAM,OAAO,WAAW;CACvC,MAAM,UAAU,UAAU,OAAO,aAAa,MAAM,SAAS,UAAU,OAAOC,yBAAAA,uBAAuB,IAAI,IAAI;CAC7G,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,IAAI;EACJ,kBAAA;EACA,qBAAA;EACA,WAAWC,cAAAA,GAAG,qCA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controlHeightClass","labelSizeClass","ColorSwatch","InputField","fieldAriaProps","defaultPlaceholder","NumberStepperControl","ClearableFieldGroup","DateField","inputClass","DateMathControl","Switch","withSyntheticValue","GridControl","RadioGroupControl","SegmentedEnumControl","Combobox","comboboxAriaProps","useState","_Fragment","useLookupFetcher","useRef","useCallback","resolveLookupScope","LookupTreeControl","TagsComboboxControl","ConnectionLookupControl","fieldOptionToComboboxOption","Suspense"],"sources":["../../src/components/json-schema-form-fields.tsx"],"sourcesContent":["import { lazy, Suspense, useCallback, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { formatDateTimeRelative } from \"../data/cells/timestamp-format\";\nimport { Combobox } from \"./Combobox\";\nimport { DateField } from \"./DateField\";\nimport { DateMathControl } from \"./json-schema-form-date-math\";\nimport { ColorSwatch } from \"./json-schema-form-color\";\nimport { InputField } from \"./InputField\";\nimport { Switch } from \"./Switch\";\nimport { ClearableFieldGroup } from \"./clearable-field-group\";\nimport { NumberStepperControl } from \"./json-schema-form-number-stepper\";\nimport { RadioGroupControl, SegmentedEnumControl } from \"./json-schema-form-enum-choice\";\nimport { GridControl } from \"./json-schema-form-grid\";\nimport { ConnectionLookupControl } from \"./json-schema-form-connection\";\nimport { LookupTreeControl } from \"./json-schema-form-lookup-tree\";\nimport { fieldOptionToComboboxOption } from \"./lookup-option-view\";\nimport { TagsComboboxControl } from \"./json-schema-form-tags-combobox\";\nimport { resolveLookupScope, useLookupFetcher } from \"./form-lookup-context\";\nimport type { FieldControl, FieldOption } from \"./json-schema-form-types\";\nimport {\n comboboxAriaProps,\n defaultPlaceholder,\n fieldAriaProps,\n inputClass,\n toText,\n withSyntheticValue,\n} from \"./json-schema-form-utils\";\nimport {\n controlHeightClass,\n labelSizeClass,\n type FormSize,\n} from \"./json-schema-form-size\";\n\nconst LazyMdxEditorField = lazy(async () => {\n const mod = await import(\"./MdxEditorField\");\n return { default: mod.MdxEditorField };\n});\n\n// ReadOnlyValue renders a `readOnly` field's current value as static text — no\n// input, no border, just the value (date/date-time formatted human-readably).\n// An empty value shows an em-dash. Carries the same id + data-jsf-input as the\n// editable controls so layout and queries stay uniform.\nexport function ReadOnlyValue({ field, fieldId, size }: { field: FieldControl; fieldId: string; size: FormSize }) {\n const text = toText(field.value);\n const secret = field.schema.format === \"password\";\n const display = secret && text ? \"••••••••\" : field.kind === \"date\" && text ? formatDateTimeRelative(text) : text;\n return (\n <span\n id={fieldId}\n data-jsf-input\n data-jsf-readonly\n className={cn(\"flex items-center text-foreground\", controlHeightClass[size], labelSizeClass[size])}\n title={secret ? undefined : text || undefined}\n >\n {display || <span className=\"text-muted-foreground\">—</span>}\n </span>\n );\n}\n\nexport function StringControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // format:\"color\" prefixes the text input with a native color picker bound to the\n // same value; a consumer-set `prefix` wins if both are present.\n const prefix =\n field.prefix ??\n (field.schema.format === \"color\" ? (\n <ColorSwatch label={field.label} value={toText(field.value)} disabled={readOnly} onPick={field.onChange} />\n ) : undefined);\n return (\n <InputField\n prefix={prefix}\n suffix={field.suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n // format:\"password\" masks secret material (API keys, client secrets);\n // autoComplete new-password stops browsers from offering saved logins.\n type={field.schema.format === \"password\" ? \"password\" : \"text\"}\n autoComplete={field.schema.format === \"password\" ? \"new-password\" : undefined}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n className={controlHeightClass[size]}\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(value) => field.onChange(value)}\n />\n );\n}\n\nexport function NumberControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // A bounded number can opt into a single-thumb progress slider.\n if (field.schema[\"x-number-display\"] === \"slider\" && typeof field.schema.maximum === \"number\") {\n return <NumberSliderControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n if (field.schema[\"x-number-display\"] === \"stepper\") {\n return <NumberStepperControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n // Default type=\"text\" (not number) so non-numeric values a consumer permits —\n // e.g. template tokens — are not silently dropped by the browser. A schema that\n // declares `multipleOf` opts into a real `<input type=\"number\">` (native step,\n // spin buttons, min/max), matching a hand-built numeric field.\n const coerce = field.coerceNumber !== false;\n const step = typeof field.schema.multipleOf === \"number\" ? field.schema.multipleOf : undefined;\n const native = step !== undefined && !(field.allowCustomValue && typeof field.value === \"string\" && field.value.includes(\"{{\"));\n // A static unit (e.g. \"%\") rides the right edge of the input as a display-only\n // suffix; a consumer-set `suffix` (e.g. an insert-snippet button) wins if both\n // are present (number insert triggers mount on the left as `prefix`).\n const suffix = field.suffix ?? (field.unit ? (\n <span className=\"pointer-events-none select-none text-muted-foreground\">{field.unit}</span>\n ) : undefined);\n return (\n <InputField\n prefix={field.prefix}\n suffix={suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n type={native ? \"number\" : \"text\"}\n inputMode=\"decimal\"\n {...(native\n ? {\n step,\n ...(typeof field.schema.minimum === \"number\" ? { min: field.schema.minimum } : {}),\n ...(typeof field.schema.maximum === \"number\" ? { max: field.schema.maximum } : {}),\n }\n : {})}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n className={controlHeightClass[size]}\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(raw) => {\n // Coerce mid-typing ONLY when the parse round-trips to the same text\n // (e.g. \"100\", \"33.5\") — so an in-progress decimal like \"33.\" or a\n // trailing-zero \"33.30\" keeps its raw text instead of collapsing to a\n // number and stranding the caret. Non-numeric tokens fall through to\n // the raw string. Blur finalizes any still-uncoerced numeric text.\n if (coerce && raw.trim() !== \"\" && String(Number(raw)) === raw.trim()) {\n field.onChange(Number(raw));\n } else {\n field.onChange(raw);\n }\n }}\n onBlur={(e) => {\n const raw = e.target.value;\n if (coerce && raw.trim() !== \"\" && Number.isFinite(Number(raw))) {\n field.onChange(Number(raw));\n }\n }}\n />\n );\n}\n\n// A single-thumb range input styled with a progress-filled track. The input sits\n// above the track/fill divs; only its thumb is painted.\nconst SLIDER_INPUT_CLASS =\n \"absolute inset-0 h-6 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent [&::-webkit-slider-thumb]:size-3.5 [&::-webkit-slider-thumb]:-mt-[5px] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-background/80 [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm [&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent [&::-moz-range-thumb]:size-3.5 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm\";\n\n// NumberSliderControl renders a bounded number (`x-number-display: \"slider\"`) as\n// a single-thumb slider whose fill grows with the value, with the live value\n// shown to the right.\nexport function NumberSliderControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const min = typeof field.schema.minimum === \"number\" ? field.schema.minimum : 0;\n const max = typeof field.schema.maximum === \"number\" ? field.schema.maximum : 100;\n const step = typeof field.schema.multipleOf === \"number\" ? field.schema.multipleOf : 1;\n const raw = typeof field.value === \"number\" ? field.value : Number(toText(field.value));\n const hasValue = Number.isFinite(raw);\n const value = hasValue ? Math.min(max, Math.max(min, raw)) : min;\n const percent = max > min ? ((value - min) / (max - min)) * 100 : 0;\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}>\n <div className=\"flex items-center gap-3\">\n <div className=\"relative h-6 min-w-0 flex-1\">\n <div className=\"absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border\" />\n <div\n className=\"absolute left-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary/70\"\n style={{ width: `${percent}%` }}\n />\n <input\n id={fieldId}\n data-jsf-input\n type=\"range\"\n aria-label={field.label}\n {...fieldAriaProps(field, fieldId)}\n min={min}\n max={max}\n step={step}\n value={value}\n disabled={readOnly}\n className={cn(SLIDER_INPUT_CLASS, field.inputClassName)}\n onChange={(event) => field.onChange(Number(event.target.value))}\n />\n </div>\n <span className={cn(\"w-16 shrink-0 text-right tabular-nums\", labelSizeClass[size])}>\n {hasValue ? value.toLocaleString() : \"—\"}\n </span>\n </div>\n </ClearableFieldGroup>\n );\n}\n\n// DateControl edits a `format: date`/`date-time` string. Read-only, it shows the\n// human-readable absolute + relative form (e.g. \"Apr 15, 2026, 12:00 PM (2h\n// ago)\"); editable, a DateField in the schema's date or datetime mode. The raw\n// string is committed unchanged so a\n// consumer-permitted template token in the field is preserved.\nexport function DateControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const text = toText(field.value);\n if (!readOnly && field.allowCustomValue && text.includes(\"{{\")) {\n return <StringControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n }\n if (readOnly) {\n return (\n <div\n id={fieldId}\n data-jsf-input\n className={cn(\"flex items-center text-foreground\", controlHeightClass[size], labelSizeClass[size])}\n title={text || undefined}\n >\n {text ? formatDateTimeRelative(text) : <span className=\"text-muted-foreground\">—</span>}\n </div>\n );\n }\n const input = (\n <DateField\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n disabled={readOnly}\n mode={field.dateFormat === \"date\" ? \"date\" : \"datetime\"}\n id={fieldId}\n aria-label={field.label}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n inputClassName={cn(inputClass(size), field.prefix && \"pl-8\", field.suffix ? \"pr-14\" : \"pr-8\")}\n value={text}\n onChange={(next) => field.onChange(next)}\n placeholder={defaultPlaceholder(field.schema)}\n prefix={field.prefix}\n suffix={field.suffix}\n />\n );\n if (field.dateFormat !== \"date-math\") return input;\n return (\n <DateMathControl label={field.label} value={text} readOnly={readOnly} onChange={(next) => field.onChange(next)}>\n {input}\n </DateMathControl>\n );\n}\n\nexport function BooleanControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n // Only render a switch when the value is genuinely boolean (or unset).\n // A non-boolean value (e.g. a token a consumer left in place) renders as text\n // so it is preserved and editable.\n if (typeof field.value === \"boolean\" || field.value === undefined || field.value === null) {\n return (\n <div className={cn(\"flex items-center gap-1\", controlHeightClass[size])}>\n {field.prefix}\n <Switch\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n checked={field.value === true}\n disabled={readOnly}\n onChange={field.onChange}\n />\n </div>\n );\n }\n return <StringControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} />;\n}\n\nexport function EnumControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const value = toText(field.value);\n const options = withSyntheticValue(field.options ?? [], value);\n if (field.display === \"grid\") {\n return <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><GridControl field={field} fieldId={fieldId} readOnly={readOnly} size={size} /></ClearableFieldGroup>;\n }\n if (field.display === \"radio\") {\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><RadioGroupControl field={field} fieldId={fieldId} readOnly={readOnly} options={options} value={value} size={size} /></ClearableFieldGroup>\n );\n }\n if (field.display === \"segmented\") {\n return (\n <ClearableFieldGroup clearable={field.nullable === true && !readOnly && field.value != null} clearLabel={`Clear ${field.label} to null`} onClear={() => field.onChange(null)}><SegmentedEnumControl field={field} fieldId={fieldId} readOnly={readOnly} options={options} value={value} size={size} /></ClearableFieldGroup>\n );\n }\n return (\n <Combobox\n id={fieldId}\n options={options}\n value={value}\n disabled={readOnly}\n size={size}\n allowCustomValue={field.allowCustomValue ?? false}\n {...(field.nullable ? { clearable: true } : {})}\n clearLabel={`Clear ${field.label} to null`}\n {...(field.nullable ? { onClear: () => field.onChange(null) } : {})}\n onChange={(v) => field.onChange(v)}\n prefix={field.prefix}\n suffix={field.suffix}\n {...comboboxAriaProps(field, fieldId)}\n {...(field.inputClassName ? { className: field.inputClassName } : {})}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n}\n\n// LookupControl is the async entity-reference picker for an `x-clicky-lookup`\n// field. It wraps Combobox and fetches options lazily through the form's\n// LookupFetcher (from context): the head set loads when the menu opens and the\n// (debounced) typed query drives server-side search. Single-select keeps\n// allowCustomValue on so a value outside the option set still commits (e.g. an\n// inline DSN). When no fetcher is wired it degrades to a free-text combobox.\nexport function LookupControl(props: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n rootValue?: Record<string, unknown>;\n}) {\n // A failed lookup is shown under the control until the next one succeeds; the\n // options already loaded stay as they were.\n const [error, setError] = useState<string>();\n const errorId = `${props.fieldId}-lookup-error`;\n return (\n <>\n <LookupInput {...props} onError={setError} {...(error ? { errorId } : {})} />\n {error && (\n <p id={errorId} role=\"alert\" data-jsf-lookup-error className=\"text-xs text-destructive\">\n {error}\n </p>\n )}\n </>\n );\n}\n\nfunction LookupInput({\n field,\n fieldId,\n readOnly,\n size,\n rootValue,\n onError,\n errorId,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n rootValue?: Record<string, unknown>;\n onError: (message: string | undefined) => void;\n errorId?: string;\n}) {\n const descriptor = field.lookup;\n const fetcher = useLookupFetcher(descriptor);\n const value = toText(field.value);\n const [options, setOptions] = useState<FieldOption[]>([]);\n const [loading, setLoading] = useState(false);\n\n // rootValue is read through a ref so onSearch stays referentially stable: a new\n // onSearch each render would retrigger Combobox's search effect on every\n // setOptions, looping. The scopeKey effect below re-fetches when scope changes.\n const rootRef = useRef(rootValue);\n rootRef.current = rootValue;\n\n const onSearch = useCallback(\n (query: string) => {\n if (!descriptor || !fetcher) return;\n setLoading(true);\n const root = rootRef.current;\n fetcher({ descriptor, query, ...(root ? { rootValue: root } : {}) })\n .then((next) => {\n setOptions(next);\n onError(undefined);\n })\n .catch((cause: unknown) => onError(cause instanceof Error ? cause.message : String(cause)))\n .finally(() => setLoading(false));\n },\n [descriptor, fetcher, onError],\n );\n\n // Re-fetch the head set when the scope (a sibling field, e.g. provider type)\n // changes so the out-of-scope set is replaced rather than shown stale.\n const scopeKey = descriptor ? JSON.stringify(resolveLookupScope(descriptor, rootValue)) : \"\";\n useEffect(() => {\n if (descriptor && fetcher) onSearch(\"\");\n else setOptions([]);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scopeKey, onSearch]);\n\n // A descriptor that declares a hierarchy browses its options as a tree rather\n // than scrolling one flat list. It owns the multi-value case too, since the\n // committed value is then an array rather than a single string.\n if (descriptor?.hierarchy) {\n return (\n <LookupTreeControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n hierarchy={descriptor.hierarchy}\n />\n );\n }\n\n // A multi lookup commits an ARRAY, so it takes the tags picker rather than the\n // single-value combobox below — which would render the array as an empty box\n // and then overwrite it with a bare string. Without a fetcher the same control\n // renders the already-committed values with an empty option set.\n if (descriptor?.multi) {\n return (\n <TagsComboboxControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n {...(fetcher ? { onSearch } : {})}\n />\n );\n }\n\n if (!descriptor || !fetcher) {\n return (\n <Combobox\n id={fieldId}\n options={withSyntheticValue([], value)}\n {...(field.nullable ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) } : {})}\n value={value}\n disabled={readOnly}\n size={size}\n allowCustomValue\n onChange={(v) => field.onChange(v)}\n {...comboboxAriaProps(field, fieldId)}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n }\n\n // A `format: \"connection\"` field is picked by its `connection://` ref from a\n // typed, grouped picker that can create the connection it is missing.\n if (field.schema.format === \"connection\") {\n return (\n <ConnectionLookupControl\n field={field}\n fieldId={fieldId}\n readOnly={readOnly}\n size={size}\n options={options}\n loading={loading}\n onSearch={onSearch}\n />\n );\n }\n\n return (\n <Combobox\n id={fieldId}\n options={withSyntheticValue(options, value).map(fieldOptionToComboboxOption)}\n {...(field.nullable ? { clearable: true, clearLabel: `Clear ${field.label} to null`, onClear: () => field.onChange(null) } : {})}\n value={value}\n disabled={readOnly}\n size={size}\n loading={loading}\n allowCustomValue={field.allowCustomValue ?? false}\n onSearch={onSearch}\n onChange={(v) => field.onChange(v)}\n {...comboboxAriaProps(field, fieldId)}\n {...(errorId ? { invalid: true as const, describedBy: errorId } : {})}\n {...(defaultPlaceholder(field.schema) ? { placeholder: defaultPlaceholder(field.schema) } : {})}\n />\n );\n}\n\n// TextareaControl edits a long-form string in a multi-line box. Read-only, it\n// shows the value with line breaks preserved; editable, a resizable <textarea>.\n// The raw string is committed unchanged so a consumer-permitted template token\n// survives.\nexport function TextareaControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const text = toText(field.value);\n if (readOnly) {\n return (\n <span\n id={fieldId}\n data-jsf-input\n data-jsf-readonly\n className={cn(\"block whitespace-pre-wrap break-words text-foreground\", labelSizeClass[size])}\n title={text || undefined}\n >\n {text || <span className=\"text-muted-foreground\">—</span>}\n </span>\n );\n }\n return (\n <InputField\n as=\"textarea\"\n prefix={field.prefix}\n suffix={field.suffix}\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n rows={4}\n className=\"h-auto min-h-[5rem]\"\n inputClassName={cn(labelSizeClass[size], field.inputClassName)}\n value={text}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(value) => field.onChange(value)}\n />\n );\n}\n\nexport function MarkdownControl({\n field,\n fieldId,\n readOnly,\n size,\n}: {\n field: FieldControl;\n fieldId: string;\n readOnly: boolean;\n size: FormSize;\n}) {\n const fallback = (\n <textarea\n id={fieldId}\n data-jsf-input\n {...fieldAriaProps(field, fieldId)}\n rows={6}\n className={cn(inputClass(size), \"h-auto resize-y font-mono\", field.prefix && \"pl-8\", field.suffix && \"pr-8\")}\n value={toText(field.value)}\n disabled={readOnly}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(e) => field.onChange(e.target.value)}\n />\n );\n\n return (\n <Suspense fallback={fallback}>\n <LazyMdxEditorField\n clearable={field.nullable === true}\n clearLabel={`Clear ${field.label} to null`}\n onClear={() => field.onChange(null)}\n id={fieldId}\n value={toText(field.value)}\n readOnly={readOnly}\n size={size}\n placeholder={defaultPlaceholder(field.schema)}\n onChange={(next) => field.onChange(next)}\n {...field.markdownOptions}\n />\n </Suspense>\n );\n}\n\n// DisplayControl renders a static, non-editable presentation element:\n// Label/Title (heading), Message (info text), Line (divider), or Blank/Filler\n// (spacer). It never collects a value; the heading/text source is the field's\n// title (label) and, for \"text\", its description. Rendered identically in the\n// form and the read-only Viewer.\nexport function DisplayControl({ field, size }: { field: FieldControl; size: FormSize }) {\n const variant = field.displayVariant ?? \"text\";\n if (variant === \"divider\") {\n return <hr data-jsf-input className=\"my-1 w-full border-t border-border\" />;\n }\n if (variant === \"spacer\") {\n return <div data-jsf-input aria-hidden className=\"h-2\" />;\n }\n if (variant === \"heading\") {\n return (\n <div\n data-jsf-input\n className={cn(\"border-b border-border pb-1 font-semibold text-foreground\", labelSizeClass[size])}\n >\n {field.label}\n </div>\n );\n }\n const text = field.description ?? toText(field.value) ?? field.label;\n return (\n <p data-jsf-input className={cn(\"text-muted-foreground\", labelSizeClass[size])}>\n {text || field.label}\n </p>\n );\n}\n\n// LinkControl renders a read-only external hyperlink. The\n// href is field.href, falling back to the value when it is an absolute URL; with\n// neither it degrades to a plain read-only value.\nexport function LinkControl({ field, fieldId, size }: { field: FieldControl; fieldId: string; size: FormSize }) {\n const text = toText(field.value);\n const href = field.href ?? (/^https?:\\/\\//i.test(text) ? text : undefined);\n if (!href) {\n return <ReadOnlyValue field={field} fieldId={fieldId} size={size} />;\n }\n return (\n <a\n id={fieldId}\n data-jsf-input\n href={href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className={cn(\"inline-flex items-center text-primary underline underline-offset-2\", controlHeightClass[size], labelSizeClass[size])}\n >\n {text || field.label || href}\n </a>\n );\n}\n\n// HMR probe\n// HMR probe 2\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,sBAAA,GAAqBA,MAAAA,KAAAA,CAAK,YAAY;CAE1C,OAAO,EAAE,UAAS,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QADA,sBAAA,CAAA,EAAA,CACI,eAAe;AACvC,CAAC;AAMD,SAAgB,cAAc,EAAE,OAAO,SAAS,QAAkE;CAChH,MAAM,OAAOC,+BAAAA,OAAO,MAAM,KAAK;CAC/B,MAAM,SAAS,MAAM,OAAO,WA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,OAAO,KAAA;CAChE,IAAI,CAAC,MACH,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;EAAsB;EAAgB;EAAe;CAAO,CAAA;CAErE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,IAAI;EACJ,kBAAA;EACM;EACN,QAAO;EACP,KAAI;EACJ,WAAWE,cAAAA,GAAG,sEAAsEC,8BAAAA,mBAAmB,OAAOC,8BAAAA,eAAe,KAAK;EAEjI,UAAA,QAAQ,MAAM,SAAS;CACvB,CAAA;AAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-fields.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-fields.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-schema-form-fields.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-fields.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,0BAA0B,CAAC;AAS1E,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAWjC,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,+BAe/G;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB,+BA8BA;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ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AO,EACP,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB,+BAmCA;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,GACL,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB,+BA+BA;AAOD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,+BAwBtF;AAKD,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,+BAkB7G"}
|
|
@@ -2,6 +2,7 @@ import { cn } from "../lib/utils.js";
|
|
|
2
2
|
import { formatDateTimeRelative } from "../data/cells/timestamp-format.js";
|
|
3
3
|
import { Combobox } from "./Combobox.js";
|
|
4
4
|
import { DateField } from "./DateField.js";
|
|
5
|
+
import { DateMathControl } from "./json-schema-form-date-math.js";
|
|
5
6
|
import { ColorSwatch } from "./json-schema-form-color.js";
|
|
6
7
|
import { InputField } from "./InputField.js";
|
|
7
8
|
import { Switch } from "./Switch.js";
|
|
@@ -178,12 +179,12 @@ function DateControl({ field, fieldId, readOnly, size }) {
|
|
|
178
179
|
children: "—"
|
|
179
180
|
})
|
|
180
181
|
});
|
|
181
|
-
|
|
182
|
+
const input = /* @__PURE__ */ jsx(DateField, {
|
|
182
183
|
clearable: field.nullable === true,
|
|
183
184
|
clearLabel: `Clear ${field.label} to null`,
|
|
184
185
|
onClear: () => field.onChange(null),
|
|
185
186
|
disabled: readOnly,
|
|
186
|
-
mode: field.dateFormat === "date
|
|
187
|
+
mode: field.dateFormat === "date" ? "date" : "datetime",
|
|
187
188
|
id: fieldId,
|
|
188
189
|
"aria-label": field.label,
|
|
189
190
|
"data-jsf-input": true,
|
|
@@ -195,6 +196,14 @@ function DateControl({ field, fieldId, readOnly, size }) {
|
|
|
195
196
|
prefix: field.prefix,
|
|
196
197
|
suffix: field.suffix
|
|
197
198
|
});
|
|
199
|
+
if (field.dateFormat !== "date-math") return input;
|
|
200
|
+
return /* @__PURE__ */ jsx(DateMathControl, {
|
|
201
|
+
label: field.label,
|
|
202
|
+
value: text,
|
|
203
|
+
readOnly,
|
|
204
|
+
onChange: (next) => field.onChange(next),
|
|
205
|
+
children: input
|
|
206
|
+
});
|
|
198
207
|
}
|
|
199
208
|
function BooleanControl({ field, fieldId, readOnly, size }) {
|
|
200
209
|
if (typeof field.value === "boolean" || field.value === void 0 || field.value === null) return /* @__PURE__ */ jsxs("div", {
|