* Fixed tabs widget bugs and other updates: 1. Moved drag icon to the left of tab name field in the tabs widget property pane 2. Change drag icon 3. Add scroll when the tabs occupy more width than the width of tabs widget. 4. Add selected tab name validation. 5. Hide overflow tabs. 6. Avoid vertical scrollbars in tabs widget header
36 lines
914 B
TypeScript
36 lines
914 B
TypeScript
import { WidgetProps } from "widgets/BaseWidget";
|
|
import { DataTree } from "entities/DataTree/dataTreeFactory";
|
|
|
|
// Always add a validator function in ./Validators for these types
|
|
export const VALIDATION_TYPES = {
|
|
TEXT: "TEXT",
|
|
REGEX: "REGEX",
|
|
NUMBER: "NUMBER",
|
|
BOOLEAN: "BOOLEAN",
|
|
OBJECT: "OBJECT",
|
|
ARRAY: "ARRAY",
|
|
TABLE_DATA: "TABLE_DATA",
|
|
OPTIONS_DATA: "OPTIONS_DATA",
|
|
DATE: "DATE",
|
|
TABS_DATA: "TABS_DATA",
|
|
CHART_DATA: "CHART_DATA",
|
|
MARKERS: "MARKERS",
|
|
ACTION_SELECTOR: "ACTION_SELECTOR",
|
|
ARRAY_ACTION_SELECTOR: "ARRAY_ACTION_SELECTOR",
|
|
SELECTED_TAB: "SELECTED_TAB",
|
|
};
|
|
|
|
export type ValidationResponse = {
|
|
isValid: boolean;
|
|
parsed: any;
|
|
message?: string;
|
|
transformed?: any;
|
|
};
|
|
|
|
export type ValidationType = typeof VALIDATION_TYPES[keyof typeof VALIDATION_TYPES];
|
|
export type Validator = (
|
|
value: any,
|
|
props: WidgetProps,
|
|
dataTree?: DataTree,
|
|
) => ValidationResponse;
|