@osdk/react-components 0.14.0 → 0.14.1-main-02c796c751f1d190bead67b4656a20dbf07904f9
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/CHANGELOG.md +10 -0
- package/build/browser/action-form/FormFieldApi.js.map +1 -1
- package/build/browser/action-form/fields/DropdownField.js +13 -7
- package/build/browser/action-form/fields/DropdownField.js.map +1 -1
- package/build/browser/object-table/components/DropdownCellField.js +2 -1
- package/build/browser/object-table/components/DropdownCellField.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-XEYMYI4E.cjs → chunk-3U2AKW4Q.cjs} +11 -11
- package/build/cjs/{chunk-XEYMYI4E.cjs.map → chunk-3U2AKW4Q.cjs.map} +1 -1
- package/build/cjs/{chunk-G4ZVOFRN.cjs → chunk-6BGMCPBS.cjs} +15 -9
- package/build/cjs/chunk-6BGMCPBS.cjs.map +1 -0
- package/build/cjs/{chunk-65BHVKDS.cjs → chunk-6FOE54PA.cjs} +3 -3
- package/build/cjs/chunk-6FOE54PA.cjs.map +1 -0
- package/build/cjs/{chunk-2ZHJ6SVE.cjs → chunk-GB2TTKVB.cjs} +4 -4
- package/build/cjs/{chunk-2ZHJ6SVE.cjs.map → chunk-GB2TTKVB.cjs.map} +1 -1
- package/build/cjs/{chunk-EB32R5BL.cjs → chunk-JZ3VQMIH.cjs} +8 -7
- package/build/cjs/chunk-JZ3VQMIH.cjs.map +1 -0
- package/build/cjs/{chunk-MYDHKZHW.cjs → chunk-OF52MZQJ.cjs} +4 -4
- package/build/cjs/{chunk-MYDHKZHW.cjs.map → chunk-OF52MZQJ.cjs.map} +1 -1
- package/build/cjs/public/experimental/action-form.cjs +5 -5
- package/build/cjs/public/experimental/action-form.d.cts +8 -0
- package/build/cjs/public/experimental/filter-list.cjs +13 -13
- package/build/cjs/public/experimental/object-table.cjs +9 -9
- package/build/cjs/public/experimental/pdf-viewer.cjs +24 -24
- package/build/cjs/public/experimental.cjs +47 -47
- package/build/esm/action-form/FormFieldApi.js.map +1 -1
- package/build/esm/action-form/fields/DropdownField.js +13 -7
- package/build/esm/action-form/fields/DropdownField.js.map +1 -1
- package/build/esm/object-table/components/DropdownCellField.js +2 -1
- package/build/esm/object-table/components/DropdownCellField.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/action-form/FormFieldApi.d.ts +8 -0
- package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
- package/build/types/action-form/fields/DropdownField.d.ts.map +1 -1
- package/build/types/object-table/components/DropdownCellField.d.ts.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-65BHVKDS.cjs.map +0 -1
- package/build/cjs/chunk-EB32R5BL.cjs.map +0 -1
- package/build/cjs/chunk-G4ZVOFRN.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.14.1-main-02c796c751f1d190bead67b4656a20dbf07904f9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 99ec28c: Fix page scroll being blocked when opening a dropdown in an editable ObjectTable
|
|
8
|
+
- Updated dependencies [02c796c]
|
|
9
|
+
- @osdk/client@2.18.1-main-02c796c751f1d190bead67b4656a20dbf07904f9
|
|
10
|
+
- @osdk/api@2.18.1-main-02c796c751f1d190bead67b4656a20dbf07904f9
|
|
11
|
+
- @osdk/react@2.18.1-main-02c796c751f1d190bead67b4656a20dbf07904f9
|
|
12
|
+
|
|
3
13
|
## 0.14.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"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 type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nimport type {\n DatePickerProps,\n DateRangePickerProps,\n} from \"../shared/calendar/index.js\";\nimport type { PortalContainer } from \"../shared/PortalDismissLayer.js\";\n\nexport type { PortalContainer };\n\n/**\n * A form field definition specifies configuration for a single field.\n * Implemented as a distributed mapped type so `fieldComponent` narrows\n * `fieldComponentProps` to the matching component prop type.\n */\nexport type FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> = K extends unknown ? {\n // Distribute over each field key so a field's key, value type, and allowed\n // components stay correlated when K is the default union of all keys.\n [C in ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]: {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (\n value: FieldValueType<Q, K>,\n ) => Promise<string | undefined>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: C;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: Omit<\n FormFieldPropsByType[C],\n FormManagedProps<C>\n >;\n };\n }[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]\n : never;\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangePickerProps;\n DATETIME_PICKER: DatePickerProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n SWITCH: SwitchFieldProps;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Switch field props for boolean values.\n */\nexport type SwitchFieldProps = BaseFormFieldProps<boolean>;\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport interface ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> extends\n Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n{\n /**\n * The object type definition to search within.\n */\n objectType: Q;\n}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"SWITCH\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n | \"CUSTOM\"\n | (P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\" | \"SWITCH\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never);\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FormFieldApi.js","names":[],"sources":["FormFieldApi.ts"],"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 type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n CompileTimeMetadata,\n DataValueClientToWire,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\nimport type React from \"react\";\n\nimport type {\n DatePickerProps,\n DateRangePickerProps,\n} from \"../shared/calendar/index.js\";\nimport type { PortalContainer } from \"../shared/PortalDismissLayer.js\";\n\nexport type { PortalContainer };\n\n/**\n * A form field definition specifies configuration for a single field.\n * Implemented as a distributed mapped type so `fieldComponent` narrows\n * `fieldComponentProps` to the matching component prop type.\n */\nexport type FormFieldDefinition<\n Q extends ActionDefinition<unknown>,\n K extends FieldKey<Q> = FieldKey<Q>,\n> = K extends unknown ? {\n // Distribute over each field key so a field's key, value type, and allowed\n // components stay correlated when K is the default union of all keys.\n [C in ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]: {\n /**\n * The field's unique key\n */\n fieldKey: K;\n\n /**\n * Display label for the field\n */\n label: string;\n\n /**\n * Default value of the field\n */\n defaultValue?: FieldValueType<Q, K>;\n\n /**\n * Whether the field is required\n */\n isRequired?: boolean;\n\n /**\n * Placeholder text\n */\n placeholder?: string;\n\n /**\n * Additional information to display on this field.\n * Accepts plain text or rich content (e.g. JSX with links or formatting).\n * Rendered as a tooltip icon next to the label by default, or below the\n * label when helperTextPlacement is \"bottom\".\n */\n helperText?: React.ReactNode;\n\n /**\n * The placement of the helper text either below the field or in a tooltip\n *\n * @default \"tooltip\"\n */\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n\n /**\n * Whether the field is disabled\n */\n isDisabled?: boolean;\n\n /**\n * A callback to customize error messages when a built-in validation rule fails.\n * Receives a discriminated union with the constraint data (e.g., the min value\n * that was exceeded) so the message can reference the threshold.\n *\n * Return a string to override the default message, or `undefined` to keep it.\n */\n onValidationError?: (error: ValidationError) => string | undefined;\n\n /**\n * Additional function to validate the field.\n *\n * Return `undefined` if valid, or an error message string if invalid.\n */\n validate?: (\n value: FieldValueType<Q, K>,\n ) => Promise<string | undefined>;\n\n /**\n * The form field component type to render\n */\n fieldComponent: C;\n\n /**\n * The component props for the form field.\n * Excludes runtime props (value, onChange) which are managed by ActionForm.\n */\n fieldComponentProps: Omit<\n FormFieldPropsByType[C],\n FormManagedProps<C>\n >;\n };\n }[ValidFormFieldForPropertyType<FieldDescriptorType<Q, K>>]\n : never;\n\n/**\n * A discriminated union describing which validation rule failed and the\n * constraint data the user needs to build a meaningful error message.\n */\nexport type ValidationError =\n | { type: \"required\" }\n | { type: \"min\"; min: number | Date }\n | { type: \"max\"; max: number | Date }\n | { type: \"minLength\"; minLength: number }\n | { type: \"maxLength\"; maxLength: number }\n | { type: \"maxSize\"; maxSize: number }\n | { type: \"validate\"; message: string };\n\n/**\n * Maps field types to their corresponding props\n */\nexport interface FormFieldPropsByType {\n DATE_RANGE_INPUT: DateRangePickerProps;\n DATETIME_PICKER: DatePickerProps;\n DROPDOWN: DropdownFieldProps<unknown, boolean>;\n FILE_PICKER: FilePickerProps;\n NUMBER_INPUT: NumberInputFieldProps;\n OBJECT_SELECT: ObjectSelectFieldProps<ObjectTypeDefinition>;\n OBJECT_SET: ObjectSetFieldProps<ObjectTypeDefinition>;\n RADIO_BUTTONS: RadioButtonsFieldProps<unknown>;\n SWITCH: SwitchFieldProps;\n TEXT_AREA: TextAreaFieldProps;\n TEXT_INPUT: TextInputFieldProps;\n CUSTOM: CustomFieldProps<unknown>;\n}\n\n/**\n * Dropdown field props with selectable items\n */\nexport interface DropdownFieldProps<V, Multiple extends boolean = false>\n extends BaseFormFieldProps<Multiple extends true ? V[] : V>\n{\n /**\n * Available items for the dropdown\n */\n items: V[];\n\n /**\n * Converts an item to a display string. Defaults to `String()`.\n */\n itemToStringLabel?: (item: V) => string;\n\n /**\n * Returns a unique string key for a list item. Used as the React `key`.\n * Falls back to the item's index when not provided.\n */\n itemToKey?: (item: V) => string;\n\n /**\n * Custom equality check for item values. Defaults to `Object.is`.\n * Required when items are objects to ensure correct selection matching.\n */\n isItemEqual?: (a: V, b: V) => boolean;\n\n /**\n * Whether the dropdown allows searching/filtering.\n * When true, renders a Combobox with a search input.\n * When false (default), renders a Select dropdown.\n */\n isSearchable?: boolean;\n\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n\n /**\n * Whether multiple values can be selected\n */\n isMultiple?: Multiple;\n\n /**\n * Ref forwarded to the portal container element.\n * Used to track portaled content for click-outside detection.\n */\n portalRef?: React.Ref<HTMLDivElement>;\n\n /**\n * Element that receives the dropdown portal. Use this when rendering inside\n * modal dialogs so popups stay in the dialog's stacking and focus context\n * instead of being appended directly to document.body.\n */\n portalContainer?: PortalContainer;\n\n /**\n * Controlled search input value. Must be provided together with `onQueryChange`.\n */\n query?: string;\n\n /**\n * Callback when the search input value changes.\n * Can be used standalone as an event listener or together with `query`\n * for fully controlled search state.\n */\n onQueryChange?: (query: string) => void;\n\n /**\n * When true, disables the combobox's built-in client-side filtering.\n * Use when items are already filtered server-side (e.g. via `onQueryChange`).\n *\n * @default false\n */\n disableClientSideFiltering?: boolean;\n\n /**\n * Status message rendered below the search input and above the item list\n * inside the popup. Use for loading/error/empty messages.\n */\n popupStatus?: React.ReactNode;\n\n /**\n * A React node to render after the item list.\n * Use for infinite scroll sentinels, \"load more\" buttons, etc.\n */\n trailingItem?: React.ReactNode;\n\n /**\n * Whether the dropdown locks page scroll and renders a full-viewport\n * dismiss layer when open. Set to `false` when the dropdown is not\n * inside a `<label>` to allow normal page scrolling.\n *\n * @default true\n */\n modal?: boolean;\n}\n\nexport interface FilePickerProps extends BaseFormFieldProps<File | File[]> {\n /**\n * Whether multiple files can be selected\n */\n isMulti?: boolean;\n\n /**\n * Accepted file types (e.g., \"image/*\", \".pdf\")\n */\n accept?: string | string[];\n\n /**\n * Maximum file size in bytes\n */\n maxSize?: number;\n\n /**\n * The text displayed when no file is selected.\n *\n * @default \"No file chosen\"\n */\n text?: string;\n\n /**\n * The text displayed on the browse button.\n *\n * @default \"Browse\"\n */\n buttonText?: string;\n}\n\n/**\n * Text area field props\n */\nexport interface TextAreaFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | \"rows\"\n | \"wrap\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\nexport interface TextInputFieldProps extends\n BaseFormFieldProps<string>,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n /**\n * If provided, this will be added to the field validation\n */\n | \"minLength\"\n /**\n * If provided, this will be added to the field validation\n */\n | \"maxLength\"\n >\n{\n placeholder?: string;\n}\n\n/**\n * Number input field props\n */\nexport interface NumberInputFieldProps extends BaseFormFieldProps<number> {\n /**\n * Minimum allowed value.\n */\n min?: number;\n\n /**\n * Maximum allowed value.\n */\n max?: number;\n\n /**\n * Step increment for the input. Used by the stepper buttons and ArrowUp/ArrowDown keyboard stepping.\n *\n * @default 1\n */\n step?: number;\n\n /**\n * Placeholder text shown when the input is empty.\n */\n placeholder?: string;\n}\n\n/**\n * Radio buttons field props\n */\nexport interface RadioButtonsFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Available options for radio buttons.\n *\n * Values are compared by reference equality (`===`). When options contain\n * non-primitive values, pass the same object references for `value` and\n * the corresponding option entry.\n */\n options: Option<V>[];\n\n /**\n * Controls the layout direction of the radio buttons.\n *\n * - `\"vertical\"` (default): options are stacked in a column\n * - `\"horizontal\"`: options are laid out in a row, wrapping when needed\n */\n orientation?: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Switch field props for boolean values.\n */\nexport type SwitchFieldProps = BaseFormFieldProps<boolean>;\n\n/**\n * Option interface for radio button options\n */\nexport interface Option<V> {\n label: string;\n value: V;\n}\n\n/**\n * Object set field displays the summary of the count of the given object set\n */\nexport interface ObjectSetFieldProps<T extends ObjectTypeDefinition>\n extends Pick<BaseFormFieldProps<ObjectSet<T>>, \"id\" | \"value\">\n{\n /**\n * Message displayed when no object set is provided.\n *\n * @default \"Object set is not defined\"\n */\n emptyMessage?: string;\n}\n\n/**\n * Object select field props for selecting object instances from the ontology.\n * Used for action parameters that accept a single object or multiple objects.\n *\n * Extends DropdownFieldProps with props that ObjectSelectField\n * manages internally (items, search, filtering) omitted from the public surface.\n */\nexport interface ObjectSelectFieldProps<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> extends\n Omit<\n DropdownFieldProps<Osdk.Instance<Q>>,\n | \"items\"\n | \"itemToStringLabel\"\n | \"itemToKey\"\n | \"isItemEqual\"\n | \"isSearchable\"\n | \"query\"\n | \"onQueryChange\"\n | \"disableClientSideFiltering\"\n | \"renderItemList\"\n >\n{\n /**\n * The object type definition to search within.\n */\n objectType: Q;\n}\n\n/**\n * Custom field props for user-defined renderers\n */\nexport interface CustomFieldProps<V> extends BaseFormFieldProps<V> {\n /**\n * Custom renderer function\n */\n customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;\n}\n\nexport interface BaseFormFieldProps<V> {\n /**\n * The HTML `id` attribute for the field input element.\n * Used for `<label htmlFor>` association.\n */\n id?: string;\n\n /**\n * The validation error message for this field, if any.\n * When set, the field should display a visual error state.\n */\n error?: string;\n\n /**\n * The value of the form field\n */\n value: V | null;\n\n /**\n * The default value of the form field.\n */\n defaultValue?: V;\n\n /**\n * Called when the field value changes.\n *\n * ActionForm internally wraps this to pass the key to `onFieldValueChange`:\n * ```\n * <DropdownField\n * {...fieldDef}\n * onChange={(value) => onFieldValueChange(fieldDef.key, value)}\n * />\n * ```\n *\n * @param value The new value of the form field\n */\n onChange?: (value: V | null) => void;\n}\n\nexport type FieldKey<Q extends ActionDefinition<unknown>> =\n keyof ActionParameters<Q>;\n\n/**\n * Extracts parameters from an ActionDefinition\n */\nexport type ActionParameters<Q extends ActionDefinition<unknown>> =\n CompileTimeMetadata<Q>[\"parameters\"];\n\n/**\n * Extracts the value type for a specific parameter\n *\n * TODO: Re-use `BaseType`\n */\nexport type FieldValueType<\n Q extends ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"] extends\n ActionMetadata.DataType.Object<infer T> ? ActionParam.ObjectType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.ObjectSet<\n infer T\n > ? ActionParam.ObjectSetType<T>\n : ActionParameters<Q>[K][\"type\"] extends ActionMetadata.DataType.Struct<\n infer T\n > ? ActionParam.StructType<T>\n : ActionParameters<Q>[K][\"type\"] extends keyof DataValueClientToWire\n ? DataValueClientToWire[ActionParameters<Q>[K][\"type\"]]\n : never;\n\n/**\n * Extracts the parameter type descriptor for a specific action parameter.\n */\nexport type FieldDescriptorType<\n Q extends ActionDefinition<unknown> = ActionDefinition<unknown>,\n K extends keyof ActionParameters<Q> = keyof ActionParameters<Q>,\n> = ActionParameters<Q>[K][\"type\"];\n\n/**\n * Available form field component types\n */\nexport type FieldComponent =\n | \"DATE_RANGE_INPUT\"\n | \"DATETIME_PICKER\"\n | \"DROPDOWN\"\n | \"FILE_PICKER\"\n | \"NUMBER_INPUT\"\n | \"OBJECT_SELECT\"\n | \"OBJECT_SET\"\n | \"RADIO_BUTTONS\"\n | \"SWITCH\"\n | \"TEXT_AREA\"\n | \"TEXT_INPUT\"\n | \"CUSTOM\";\n\n/**\n * Describes the data type of a form field, independent of OSDK.\n * Mirrors ActionMetadata.DataType to keep the rendering layer OSDK-agnostic.\n */\nexport type FieldType =\n | \"boolean\"\n | \"string\"\n | \"integer\"\n | \"long\"\n | \"double\"\n | \"datetime\"\n | \"timestamp\"\n | \"attachment\"\n | \"marking\"\n | \"mediaReference\"\n | \"objectType\"\n | \"geoshape\"\n | \"geohash\"\n | { type: \"object\"; object: string }\n | { type: \"objectSet\"; objectSet: string }\n | { type: \"interface\"; interface: string }\n | { type: \"struct\"; struct: Record<string, string> };\n\n/**\n * Props managed by form state infrastructure (FieldBridge / RHF).\n * Fields with onChange participate in form state → value and onChange are managed\n * externally. Read-only fields (no onChange, e.g. ObjectSetField) keep value in\n * fieldComponentProps so it bypasses form state cloning.\n */\ntype FormManagedProps<K extends FieldComponent> = \"onChange\" extends\n keyof FormFieldPropsByType[K] ? \"value\" | \"onChange\"\n : \"onChange\";\n\n/**\n * An OSDK-agnostic field definition used by BaseForm and FormFieldRenderer.\n * Contains only the information needed to render a single field — no generics,\n * no compile-time parameter constraints.\n *\n * Implemented as a distributed mapped type: switching on `fieldComponent`\n * narrows `fieldComponentProps` to the correct props type automatically.\n */\nexport type RendererFieldDefinition = {\n [K in FieldComponent]: {\n fieldKey: string;\n fieldComponent: K;\n fieldType?: FieldType;\n label: string;\n isRequired?: boolean;\n placeholder?: string;\n helperText?: React.ReactNode;\n helperTextPlacement?: \"bottom\" | \"tooltip\";\n validate?: (value: unknown) => Promise<string | undefined>;\n onValidationError?: (error: ValidationError) => string | undefined;\n fieldComponentProps: Omit<FormFieldPropsByType[K], FormManagedProps<K>>;\n };\n}[FieldComponent];\n\n/**\n * Gets valid form field types for a given property type\n */\nexport type ValidFormFieldForPropertyType<P extends FieldDescriptorType> =\n | \"CUSTOM\"\n | (P extends { type: \"objectSet\" } ? \"OBJECT_SET\"\n : P extends { type: \"object\" } ? \"OBJECT_SELECT\"\n : P extends \"mediaReference\" | \"attachment\" ? \"FILE_PICKER\"\n : P extends \"boolean\" ? \"RADIO_BUTTONS\" | \"DROPDOWN\" | \"SWITCH\"\n : P extends \"string\" ? \"TEXT_INPUT\" | \"TEXT_AREA\"\n : P extends \"datetime\" | \"timestamp\" ? \"DATETIME_PICKER\"\n : P extends\n | \"double\"\n | \"integer\"\n | \"long\"\n | \"float\"\n | \"short\"\n | \"byte\"\n | \"decimal\" ? \"NUMBER_INPUT\"\n : never);\n"],"mappings":"","ignoreList":[]}
|
|
@@ -44,6 +44,7 @@ export const DropdownField = typedReactMemo(function ({
|
|
|
44
44
|
disableClientSideFiltering,
|
|
45
45
|
popupStatus,
|
|
46
46
|
trailingItem,
|
|
47
|
+
modal = true,
|
|
47
48
|
...rest
|
|
48
49
|
}) {
|
|
49
50
|
// Ensure always controlled from first render: multi-select needs [],
|
|
@@ -65,7 +66,8 @@ export const DropdownField = typedReactMemo(function ({
|
|
|
65
66
|
onQueryChange: onQueryChange,
|
|
66
67
|
disableClientSideFiltering: disableClientSideFiltering,
|
|
67
68
|
popupStatus: popupStatus,
|
|
68
|
-
trailingItem: trailingItem
|
|
69
|
+
trailingItem: trailingItem,
|
|
70
|
+
modal: modal
|
|
69
71
|
}));
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -73,7 +75,8 @@ export const DropdownField = typedReactMemo(function ({
|
|
|
73
75
|
return /*#__PURE__*/React.createElement(SelectDropdown, _extends({}, rest, {
|
|
74
76
|
value: normalizedValue,
|
|
75
77
|
itemToStringLabel: resolvedItemToStringLabel,
|
|
76
|
-
getKey: getKey
|
|
78
|
+
getKey: getKey,
|
|
79
|
+
modal: modal
|
|
77
80
|
}));
|
|
78
81
|
});
|
|
79
82
|
const SelectDropdown = typedReactMemo(function ({
|
|
@@ -87,7 +90,8 @@ const SelectDropdown = typedReactMemo(function ({
|
|
|
87
90
|
placeholder,
|
|
88
91
|
portalRef,
|
|
89
92
|
portalContainer,
|
|
90
|
-
onBlur
|
|
93
|
+
onBlur,
|
|
94
|
+
modal = true
|
|
91
95
|
}) {
|
|
92
96
|
const [open, setOpen] = useState(false);
|
|
93
97
|
const handleOpenChange = useCallback(nextOpen => {
|
|
@@ -112,7 +116,8 @@ const SelectDropdown = typedReactMemo(function ({
|
|
|
112
116
|
open: open,
|
|
113
117
|
onOpenChange: handleOpenChange,
|
|
114
118
|
isItemEqualToValue: isItemEqual,
|
|
115
|
-
itemToStringLabel: itemToStringLabel
|
|
119
|
+
itemToStringLabel: itemToStringLabel,
|
|
120
|
+
modal: modal
|
|
116
121
|
}, /*#__PURE__*/React.createElement(Select.Trigger, {
|
|
117
122
|
id: id,
|
|
118
123
|
placeholder: placeholder
|
|
@@ -131,7 +136,7 @@ const SelectDropdown = typedReactMemo(function ({
|
|
|
131
136
|
}, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Select.Portal, {
|
|
132
137
|
ref: portalRef,
|
|
133
138
|
container: portalContainer
|
|
134
|
-
}, open && /*#__PURE__*/React.createElement(PortalDismissLayer, {
|
|
139
|
+
}, open && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {
|
|
135
140
|
className: dropdownStyles.osdkSelectDismissLayer,
|
|
136
141
|
onDismiss: handleDismiss
|
|
137
142
|
}), /*#__PURE__*/React.createElement(Select.Positioner, null, /*#__PURE__*/React.createElement(Select.Popup, null, items.map(item => /*#__PURE__*/React.createElement(Select.Item, {
|
|
@@ -157,7 +162,8 @@ const ComboboxDropdown = typedReactMemo(function ({
|
|
|
157
162
|
disableClientSideFiltering,
|
|
158
163
|
popupStatus,
|
|
159
164
|
trailingItem,
|
|
160
|
-
onBlur
|
|
165
|
+
onBlur,
|
|
166
|
+
modal = true
|
|
161
167
|
}) {
|
|
162
168
|
const [open, setOpen] = useState(false);
|
|
163
169
|
const hasValue = isMultiple ? Array.isArray(value) && value.length > 0 : value != null;
|
|
@@ -245,7 +251,7 @@ const ComboboxDropdown = typedReactMemo(function ({
|
|
|
245
251
|
}, /*#__PURE__*/React.createElement(SmallCross, null)), /*#__PURE__*/React.createElement(Combobox.Icon, null, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Combobox.Portal, {
|
|
246
252
|
ref: portalRef,
|
|
247
253
|
container: portalContainer
|
|
248
|
-
}, open && /*#__PURE__*/React.createElement(PortalDismissLayer, {
|
|
254
|
+
}, open && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {
|
|
249
255
|
className: dropdownStyles.osdkComboboxDismissLayer,
|
|
250
256
|
onDismiss: handleDismiss
|
|
251
257
|
}), /*#__PURE__*/React.createElement(Combobox.Positioner, null, /*#__PURE__*/React.createElement(Combobox.Popup, null, isSearchable && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownField.js","names":["CaretDown","Cross","SmallCross","Tick","React","useCallback","useState","Combobox","comboboxStyles","Select","selectStyles","PortalDismissLayer","typedReactMemo","dropdownStyles","EMPTY_ARRAY","DropdownField","isSearchable","isMultiple","itemToStringLabel","itemToKey","value","query","onQueryChange","disableClientSideFiltering","popupStatus","trailingItem","rest","normalizedValue","resolvedItemToStringLabel","defaultItemToStringLabel","getKey","item","createElement","ComboboxDropdown","_extends","SelectDropdown","id","onChange","items","isItemEqual","placeholder","portalRef","portalContainer","onBlur","open","setOpen","handleOpenChange","nextOpen","handleClear","handleDismiss","Root","onValueChange","onOpenChange","isItemEqualToValue","Trigger","className","osdkSelectValueContainer","Value","osdkSelectPlaceholder","role","osdkSelectClear","onMouseDown","preventTriggerOpen","onClick","osdkSelectIcon","Portal","ref","container","osdkSelectDismissLayer","onDismiss","Positioner","Popup","map","Item","key","hasValue","Array","isArray","length","handleValueChange","args","cleared","handleRemoveItem","itemToRemove","next","filter","v","renderItem","ItemIndicator","multiple","inputValue","onInputValueChange","undefined","osdkComboboxTriggerMulti","osdkComboboxValueContainer","osdkComboboxTriggerChips","osdkComboboxTriggerChip","osdkComboboxTriggerChipRemove","size","Fragment","osdkComboboxPlaceholder","osdkComboboxClear","Icon","osdkComboboxDismissLayer","osdkComboboxPopupSearchInput","SearchInput","Empty","List","Collection","e","stopPropagation","preventDefault","String","label"],"sources":["DropdownField.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 { CaretDown, Cross, SmallCross, Tick } from \"@blueprintjs/icons\";\nimport React, { useCallback, useState } from \"react\";\nimport { Combobox } from \"../../base-components/combobox/Combobox.js\";\nimport comboboxStyles from \"../../base-components/combobox/Combobox.module.css\";\nimport { Select } from \"../../base-components/select/Select.js\";\nimport selectStyles from \"../../base-components/select/Select.module.css\";\nimport { PortalDismissLayer } from \"../../shared/PortalDismissLayer.js\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport type { DropdownFieldProps } from \"../FormFieldApi.js\";\nimport dropdownStyles from \"./DropdownField.module.css\";\n\nconst EMPTY_ARRAY: [] = [];\n\n/**\n * SelectDropdown is only used for single-select (the multi-select path\n * always routes to ComboboxDropdown). We keep the `Multiple` generic so\n * the spread from DropdownField type-checks, but SelectDropdown never\n * reads `isMultiple`.\n */\ninterface InnerSelectProps<V, Multiple extends boolean>\n extends Omit<DropdownFieldProps<V, Multiple>, \"isSearchable\">\n{\n itemToStringLabel: (item: V) => string;\n getKey: (item: V) => string;\n portalRef?: React.Ref<HTMLDivElement>;\n query?: string;\n onQueryChange?: (query: string) => void;\n onBlur?: () => void;\n}\n\ninterface InnerComboboxProps<V, Multiple extends boolean>\n extends InnerSelectProps<V, Multiple>\n{\n isSearchable: boolean;\n disableClientSideFiltering?: boolean;\n popupStatus?: React.ReactNode;\n trailingItem?: DropdownFieldProps<V, Multiple>[\"trailingItem\"];\n}\n\nexport const DropdownField: <V, Multiple extends boolean = false>(\n props: DropdownFieldProps<V, Multiple> & { onBlur?: () => void },\n) => React.ReactElement = typedReactMemo(function DropdownFieldFn<\n V,\n Multiple extends boolean = false,\n>({\n isSearchable = false,\n isMultiple,\n itemToStringLabel,\n itemToKey,\n value,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n ...rest\n}: DropdownFieldProps<V, Multiple> & {\n onBlur?: () => void;\n}): React.ReactElement {\n // Ensure always controlled from first render: multi-select needs [],\n // single-select needs null. Passing undefined switches Base UI from\n // uncontrolled to controlled and triggers a warning.\n const normalizedValue = (value\n ?? (isMultiple ? EMPTY_ARRAY : null)) as typeof value;\n\n const resolvedItemToStringLabel = itemToStringLabel\n ?? defaultItemToStringLabel;\n\n const getKey = useCallback(\n (item: V) => itemToKey?.(item) ?? resolvedItemToStringLabel(item),\n [itemToKey, resolvedItemToStringLabel],\n );\n\n // Multi-select always uses Combobox for the chip-based UI because it looks better\n if (isSearchable || isMultiple) {\n return (\n <ComboboxDropdown\n {...rest}\n isMultiple={isMultiple}\n value={normalizedValue}\n itemToStringLabel={resolvedItemToStringLabel}\n getKey={getKey}\n isSearchable={isSearchable}\n query={query}\n onQueryChange={onQueryChange}\n disableClientSideFiltering={disableClientSideFiltering}\n popupStatus={popupStatus}\n trailingItem={trailingItem}\n />\n );\n }\n\n // TODO: Support trailingItem\n return (\n <SelectDropdown\n {...rest}\n value={normalizedValue}\n itemToStringLabel={resolvedItemToStringLabel}\n getKey={getKey}\n />\n );\n});\n\nconst SelectDropdown = typedReactMemo(function SelectDropdownFn<\n V,\n Multiple extends boolean,\n>({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n getKey,\n isItemEqual,\n placeholder,\n portalRef,\n portalContainer,\n onBlur,\n}: InnerSelectProps<V, Multiple>): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const hasValue = value != null;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n setOpen(nextOpen);\n // Mark the field as touched when the popover closes so RHF validates.\n // Opening the popover does not trigger validation.\n if (!nextOpen) {\n onBlur?.();\n }\n },\n [onBlur],\n );\n\n const handleClear = useCallback(() => {\n // SelectDropdown is always single-select, so cleared value is null.\n (onChange as ((v: V | null) => void) | undefined)?.(null);\n handleOpenChange(false);\n }, [onChange, handleOpenChange]);\n\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n\n return (\n <div>\n <Select.Root\n value={value}\n onValueChange={onChange}\n open={open}\n onOpenChange={handleOpenChange}\n isItemEqualToValue={isItemEqual}\n itemToStringLabel={itemToStringLabel}\n >\n <Select.Trigger id={id} placeholder={placeholder}>\n <div className={selectStyles.osdkSelectValueContainer}>\n <Select.Value />\n {placeholder != null && (\n <span className={selectStyles.osdkSelectPlaceholder}>\n {placeholder}\n </span>\n )}\n </div>\n {hasValue && (\n <span\n role=\"button\"\n aria-label=\"Clear\"\n className={selectStyles.osdkSelectClear}\n onMouseDown={preventTriggerOpen}\n onClick={handleClear}\n >\n <SmallCross />\n </span>\n )}\n <span className={selectStyles.osdkSelectIcon}>\n <CaretDown />\n </span>\n </Select.Trigger>\n <Select.Portal ref={portalRef} container={portalContainer}>\n {open && (\n <PortalDismissLayer\n className={dropdownStyles.osdkSelectDismissLayer}\n onDismiss={handleDismiss}\n />\n )}\n <Select.Positioner>\n <Select.Popup>\n {items.map((item) => (\n <Select.Item key={getKey(item)} value={item}>\n {itemToStringLabel(item)}\n </Select.Item>\n ))}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n </div>\n );\n});\n\nconst ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn<\n V,\n Multiple extends boolean,\n>({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n getKey,\n isItemEqual,\n isMultiple,\n isSearchable,\n placeholder,\n portalRef,\n portalContainer,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n onBlur,\n}: InnerComboboxProps<V, Multiple>): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const hasValue = isMultiple\n ? Array.isArray(value) && value.length > 0\n : value != null;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n setOpen(nextOpen);\n if (!nextOpen) {\n onBlur?.();\n }\n },\n [onBlur],\n );\n\n // Mark the field as touched on every value change so RHF revalidates\n // immediately — especially important for multi-select where the popup\n // stays open after toggling an item.\n const handleValueChange: typeof onChange = useCallback(\n (...args: Parameters<NonNullable<typeof onChange>>) => {\n onChange?.(...args);\n // Multi-select: popover stays open, so fire onBlur directly.\n // Single-select: popover closes on selection, handleOpenChange(false)\n // already fires onBlur.\n if (isMultiple) {\n onBlur?.();\n }\n },\n [onChange, onBlur, isMultiple],\n );\n\n const handleClear = useCallback(() => {\n // TypeScript can't narrow the conditional type `Multiple extends true ? V[] : V`\n // at runtime, so we cast through the known parameter type at this single call site.\n const cleared = isMultiple ? (EMPTY_ARRAY as V[]) : null;\n (handleValueChange as (v: V[] | V | null) => void)(cleared);\n // Single-select: close after clearing. Multi-select: keep open for continued selection.\n if (!isMultiple) {\n handleOpenChange(false);\n }\n }, [isMultiple, handleValueChange, handleOpenChange]);\n\n const handleRemoveItem = useCallback(\n (itemToRemove: V) => {\n if (!isMultiple || !Array.isArray(value)) {\n return;\n }\n const next = value.filter((v) =>\n isItemEqual != null\n ? !isItemEqual(v, itemToRemove)\n : v !== itemToRemove\n );\n (handleValueChange as (v: V[] | V | null) => void)(next);\n },\n [isMultiple, value, handleValueChange, isItemEqual],\n );\n\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n\n const renderItem = useCallback(\n (item: V) => (\n <Combobox.Item key={getKey(item)} value={item}>\n {isMultiple && (\n <Combobox.ItemIndicator>\n <Tick />\n </Combobox.ItemIndicator>\n )}\n {itemToStringLabel(item)}\n </Combobox.Item>\n ),\n [getKey, isMultiple, itemToStringLabel],\n );\n\n return (\n <div>\n <Combobox.Root\n value={value}\n onValueChange={handleValueChange}\n open={open}\n onOpenChange={handleOpenChange}\n multiple={isMultiple}\n itemToStringLabel={itemToStringLabel}\n isItemEqualToValue={isItemEqual}\n items={items}\n inputValue={query}\n onInputValueChange={onQueryChange}\n filter={disableClientSideFiltering ? null : undefined}\n >\n <Combobox.Trigger\n id={id}\n className={isMultiple\n ? comboboxStyles.osdkComboboxTriggerMulti\n : undefined}\n >\n <div className={comboboxStyles.osdkComboboxValueContainer}>\n {isMultiple && Array.isArray(value) && value.length > 0\n ? (\n <div className={comboboxStyles.osdkComboboxTriggerChips}>\n {value.map((item: V) => (\n <span\n key={getKey(item)}\n className={comboboxStyles.osdkComboboxTriggerChip}\n >\n {itemToStringLabel(item)}\n <span\n role=\"button\"\n aria-label={`Remove ${itemToStringLabel(item)}`}\n className={comboboxStyles.osdkComboboxTriggerChipRemove}\n onMouseDown={preventTriggerOpen}\n onClick={() => handleRemoveItem(item)}\n >\n <Cross size={12} />\n </span>\n </span>\n ))}\n </div>\n )\n : (\n <>\n <Combobox.Value />\n {!hasValue && placeholder != null && (\n <span className={comboboxStyles.osdkComboboxPlaceholder}>\n {placeholder}\n </span>\n )}\n </>\n )}\n </div>\n {hasValue && (\n <span\n role=\"button\"\n aria-label=\"Clear\"\n className={comboboxStyles.osdkComboboxClear}\n onMouseDown={preventTriggerOpen}\n onClick={handleClear}\n >\n <SmallCross />\n </span>\n )}\n <Combobox.Icon>\n <CaretDown />\n </Combobox.Icon>\n </Combobox.Trigger>\n <Combobox.Portal ref={portalRef} container={portalContainer}>\n {open && (\n <PortalDismissLayer\n className={dropdownStyles.osdkComboboxDismissLayer}\n onDismiss={handleDismiss}\n />\n )}\n <Combobox.Positioner>\n <Combobox.Popup>\n {isSearchable && (\n <div className={comboboxStyles.osdkComboboxPopupSearchInput}>\n <Combobox.SearchInput placeholder=\"Search…\" />\n </div>\n )}\n {popupStatus}\n {/* Hide \"No results\" when popupStatus provides its own message (e.g. \"Searching…\") */}\n {popupStatus == null && (\n <Combobox.Empty>No results</Combobox.Empty>\n )}\n <Combobox.List>\n <Combobox.Collection>{renderItem}</Combobox.Collection>\n {trailingItem}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n </div>\n );\n});\n\n// Prevent the clear/remove click from bubbling into the trigger\n// and toggling the dropdown open/closed.\nfunction preventTriggerOpen(e: React.MouseEvent): void {\n e.stopPropagation();\n e.preventDefault();\n}\n\nfunction defaultItemToStringLabel<V>(item: V): string {\n if (item == null || typeof item !== \"object\") {\n return String(item);\n }\n if (\"label\" in item && item.label != null && typeof item.label === \"string\") {\n return item.label;\n }\n return String(item);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,oBAAoB;AACvE,OAAOC,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,QAAQ,QAAQ,4CAA4C;AACrE,OAAOC,cAAc,MAAM,oDAAoD;AAC/E,SAASC,MAAM,QAAQ,wCAAwC;AAC/D,OAAOC,YAAY,MAAM,gDAAgD;AACzE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAOC,cAAc,MAAM,4BAA4B;AAEvD,MAAMC,WAAe,GAAG,EAAE;;AAE1B;AACA;AACA;AACA;AACA;AACA;;AAqBA,OAAO,MAAMC,aAEU,GAAGH,cAAc,CAAC,UAGvC;EACAI,YAAY,GAAG,KAAK;EACpBC,UAAU;EACVC,iBAAiB;EACjBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,aAAa;EACbC,0BAA0B;EAC1BC,WAAW;EACXC,YAAY;EACZ,GAAGC;AAGL,CAAC,EAAsB;EACrB;EACA;EACA;EACA,MAAMC,eAAe,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AAC;AACpB;AAEA,SAASlF,wBAAwBA,CAAIE,IAAO,EAAU;EACpD,IAAIA,IAAI,IAAI,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC5C,OAAOiF,MAAM,CAACjF,IAAI,CAAC;EACrB;EACA,IAAI,OAAO,IAAIA,IAAI,IAAIA,IAAI,CAACkF,KAAK,IAAI,IAAI,IAAI,OAAOlF,IAAI,CAACkF,KAAK,KAAK,QAAQ,EAAE;IAC3E,OAAOlF,IAAI,CAACkF,KAAK;EACnB;EACA,OAAOD,MAAM,CAACjF,IAAI,CAAC;AACrB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DropdownField.js","names":["CaretDown","Cross","SmallCross","Tick","React","useCallback","useState","Combobox","comboboxStyles","Select","selectStyles","PortalDismissLayer","typedReactMemo","dropdownStyles","EMPTY_ARRAY","DropdownField","isSearchable","isMultiple","itemToStringLabel","itemToKey","value","query","onQueryChange","disableClientSideFiltering","popupStatus","trailingItem","modal","rest","normalizedValue","resolvedItemToStringLabel","defaultItemToStringLabel","getKey","item","createElement","ComboboxDropdown","_extends","SelectDropdown","id","onChange","items","isItemEqual","placeholder","portalRef","portalContainer","onBlur","open","setOpen","handleOpenChange","nextOpen","handleClear","handleDismiss","Root","onValueChange","onOpenChange","isItemEqualToValue","Trigger","className","osdkSelectValueContainer","Value","osdkSelectPlaceholder","role","osdkSelectClear","onMouseDown","preventTriggerOpen","onClick","osdkSelectIcon","Portal","ref","container","osdkSelectDismissLayer","onDismiss","Positioner","Popup","map","Item","key","hasValue","Array","isArray","length","handleValueChange","args","cleared","handleRemoveItem","itemToRemove","next","filter","v","renderItem","ItemIndicator","multiple","inputValue","onInputValueChange","undefined","osdkComboboxTriggerMulti","osdkComboboxValueContainer","osdkComboboxTriggerChips","osdkComboboxTriggerChip","osdkComboboxTriggerChipRemove","size","Fragment","osdkComboboxPlaceholder","osdkComboboxClear","Icon","osdkComboboxDismissLayer","osdkComboboxPopupSearchInput","SearchInput","Empty","List","Collection","e","stopPropagation","preventDefault","String","label"],"sources":["DropdownField.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 { CaretDown, Cross, SmallCross, Tick } from \"@blueprintjs/icons\";\nimport React, { useCallback, useState } from \"react\";\nimport { Combobox } from \"../../base-components/combobox/Combobox.js\";\nimport comboboxStyles from \"../../base-components/combobox/Combobox.module.css\";\nimport { Select } from \"../../base-components/select/Select.js\";\nimport selectStyles from \"../../base-components/select/Select.module.css\";\nimport { PortalDismissLayer } from \"../../shared/PortalDismissLayer.js\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport type { DropdownFieldProps } from \"../FormFieldApi.js\";\nimport dropdownStyles from \"./DropdownField.module.css\";\n\nconst EMPTY_ARRAY: [] = [];\n\n/**\n * SelectDropdown is only used for single-select (the multi-select path\n * always routes to ComboboxDropdown). We keep the `Multiple` generic so\n * the spread from DropdownField type-checks, but SelectDropdown never\n * reads `isMultiple`.\n */\ninterface InnerSelectProps<V, Multiple extends boolean>\n extends Omit<DropdownFieldProps<V, Multiple>, \"isSearchable\">\n{\n itemToStringLabel: (item: V) => string;\n getKey: (item: V) => string;\n portalRef?: React.Ref<HTMLDivElement>;\n query?: string;\n onQueryChange?: (query: string) => void;\n onBlur?: () => void;\n modal?: boolean;\n}\n\ninterface InnerComboboxProps<V, Multiple extends boolean>\n extends InnerSelectProps<V, Multiple>\n{\n isSearchable: boolean;\n disableClientSideFiltering?: boolean;\n popupStatus?: React.ReactNode;\n trailingItem?: DropdownFieldProps<V, Multiple>[\"trailingItem\"];\n}\n\nexport const DropdownField: <V, Multiple extends boolean = false>(\n props: DropdownFieldProps<V, Multiple> & { onBlur?: () => void },\n) => React.ReactElement = typedReactMemo(function DropdownFieldFn<\n V,\n Multiple extends boolean = false,\n>({\n isSearchable = false,\n isMultiple,\n itemToStringLabel,\n itemToKey,\n value,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n modal = true,\n ...rest\n}: DropdownFieldProps<V, Multiple> & {\n onBlur?: () => void;\n}): React.ReactElement {\n // Ensure always controlled from first render: multi-select needs [],\n // single-select needs null. Passing undefined switches Base UI from\n // uncontrolled to controlled and triggers a warning.\n const normalizedValue = (value\n ?? (isMultiple ? EMPTY_ARRAY : null)) as typeof value;\n\n const resolvedItemToStringLabel = itemToStringLabel\n ?? defaultItemToStringLabel;\n\n const getKey = useCallback(\n (item: V) => itemToKey?.(item) ?? resolvedItemToStringLabel(item),\n [itemToKey, resolvedItemToStringLabel],\n );\n\n // Multi-select always uses Combobox for the chip-based UI because it looks better\n if (isSearchable || isMultiple) {\n return (\n <ComboboxDropdown\n {...rest}\n isMultiple={isMultiple}\n value={normalizedValue}\n itemToStringLabel={resolvedItemToStringLabel}\n getKey={getKey}\n isSearchable={isSearchable}\n query={query}\n onQueryChange={onQueryChange}\n disableClientSideFiltering={disableClientSideFiltering}\n popupStatus={popupStatus}\n trailingItem={trailingItem}\n modal={modal}\n />\n );\n }\n\n // TODO: Support trailingItem\n return (\n <SelectDropdown\n {...rest}\n value={normalizedValue}\n itemToStringLabel={resolvedItemToStringLabel}\n getKey={getKey}\n modal={modal}\n />\n );\n});\n\nconst SelectDropdown = typedReactMemo(function SelectDropdownFn<\n V,\n Multiple extends boolean,\n>({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n getKey,\n isItemEqual,\n placeholder,\n portalRef,\n portalContainer,\n onBlur,\n modal = true,\n}: InnerSelectProps<V, Multiple>): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const hasValue = value != null;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n setOpen(nextOpen);\n // Mark the field as touched when the popover closes so RHF validates.\n // Opening the popover does not trigger validation.\n if (!nextOpen) {\n onBlur?.();\n }\n },\n [onBlur],\n );\n\n const handleClear = useCallback(() => {\n // SelectDropdown is always single-select, so cleared value is null.\n (onChange as ((v: V | null) => void) | undefined)?.(null);\n handleOpenChange(false);\n }, [onChange, handleOpenChange]);\n\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n\n return (\n <div>\n <Select.Root\n value={value}\n onValueChange={onChange}\n open={open}\n onOpenChange={handleOpenChange}\n isItemEqualToValue={isItemEqual}\n itemToStringLabel={itemToStringLabel}\n modal={modal}\n >\n <Select.Trigger id={id} placeholder={placeholder}>\n <div className={selectStyles.osdkSelectValueContainer}>\n <Select.Value />\n {placeholder != null && (\n <span className={selectStyles.osdkSelectPlaceholder}>\n {placeholder}\n </span>\n )}\n </div>\n {hasValue && (\n <span\n role=\"button\"\n aria-label=\"Clear\"\n className={selectStyles.osdkSelectClear}\n onMouseDown={preventTriggerOpen}\n onClick={handleClear}\n >\n <SmallCross />\n </span>\n )}\n <span className={selectStyles.osdkSelectIcon}>\n <CaretDown />\n </span>\n </Select.Trigger>\n <Select.Portal ref={portalRef} container={portalContainer}>\n {open && modal && (\n <PortalDismissLayer\n className={dropdownStyles.osdkSelectDismissLayer}\n onDismiss={handleDismiss}\n />\n )}\n <Select.Positioner>\n <Select.Popup>\n {items.map((item) => (\n <Select.Item key={getKey(item)} value={item}>\n {itemToStringLabel(item)}\n </Select.Item>\n ))}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n </div>\n );\n});\n\nconst ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn<\n V,\n Multiple extends boolean,\n>({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n getKey,\n isItemEqual,\n isMultiple,\n isSearchable,\n placeholder,\n portalRef,\n portalContainer,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n onBlur,\n modal = true,\n}: InnerComboboxProps<V, Multiple>): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const hasValue = isMultiple\n ? Array.isArray(value) && value.length > 0\n : value != null;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n setOpen(nextOpen);\n if (!nextOpen) {\n onBlur?.();\n }\n },\n [onBlur],\n );\n\n // Mark the field as touched on every value change so RHF revalidates\n // immediately — especially important for multi-select where the popup\n // stays open after toggling an item.\n const handleValueChange: typeof onChange = useCallback(\n (...args: Parameters<NonNullable<typeof onChange>>) => {\n onChange?.(...args);\n // Multi-select: popover stays open, so fire onBlur directly.\n // Single-select: popover closes on selection, handleOpenChange(false)\n // already fires onBlur.\n if (isMultiple) {\n onBlur?.();\n }\n },\n [onChange, onBlur, isMultiple],\n );\n\n const handleClear = useCallback(() => {\n // TypeScript can't narrow the conditional type `Multiple extends true ? V[] : V`\n // at runtime, so we cast through the known parameter type at this single call site.\n const cleared = isMultiple ? (EMPTY_ARRAY as V[]) : null;\n (handleValueChange as (v: V[] | V | null) => void)(cleared);\n // Single-select: close after clearing. Multi-select: keep open for continued selection.\n if (!isMultiple) {\n handleOpenChange(false);\n }\n }, [isMultiple, handleValueChange, handleOpenChange]);\n\n const handleRemoveItem = useCallback(\n (itemToRemove: V) => {\n if (!isMultiple || !Array.isArray(value)) {\n return;\n }\n const next = value.filter((v) =>\n isItemEqual != null\n ? !isItemEqual(v, itemToRemove)\n : v !== itemToRemove\n );\n (handleValueChange as (v: V[] | V | null) => void)(next);\n },\n [isMultiple, value, handleValueChange, isItemEqual],\n );\n\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n\n const renderItem = useCallback(\n (item: V) => (\n <Combobox.Item key={getKey(item)} value={item}>\n {isMultiple && (\n <Combobox.ItemIndicator>\n <Tick />\n </Combobox.ItemIndicator>\n )}\n {itemToStringLabel(item)}\n </Combobox.Item>\n ),\n [getKey, isMultiple, itemToStringLabel],\n );\n\n return (\n <div>\n <Combobox.Root\n value={value}\n onValueChange={handleValueChange}\n open={open}\n onOpenChange={handleOpenChange}\n multiple={isMultiple}\n itemToStringLabel={itemToStringLabel}\n isItemEqualToValue={isItemEqual}\n items={items}\n inputValue={query}\n onInputValueChange={onQueryChange}\n filter={disableClientSideFiltering ? null : undefined}\n >\n <Combobox.Trigger\n id={id}\n className={isMultiple\n ? comboboxStyles.osdkComboboxTriggerMulti\n : undefined}\n >\n <div className={comboboxStyles.osdkComboboxValueContainer}>\n {isMultiple && Array.isArray(value) && value.length > 0\n ? (\n <div className={comboboxStyles.osdkComboboxTriggerChips}>\n {value.map((item: V) => (\n <span\n key={getKey(item)}\n className={comboboxStyles.osdkComboboxTriggerChip}\n >\n {itemToStringLabel(item)}\n <span\n role=\"button\"\n aria-label={`Remove ${itemToStringLabel(item)}`}\n className={comboboxStyles.osdkComboboxTriggerChipRemove}\n onMouseDown={preventTriggerOpen}\n onClick={() => handleRemoveItem(item)}\n >\n <Cross size={12} />\n </span>\n </span>\n ))}\n </div>\n )\n : (\n <>\n <Combobox.Value />\n {!hasValue && placeholder != null && (\n <span className={comboboxStyles.osdkComboboxPlaceholder}>\n {placeholder}\n </span>\n )}\n </>\n )}\n </div>\n {hasValue && (\n <span\n role=\"button\"\n aria-label=\"Clear\"\n className={comboboxStyles.osdkComboboxClear}\n onMouseDown={preventTriggerOpen}\n onClick={handleClear}\n >\n <SmallCross />\n </span>\n )}\n <Combobox.Icon>\n <CaretDown />\n </Combobox.Icon>\n </Combobox.Trigger>\n <Combobox.Portal ref={portalRef} container={portalContainer}>\n {open && modal && (\n <PortalDismissLayer\n className={dropdownStyles.osdkComboboxDismissLayer}\n onDismiss={handleDismiss}\n />\n )}\n <Combobox.Positioner>\n <Combobox.Popup>\n {isSearchable && (\n <div className={comboboxStyles.osdkComboboxPopupSearchInput}>\n <Combobox.SearchInput placeholder=\"Search…\" />\n </div>\n )}\n {popupStatus}\n {/* Hide \"No results\" when popupStatus provides its own message (e.g. \"Searching…\") */}\n {popupStatus == null && (\n <Combobox.Empty>No results</Combobox.Empty>\n )}\n <Combobox.List>\n <Combobox.Collection>{renderItem}</Combobox.Collection>\n {trailingItem}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n </div>\n );\n});\n\n// Prevent the clear/remove click from bubbling into the trigger\n// and toggling the dropdown open/closed.\nfunction preventTriggerOpen(e: React.MouseEvent): void {\n e.stopPropagation();\n e.preventDefault();\n}\n\nfunction defaultItemToStringLabel<V>(item: V): string {\n if (item == null || typeof item !== \"object\") {\n return String(item);\n }\n if (\"label\" in item && item.label != null && typeof item.label === \"string\") {\n return item.label;\n }\n return String(item);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,oBAAoB;AACvE,OAAOC,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,SAASC,QAAQ,QAAQ,4CAA4C;AACrE,OAAOC,cAAc,MAAM,oDAAoD;AAC/E,SAASC,MAAM,QAAQ,wCAAwC;AAC/D,OAAOC,YAAY,MAAM,gDAAgD;AACzE,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,cAAc,QAAQ,2BAA2B;AAE1D,OAAOC,cAAc,MAAM,4BAA4B;AAEvD,MAAMC,WAAe,GAAG,EAAE;;AAE1B;AACA;AACA;AACA;AACA;AACA;;AAsBA,OAAO,MAAMC,aAEU,GAAGH,cAAc,CAAC,UAGvC;EACAI,YAAY,GAAG,KAAK;EACpBC,UAAU;EACVC,iBAAiB;EACjBC,SAAS;EACTC,KAAK;EACLC,KAAK;EACLC,aAAa;EACbC,0BAA0B;EAC1BC,WAAW;EACXC,YAAY;EACZC,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G,KAAA,CAAA6B,aAAA,CAAC1B,QAAQ,CAACsG,UAAU,QAAErB,UAAgC,CAAC,EACtD/D,YACY,CACD,CACG,CACN,CACJ,CACZ,CAAC;AAEV,CAAC,CAAC;;AAEF;AACA;AACA,SAASsC,kBAAkBA,CAAC+C,CAAmB,EAAQ;EACrDA,CAAC,CAACC,eAAe,CAAC,CAAC;EACnBD,CAAC,CAACE,cAAc,CAAC,CAAC;AACpB;AAEA,SAASlF,wBAAwBA,CAAIE,IAAO,EAAU;EACpD,IAAIA,IAAI,IAAI,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC5C,OAAOiF,MAAM,CAACjF,IAAI,CAAC;EACrB;EACA,IAAI,OAAO,IAAIA,IAAI,IAAIA,IAAI,CAACkF,KAAK,IAAI,IAAI,IAAI,OAAOlF,IAAI,CAACkF,KAAK,KAAK,QAAQ,EAAE;IAC3E,OAAOlF,IAAI,CAACkF,KAAK;EACnB;EACA,OAAOD,MAAM,CAACjF,IAAI,CAAC;AACrB","ignoreList":[]}
|
|
@@ -45,7 +45,8 @@ function DropdownCellFieldInner({
|
|
|
45
45
|
}, /*#__PURE__*/React.createElement(DropdownField, _extends({}, fieldComponentProps, {
|
|
46
46
|
portalRef: portalRef,
|
|
47
47
|
value: inputValue,
|
|
48
|
-
onChange: onChange
|
|
48
|
+
onChange: onChange,
|
|
49
|
+
modal: false
|
|
49
50
|
})));
|
|
50
51
|
}
|
|
51
52
|
export const DropdownCellField = /*#__PURE__*/React.memo(DropdownCellFieldInner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownCellField.js","names":["classNames","React","DropdownField","styles","useRegisterPortal","ReadonlyDisplayCell","DropdownCellFieldInner","fieldComponentProps","isRowFocused","inputValue","hasValidationError","isEdited","onChange","portalRef","createElement","className","osdkEditableCellDropdown","error","osdkEditedInput","_extends","value","DropdownCellField","memo"],"sources":["DropdownCellField.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 classNames from \"classnames\";\nimport React from \"react\";\nimport { DropdownField } from \"../../action-form/fields/DropdownField.js\";\nimport styles from \"../EditableCell.module.css\";\nimport { useRegisterPortal } from \"../utils/PortalTracker.js\";\nimport type { DropdownEditConfig } from \"../utils/types.js\";\nimport { ReadonlyDisplayCell } from \"./ReadonlyDisplayCell.js\";\n\ninterface DropdownCellFieldProps {\n fieldComponentProps: DropdownEditConfig;\n isRowFocused: boolean;\n inputValue: string;\n hasValidationError: boolean;\n isEdited: boolean;\n onChange: (newValue: unknown) => void;\n}\n\nfunction DropdownCellFieldInner({\n fieldComponentProps,\n isRowFocused,\n inputValue,\n hasValidationError,\n isEdited,\n onChange,\n}: DropdownCellFieldProps): React.ReactElement {\n const portalRef = useRegisterPortal();\n\n if (!isRowFocused) {\n return (\n <ReadonlyDisplayCell\n inputValue={inputValue}\n hasValidationError={hasValidationError}\n isEdited={isEdited}\n />\n );\n }\n return (\n <div\n className={classNames(\n styles.osdkEditableCellDropdown,\n {\n [styles.error]: hasValidationError,\n [styles.osdkEditedInput]: isEdited,\n },\n )}\n >\n <DropdownField\n {...fieldComponentProps}\n portalRef={portalRef}\n value={inputValue}\n onChange={onChange}\n />\n </div>\n );\n}\n\nexport const DropdownCellField: React.MemoExoticComponent<\n typeof DropdownCellFieldInner\n> = React.memo(DropdownCellFieldInner);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2CAA2C;AACzE,OAAOC,MAAM,MAAM,4BAA4B;AAC/C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,mBAAmB,QAAQ,0BAA0B;AAW9D,SAASC,sBAAsBA,CAAC;EAC9BC,mBAAmB;EACnBC,YAAY;EACZC,UAAU;EACVC,kBAAkB;EAClBC,QAAQ;EACRC;AACsB,CAAC,EAAsB;EAC7C,MAAMC,SAAS,GAAGT,iBAAiB,CAAC,CAAC;EAErC,IAAI,CAACI,YAAY,EAAE;IACjB,oBACEP,KAAA,CAAAa,aAAA,CAACT,mBAAmB;MAClBI,UAAU,EAAEA,UAAW;MACvBC,kBAAkB,EAAEA,kBAAmB;MACvCC,QAAQ,EAAEA;IAAS,CACpB,CAAC;EAEN;EACA,oBACEV,KAAA,CAAAa,aAAA;IACEC,SAAS,EAAEf,UAAU,CACnBG,MAAM,CAACa,wBAAwB,EAC/B;MACE,CAACb,MAAM,CAACc,KAAK,GAAGP,kBAAkB;MAClC,CAACP,MAAM,CAACe,eAAe,GAAGP;IAC5B,CACF;EAAE,gBAEFV,KAAA,CAAAa,aAAA,CAACZ,aAAa,EAAAiB,QAAA,KACRZ,mBAAmB;IACvBM,SAAS,EAAEA,SAAU;IACrBO,KAAK,EAAEX,UAAW;IAClBG,QAAQ,EAAEA;
|
|
1
|
+
{"version":3,"file":"DropdownCellField.js","names":["classNames","React","DropdownField","styles","useRegisterPortal","ReadonlyDisplayCell","DropdownCellFieldInner","fieldComponentProps","isRowFocused","inputValue","hasValidationError","isEdited","onChange","portalRef","createElement","className","osdkEditableCellDropdown","error","osdkEditedInput","_extends","value","modal","DropdownCellField","memo"],"sources":["DropdownCellField.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 classNames from \"classnames\";\nimport React from \"react\";\nimport { DropdownField } from \"../../action-form/fields/DropdownField.js\";\nimport styles from \"../EditableCell.module.css\";\nimport { useRegisterPortal } from \"../utils/PortalTracker.js\";\nimport type { DropdownEditConfig } from \"../utils/types.js\";\nimport { ReadonlyDisplayCell } from \"./ReadonlyDisplayCell.js\";\n\ninterface DropdownCellFieldProps {\n fieldComponentProps: DropdownEditConfig;\n isRowFocused: boolean;\n inputValue: string;\n hasValidationError: boolean;\n isEdited: boolean;\n onChange: (newValue: unknown) => void;\n}\n\nfunction DropdownCellFieldInner({\n fieldComponentProps,\n isRowFocused,\n inputValue,\n hasValidationError,\n isEdited,\n onChange,\n}: DropdownCellFieldProps): React.ReactElement {\n const portalRef = useRegisterPortal();\n\n if (!isRowFocused) {\n return (\n <ReadonlyDisplayCell\n inputValue={inputValue}\n hasValidationError={hasValidationError}\n isEdited={isEdited}\n />\n );\n }\n return (\n <div\n className={classNames(\n styles.osdkEditableCellDropdown,\n {\n [styles.error]: hasValidationError,\n [styles.osdkEditedInput]: isEdited,\n },\n )}\n >\n <DropdownField\n {...fieldComponentProps}\n portalRef={portalRef}\n value={inputValue}\n onChange={onChange}\n modal={false}\n />\n </div>\n );\n}\n\nexport const DropdownCellField: React.MemoExoticComponent<\n typeof DropdownCellFieldInner\n> = React.memo(DropdownCellFieldInner);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,2CAA2C;AACzE,OAAOC,MAAM,MAAM,4BAA4B;AAC/C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,mBAAmB,QAAQ,0BAA0B;AAW9D,SAASC,sBAAsBA,CAAC;EAC9BC,mBAAmB;EACnBC,YAAY;EACZC,UAAU;EACVC,kBAAkB;EAClBC,QAAQ;EACRC;AACsB,CAAC,EAAsB;EAC7C,MAAMC,SAAS,GAAGT,iBAAiB,CAAC,CAAC;EAErC,IAAI,CAACI,YAAY,EAAE;IACjB,oBACEP,KAAA,CAAAa,aAAA,CAACT,mBAAmB;MAClBI,UAAU,EAAEA,UAAW;MACvBC,kBAAkB,EAAEA,kBAAmB;MACvCC,QAAQ,EAAEA;IAAS,CACpB,CAAC;EAEN;EACA,oBACEV,KAAA,CAAAa,aAAA;IACEC,SAAS,EAAEf,UAAU,CACnBG,MAAM,CAACa,wBAAwB,EAC/B;MACE,CAACb,MAAM,CAACc,KAAK,GAAGP,kBAAkB;MAClC,CAACP,MAAM,CAACe,eAAe,GAAGP;IAC5B,CACF;EAAE,gBAEFV,KAAA,CAAAa,aAAA,CAACZ,aAAa,EAAAiB,QAAA,KACRZ,mBAAmB;IACvBM,SAAS,EAAEA,SAAU;IACrBO,KAAK,EAAEX,UAAW;IAClBG,QAAQ,EAAEA,QAAS;IACnBS,KAAK,EAAE;EAAM,EACd,CACE,CAAC;AAEV;AAEA,OAAO,MAAMC,iBAEZ,gBAAGrB,KAAK,CAACsB,IAAI,CAACjB,sBAAsB,CAAC","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.14.
|
|
17
|
+
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.14.1-main-02c796c751f1d190bead67b4656a20dbf07904f9"}`;
|
|
18
18
|
export function componentUserAgent(componentName) {
|
|
19
19
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkX337DNCW_cjs = require('./chunk-X337DNCW.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk6BGMCPBS_cjs = require('./chunk-6BGMCPBS.cjs');
|
|
5
5
|
var chunkI3OSD6CF_cjs = require('./chunk-I3OSD6CF.cjs');
|
|
6
6
|
var chunkZ4JDLERD_cjs = require('./chunk-Z4JDLERD.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk6FOE54PA_cjs = require('./chunk-6FOE54PA.cjs');
|
|
8
8
|
var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
|
|
9
9
|
var chunkMD4KDE44_cjs = require('./chunk-MD4KDE44.cjs');
|
|
10
10
|
var react = require('@osdk/react');
|
|
@@ -610,7 +610,7 @@ function _extends() {
|
|
|
610
610
|
return n;
|
|
611
611
|
}, _extends.apply(null, arguments);
|
|
612
612
|
}
|
|
613
|
-
var AsyncDropdownField =
|
|
613
|
+
var AsyncDropdownField = chunk6BGMCPBS_cjs.typedReactMemo(function AsyncDropdownFieldFn({
|
|
614
614
|
isLoading,
|
|
615
615
|
hasMore,
|
|
616
616
|
isSearching,
|
|
@@ -642,7 +642,7 @@ var AsyncDropdownField = chunkG4ZVOFRN_cjs.typedReactMemo(function AsyncDropdown
|
|
|
642
642
|
callback: onFetchMore,
|
|
643
643
|
loadedCount: itemCount
|
|
644
644
|
});
|
|
645
|
-
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
645
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(chunk6BGMCPBS_cjs.DropdownField, _extends({}, dropdownProps, {
|
|
646
646
|
isSearchable: true,
|
|
647
647
|
popupStatus,
|
|
648
648
|
trailingItem: hasMore ? /* @__PURE__ */ React18__namespace.default.createElement(InfiniteScrollSentinel, {
|
|
@@ -788,7 +788,7 @@ var DEFAULT_OBJECT_ICON = {
|
|
|
788
788
|
};
|
|
789
789
|
var ICON_SIZE = icons.IconSize.STANDARD;
|
|
790
790
|
var DEFAULT_EMPTY_MESSAGE = "Object set is not defined";
|
|
791
|
-
var ObjectSetField =
|
|
791
|
+
var ObjectSetField = chunk6BGMCPBS_cjs.typedReactMemo(function ObjectSetFieldFn({
|
|
792
792
|
value,
|
|
793
793
|
emptyMessage = DEFAULT_EMPTY_MESSAGE
|
|
794
794
|
}) {
|
|
@@ -873,7 +873,7 @@ function toComponentIcon(apiIcon) {
|
|
|
873
873
|
var RadioButtonsField_default = {};
|
|
874
874
|
|
|
875
875
|
// src/action-form/fields/RadioButtonsField.tsx
|
|
876
|
-
var RadioButtonsField =
|
|
876
|
+
var RadioButtonsField = chunk6BGMCPBS_cjs.typedReactMemo(function RadioButtonsFieldFn({
|
|
877
877
|
id,
|
|
878
878
|
value,
|
|
879
879
|
onChange,
|
|
@@ -1055,7 +1055,7 @@ function renderFieldComponent(fieldDefinition, value, onChange, error, portalCon
|
|
|
1055
1055
|
error
|
|
1056
1056
|
}, fieldDefinition.fieldComponentProps));
|
|
1057
1057
|
case "DROPDOWN": {
|
|
1058
|
-
return /* @__PURE__ */ React18__namespace.default.createElement(
|
|
1058
|
+
return /* @__PURE__ */ React18__namespace.default.createElement(chunk6BGMCPBS_cjs.DropdownField, _extends3({
|
|
1059
1059
|
id: fieldDefinition.fieldKey,
|
|
1060
1060
|
value,
|
|
1061
1061
|
onChange,
|
|
@@ -1673,7 +1673,7 @@ function _extends4() {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
var EMPTY_FIELD_DEFINITIONS = [];
|
|
1675
1675
|
var EMPTY_FORM_CONTENT = [];
|
|
1676
|
-
var ActionForm =
|
|
1676
|
+
var ActionForm = chunk6BGMCPBS_cjs.typedReactMemo(function ActionFormFn({
|
|
1677
1677
|
actionDefinition,
|
|
1678
1678
|
formTitle,
|
|
1679
1679
|
showFormTitle = false,
|
|
@@ -1778,9 +1778,9 @@ var ActionForm = chunkG4ZVOFRN_cjs.typedReactMemo(function ActionFormFn({
|
|
|
1778
1778
|
});
|
|
1779
1779
|
|
|
1780
1780
|
// src/public/experimental/action-form.ts
|
|
1781
|
-
var ActionForm2 =
|
|
1781
|
+
var ActionForm2 = chunk6FOE54PA_cjs.withOsdkMetrics(ActionForm, "ActionForm");
|
|
1782
1782
|
|
|
1783
1783
|
exports.ActionForm = ActionForm2;
|
|
1784
1784
|
exports.BaseForm = BaseForm;
|
|
1785
|
-
//# sourceMappingURL=chunk-
|
|
1786
|
-
//# sourceMappingURL=chunk-
|
|
1785
|
+
//# sourceMappingURL=chunk-3U2AKW4Q.cjs.map
|
|
1786
|
+
//# sourceMappingURL=chunk-3U2AKW4Q.cjs.map
|