Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing folded for object Input [typescript] #3264

Open
serchserch opened this issue May 3, 2024 · 0 comments
Open

Missing folded for object Input [typescript] #3264

serchserch opened this issue May 3, 2024 · 0 comments
Labels

Comments

@serchserch
Copy link

Missing folded property

The documentation indicates that the folded property can be used when the input type is object. However, this property is not currently available in the Input interface.

Docs: https://www.builder.io/c/docs/custom-components-input-types

image

Packages @builder.io/react@3.2.6 & @builder.io+sdk@2.2.2

/**
 * This is the interface for inputs in `Builder.registerComponent`
 *
 * ```js
 * Builder.registerComponent(MyComponent, {
 *   inputs: [{ name: 'title', type: 'text' }] // <- Input[]
 * })
 * ```
 *
 * Learn more about registering custom components [here](https://www.builder.io/c/docs/custom-react-components)
 */
export interface Input {
    /** This is the name of the component prop this input represents */
    name: string;
    /** A friendlier name to show in the UI if the component prop name is not ideal for end users */
    friendlyName?: string;
    /** @hidden @deprecated */
    description?: string;
    /** A default value to use */
    defaultValue?: any;
    /**
     * The type of input to use, such as 'text'
     *
     * See all available inputs [here](https://www.builder.io/c/docs/custom-react-components#input-types)
     * and you can create your own custom input types and associated editor UIs with [plugins](https://www.builder.io/c/docs/extending/plugins)
     */
    type: string;
    /** Is this input mandatory or not */
    required?: boolean;
    /** @hidden */
    autoFocus?: boolean;
    subFields?: Input[];
    /**
     * Additional text to render in the UI to give guidance on how to use this
     *
     * @example
     * ```js
     * helperText: 'Be sure to use a proper URL, starting with "https://"'
     * 111
     */
    helperText?: string;
    /** @hidden */
    allowedFileTypes?: string[];
    /** @hidden */
    imageHeight?: number;
    /** @hidden */
    imageWidth?: number;
    /** @hidden */
    mediaHeight?: number;
    /** @hidden */
    mediaWidth?: number;
    /** @hidden */
    hideFromUI?: boolean;
    /** @hidden */
    modelId?: string;
    /**
     * Number field type validation maximum accepted input
     */
    max?: number;
    /**
     * Number field type validation minimum accepted input
     */
    min?: number;
    /**
     * Number field type step size when using arrows
     */
    step?: number;
    /**
     * Set this to `true` to show the editor for this input when
     * children of this component are selected. This is useful for things
     * like Tabs, such that users may not always select the Tabs component
     * directly but will still be looking for how to add additional tabs
     */
    broadcast?: boolean;
    /**
     * Set this to `true` to show the editor for this input when
     * group locked parents of this component are selected. This is useful
     * to bubble up important inputs for locked groups, like text and images
     */
    bubble?: boolean;
    /**
     * Set this to `true` if you want this component to be translatable
     */
    localized?: boolean;
    /** @hidden */
    options?: {
        [key: string]: any;
    };
    /**
     * For "text" input type, specifying an enum will show a dropdown of options instead
     */
    enum?: string[] | {
        label: string;
        value: string | number | boolean;
        helperText?: string;
    }[];
    /** Regex field validation for all string types (text, longText, html, url, etc) */
    regex?: {
        /** pattern to test, like "^\/[a-z]$" */
        pattern: string;
        /** flags for the RegExp constructor, e.g. "gi"  */
        options?: string;
        /**
         * Friendly message to display to end-users if the regex fails, e.g.
         * "You must use a relative url starting with '/...' "
         */
        message: string;
    };
    /**
     * Set this to `true` to put this under the "show more" section of
     * the options editor. Useful for things that are more advanced
     * or more rarely used and don't need to be too prominent
     */
    advanced?: boolean;
    /** @hidden */
    onChange?: Function | string;
    /** @hidden */
    code?: boolean;
    /** @hidden */
    richText?: boolean;
    /** @hidden */
    showIf?: ((options: Map<string, any>) => boolean) | string;
    /** @hidden */
    copyOnAdd?: boolean;
    /**
     * Use optionally with inputs of type `reference`. Restricts the content entry picker to a specific model by name.
     */
    model?: string;
    meta?: Record<string, any>;
}
@github-actions github-actions bot added the Stale label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant