@opencxh/ui-kit 3.83.0 → 3.87.0

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.
@@ -1,6 +1,6 @@
1
1
  import { InternalSDK } from '@opencxh/domain';
2
2
  import { default as React } from 'react';
3
- export type FormFieldType = "text" | "email" | "password" | "number" | "tel" | "url" | "textarea" | "select" | "checkbox" | "radio" | "date" | "file" | "custom" | "array";
3
+ export type FormFieldType = "text" | "email" | "password" | "number" | "tel" | "url" | "textarea" | "select" | "checkbox" | "radio" | "date" | "file" | "folder" | "custom" | "array";
4
4
  type NestedKeys<T> = {
5
5
  [K in keyof T]: T[K] extends object ? `${K & string}.${NestedKeys<T[K]>}` : K & string;
6
6
  }[keyof T];
@@ -13,6 +13,7 @@ export { Select, type SelectOption, type SelectProps } from './input/Select';
13
13
  export { TextArea, type TextAreaProps } from './input/TextArea';
14
14
  export { TextField, type TextFieldProps } from './input/TextField';
15
15
  export { StorageInput, type StorageInputProps } from './input/StorageInput';
16
+ export { FolderSelect, type FolderSelectProps, type FolderDestination } from './input/FolderSelect';
16
17
  export { Form, type FormButtonProps, type FormFieldType, type FormGroup, type FormGroupItem, type FormProps } from './forms/Form';
17
18
  export { Dropdown, type DropdownOption, type DropdownProps } from './overlays/Dropdown';
18
19
  export { Modal, type ModalProps } from './overlays/Modal';
@@ -0,0 +1,27 @@
1
+ import { VirtualMount } from '@opencxh/domain';
2
+ export interface FolderDestination {
3
+ /** Storage folder (mount) id. */
4
+ folderId?: string;
5
+ /** Optional sub-path template, e.g. "{yyyy}/{mm}/{dd}". */
6
+ pathTemplate?: string;
7
+ }
8
+ export interface FolderSelectProps {
9
+ value?: FolderDestination;
10
+ onChange?: (value: FolderDestination) => void;
11
+ /** Loads the selectable storage folders (the shell wires this to storage.mount). */
12
+ onListFolders?: () => Promise<{
13
+ data: VirtualMount[];
14
+ }> | undefined;
15
+ disabled?: boolean;
16
+ size?: "sm" | "md" | "lg" | "full";
17
+ placeholder?: string;
18
+ templatePlaceholder?: string;
19
+ /** Show the sub-path template input (default true). */
20
+ showTemplate?: boolean;
21
+ }
22
+ /**
23
+ * Destination picker for a storage folder (+ optional sub-path template).
24
+ * Unlike StorageInput (which picks/uploads a file), this selects *where* things
25
+ * should be written. Used by the `type: "folder"` form field.
26
+ */
27
+ export declare function FolderSelect({ value, onChange, onListFolders, disabled, size, placeholder, templatePlaceholder, showTemplate, }: FolderSelectProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencxh/ui-kit",
3
- "version": "3.83.0",
3
+ "version": "3.87.0",
4
4
  "description": "Theme-aware UI component library for OpenCXH platform",
5
5
  "type": "module",
6
6
  "exports": {