PromucFlow_constructor/app/client/src/widgets/constants.ts
Abhinav Jha 60503bb9a6
feat: Dynamic Height widget config (#13143)
* Add platform feature which adds dynamic height property controls and default properties based on widget config

* Move features to the top, so that defaults can override them if necessary

* - Add unit tests to verify that the property controls show up for dynamic height
- Add unit test to verify that the hidden hook in the dynamic height controls work
- Fix console warning for react key unavailable in Generator.tsx
- Move constants and types to their respective files

* Remove dynamic height config from Container Widget

* Add comments in hard to understand areas

* Add function which converts fn validation params to fnString
2022-04-22 15:14:22 +05:30

50 lines
1.2 KiB
TypeScript

import { PropertyPaneConfig } from "constants/PropertyControlConstants";
import { WidgetConfigProps } from "reducers/entityReducers/widgetConfigReducer";
import { DerivedPropertiesMap } from "utils/WidgetFactory";
import { WidgetFeatures } from "utils/WidgetFeatures";
import { WidgetProps } from "./BaseWidget";
export interface WidgetConfiguration {
type: string;
name: string;
iconSVG?: string;
defaults: Partial<WidgetProps> & WidgetConfigProps;
hideCard?: boolean;
isCanvas?: boolean;
needsMeta?: boolean;
features?: WidgetFeatures;
properties: {
config: PropertyPaneConfig[];
default: Record<string, string>;
meta: Record<string, any>;
derived: DerivedPropertiesMap;
};
}
export const GRID_DENSITY_MIGRATION_V1 = 4;
export enum BlueprintOperationTypes {
MODIFY_PROPS = "MODIFY_PROPS",
ADD_ACTION = "ADD_ACTION",
CHILD_OPERATIONS = "CHILD_OPERATIONS",
}
export type FlattenedWidgetProps = WidgetProps & {
children?: string[];
};
export interface DSLWidget extends WidgetProps {
children?: DSLWidget[];
}
export enum FileDataTypes {
Base64 = "Base64",
Text = "Text",
Binary = "Binary",
}
export type AlignWidget = "LEFT" | "RIGHT";
// Minimum Rows for Widget Popups
export const MinimumPopupRows = 12;