@osdk/react-components 0.2.0-beta.24 → 0.2.0-beta.26
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/AGENTS.md +4 -0
- package/CHANGELOG.md +38 -0
- package/build/browser/action-form/ActionForm.js +15 -11
- package/build/browser/action-form/ActionForm.js.map +1 -1
- package/build/browser/action-form/FormFieldApi.js.map +1 -1
- package/build/browser/action-form/fields/{TextInputField.module.css → BaseInput.module.css} +2 -2
- package/build/browser/action-form/fields/BaseInput.module.css.js +6 -0
- package/build/browser/action-form/fields/CustomField.js +30 -0
- package/build/browser/action-form/fields/CustomField.js.map +1 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js +26 -16
- package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/browser/action-form/fields/RadioButtonsField.js +57 -0
- package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -0
- package/build/browser/action-form/fields/RadioButtonsField.module.css +83 -0
- package/build/browser/action-form/fields/RadioButtonsField.module.css.js +10 -0
- package/build/browser/action-form/fields/TextAreaField.js +50 -0
- package/build/browser/action-form/fields/TextAreaField.js.map +1 -0
- package/build/browser/action-form/fields/TextInputField.js +3 -3
- package/build/browser/action-form/fields/TextInputField.js.map +1 -1
- package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +97 -10
- package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
- package/build/browser/base-components/dialog/Dialog.js +4 -2
- package/build/browser/base-components/dialog/Dialog.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/hooks/useFunctionColumnsData.js +57 -192
- package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -1
- package/build/browser/pdf-viewer/PdfViewer.js +49 -8
- package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/PdfViewerContext.js +108 -0
- package/build/browser/pdf-viewer/PdfViewerContext.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js +85 -18
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +18 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css.js +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js +15 -3
- package/build/browser/pdf-viewer/components/PdfViewerContent.js.map +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.module.css +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js +29 -2
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js.map +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css +5 -0
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css.js +1 -0
- package/build/browser/pdf-viewer/constants.js +2 -1
- package/build/browser/pdf-viewer/constants.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
- package/build/browser/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfFormFields.js +341 -0
- package/build/browser/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
- package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js +16 -10
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
- package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +3 -3
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
- package/build/browser/pdf-viewer/types.js.map +1 -1
- package/build/browser/public/experimental.js +5 -0
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/styles.css +144 -35
- package/build/cjs/{chunk-GT6IV6LV.cjs → chunk-MRRRZN44.cjs} +6 -4
- package/build/cjs/chunk-MRRRZN44.cjs.map +1 -0
- package/build/cjs/public/experimental.cjs +1981 -1314
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +82 -5
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +267 -26
- package/build/cjs/public/primitives.cjs +5 -5
- package/build/cjs/public/primitives.d.cts +3 -2
- package/build/esm/action-form/ActionForm.js +15 -11
- package/build/esm/action-form/ActionForm.js.map +1 -1
- package/build/esm/action-form/FormFieldApi.js.map +1 -1
- package/build/esm/action-form/fields/{TextInputField.module.css → BaseInput.module.css} +2 -2
- package/build/esm/action-form/fields/CustomField.js +30 -0
- package/build/esm/action-form/fields/CustomField.js.map +1 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js +26 -16
- package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/esm/action-form/fields/RadioButtonsField.js +57 -0
- package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -0
- package/build/esm/action-form/fields/RadioButtonsField.module.css +83 -0
- package/build/esm/action-form/fields/TextAreaField.js +50 -0
- package/build/esm/action-form/fields/TextAreaField.js.map +1 -0
- package/build/esm/action-form/fields/TextInputField.js +3 -3
- package/build/esm/action-form/fields/TextInputField.js.map +1 -1
- package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +97 -10
- package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
- package/build/esm/base-components/dialog/Dialog.js +4 -2
- package/build/esm/base-components/dialog/Dialog.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/hooks/useFunctionColumnsData.js +57 -192
- package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -1
- package/build/esm/pdf-viewer/PdfViewer.js +49 -8
- package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/PdfViewerContext.js +108 -0
- package/build/esm/pdf-viewer/PdfViewerContext.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js +85 -18
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.module.css +18 -0
- package/build/esm/pdf-viewer/components/PdfViewerContent.js +15 -3
- package/build/esm/pdf-viewer/components/PdfViewerContent.js.map +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.module.css +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.module.css +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js +29 -2
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js.map +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.module.css +5 -0
- package/build/esm/pdf-viewer/constants.js +2 -1
- package/build/esm/pdf-viewer/constants.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js +30 -0
- package/build/esm/pdf-viewer/hooks/usePdfAnnotationsByPage.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfFormFields.js +341 -0
- package/build/esm/pdf-viewer/hooks/usePdfFormFields.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js +227 -0
- package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js +16 -10
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
- package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +3 -3
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
- package/build/esm/pdf-viewer/types.js.map +1 -1
- package/build/esm/public/experimental.js +5 -0
- package/build/esm/public/experimental.js.map +1 -1
- package/build/types/action-form/FormFieldApi.d.ts +11 -5
- package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
- package/build/types/action-form/fields/CustomField.d.ts +9 -0
- package/build/types/action-form/fields/CustomField.d.ts.map +1 -0
- package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
- package/build/types/action-form/fields/RadioButtonsField.d.ts +3 -0
- package/build/types/action-form/fields/RadioButtonsField.d.ts.map +1 -0
- package/build/types/action-form/fields/TextAreaField.d.ts +3 -0
- package/build/types/action-form/fields/TextAreaField.d.ts.map +1 -0
- package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +7 -4
- package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -1
- package/build/types/base-components/dialog/Dialog.d.ts +3 -2
- package/build/types/base-components/dialog/Dialog.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +4 -3
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts +2 -2
- package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfViewerContext.d.ts +64 -0
- package/build/types/pdf-viewer/PdfViewerContext.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts.map +1 -1
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts +8 -4
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts.map +1 -1
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts +6 -1
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts.map +1 -1
- package/build/types/pdf-viewer/constants.d.ts +1 -1
- package/build/types/pdf-viewer/constants.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts +5 -0
- package/build/types/pdf-viewer/hooks/usePdfAnnotationsByPage.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts +24 -0
- package/build/types/pdf-viewer/hooks/usePdfFormFields.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts +36 -0
- package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/types.d.ts +137 -13
- package/build/types/pdf-viewer/types.d.ts.map +1 -1
- package/build/types/public/experimental.d.ts +6 -1
- package/build/types/public/experimental.d.ts.map +1 -1
- package/package.json +6 -6
- package/build/browser/action-form/fields/TextInputField.module.css.js +0 -6
- package/build/browser/action-form/utils/getDefaultFieldComponent.js +0 -56
- package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +0 -1
- package/build/cjs/chunk-GT6IV6LV.cjs.map +0 -1
- package/build/esm/action-form/utils/getDefaultFieldComponent.js +0 -56
- package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +0 -1
- package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +0 -6
- package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
.osdkBaseInput {
|
|
18
18
|
display: block;
|
|
19
19
|
width: 100%;
|
|
20
20
|
min-height: var(--osdk-input-min-height);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React, { memo } from "react";
|
|
18
|
+
/**
|
|
19
|
+
* Renders a user-provided custom field. Delegates all rendering to the
|
|
20
|
+
* `customRenderer` callback, passing through the standard form field props
|
|
21
|
+
* (value, onChange, id) so the custom implementation can participate in
|
|
22
|
+
* form state management.
|
|
23
|
+
*/
|
|
24
|
+
export const CustomField = /*#__PURE__*/memo(function ({
|
|
25
|
+
customRenderer: CustomRenderer,
|
|
26
|
+
...baseProps
|
|
27
|
+
}) {
|
|
28
|
+
return /*#__PURE__*/React.createElement(CustomRenderer, baseProps);
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=CustomField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomField.js","names":["React","memo","CustomField","customRenderer","CustomRenderer","baseProps","createElement"],"sources":["CustomField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport type { CustomFieldProps } from \"../FormFieldApi.js\";\n\n/**\n * Renders a user-provided custom field. Delegates all rendering to the\n * `customRenderer` callback, passing through the standard form field props\n * (value, onChange, id) so the custom implementation can participate in\n * form state management.\n */\nexport const CustomField: React.FC<CustomFieldProps<unknown>> = memo(\n function CustomFieldFn({ customRenderer: CustomRenderer, ...baseProps }) {\n return <CustomRenderer {...baseProps} />;\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AAGnC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAgD,gBAAGD,IAAI,CAClE,UAAuB;EAAEE,cAAc,EAAEC,cAAc;EAAE,GAAGC;AAAU,CAAC,EAAE;EACvE,oBAAOL,KAAA,CAAAM,aAAA,CAACF,cAAc,EAAKC,SAAY,CAAC;AAC1C,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
/*
|
|
3
|
-
* Copyright
|
|
3
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,10 +17,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
17
17
|
|
|
18
18
|
import React, { memo } from "react";
|
|
19
19
|
import { FormField } from "../FormField.js";
|
|
20
|
+
import { CustomField } from "./CustomField.js";
|
|
20
21
|
import { DatetimePickerField } from "./DatetimePickerField.js";
|
|
21
22
|
import { DropdownField } from "./DropdownField.js";
|
|
23
|
+
import { RadioButtonsField } from "./RadioButtonsField.js";
|
|
24
|
+
import { TextAreaField } from "./TextAreaField.js";
|
|
22
25
|
import { TextInputField } from "./TextInputField.js";
|
|
23
|
-
const EMPTY_ITEMS = [];
|
|
24
26
|
export const FormFieldRenderer = /*#__PURE__*/memo(function ({
|
|
25
27
|
fieldDefinition,
|
|
26
28
|
value,
|
|
@@ -42,28 +44,26 @@ export const FormFieldRenderer = /*#__PURE__*/memo(function ({
|
|
|
42
44
|
function renderFieldComponent(fieldDefinition, value, onChange) {
|
|
43
45
|
switch (fieldDefinition.fieldComponent) {
|
|
44
46
|
case "TEXT_INPUT":
|
|
45
|
-
|
|
47
|
+
return /*#__PURE__*/React.createElement(TextInputField, _extends({
|
|
48
|
+
id: fieldDefinition.fieldKey,
|
|
49
|
+
value: value != null ? String(value) : "",
|
|
50
|
+
onChange: onChange,
|
|
51
|
+
placeholder: fieldDefinition.placeholder
|
|
52
|
+
}, fieldDefinition.fieldComponentProps));
|
|
46
53
|
case "TEXT_AREA":
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
48
|
-
id: fieldDefinition.fieldKey
|
|
49
|
-
// TODO: Use coerceFieldValue
|
|
50
|
-
,
|
|
54
|
+
return /*#__PURE__*/React.createElement(TextAreaField, _extends({
|
|
55
|
+
id: fieldDefinition.fieldKey,
|
|
51
56
|
value: value != null ? String(value) : "",
|
|
52
57
|
onChange: onChange,
|
|
53
58
|
placeholder: fieldDefinition.placeholder
|
|
54
|
-
});
|
|
59
|
+
}, fieldDefinition.fieldComponentProps));
|
|
55
60
|
case "DROPDOWN":
|
|
56
61
|
{
|
|
57
|
-
const {
|
|
58
|
-
items = EMPTY_ITEMS,
|
|
59
|
-
...dropdownProps
|
|
60
|
-
} = fieldDefinition.fieldComponentProps ?? {};
|
|
61
62
|
return /*#__PURE__*/React.createElement(DropdownField, _extends({
|
|
62
63
|
value: value,
|
|
63
64
|
onChange: onChange,
|
|
64
|
-
items: items,
|
|
65
65
|
placeholder: fieldDefinition.placeholder
|
|
66
|
-
},
|
|
66
|
+
}, fieldDefinition.fieldComponentProps));
|
|
67
67
|
}
|
|
68
68
|
case "DATETIME_PICKER":
|
|
69
69
|
return /*#__PURE__*/React.createElement(DatetimePickerField, _extends({
|
|
@@ -74,11 +74,21 @@ function renderFieldComponent(fieldDefinition, value, onChange) {
|
|
|
74
74
|
value: value instanceof Date ? value : null,
|
|
75
75
|
onChange: onChange
|
|
76
76
|
}, fieldDefinition.fieldComponentProps));
|
|
77
|
-
case "NUMBER_INPUT":
|
|
78
77
|
case "RADIO_BUTTONS":
|
|
78
|
+
return /*#__PURE__*/React.createElement(RadioButtonsField, _extends({
|
|
79
|
+
id: fieldDefinition.fieldKey,
|
|
80
|
+
value: value,
|
|
81
|
+
onChange: onChange
|
|
82
|
+
}, fieldDefinition.fieldComponentProps));
|
|
83
|
+
case "CUSTOM":
|
|
84
|
+
return /*#__PURE__*/React.createElement(CustomField, _extends({
|
|
85
|
+
id: fieldDefinition.fieldKey,
|
|
86
|
+
value: value,
|
|
87
|
+
onChange: onChange
|
|
88
|
+
}, fieldDefinition.fieldComponentProps));
|
|
89
|
+
case "NUMBER_INPUT":
|
|
79
90
|
case "FILE_PICKER":
|
|
80
91
|
case "OBJECT_SET":
|
|
81
|
-
case "CUSTOM":
|
|
82
92
|
return /*#__PURE__*/React.createElement("div", null, "Unsupported field type: ", fieldDefinition.fieldComponent);
|
|
83
93
|
default:
|
|
84
94
|
return assertUnreachableFieldComponent(fieldDefinition);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","DatetimePickerField","DropdownField","
|
|
1
|
+
{"version":3,"file":"FormFieldRenderer.js","names":["React","memo","FormField","CustomField","DatetimePickerField","DropdownField","RadioButtonsField","TextAreaField","TextInputField","FormFieldRenderer","fieldDefinition","value","onFieldValueChange","label","isRequired","helperText","helperTextPlacement","createElement","fieldKey","undefined","renderFieldComponent","onChange","fieldComponent","_extends","id","String","placeholder","fieldComponentProps","Date","assertUnreachableFieldComponent","Error"],"sources":["FormFieldRenderer.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { memo } from \"react\";\nimport { FormField } from \"../FormField.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\nimport { CustomField } from \"./CustomField.js\";\nimport { DatetimePickerField } from \"./DatetimePickerField.js\";\nimport { DropdownField } from \"./DropdownField.js\";\nimport { RadioButtonsField } from \"./RadioButtonsField.js\";\nimport { TextAreaField } from \"./TextAreaField.js\";\nimport { TextInputField } from \"./TextInputField.js\";\n\nexport interface FormFieldRendererProps {\n fieldDefinition: RendererFieldDefinition;\n value: unknown;\n onFieldValueChange: (value: unknown) => void;\n}\n\nexport const FormFieldRenderer: React.FC<FormFieldRendererProps> = memo(\n function FormFieldRendererFn({\n fieldDefinition,\n value,\n onFieldValueChange,\n }: FormFieldRendererProps): React.ReactElement {\n const { label, isRequired, helperText, helperTextPlacement } =\n fieldDefinition;\n\n return (\n <FormField\n label={label}\n isRequired={isRequired}\n fieldKey={fieldDefinition.fieldKey}\n helperText={helperTextPlacement !== \"tooltip\" ? helperText : undefined}\n >\n {renderFieldComponent(fieldDefinition, value, onFieldValueChange)}\n </FormField>\n );\n },\n);\n\nfunction renderFieldComponent(\n fieldDefinition: RendererFieldDefinition,\n value: unknown,\n onChange: (value: unknown) => void,\n): React.ReactElement {\n switch (fieldDefinition.fieldComponent) {\n case \"TEXT_INPUT\":\n return (\n <TextInputField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"TEXT_AREA\":\n return (\n <TextAreaField\n id={fieldDefinition.fieldKey}\n value={value != null ? String(value) : \"\"}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"DROPDOWN\": {\n return (\n <DropdownField\n value={value}\n onChange={onChange}\n placeholder={fieldDefinition.placeholder}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n }\n case \"DATETIME_PICKER\":\n return (\n <DatetimePickerField\n id={fieldDefinition.fieldKey}\n placeholder={fieldDefinition.placeholder}\n // TODO: Use coerceFieldValue\n value={value instanceof Date ? value : null}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"RADIO_BUTTONS\":\n return (\n <RadioButtonsField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"CUSTOM\":\n return (\n <CustomField\n id={fieldDefinition.fieldKey}\n value={value}\n onChange={onChange}\n {...fieldDefinition.fieldComponentProps}\n />\n );\n case \"NUMBER_INPUT\":\n case \"FILE_PICKER\":\n case \"OBJECT_SET\":\n return <div>Unsupported field type: {fieldDefinition.fieldComponent}\n </div>;\n default:\n return assertUnreachableFieldComponent(fieldDefinition);\n }\n}\n\nfunction assertUnreachableFieldComponent(value: never): never {\n throw new Error(`Unhandled field component: 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S;QAC7BP,KAAK,EAAEA,KAAM;QACbU,QAAQ,EAAEA;MAAS,GACfX,eAAe,CAACiB,mBAAmB,CACxC,CAAC;IAEN,KAAK,cAAc;IACnB,KAAK,aAAa;IAClB,KAAK,YAAY;MACf,oBAAO3B,KAAA,CAAAiB,aAAA,cAAK,0BAAwB,EAACP,eAAe,CAACY,cAChD,CAAC;IACR;MACE,OAAOO,+BAA+B,CAACnB,eAAe,CAAC;EAC3D;AACF;AAEA,SAASmB,+BAA+BA,CAAClB,KAAY,EAAS;EAC5D,MAAM,IAAImB,KAAK,CAAC,8BAA8BL,MAAM,CAACd,KAAK,CAAC,EAAE,CAAC;AAChE","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Radio } from "@base-ui/react/radio";
|
|
18
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
19
|
+
import React, { memo, useCallback, useMemo } from "react";
|
|
20
|
+
import { typedReactMemo } from "../../shared/typedMemo.js";
|
|
21
|
+
import styles from "./RadioButtonsField.module.css";
|
|
22
|
+
export const RadioButtonsField = typedReactMemo(function ({
|
|
23
|
+
id,
|
|
24
|
+
value,
|
|
25
|
+
onChange,
|
|
26
|
+
options
|
|
27
|
+
}) {
|
|
28
|
+
const selectedLabel = useMemo(() => value != null ? options.find(opt => opt.value === value)?.label : undefined, [options, value]);
|
|
29
|
+
const handleValueChange = useCallback(nextLabel => {
|
|
30
|
+
const match = options.find(opt => opt.label === nextLabel);
|
|
31
|
+
onChange?.(match?.value ?? null);
|
|
32
|
+
}, [options, onChange]);
|
|
33
|
+
return /*#__PURE__*/React.createElement(RadioGroup, {
|
|
34
|
+
id: id,
|
|
35
|
+
className: styles.osdkRadioGroup,
|
|
36
|
+
value: selectedLabel,
|
|
37
|
+
onValueChange: handleValueChange
|
|
38
|
+
}, options.map(option => /*#__PURE__*/React.createElement(RadioItem, {
|
|
39
|
+
key: option.label,
|
|
40
|
+
option: option
|
|
41
|
+
})));
|
|
42
|
+
});
|
|
43
|
+
const RadioItem = /*#__PURE__*/memo(function ({
|
|
44
|
+
option
|
|
45
|
+
}) {
|
|
46
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
47
|
+
className: styles.osdkRadioItem
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Radio.Root, {
|
|
49
|
+
value: option.label,
|
|
50
|
+
className: styles.osdkRadioRoot
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Radio.Indicator, {
|
|
52
|
+
className: styles.osdkRadioIndicator
|
|
53
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
54
|
+
className: styles.osdkRadioLabel
|
|
55
|
+
}, option.label));
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=RadioButtonsField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonsField.js","names":["Radio","RadioGroup","React","memo","useCallback","useMemo","typedReactMemo","styles","RadioButtonsField","id","value","onChange","options","selectedLabel","find","opt","label","undefined","handleValueChange","nextLabel","match","createElement","className","osdkRadioGroup","onValueChange","map","option","RadioItem","key","osdkRadioItem","Root","osdkRadioRoot","Indicator","osdkRadioIndicator","osdkRadioLabel"],"sources":["RadioButtonsField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup } from \"@base-ui/react/radio-group\";\nimport React, { memo, useCallback, useMemo } from \"react\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport type { Option, RadioButtonsFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./RadioButtonsField.module.css\";\n\nexport const RadioButtonsField: <V>(\n props: RadioButtonsFieldProps<V>,\n) => React.ReactElement = typedReactMemo(function RadioButtonsFieldFn<V,>({\n id,\n value,\n onChange,\n options,\n}: RadioButtonsFieldProps<V>): React.ReactElement {\n const selectedLabel = useMemo(\n () =>\n value != null\n ? options.find((opt) => opt.value === value)?.label\n : undefined,\n [options, value],\n );\n\n const handleValueChange = useCallback(\n (nextLabel: unknown) => {\n const match = options.find((opt) => opt.label === nextLabel);\n onChange?.(match?.value ?? null);\n },\n [options, onChange],\n );\n\n return (\n <RadioGroup\n id={id}\n className={styles.osdkRadioGroup}\n value={selectedLabel}\n onValueChange={handleValueChange}\n >\n {options.map((option) => (\n <RadioItem key={option.label} option={option} />\n ))}\n </RadioGroup>\n );\n});\n\nconst RadioItem = memo(function RadioItemFn({\n option,\n}: {\n option: Option<unknown>;\n}): React.ReactElement {\n return (\n <label className={styles.osdkRadioItem}>\n <Radio.Root value={option.label} className={styles.osdkRadioRoot}>\n <Radio.Indicator className={styles.osdkRadioIndicator} />\n </Radio.Root>\n <span className={styles.osdkRadioLabel}>{option.label}</span>\n </label>\n );\n});\n"],"mappings":"AAAA;AACA;A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MAAMC,SAAS,gBAAGxB,IAAI,CAAC,UAAqB;EAC1CuB;AAGF,CAAC,EAAsB;EACrB,oBACExB,KAAA,CAAAmB,aAAA;IAAOC,SAAS,EAAEf,MAAM,CAACsB;EAAc,gBACrC3B,KAAA,CAAAmB,aAAA,CAACrB,KAAK,CAAC8B,IAAI;IAACpB,KAAK,EAAEgB,MAAM,CAACV,KAAM;IAACM,SAAS,EAAEf,MAAM,CAACwB;EAAc,gBAC/D7B,KAAA,CAAAmB,aAAA,CAACrB,KAAK,CAACgC,SAAS;IAACV,SAAS,EAAEf,MAAM,CAAC0B;EAAmB,CAAE,CAC9C,CAAC,eACb/B,KAAA,CAAAmB,aAAA;IAAMC,SAAS,EAAEf,MAAM,CAAC2B;EAAe,GAAER,MAAM,CAACV,KAAY,CACvD,CAAC;AAEZ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.osdkRadioGroup {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--osdk-radio-gap);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.osdkRadioItem {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: var(--osdk-radio-item-gap);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.osdkRadioRoot {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: var(--osdk-radio-size);
|
|
34
|
+
height: var(--osdk-radio-size);
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
border: var(--osdk-radio-border);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
|
|
40
|
+
&[data-unchecked] {
|
|
41
|
+
background-color: var(--osdk-radio-bg);
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
background-color: var(--osdk-radio-bg-hover);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-checked] {
|
|
49
|
+
background-color: var(--osdk-radio-bg-checked);
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: var(--osdk-radio-bg-checked-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:active {
|
|
56
|
+
background-color: var(--osdk-radio-bg-checked-active);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:focus-visible {
|
|
61
|
+
outline: var(--osdk-focus-outline);
|
|
62
|
+
outline-offset: calc(-1 * var(--osdk-focus-visible-outline-offset));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.osdkRadioIndicator {
|
|
67
|
+
width: var(--osdk-radio-indicator-size);
|
|
68
|
+
height: var(--osdk-radio-indicator-size);
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
background-color: var(--osdk-radio-indicator-color);
|
|
71
|
+
|
|
72
|
+
&[data-unchecked] {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.osdkRadioLabel {
|
|
78
|
+
font-family: var(--osdk-typography-font-family);
|
|
79
|
+
font-size: var(--osdk-typography-font-size-default);
|
|
80
|
+
line-height: var(--osdk-typography-line-height-default);
|
|
81
|
+
color: var(--osdk-typography-color-default);
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Input } from "@base-ui/react/input";
|
|
19
|
+
import React, { useCallback } from "react";
|
|
20
|
+
import styles from "./BaseInput.module.css";
|
|
21
|
+
const TEXTAREA_STYLE = {
|
|
22
|
+
resize: "vertical"
|
|
23
|
+
};
|
|
24
|
+
export function TextAreaField({
|
|
25
|
+
id,
|
|
26
|
+
value,
|
|
27
|
+
onChange,
|
|
28
|
+
placeholder,
|
|
29
|
+
rows,
|
|
30
|
+
wrap,
|
|
31
|
+
minLength,
|
|
32
|
+
maxLength
|
|
33
|
+
}) {
|
|
34
|
+
const renderTextarea = useCallback(props => /*#__PURE__*/React.createElement("textarea", _extends({}, props, {
|
|
35
|
+
rows: rows,
|
|
36
|
+
wrap: wrap,
|
|
37
|
+
style: TEXTAREA_STYLE
|
|
38
|
+
})), [rows, wrap]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
40
|
+
id: id,
|
|
41
|
+
className: styles.osdkBaseInput,
|
|
42
|
+
value: value ?? "",
|
|
43
|
+
onValueChange: onChange,
|
|
44
|
+
placeholder: placeholder,
|
|
45
|
+
minLength: minLength,
|
|
46
|
+
maxLength: maxLength,
|
|
47
|
+
render: renderTextarea
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=TextAreaField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextAreaField.js","names":["Input","React","useCallback","styles","TEXTAREA_STYLE","resize","TextAreaField","id","value","onChange","placeholder","rows","wrap","minLength","maxLength","renderTextarea","props","createElement","_extends","style","className","osdkBaseInput","onValueChange","render"],"sources":["TextAreaField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport React, { useCallback } from \"react\";\nimport type { TextAreaFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./BaseInput.module.css\";\n\nconst TEXTAREA_STYLE: React.CSSProperties = { resize: \"vertical\" };\n\nexport function TextAreaField({\n id,\n value,\n onChange,\n placeholder,\n rows,\n wrap,\n minLength,\n maxLength,\n}: TextAreaFieldProps): React.ReactElement {\n const renderTextarea = useCallback(\n (props: React.ComponentPropsWithRef<\"textarea\">) => (\n <textarea {...props} rows={rows} wrap={wrap} style={TEXTAREA_STYLE} />\n ),\n [rows, wrap],\n );\n\n return (\n <Input\n id={id}\n className={styles.osdkBaseInput}\n value={value ?? \"\"}\n onValueChange={onChange}\n placeholder={placeholder}\n minLength={minLength}\n maxLength={maxLength}\n render={renderTextarea}\n />\n );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,OAAOC,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAE1C,OAAOC,MAAM,MAAM,wBAAwB;AAE3C,MAAMC,cAAmC,GAAG;EAAEC,MAAM,EAAE;AAAW,CAAC;AAElE,OAAO,SAASC,aAAaA,CAAC;EAC5BC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,IAAI;EACJC,IAAI;EACJC,SAAS;EACTC;AACkB,CAAC,EAAsB;EACzC,MAAMC,cAAc,GAAGb,WAAW,CAC/Bc,KAA8C,iBAC7Cf,KAAA,CAAAgB,aAAA,aAAAC,QAAA,KAAcF,KAAK;IAAEL,IAAI,EAAEA,IAAK;IAACC,IAAI,EAAEA,IAAK;IAACO,KAAK,EAAEf;EAAe,EAAE,CACtE,EACD,CAACO,IAAI,EAAEC,IAAI,CACb,CAAC;EAED,oBACEX,KAAA,CAAAgB,aAAA,CAACjB,KAAK;IACJO,EAAE,EAAEA,EAAG;IACPa,SAAS,EAAEjB,MAAM,CAACkB,aAAc;IAChCb,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBc,aAAa,EAAEb,QAAS;IACxBC,WAAW,EAAEA,WAAY;IACzBG,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA,SAAU;IACrBS,MAAM,EAAER;EAAe,CACxB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { Input } from "@base-ui/react/input";
|
|
18
18
|
import React from "react";
|
|
19
|
-
import styles from "./
|
|
19
|
+
import styles from "./BaseInput.module.css";
|
|
20
20
|
export function TextInputField({
|
|
21
21
|
id,
|
|
22
22
|
value,
|
|
@@ -27,7 +27,7 @@ export function TextInputField({
|
|
|
27
27
|
}) {
|
|
28
28
|
return /*#__PURE__*/React.createElement(Input, {
|
|
29
29
|
id: id,
|
|
30
|
-
className: styles.
|
|
30
|
+
className: styles.osdkBaseInput,
|
|
31
31
|
type: "text",
|
|
32
32
|
value: value ?? "",
|
|
33
33
|
onValueChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputField.js","names":["Input","React","styles","TextInputField","id","value","onChange","placeholder","minLength","maxLength","createElement","className","
|
|
1
|
+
{"version":3,"file":"TextInputField.js","names":["Input","React","styles","TextInputField","id","value","onChange","placeholder","minLength","maxLength","createElement","className","osdkBaseInput","type","onValueChange"],"sources":["TextInputField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport React from \"react\";\nimport type { TextInputFieldProps } from \"../FormFieldApi.js\";\nimport styles from \"./BaseInput.module.css\";\n\nexport function TextInputField({\n id,\n value,\n onChange,\n placeholder,\n minLength,\n maxLength,\n}: TextInputFieldProps & { id?: string }): React.ReactElement {\n return (\n <Input\n id={id}\n className={styles.osdkBaseInput}\n type=\"text\"\n value={value ?? \"\"}\n onValueChange={onChange}\n placeholder={placeholder}\n minLength={minLength}\n maxLength={maxLength}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,wBAAwB;AAE3C,OAAO,SAASC,cAAcA,CAAC;EAC7BC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,SAAS;EACTC;AACqC,CAAC,EAAsB;EAC5D,oBACER,KAAA,CAAAS,aAAA,CAACV,KAAK;IACJI,EAAE,EAAEA,EAAG;IACPO,SAAS,EAAET,MAAM,CAACU,aAAc;IAChCC,IAAI,EAAC,MAAM;IACXR,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBS,aAAa,EAAER,QAAS;IACxBC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAEA,SAAU;IACrBC,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -14,20 +14,107 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import { assertUnreachable } from "../../shared/assertUnreachable.js";
|
|
19
18
|
/**
|
|
20
|
-
* Derives default field definitions from
|
|
19
|
+
* Derives default field definitions from ActionMetadata.
|
|
20
|
+
*
|
|
21
|
+
* Each parameter type maps to a concrete RendererFieldDefinition with the
|
|
22
|
+
* correct fieldComponent and default fieldComponentProps.
|
|
21
23
|
*/
|
|
22
24
|
export function getDefaultFieldDefinitions(metadata) {
|
|
23
|
-
return Object.entries(metadata.parameters).map(([key, param]) => (
|
|
24
|
-
|
|
25
|
+
return Object.entries(metadata.parameters).map(([key, param]) => buildFieldDefinition(key, param));
|
|
26
|
+
}
|
|
27
|
+
const EMPTY_ITEMS = [];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Maps a single action parameter to its default RendererFieldDefinition.
|
|
31
|
+
*
|
|
32
|
+
* Switches on the parameter's data type to select both the field component
|
|
33
|
+
* and its required default props.
|
|
34
|
+
*/
|
|
35
|
+
function buildFieldDefinition(key, param) {
|
|
36
|
+
const base = {
|
|
25
37
|
fieldKey: key,
|
|
26
38
|
label: key,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
isRequired: !param.nullable,
|
|
40
|
+
fieldType: param.type
|
|
41
|
+
};
|
|
42
|
+
const paramType = param.type;
|
|
43
|
+
if (typeof paramType === "object") {
|
|
44
|
+
switch (paramType.type) {
|
|
45
|
+
case "objectSet":
|
|
46
|
+
return {
|
|
47
|
+
...base,
|
|
48
|
+
fieldComponent: "OBJECT_SET",
|
|
49
|
+
fieldComponentProps: {}
|
|
50
|
+
};
|
|
51
|
+
case "object":
|
|
52
|
+
case "interface":
|
|
53
|
+
// TODO: provide correct items
|
|
54
|
+
return {
|
|
55
|
+
...base,
|
|
56
|
+
fieldComponent: "DROPDOWN",
|
|
57
|
+
fieldComponentProps: {
|
|
58
|
+
items: EMPTY_ITEMS
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
case "struct":
|
|
62
|
+
return {
|
|
63
|
+
...base,
|
|
64
|
+
fieldComponent: "TEXT_INPUT",
|
|
65
|
+
fieldComponentProps: {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
switch (paramType) {
|
|
70
|
+
case "string":
|
|
71
|
+
case "marking":
|
|
72
|
+
case "geohash":
|
|
73
|
+
case "geoshape":
|
|
74
|
+
case "objectType":
|
|
75
|
+
return {
|
|
76
|
+
...base,
|
|
77
|
+
fieldComponent: "TEXT_INPUT",
|
|
78
|
+
fieldComponentProps: {}
|
|
79
|
+
};
|
|
80
|
+
case "boolean":
|
|
81
|
+
return {
|
|
82
|
+
...base,
|
|
83
|
+
fieldComponent: "RADIO_BUTTONS",
|
|
84
|
+
fieldComponentProps: {
|
|
85
|
+
options: [{
|
|
86
|
+
label: "True",
|
|
87
|
+
value: true
|
|
88
|
+
}, {
|
|
89
|
+
label: "False",
|
|
90
|
+
value: false
|
|
91
|
+
}]
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
case "integer":
|
|
95
|
+
case "double":
|
|
96
|
+
case "long":
|
|
97
|
+
return {
|
|
98
|
+
...base,
|
|
99
|
+
fieldComponent: "NUMBER_INPUT",
|
|
100
|
+
fieldComponentProps: {}
|
|
101
|
+
};
|
|
102
|
+
case "datetime":
|
|
103
|
+
case "timestamp":
|
|
104
|
+
return {
|
|
105
|
+
...base,
|
|
106
|
+
fieldComponent: "DATETIME_PICKER",
|
|
107
|
+
fieldComponentProps: {}
|
|
108
|
+
};
|
|
109
|
+
case "attachment":
|
|
110
|
+
case "mediaReference":
|
|
111
|
+
return {
|
|
112
|
+
...base,
|
|
113
|
+
fieldComponent: "FILE_PICKER",
|
|
114
|
+
fieldComponentProps: {}
|
|
115
|
+
};
|
|
116
|
+
default:
|
|
117
|
+
return assertUnreachable(paramType);
|
|
118
|
+
}
|
|
32
119
|
}
|
|
33
120
|
//# sourceMappingURL=getDefaultFieldDefinitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultFieldDefinitions.js","names":["
|
|
1
|
+
{"version":3,"file":"getDefaultFieldDefinitions.js","names":["assertUnreachable","getDefaultFieldDefinitions","metadata","Object","entries","parameters","map","key","param","buildFieldDefinition","EMPTY_ITEMS","base","fieldKey","label","isRequired","nullable","fieldType","type","paramType","fieldComponent","fieldComponentProps","items","options","value"],"sources":["getDefaultFieldDefinitions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ActionMetadata } from \"@osdk/api\";\nimport { assertUnreachable } from \"../../shared/assertUnreachable.js\";\nimport type { RendererFieldDefinition } from \"../FormFieldApi.js\";\n\n/**\n * Derives default field definitions from ActionMetadata.\n *\n * Each parameter type maps to a concrete RendererFieldDefinition with the\n * correct fieldComponent and default fieldComponentProps.\n */\nexport function getDefaultFieldDefinitions(\n metadata: ActionMetadata,\n): ReadonlyArray<RendererFieldDefinition> {\n return Object.entries(metadata.parameters).map(\n ([key, param]) => buildFieldDefinition(key, param),\n );\n}\n\nconst EMPTY_ITEMS: unknown[] = [];\n\n/**\n * Maps a single action parameter to its default RendererFieldDefinition.\n *\n * Switches on the parameter's data type to select both the field component\n * and its required default props.\n */\nfunction buildFieldDefinition(\n key: string,\n param: ActionMetadata.Parameter,\n): RendererFieldDefinition {\n const base = {\n fieldKey: key,\n label: key,\n isRequired: !param.nullable,\n fieldType: param.type,\n };\n\n const paramType = param.type;\n\n if (typeof paramType === \"object\") {\n switch (paramType.type) {\n case \"objectSet\":\n return {\n ...base,\n fieldComponent: \"OBJECT_SET\",\n fieldComponentProps: {},\n };\n case \"object\":\n case \"interface\":\n // TODO: provide correct items\n return {\n ...base,\n fieldComponent: \"DROPDOWN\",\n fieldComponentProps: { items: EMPTY_ITEMS },\n };\n case \"struct\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n }\n }\n\n switch (paramType) {\n case \"string\":\n case \"marking\":\n case \"geohash\":\n case \"geoshape\":\n case \"objectType\":\n return {\n ...base,\n fieldComponent: \"TEXT_INPUT\",\n fieldComponentProps: {},\n };\n case \"boolean\":\n return {\n ...base,\n fieldComponent: \"RADIO_BUTTONS\",\n fieldComponentProps: {\n options: [{ label: \"True\", value: true }, {\n label: \"False\",\n value: false,\n }],\n },\n };\n case \"integer\":\n case \"double\":\n case \"long\":\n return {\n ...base,\n fieldComponent: \"NUMBER_INPUT\",\n fieldComponentProps: {},\n };\n case \"datetime\":\n case \"timestamp\":\n return {\n ...base,\n fieldComponent: \"DATETIME_PICKER\",\n fieldComponentProps: {},\n };\n case \"attachment\":\n case \"mediaReference\":\n return {\n ...base,\n fieldComponent: \"FILE_PICKER\",\n fieldComponentProps: {},\n };\n default:\n return assertUnreachable(paramType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,mCAAmC;AAGrE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CACxCC,QAAwB,EACgB;EACxC,OAAOC,MAAM,CAACC,OAAO,CAACF,QAAQ,CAACG,UAAU,CAAC,CAACC,GAAG,CAC5C,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAKC,oBAAoB,CAACF,GAAG,EAAEC,KAAK,CACnD,CAAC;AACH;AAEA,MAAME,WAAsB,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA,SAASD,oBAAoBA,CAC3BF,GAAW,EACXC,KAA+B,EACN;EACzB,MAAMG,IAAI,GAAG;IACXC,QAAQ,EAAEL,GAAG;IACbM,KAAK,EAAEN,GAAG;IACVO,UAAU,EAAE,CAACN,KAAK,CAACO,QAAQ;IAC3BC,SAAS,EAAER,KAAK,CAACS;EACnB,CAAC;EAED,MAAMC,SAAS,GAAGV,KAAK,CAACS,IAAI;EAE5B,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAE;IACjC,QAAQA,SAAS,CAACD,IAAI;MACpB,KAAK,WAAW;QACd,OAAO;UACL,GAAGN,IAAI;U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,CAACkB,SAAS,CAAC;EACvC;AACF","ignoreList":[]}
|
|
@@ -25,11 +25,13 @@ export function Dialog({
|
|
|
25
25
|
title,
|
|
26
26
|
children,
|
|
27
27
|
footer,
|
|
28
|
-
className
|
|
28
|
+
className,
|
|
29
|
+
disablePointerDismissal
|
|
29
30
|
}) {
|
|
30
31
|
return /*#__PURE__*/React.createElement(BaseUIDialog.Root, {
|
|
31
32
|
open: isOpen,
|
|
32
|
-
onOpenChange: onOpenChange
|
|
33
|
+
onOpenChange: onOpenChange,
|
|
34
|
+
disablePointerDismissal: disablePointerDismissal
|
|
33
35
|
}, /*#__PURE__*/React.createElement(BaseUIDialog.Portal, null, /*#__PURE__*/React.createElement(BaseUIDialog.Backdrop, {
|
|
34
36
|
className: styles.backdrop
|
|
35
37
|
}), /*#__PURE__*/React.createElement(BaseUIDialog.Popup, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["Dialog","BaseUIDialog","Cross","classnames","React","styles","isOpen","onOpenChange","title","children","footer","className","createElement","Root","open","Portal","Backdrop","backdrop","Popup","popup","header","Title","Close","closeButton","closeIcon","body"],"sources":["Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dialog as BaseUIDialog } from \"@base-ui/react/dialog\";\nimport { Cross } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Dialog.module.css\";\n\nexport interface DialogProps {\n isOpen: boolean;\n onOpenChange: () => void;\n title: React.ReactNode;\n children: React.ReactNode;\n footer?: React.ReactNode;\n className?: string;\n}\n\nexport function Dialog({\n isOpen,\n onOpenChange,\n title,\n children,\n footer,\n className,\n}: DialogProps): React.ReactElement {\n return (\n <BaseUIDialog.Root
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["Dialog","BaseUIDialog","Cross","classnames","React","styles","isOpen","onOpenChange","title","children","footer","className","disablePointerDismissal","createElement","Root","open","Portal","Backdrop","backdrop","Popup","popup","header","Title","Close","closeButton","closeIcon","body"],"sources":["Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dialog as BaseUIDialog } from \"@base-ui/react/dialog\";\nimport { Cross } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Dialog.module.css\";\n\nexport interface DialogProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n title: React.ReactNode;\n children: React.ReactNode;\n footer?: React.ReactNode;\n className?: string;\n disablePointerDismissal?: boolean;\n}\n\nexport function Dialog({\n isOpen,\n onOpenChange,\n title,\n children,\n footer,\n className,\n disablePointerDismissal,\n}: DialogProps): React.ReactElement {\n return (\n <BaseUIDialog.Root\n open={isOpen}\n onOpenChange={onOpenChange}\n disablePointerDismissal={disablePointerDismissal}\n >\n <BaseUIDialog.Portal>\n <BaseUIDialog.Backdrop className={styles.backdrop} />\n <BaseUIDialog.Popup\n className={classnames(\n styles.popup,\n className,\n )}\n >\n <div className={styles.header}>\n <BaseUIDialog.Title className={styles.title}>\n {title}\n </BaseUIDialog.Title>\n <BaseUIDialog.Close\n className={styles.closeButton}\n aria-label=\"Close dialog\"\n >\n <Cross className={styles.closeIcon} />\n </BaseUIDialog.Close>\n </div>\n <div className={styles.body}>{children}</div>\n {footer != null && <div className={styles.footer}>{footer}</div>}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>\n </BaseUIDialog.Root>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,IAAIC,YAAY,QAAQ,uBAAuB;AAC9D,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,qBAAqB;AAYxC,OAAO,SAASL,MAAMA,CAAC;EACrBM,MAAM;EACNC,YAAY;EACZC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC;AACW,CAAC,EAAsB;EAClC,oBACER,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACa,IAAI;IAChBC,IAAI,EAAET,MAAO;IACbC,YAAY,EAAEA,YAAa;IAC3BK,uBAAuB,EAAEA;EAAwB,gBAEjDR,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACe,MAAM,qBAClBZ,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACgB,QAAQ;IAACN,SAAS,EAAEN,MAAM,CAACa;EAAS,CAAE,CAAC,eACrDd,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACkB,KAAK;IACjBR,SAAS,EAAER,UAAU,CACnBE,MAAM,CAACe,KAAK,EACZT,SACF;EAAE,gBAEFP,KAAA,CAAAS,aAAA;IAAKF,SAAS,EAAEN,MAAM,CAACgB;EAAO,gBAC5BjB,KAAA,CAAAS,aAAA,CAACZ,YAAY,CAACqB,KAAK;IAACX,SAAS,EAAEN,MAAM,CAACG;EAAM,GACzCA,KACiB,CAAC,eACrBJ,KAAA,C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