@osdk/react-components 0.14.0 → 0.14.1-main-99ec28ce779aa23be193edb2314d9e1dab938cc8
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 +6 -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-G4ZVOFRN.cjs → chunk-6BGMCPBS.cjs} +15 -9
- package/build/cjs/chunk-6BGMCPBS.cjs.map +1 -0
- package/build/cjs/{chunk-65BHVKDS.cjs → chunk-AIYSQOC3.cjs} +3 -3
- package/build/cjs/chunk-AIYSQOC3.cjs.map +1 -0
- package/build/cjs/{chunk-MYDHKZHW.cjs → chunk-EGQYHG5E.cjs} +4 -4
- package/build/cjs/{chunk-MYDHKZHW.cjs.map → chunk-EGQYHG5E.cjs.map} +1 -1
- package/build/cjs/{chunk-2ZHJ6SVE.cjs → chunk-JBVBRMAA.cjs} +4 -4
- package/build/cjs/{chunk-2ZHJ6SVE.cjs.map → chunk-JBVBRMAA.cjs.map} +1 -1
- package/build/cjs/{chunk-XEYMYI4E.cjs → chunk-NSUISUM6.cjs} +11 -11
- package/build/cjs/{chunk-XEYMYI4E.cjs.map → chunk-NSUISUM6.cjs.map} +1 -1
- package/build/cjs/{chunk-EB32R5BL.cjs → chunk-PVLU54JY.cjs} +8 -7
- package/build/cjs/chunk-PVLU54JY.cjs.map +1 -0
- 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 +3 -3
- 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 +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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AA4B,aAAA,CAACzB,QAAQ,CAAC+D,UAAU,qBAClBlE,KAAA,CAAA4B,aAAA,CAACzB,QAAQ,CAACgE,KAAK,QACZvD,YAAY,iBACXZ,KAAA,CAAA4B,aAAA;IAAKuB,SAAS,EAAE/C,cAAc,CAACgG;EAA6B,gBAC1DpG,KAAA,CAAA4B,aAAA,CAACzB,QAAQ,CAACkG,WAAW;IAACjE,WAAW,EAAC;EAAS,CAAE,CAC1C,CACN,EACAhB,WAAW,EAEXA,WAAW,IAAI,IAAI,iBAClBpB,KAAA,CAAA4B,aAAA,CAACzB,QAAQ,CAACmG,KAAK,QAAC,YAA0B,CAC3C,eACDtG,KAAA,CAAA4B,aAAA,CAACzB,QAAQ,CAACoG,IAAI,qBACZvG,KAAA,CAAA4B,aAAA,CAACzB,QAAQ,CAACqG,UAAU,QAAErB,UAAgC,CAAC,EACtD9D,YACY,CACD,CACG,CACN,CACJ,CACZ,CAAC;AAEV,CAAC,CAAC;;AAEF;AACA;AACA,SAASqC,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":[]}
|
|
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"],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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-99ec28ce779aa23be193edb2314d9e1dab938cc8"}`;
|
|
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":[]}
|
|
@@ -123,6 +123,7 @@ var DropdownField = typedReactMemo(function DropdownFieldFn({
|
|
|
123
123
|
disableClientSideFiltering,
|
|
124
124
|
popupStatus,
|
|
125
125
|
trailingItem,
|
|
126
|
+
modal = true,
|
|
126
127
|
...rest
|
|
127
128
|
}) {
|
|
128
129
|
const normalizedValue = value ?? (isMultiple ? EMPTY_ARRAY : null);
|
|
@@ -139,13 +140,15 @@ var DropdownField = typedReactMemo(function DropdownFieldFn({
|
|
|
139
140
|
onQueryChange,
|
|
140
141
|
disableClientSideFiltering,
|
|
141
142
|
popupStatus,
|
|
142
|
-
trailingItem
|
|
143
|
+
trailingItem,
|
|
144
|
+
modal
|
|
143
145
|
}));
|
|
144
146
|
}
|
|
145
147
|
return /* @__PURE__ */ React3__default.default.createElement(SelectDropdown, _extends2({}, rest, {
|
|
146
148
|
value: normalizedValue,
|
|
147
149
|
itemToStringLabel: resolvedItemToStringLabel,
|
|
148
|
-
getKey
|
|
150
|
+
getKey,
|
|
151
|
+
modal
|
|
149
152
|
}));
|
|
150
153
|
});
|
|
151
154
|
var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
@@ -159,7 +162,8 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
159
162
|
placeholder,
|
|
160
163
|
portalRef,
|
|
161
164
|
portalContainer,
|
|
162
|
-
onBlur
|
|
165
|
+
onBlur,
|
|
166
|
+
modal = true
|
|
163
167
|
}) {
|
|
164
168
|
const [open, setOpen] = React3.useState(false);
|
|
165
169
|
const hasValue = value != null;
|
|
@@ -182,7 +186,8 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
182
186
|
open,
|
|
183
187
|
onOpenChange: handleOpenChange,
|
|
184
188
|
isItemEqualToValue: isItemEqual,
|
|
185
|
-
itemToStringLabel
|
|
189
|
+
itemToStringLabel,
|
|
190
|
+
modal
|
|
186
191
|
}, /* @__PURE__ */ React3__default.default.createElement(Select.Trigger, {
|
|
187
192
|
id,
|
|
188
193
|
placeholder
|
|
@@ -201,7 +206,7 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
201
206
|
}, /* @__PURE__ */ React3__default.default.createElement(icons.CaretDown, null))), /* @__PURE__ */ React3__default.default.createElement(Select.Portal, {
|
|
202
207
|
ref: portalRef,
|
|
203
208
|
container: portalContainer
|
|
204
|
-
}, open && /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.PortalDismissLayer, {
|
|
209
|
+
}, open && modal && /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.PortalDismissLayer, {
|
|
205
210
|
className: DropdownField_default.osdkSelectDismissLayer,
|
|
206
211
|
onDismiss: handleDismiss
|
|
207
212
|
}), /* @__PURE__ */ React3__default.default.createElement(Select.Positioner, null, /* @__PURE__ */ React3__default.default.createElement(Select.Popup, null, items.map((item) => /* @__PURE__ */ React3__default.default.createElement(Select.Item, {
|
|
@@ -227,7 +232,8 @@ var ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({
|
|
|
227
232
|
disableClientSideFiltering,
|
|
228
233
|
popupStatus,
|
|
229
234
|
trailingItem,
|
|
230
|
-
onBlur
|
|
235
|
+
onBlur,
|
|
236
|
+
modal = true
|
|
231
237
|
}) {
|
|
232
238
|
const [open, setOpen] = React3.useState(false);
|
|
233
239
|
const hasValue = isMultiple ? Array.isArray(value) && value.length > 0 : value != null;
|
|
@@ -305,7 +311,7 @@ var ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({
|
|
|
305
311
|
}, /* @__PURE__ */ React3__default.default.createElement(icons.SmallCross, null)), /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.Combobox.Icon, null, /* @__PURE__ */ React3__default.default.createElement(icons.CaretDown, null))), /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.Combobox.Portal, {
|
|
306
312
|
ref: portalRef,
|
|
307
313
|
container: portalContainer
|
|
308
|
-
}, open && /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.PortalDismissLayer, {
|
|
314
|
+
}, open && modal && /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.PortalDismissLayer, {
|
|
309
315
|
className: DropdownField_default.osdkComboboxDismissLayer,
|
|
310
316
|
onDismiss: handleDismiss
|
|
311
317
|
}), /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.Combobox.Positioner, null, /* @__PURE__ */ React3__default.default.createElement(chunkZ4JDLERD_cjs.Combobox.Popup, null, isSearchable && /* @__PURE__ */ React3__default.default.createElement("div", {
|
|
@@ -330,5 +336,5 @@ function defaultItemToStringLabel(item) {
|
|
|
330
336
|
|
|
331
337
|
exports.DropdownField = DropdownField;
|
|
332
338
|
exports.typedReactMemo = typedReactMemo;
|
|
333
|
-
//# sourceMappingURL=chunk-
|
|
334
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-6BGMCPBS.cjs.map
|
|
340
|
+
//# sourceMappingURL=chunk-6BGMCPBS.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shared/typedMemo.ts","../../src/base-components/select/Select.module.css","../../src/base-components/select/Select.tsx","../../src/action-form/fields/DropdownField.module.css","../../src/action-form/fields/DropdownField.tsx"],"names":["React","BaseUISelect","classnames","CaretDown","_extends","useCallback","useState","SmallCross","PortalDismissLayer","Combobox","Tick","Combobox_default","Cross"],"mappings":";;;;;;;;;;;;;AAuBO,IAAM,iBAAiBA,uBAAA,CAAM;;;ACvBpC,IAAA,cAAA,GAAA,EAAA;;;ACAA,SAAS,QAAA,GAAW;AAAE,EAAA,OAAO,QAAA,GAAW,OAAO,MAAA,GAAS,MAAA,CAAO,OAAO,IAAA,EAAK,GAAI,SAAU,CAAA,EAAG;AAAE,IAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,SAAA,CAAU,QAAQ,CAAA,EAAA,EAAK;AAAE,MAAA,IAAI,CAAA,GAAI,UAAU,CAAC,CAAA;AAAG,MAAA,KAAA,IAAS,CAAA,IAAK,CAAA,EAAG,CAAC,IAAI,cAAA,CAAe,IAAA,CAAK,CAAA,EAAG,CAAC,CAAA,KAAM,CAAA,CAAE,CAAC,CAAA,GAAI,EAAE,CAAC,CAAA,CAAA;AAAA,IAAI;AAAE,IAAA,OAAO,CAAA;AAAA,EAAG,CAAA,EAAG,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAG;AAsBnR,SAAS,UAAA,CAA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AAM,aAAA,CAAcS,0BAAA,CAAS,IAAA,EAAM,IAAA,kBAAmBT,uBAAAA,CAAM,cAAcS,0BAAA,CAAS,UAAA,EAAY,IAAA,EAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjQ,CAAC,CAAA;AAID,SAAS,mBAAmB,CAAA,EAAG;AAC7B,EAAA,CAAA,CAAE,eAAA,EAAgB;AAClB,EAAA,CAAA,CAAE,cAAA,EAAe;AACnB;AACA,SAAS,yBAAyB,IAAA,EAAM;AACtC,EAAA,IAAI,IAAA,IAAQ,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AAC5C,IAAA,OAAO,OAAO,IAAI,CAAA;AAAA,EACpB;AACA,EAAA,IAAI,OAAA,IAAW,QAAQ,IAAA,CAAK,KAAA,IAAS,QAAQ,OAAO,IAAA,CAAK,UAAU,QAAA,EAAU;AAC3E,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AACA,EAAA,OAAO,OAAO,IAAI,CAAA;AACpB","file":"chunk-6BGMCPBS.cjs","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 from \"react\";\n\n/**\n * TODO: Delete this once `React.memo` is typed to not lose generics to `unknown`\n *\n * Context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37087\n */\nexport const typedReactMemo = React.memo;","/*\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\n/* TODO: Extract each variable into its tokens file and map to default value there */\n\n.osdkSelectTrigger {\n display: inline-flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--osdk-select-spacing, var(--osdk-surface-spacing));\n width: 100%;\n min-height: var(--osdk-select-min-height, 30px);\n padding: var(\n --osdk-select-trigger-padding,\n calc(var(--osdk-surface-spacing) * 1.5)\n calc(var(--osdk-surface-spacing) * 2.5)\n );\n cursor: pointer;\n border-radius: var(\n --osdk-select-border-radius,\n var(--osdk-surface-border-radius)\n );\n border: var(--osdk-select-border-width, var(--osdk-surface-border-width))\n solid\n var(--osdk-select-border-color, var(--osdk-surface-border-color-default));\n box-shadow: var(--osdk-button-shadow);\n background-color: var(\n --osdk-select-trigger-bg,\n var(--osdk-button-secondary-bg)\n );\n color: var(\n --osdk-select-trigger-color,\n var(--osdk-typography-color-default-rest)\n );\n font-family: var(\n --osdk-select-font-family,\n var(--osdk-typography-family-default)\n );\n font-size: var(\n --osdk-select-font-size,\n var(--osdk-typography-size-body-medium)\n );\n line-height: var(\n --osdk-select-line-height,\n var(--osdk-typography-line-height-default)\n );\n transition:\n background-color\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default)),\n border-color\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default));\n\n &:hover {\n background-color: var(\n --osdk-select-trigger-bg-hover,\n var(--osdk-button-secondary-bg-hover)\n );\n }\n\n &:active {\n background-color: var(\n --osdk-select-trigger-bg-active,\n var(--osdk-button-secondary-bg-active)\n );\n }\n\n /* Override global :focus rules (e.g. Blueprint) that add an outline on\n mouse click. Only show the ring on keyboard focus (:focus-visible). */\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &:focus-visible {\n outline: var(--osdk-select-focus-width, var(--osdk-emphasis-focus-width))\n solid var(--osdk-select-focus-color, var(--osdk-emphasis-focus-color));\n outline-offset: var(\n --osdk-select-focus-offset,\n var(--osdk-emphasis-focus-offset)\n );\n }\n\n &[data-popup-open]:focus-visible {\n outline: none;\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n opacity: var(--osdk-disabled-opacity, 0.5);\n }\n\n &[data-popup-open] {\n border-color: var(\n --osdk-select-border-color-active,\n var(--osdk-intent-primary-rest)\n );\n }\n}\n\n.osdkSelectValueContainer {\n flex: 1;\n display: grid;\n min-width: 0;\n\n & > * {\n grid-area: 1 / 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n\n.osdkSelectValue {\n text-align: left;\n}\n\n.osdkSelectPlaceholder {\n text-align: left;\n color: var(\n --osdk-select-placeholder-color,\n var(--osdk-typography-color-muted)\n );\n pointer-events: none;\n}\n\n.osdkSelectValue:not([data-placeholder]) ~ .osdkSelectPlaceholder {\n display: none;\n}\n\n.osdkSelectIcon {\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: var(--osdk-select-icon-color, var(--osdk-iconography-color-muted));\n flex-shrink: 0;\n transition: transform\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default));\n\n [data-popup-open] > & {\n transform: rotate(180deg);\n }\n}\n\n.osdkSelectClear {\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0;\n padding: 0;\n line-height: 0;\n border: none;\n background: transparent;\n cursor: pointer;\n flex-shrink: 0;\n color: var(--osdk-select-clear-color, var(--osdk-iconography-color-muted));\n border-radius: var(\n --osdk-select-border-radius,\n var(--osdk-surface-border-radius)\n );\n transition:\n color\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default)),\n background-color\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default));\n\n &:hover {\n color: var(\n --osdk-select-clear-color-hover,\n var(--osdk-typography-color-default-rest)\n );\n background-color: var(\n --osdk-select-clear-bg-hover,\n var(--osdk-surface-background-color-default-hover)\n );\n }\n}\n\n.osdkSelectPositioner {\n z-index: var(--osdk-select-z-index, var(--osdk-surface-z-index-3));\n /* Base UI may focus the popup/positioner so it can own select keyboard\n navigation. Keep the visual focus affordance on the active option instead\n of drawing a browser-default ring around this non-interactive wrapper. */\n outline: none;\n\n &[data-anchor-hidden] {\n visibility: hidden;\n }\n}\n\n.osdkSelectPopup {\n display: flex;\n flex-direction: column;\n min-width: var(--anchor-width);\n max-height: var(--available-height);\n overflow-y: auto;\n padding: calc(var(--osdk-select-spacing, var(--osdk-surface-spacing)) * 1.5);\n border-radius: var(\n --osdk-select-border-radius,\n var(--osdk-surface-border-radius)\n );\n border: var(--osdk-select-border-width, var(--osdk-surface-border-width))\n solid\n var(--osdk-select-border-color, var(--osdk-surface-border-color-default));\n background-color: var(\n --osdk-select-popup-bg,\n var(--osdk-surface-background-color-default-rest)\n );\n box-shadow: var(--osdk-select-popup-shadow, var(--osdk-surface-shadow-2));\n\n &:focus {\n outline: none;\n }\n}\n\n.osdkSelectItem {\n display: flex;\n align-items: center;\n padding: calc(var(--osdk-select-spacing, var(--osdk-surface-spacing)) * 1.5)\n calc(var(--osdk-select-spacing, var(--osdk-surface-spacing)) * 2);\n border-radius: var(\n --osdk-select-border-radius,\n var(--osdk-surface-border-radius)\n );\n cursor: pointer;\n font-family: var(\n --osdk-select-font-family,\n var(--osdk-typography-family-default)\n );\n font-size: var(\n --osdk-select-font-size,\n var(--osdk-typography-size-body-medium)\n );\n line-height: var(\n --osdk-select-line-height,\n var(--osdk-typography-line-height-default)\n );\n color: var(\n --osdk-select-item-color,\n var(--osdk-typography-color-default-rest)\n );\n transition: background-color\n var(\n --osdk-select-transition-duration,\n var(--osdk-emphasis-transition-duration)\n )\n var(--osdk-select-transition-ease, var(--osdk-emphasis-ease-default));\n\n &[data-highlighted] {\n background-color: var(\n --osdk-select-item-bg-highlighted,\n var(--osdk-surface-background-color-default-hover)\n );\n outline: none;\n }\n\n &[data-selected] {\n background-color: var(\n --osdk-select-item-bg-selected,\n var(--osdk-surface-layer-primary)\n );\n color: var(\n --osdk-select-item-color-selected,\n var(--osdk-intent-primary-rest)\n );\n }\n\n &[data-disabled] {\n cursor: not-allowed;\n opacity: var(--osdk-disabled-opacity, 0.5);\n }\n}\n","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); }\n/*\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 { Select as BaseUISelect } from \"@base-ui/react/select\";\nimport { CaretDown } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Select.module.css\";\nfunction SelectRoot({\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUISelect.Root, rest, children);\n}\nfunction SelectTrigger({\n className,\n placeholder,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUISelect.Trigger, _extends({\n className: classnames(styles.osdkSelectTrigger, className)\n }, rest), children ?? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.osdkSelectValueContainer\n }, /*#__PURE__*/React.createElement(BaseUISelect.Value, {\n className: styles.osdkSelectValue\n }), placeholder != null && /*#__PURE__*/React.createElement(\"span\", {\n className: styles.osdkSelectPlaceholder\n }, placeholder)), /*#__PURE__*/React.createElement(BaseUISelect.Icon, {\n className: styles.osdkSelectIcon\n }, /*#__PURE__*/React.createElement(CaretDown, null))));\n}\nfunction SelectValue(props) {\n const {\n className,\n ...rest\n } = props;\n return /*#__PURE__*/React.createElement(BaseUISelect.Value, _extends({\n className: classnames(styles.osdkSelectValue, className)\n }, rest));\n}\nfunction SelectPositioner({\n className,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUISelect.Positioner, _extends({\n className: classnames(styles.osdkSelectPositioner, className),\n sideOffset: 4\n /* Disable Base UI's default behavior of aligning the selected item in\n the popup with the trigger. This causes layout jumps when the popup\n opens because the list scrolls to center the selected item. A static\n dropdown position below the trigger is more predictable. */,\n alignItemWithTrigger: false\n }, rest), children);\n}\nfunction SelectPopup({\n className,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUISelect.Popup, _extends({\n className: classnames(styles.osdkSelectPopup, className)\n }, rest), children);\n}\nfunction SelectItem({\n className,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUISelect.Item, _extends({\n className: classnames(styles.osdkSelectItem, className)\n }, rest), /*#__PURE__*/React.createElement(BaseUISelect.ItemText, null, children));\n}\nexport const Select = {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Portal: BaseUISelect.Portal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n Item: SelectItem\n};","/*\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\n.osdkSelectDismissLayer {\n --osdk-portal-dismiss-layer-z-index: var(\n --osdk-select-z-index,\n var(--osdk-surface-z-index-3)\n );\n}\n\n.osdkComboboxDismissLayer {\n --osdk-portal-dismiss-layer-z-index: var(\n --osdk-combobox-z-index,\n var(--osdk-surface-z-index-3)\n );\n}\n","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); }\n/*\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 dropdownStyles from \"./DropdownField.module.css\";\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 */\n\nexport const DropdownField = typedReactMemo(function DropdownFieldFn({\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}) {\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 ?? (isMultiple ? EMPTY_ARRAY : null);\n const resolvedItemToStringLabel = itemToStringLabel ?? defaultItemToStringLabel;\n const getKey = useCallback(item => itemToKey?.(item) ?? resolvedItemToStringLabel(item), [itemToKey, resolvedItemToStringLabel]);\n\n // Multi-select always uses Combobox for the chip-based UI because it looks better\n if (isSearchable || isMultiple) {\n return /*#__PURE__*/React.createElement(ComboboxDropdown, _extends({}, 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 // TODO: Support trailingItem\n return /*#__PURE__*/React.createElement(SelectDropdown, _extends({}, rest, {\n value: normalizedValue,\n itemToStringLabel: resolvedItemToStringLabel,\n getKey: getKey,\n modal: modal\n }));\n});\nconst SelectDropdown = typedReactMemo(function SelectDropdownFn({\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}) {\n const [open, setOpen] = useState(false);\n const hasValue = value != null;\n const handleOpenChange = useCallback(nextOpen => {\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 }, [onBlur]);\n const handleClear = useCallback(() => {\n // SelectDropdown is always single-select, so cleared value is null.\n onChange?.(null);\n handleOpenChange(false);\n }, [onChange, handleOpenChange]);\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Select.Root, {\n value: value,\n onValueChange: onChange,\n open: open,\n onOpenChange: handleOpenChange,\n isItemEqualToValue: isItemEqual,\n itemToStringLabel: itemToStringLabel,\n modal: modal\n }, /*#__PURE__*/React.createElement(Select.Trigger, {\n id: id,\n placeholder: placeholder\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: selectStyles.osdkSelectValueContainer\n }, /*#__PURE__*/React.createElement(Select.Value, null), placeholder != null && /*#__PURE__*/React.createElement(\"span\", {\n className: selectStyles.osdkSelectPlaceholder\n }, placeholder)), hasValue && /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": \"Clear\",\n className: selectStyles.osdkSelectClear,\n onMouseDown: preventTriggerOpen,\n onClick: handleClear\n }, /*#__PURE__*/React.createElement(SmallCross, null)), /*#__PURE__*/React.createElement(\"span\", {\n className: selectStyles.osdkSelectIcon\n }, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Select.Portal, {\n ref: portalRef,\n container: portalContainer\n }, open && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {\n className: dropdownStyles.osdkSelectDismissLayer,\n onDismiss: handleDismiss\n }), /*#__PURE__*/React.createElement(Select.Positioner, null, /*#__PURE__*/React.createElement(Select.Popup, null, items.map(item => /*#__PURE__*/React.createElement(Select.Item, {\n key: getKey(item),\n value: item\n }, itemToStringLabel(item))))))));\n});\nconst ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({\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}) {\n const [open, setOpen] = useState(false);\n const hasValue = isMultiple ? Array.isArray(value) && value.length > 0 : value != null;\n const handleOpenChange = useCallback(nextOpen => {\n setOpen(nextOpen);\n if (!nextOpen) {\n onBlur?.();\n }\n }, [onBlur]);\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 = useCallback((...args) => {\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 }, [onChange, onBlur, isMultiple]);\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 : null;\n handleValueChange(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 const handleRemoveItem = useCallback(itemToRemove => {\n if (!isMultiple || !Array.isArray(value)) {\n return;\n }\n const next = value.filter(v => isItemEqual != null ? !isItemEqual(v, itemToRemove) : v !== itemToRemove);\n handleValueChange(next);\n }, [isMultiple, value, handleValueChange, isItemEqual]);\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n const renderItem = useCallback(item => /*#__PURE__*/React.createElement(Combobox.Item, {\n key: getKey(item),\n value: item\n }, isMultiple && /*#__PURE__*/React.createElement(Combobox.ItemIndicator, null, /*#__PURE__*/React.createElement(Tick, null)), itemToStringLabel(item)), [getKey, isMultiple, itemToStringLabel]);\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(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 }, /*#__PURE__*/React.createElement(Combobox.Trigger, {\n id: id,\n className: isMultiple ? comboboxStyles.osdkComboboxTriggerMulti : undefined\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxValueContainer\n }, isMultiple && Array.isArray(value) && value.length > 0 ? /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxTriggerChips\n }, value.map(item => /*#__PURE__*/React.createElement(\"span\", {\n key: getKey(item),\n className: comboboxStyles.osdkComboboxTriggerChip\n }, itemToStringLabel(item), /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": `Remove ${itemToStringLabel(item)}`,\n className: comboboxStyles.osdkComboboxTriggerChipRemove,\n onMouseDown: preventTriggerOpen,\n onClick: () => handleRemoveItem(item)\n }, /*#__PURE__*/React.createElement(Cross, {\n size: 12\n }))))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Combobox.Value, null), !hasValue && placeholder != null && /*#__PURE__*/React.createElement(\"span\", {\n className: comboboxStyles.osdkComboboxPlaceholder\n }, placeholder))), hasValue && /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": \"Clear\",\n className: comboboxStyles.osdkComboboxClear,\n onMouseDown: preventTriggerOpen,\n onClick: handleClear\n }, /*#__PURE__*/React.createElement(SmallCross, null)), /*#__PURE__*/React.createElement(Combobox.Icon, null, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Combobox.Portal, {\n ref: portalRef,\n container: portalContainer\n }, open && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {\n className: dropdownStyles.osdkComboboxDismissLayer,\n onDismiss: handleDismiss\n }), /*#__PURE__*/React.createElement(Combobox.Positioner, null, /*#__PURE__*/React.createElement(Combobox.Popup, null, isSearchable && /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxPopupSearchInput\n }, /*#__PURE__*/React.createElement(Combobox.SearchInput, {\n placeholder: \"Search\\u2026\"\n })), popupStatus, popupStatus == null && /*#__PURE__*/React.createElement(Combobox.Empty, null, \"No results\"), /*#__PURE__*/React.createElement(Combobox.List, null, /*#__PURE__*/React.createElement(Combobox.Collection, null, renderItem), trailingItem))))));\n});\n\n// Prevent the clear/remove click from bubbling into the trigger\n// and toggling the dropdown open/closed.\nfunction preventTriggerOpen(e) {\n e.stopPropagation();\n e.preventDefault();\n}\nfunction defaultItemToStringLabel(item) {\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}"]}
|
|
@@ -10,7 +10,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
10
10
|
// src/util/withOsdkMetrics.ts
|
|
11
11
|
|
|
12
12
|
// src/util/UserAgent.ts
|
|
13
|
-
var PACKAGE_USER_AGENT = `osdk-react-components/${"0.14.
|
|
13
|
+
var PACKAGE_USER_AGENT = `osdk-react-components/${"0.14.1-main-99ec28ce779aa23be193edb2314d9e1dab938cc8"}`;
|
|
14
14
|
function componentUserAgent(componentName) {
|
|
15
15
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
16
16
|
}
|
|
@@ -26,5 +26,5 @@ function withOsdkMetrics(Component, name) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
exports.withOsdkMetrics = withOsdkMetrics;
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-AIYSQOC3.cjs.map
|
|
30
|
+
//# sourceMappingURL=chunk-AIYSQOC3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/UserAgent.ts","../../src/util/withOsdkMetrics.ts"],"names":["useRegisterUserAgent","React"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,kBAAA,GAAqB,yBAAyB,sDAA2B,CAAA,CAAA;AACxE,SAAS,mBAAmB,aAAA,EAAe;AAChD,EAAA,OAAO,CAAA,EAAG,kBAAkB,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA;AAC/C;;;ACKO,SAAS,eAAA,CAAgB,WAAW,IAAA,EAAM;AAC/C,EAAA,MAAM,UAAU,CAAA,KAAA,KAAS;AACvB,IAAAA,0BAAA,CAAqB,kBAAA,CAAmB,IAAI,CAAC,CAAA;AAC7C,IAAA,uBAAoBC,sBAAA,CAAM,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,EAC1D,CAAA;AACA,EAAA,OAAA,CAAQ,WAAA,GAAc,mBAAmB,IAAI,CAAA,CAAA,CAAA;AAC7C,EAAA,OAAO,OAAA;AACT","file":"chunk-AIYSQOC3.cjs","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 = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\nexport function componentUserAgent(componentName) {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}","/*\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 { useRegisterUserAgent } from \"@osdk/react\";\nimport React from \"react\";\nimport { componentUserAgent } from \"./UserAgent.js\";\n\n// `any` is required: FunctionComponent defaults to FunctionComponent<{}> which\n// rejects components with required props. A generic P parameter doesn't help\n// because TS can't infer both P and C simultaneously from a single argument.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withOsdkMetrics(Component, name) {\n const Wrapped = props => {\n useRegisterUserAgent(componentUserAgent(name));\n return /*#__PURE__*/React.createElement(Component, props);\n };\n Wrapped.displayName = `withOsdkMetrics(${name})`;\n return Wrapped;\n}"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAIYSQOC3_cjs = require('./chunk-AIYSQOC3.cjs');
|
|
4
4
|
var chunkQ2W6GYRK_cjs = require('./chunk-Q2W6GYRK.cjs');
|
|
5
5
|
var icons = require('@blueprintjs/icons');
|
|
6
6
|
var classnames4 = require('classnames');
|
|
@@ -2231,7 +2231,7 @@ function PdfViewer({
|
|
|
2231
2231
|
}
|
|
2232
2232
|
|
|
2233
2233
|
// src/public/experimental/pdf-viewer.ts
|
|
2234
|
-
var PdfViewer2 =
|
|
2234
|
+
var PdfViewer2 = chunkAIYSQOC3_cjs.withOsdkMetrics(PdfViewer, "PdfViewer");
|
|
2235
2235
|
|
|
2236
2236
|
exports.BasePdfViewer = BasePdfViewer;
|
|
2237
2237
|
exports.PdfViewer = PdfViewer2;
|
|
@@ -2255,5 +2255,5 @@ exports.usePdfViewerInstance = usePdfViewerInstance;
|
|
|
2255
2255
|
exports.usePdfViewerSearch = usePdfViewerSearch;
|
|
2256
2256
|
exports.usePdfViewerState = usePdfViewerState;
|
|
2257
2257
|
exports.usePdfViewerSync = usePdfViewerSync;
|
|
2258
|
-
//# sourceMappingURL=chunk-
|
|
2259
|
-
//# sourceMappingURL=chunk-
|
|
2258
|
+
//# sourceMappingURL=chunk-EGQYHG5E.cjs.map
|
|
2259
|
+
//# sourceMappingURL=chunk-EGQYHG5E.cjs.map
|