Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsartisan committed Oct 15, 2024
1 parent ef5a253 commit 71fe866
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/client/src/constants/PropertyControlConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export interface PanelConfig {
}

export interface PropertyPaneControlConfig {
// unique id to identify the property. It is added automatically with generateReactKey()
// Unique identifier for the control. Used for internal tracking and debugging.
// It added by `addPropertyConfigIds` function ( app/client/src/WidgetProvider/factory/helpers.ts ).
id?: string;
// label is used to display the name of the property
label: string;
Expand Down Expand Up @@ -101,6 +102,7 @@ export interface PropertyPaneControlConfig {
invisible?: boolean;
isBindProperty: boolean;
isTriggerProperty: boolean;
/** validation configuration for the property */
validation?: ValidationConfig;
useValidationMessage?: boolean;
// TODO: Fix this the next time the file is edited
Expand Down
13 changes: 13 additions & 0 deletions app/client/src/utils/PropertyControlFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ import type {
import type BaseControl from "components/propertyControls/BaseControl";
import { isArray } from "lodash";
import type { AdditionalDynamicDataTree } from "./autocomplete/customTreeTypeDefCreator";

/**
* PropertyPaneControlFactory
*
* This classes manages all the available controls for the property pane.
* It maintains a map of control types to their respective builders.
* The control builders are responsible for creating the actual controls.
*
* Key functionalities:
* 1. Register control builders, methods, and computed value functions
* 2. Create controls based on control data and preferences
* 3. Retrieve available control types
*/
class PropertyControlFactory {
static controlMap: Map<ControlType, ControlBuilder<ControlProps>> = new Map();
static controlMethods: Map<ControlType, ControlMethods> = new Map();
Expand Down

0 comments on commit 71fe866

Please sign in to comment.