PrestoJS Documentation

website·Indexed 31 days ago

https://prestojs.com/

A library providing UI widgets and ViewModel field management, featuring a variety of field types such as DateTimeRangeField, ManyRelatedViewModelField, and JsonField, along with specialized formatters like RangeFormatter and DateTimeFormatter. It includes support for Ant Design (antd) UI components and asynchronous data handling via useAsync.

Tokens
55.6K
Snippets
373
Records
502
Agent score
43%

What's inside PrestoJS

  1. Overview of @prestojs/util features

    The @prestojs/util package provides general-purpose utilities for Presto applications, including:

    • useAsync: A hook for managing asynchronous functions.
    • Paginator: A utility class for paginating data, which can be used independently or integrated with the @prestojs/rest Endpoint class.
  2. Use ImageFormatter to render images in @prestojs/ui

    The ImageFormatter component from @prestojs/ui is used to format and display image values. Note that @prestojs/ui is a legacy package; for new projects, use @alliancesoftware/ui instead.
    import { ImageFormatter } from "@prestojs/ui";
  3. InferredPaginator Overview

    The InferredPaginator is a utility class from @prestojs/util that abstracts pagination logic. It can work with CursorPaginator, PageNumberPaginator, or LimitOffsetPaginator types, allowing developers to handle pagination without manually switching between different pagination strategies.
    import { InferredPaginator } from "@prestojs/util";
  4. Use PasswordWidget from @prestojs/ui-antd

    The PasswordWidget is a password input component provided by the @prestojs/ui-antd library.

    ⚠️ Legacy Warning: @prestojs/ui-antd is a legacy package. It is maintained for existing projects but should not be used for new projects. New projects should use @alliancesoftware/ui instead.

    import { PasswordWidget } from "@prestojs/ui-antd";
  5. Use SelectChoicesWidget for selection inputs

    The SelectChoicesWidget is a component from the @prestojs/ui-antd library used to render a selection input based on a set of choices.

    Note: @prestojs/ui-antd is a legacy package. For new projects, use @alliancesoftware/ui instead.

    import { SelectChoicesWidget } from "@prestojs/ui-antd";
  6. AsyncChoicesInterface Overview

    The AsyncChoicesInterface<ItemType, ValueType> is used in @prestojs/viewmodel to manage fields that provide choices asynchronously. It includes a multiple boolean property to indicate if the field supports multiple selections.
    import type { AsyncChoicesInterface } from "@prestojs/viewmodel";
    
    // Generic types: ItemType (the full object) and ValueType (the identifier/value)
    // AsyncChoicesInterface<ItemType, ValueType>
  7. Use the DecimalRangeWidget component from @prestojs/ui-antd

    The DecimalRangeWidget is a UI component used for handling decimal range inputs. Note that @prestojs/ui-antd is a legacy package maintained for existing projects; new projects should use @alliancesoftware/ui instead.
    import { DecimalRangeWidget } from "@prestojs/ui-antd";
  8. Use FormItem from @prestojs/final-form

    The FormItem component is part of the @prestojs/final-form package. Note that this is a legacy package maintained for existing projects; new projects should use @alliancesoftware/ui instead.
    import { FormItem } from "@prestojs/final-form";
  9. Use FormField from @prestojs/final-form

    The FormField component is part of the @prestojs/final-form package. Note that @prestojs/final-form is a legacy package maintained for existing projects; new projects should use @alliancesoftware/ui instead.
    import { FormField } from "@prestojs/final-form";
  10. Use ChoicesWidget for selection inputs in @prestojs/ui-antd

    The ChoicesWidget is a component used to render selection-based inputs (select, checkbox, or radio). Note that @prestojs/ui-antd is a legacy package; for new projects, use @alliancesoftware/ui instead.
    import { ChoicesWidget } from "@prestojs/ui-antd";
  11. Use FieldWidget from @prestojs/ui

    The FieldWidget component is part of the @prestojs/ui package. Note that @prestojs/ui is a legacy package maintained for existing projects; new projects should use @alliancesoftware/ui instead.
    import { FieldWidget } from "@prestojs/ui";
  12. Use @prestojs/ui-antd legacy package

    @prestojs/ui-antd is a legacy package. While it is maintained for existing projects, it should not be used for new projects. Developers starting new projects should use @alliancesoftware/ui instead.