PagePlug Documentation
repository·open-v1.9.39·Indexed 24 days ago
https://github.com/cloudtogo/pageplugA low-code development platform for professional developers to build web and mobile (WeChat Mini Program) applications. A localized and optimized version of Appsmith, PagePlug features high extensibility through JavaScript and seamless data integration. Documentation covers the Appsmith Design System, icon generation, Enterprise Edition (EE) overrides, and server-side ACL migration scripts.
What's inside PagePlug
- PagePlug is an open-source, declarative, and visual low-code framework designed for developers (To D). It is a localized version of Appsmith optimized for the Chinese market. It allows developers to build web applications and WeChat Mini Programs by connecting directly to data sources like APIs and databases, turning backend data into JavaScript variables that can be used in any UI component.
Key features of PagePlug
open-v1.9.39PagePlug provides several core capabilities for rapid application development:
- Visual Modeling Tool: Drag-and-drop components like tables, charts, forms, and buttons to create custom interfaces without heavy coding.
- Extensive API Support: Seamless integration with third-party APIs for data storage, message queues, and file uploads.
- Advanced Data Management: Built-in engine support for executing SQL queries and managing databases/tables without manual configuration.
- High Extensibility: Supports writing custom JavaScript anywhere in the application and allows adding third-party JS libraries to control logic and customize components.
- Security Features: Includes support for authentication, authorization, encryption, and auditing.
- Mobile Support: Built-in support for creating WeChat Mini Programs quickly.
Use the Appsmith Icons set for Entity Explorer Panel
open-v1.9.39The
appsmith-iconspackage provides a set of icons specifically designed for the Entity Explorer Panel. These icons serve as visual representations for various widgets, helping users identify components within the UI.Available icon components include:
ButtonIconCheckboxGroupIconCheckboxIconCurrencyInputIconHeadingIconIconButtonIconInlineButtonsIconInputIconKeyValueIconMenuButtonIconModalIconParagraphIconPhoneInputIconRadioGroupIconSectionIconStatsBoxIconSwitchGroupIconSwitchIconTableIconToolbarButtonsIconZoneIcon
What is a Popover and how to use it
open-v1.9.39A Popover is a page overlay triggered by a button that displays additional interactive content. It is best used for supplemental interactive content that contains at least one focusable element.
Best Practices
- Triggers: Popovers should be triggered by a button, icon, icon-button, or action-list.
- Positioning: The popover should appear near its trigger element (above, below, left, or right) to maintain a visual connection.
- Non-obstruction: Ensure the popover does not obstruct information on the page that is directly related to the popover content.
- Scrolling: For long content, ensure the content area is scrollable. The header should remain sticky during scrolling to maintain context.
When to use a Modal instead
- Critical Information: Do not use popovers for critical information, warnings, or required inputs. Use a Modal for these scenarios.
- Complex Workflows: Do not use a popover to guide users through complex, multi-step workflows. Use a Modal for workflows.
- Primary Actions: Avoid placing more than one primary action within a single Popover.
Select component variations
open-v1.9.39The
Selectcomponent supports several functional variations to suit different UI requirements:- Multiselect: Allows selecting multiple items from the list.
- With checkboxes: A multiselect variation that includes checkboxes for each option.
- Searchable: Enables users to filter the list of options by typing.
- Disabled: Renders the component in a non-interactive state.
- Loading: Displays a loading state within the component.
- Validity: Shows the visual state of the field when it is in an invalid state (e.g., during form validation errors).
Expose Widget Properties for data binding
open-v1.9.39Widget developers can define which properties are exposed to Appsmith developers. These properties represent the state of the widget.
Appsmith developers can then
bindthese properties to other entities using double curly braces{{ }}. This allows them to pass data into your widget or use your widget's state elsewhere. The platform evaluates the content within the braces, allowing for JavaScript manipulation.Example of binding an Input property to a Text widget:
{{ Input1.text }}Example of using JavaScript within a binding:
{{ Input1.text.toLowerCase() }}Popover Anatomy
open-v1.9.39A Popover consists of the following structural elements:
- Popover panel: The main container for the popover content.
- Header: An optional section containing a title and/or a close icon.
- Title: An optional element in the header providing a brief label for the content.
- Close icon: An optional element that allows users to close the popover via click or by pressing the
Esckey.
Understand the Category Token naming convention
open-v1.9.39Category tokens are mandatory for use throughout the platform and are structured to ensure consistency based on the component's category. The naming convention follows a specific hierarchical pattern to describe the token's purpose, scope, and visual properties.
Naming Pattern:
atom-category-component-kind-surface-state-presentational-attributeSegment Description Atom The type of token (e.g., colors,spacing,typography).Category The functional category (e.g., action,response,control,content).Component The specific component (e.g., button,input,avatar). This is optional if the token is not component-specific.Kind The variant or importance level (e.g., primary,secondary,tertiary).Surface The part of the component being styled (e.g., surface,label,icon).State The component state (e.g., default,hover,active).PresentationalAttribute The visual property (e.g., bg,border,foreground).Example of a component-specific token: If the
Avatarcomponent requires unique colors for its background and border that differ from the general category, the tokens would be:--ads-v2-colors-content-avatar-surface-default-bg--ads-v2-colors-content-avatar-surface-default-border
--ads-v2-colors-content-avatar-surface-default-bg --ads-v2-colors-content-avatar-surface-default-borderConfigure plugin UI with form.json and editor.json
open-v1.9.39UI rendering for plugins is controlled by two JSON files located in
src/main/resources:form.json: Defines the fields shown when a user creates a new datasource (e.g., credentials).editor.json: Defines the interface where users enter queries for execution.
Use
configPropertyto map UI fields to the plugin's internal configuration object.# form.json { "form": [ { "sectionName": "Details", "id": 1, "children": [ { "label": "DB Username", "configProperty": "datasourceConfiguration.authentication.username", "controlType": "INPUT_TEXT", "isRequired": true, "placeholderText": "", "initialValue": "" } ] } ] } # editor.json { "editor": [ { "sectionName": "", "id": 1, "children": [ { "label": "", "configProperty": "actionConfiguration.body", "controlType": "QUERY_DYNAMIC_TEXT" } ] } ] }Use the List component for interactive actions
open-v1.9.39The
Listcomponent is used to display a set of interactive actions or choices in a uniform single-column layout. It is ideal for sidebars, navigation bars, or organizational lists where actions are directly accessible without additional user interaction (unlike a Menu component).Anatomy
A List item typically consists of:
- Container: The wrapper for the item.
- Start icon: A visual indicator related to the action.
- Label: The primary text for the action item.
- End icon: An icon for more options or related actions.
When to use List vs Menu
- Use List when actions should be immediately visible and accessible (e.g., a sidebar navigation).
- Use Menu when actions should be hidden behind a trigger (e.g., a click or hover) to manage complex sets of choices or hierarchical structures.
Manage Segmented Control state
open-v1.9.39The state of an individual segment within aSegmentedControlis managed internally by the component. While you cannot control the state externally for every change, you can define a default value to be selected when the component is first rendered.Understand ZIndex design tokens
open-v1.9.39TheZIndexdesign token provides numerical values used to manage the layering of UI elements. By using these tokens, you can control the visual hierarchy and ensure specific elements (like navigation menus or modals) appear on top of other content. These tokens are part of the theme system and are typically applied via CSS variables or theme properties.