import { Query, Condition, Expression, Widget, EqValueEditor } from '@easyquery/core'; import { EasyDataTable } from '@easydata/core'; import { DateTimePicker, DateTimePickerOptions, DateLike } from '@easydata/ui'; import { ConditionRenderer } from './renderers/querypanel/condition_renderer'; import { ExpressionRenderer } from './renderers/querypanel/expression_renderer'; import { BaseElementRenderer } from './renderers/base_element_renderer'; import { QueryPanel } from './query_panel'; import { QPEditablePart } from '../types/qp_editable_part'; import { PopupMenuOptions } from '../utils/popup_menu'; import { FacetType } from '../types/facet_type'; import { ChartType } from './charts/chart_type'; /** Used in options.*/ export interface UseInOptions { useInConditions: boolean; useInResult: boolean; useInSorting: boolean; } export declare enum ColumnsEditMode { /** * ReadOnly edit mode allows to view columns but doesn't allow to change them. */ ReadOnly = 0, /** * FixedList edit mode allows to edit some columns parameters (formats, sorting) and change their order * but doesn't allow to add or delete columns. */ FixedList = 16, /** * Full edit mode allows to add, delete and change columns in any way. */ Full = 255 } export declare enum ConditionsEditMode { /** * No edit mode means that conditions are not editable at all. */ Default = 0, /** * ReadOnly edit mode allows to view conditions but doesn't allow to change them, including the condition type, operator, value, etc. */ ReadOnly = 1, /** * FixedList edit mode allows to modify some parameters of conditions (like their operators or values) but doesn't allow to add or delete conditions. */ FixedList = 16, /** * Full edit mode allows to add, delete and change conditions in any way. */ Full = 255 } /** EntitiesPanel options */ export interface EntitiesPanelOptions { showToolbar?: boolean; showSelectAllButton?: boolean; showClearSelectionButton?: boolean; showAddColumnButton?: boolean; showAddConditionButton?: boolean; showCheckboxes?: boolean; showTooltips?: boolean; /** * Gets or sets column caption format that will be used on adding selected attributes as columns */ columnTitleFormat?: string; draggableAttributes?: boolean; /** * Gets or sets the value that defines which attributes from the model should be shown in the tree. * Each attribute in the model has `Use in conditions`, `Use in columns`, `Use in sorting` properties. * This option filtering of all the attributes by these properties. */ showAttributes?: UseInOptions; showFilterBox?: boolean; /** * Gets or sets the value that defines how the search is performed in EntitiesPanel. Values: * `0` - checks if node name contains the filter text. Default behaviour. * `1` - checks if node name starts with the filter text. */ filterBoxMode?: number; /** Gets or sets a value indicating whether a progress indicator should appear while the model is loading */ showIndicatorOnLoad?: boolean; /** * Defines where to display attributes in the tree: * `0` - attributes are displayed after entities * `1` - attributes are displayed before entities * `2` - attributes and entities are mixed, and displayed in alphabetical order. In this case the `sortEntities` option value dosn't matter. */ attrPlacement?: number; /** Defines whether entities and attributes should be sorted alphabetically. If false, they are displayed as listed in the model. */ sortEntities?: boolean; /** Defines whether all selections will be cleared automatically after `add columns` or `add conditions` operation. */ autoClearSelection?: boolean; /** * The callback that is called when the entity node has been rendered. It allows you to make any changes you need to the markup of the node. * Parameters: * `entNode` - jQuery object that represents the node div * @example * entityRenderedCallbackHandler: function (entNode) { * entNode.addClass("some-cool-class"); * } */ entityRenderedCallback?: (entNode: HTMLElement) => void; /** * The callback that is called when the attribute node has been rendered. It allows you to make any changes you need to the markup of the node. * Parameters: * `attrNode` - jQuery object that represents the node div * @example * attributeRenderedCallbackHandler: function (attrNode) { * attrNode.addClass("some-cool-class"); * } */ attributeRenderedCallback?: (attrNode: HTMLElement) => void; syncWithColumns?: boolean; [name: string]: any; } /**Columns panel options */ export interface ColumnsPanelOptions { isSubQuery?: boolean; activeColumn?: any; /** Gets or sets a value indicating whether columns panel must show a special `add column` link at the bottom */ showAddRow?: boolean; /** Gets or sets a value indicating whether columns panel must show a header at the top */ showHeader?: boolean; /** Gets or sets a value indicating whether columns panel must show an editable caption for each column (i.e. `SELECT ColumnName AS ColumnCaption...`) */ showColumnTitles?: boolean; /** Gets or sets a value indicating whether columns panel must show button to change display */ allowDisplayFormatChange?: boolean; /** Gets or sets a value indicating whether columns panel allows user to use aggregated columns */ allowAggrColumns?: boolean; /** Gets or sets a value indicating whether it's allowed to add exactly the same column more than once */ allowDuplicates?: boolean; /** Gets or sets a value indicating whether it's allowed to use a custom expression for the column definition instead of some entity attribute. If it's turned on - a new menu item appears in the menu dropped on clicking on [f] button. */ allowCustomExpressions?: boolean; /** Gets or sets a value indicating whether columns panel allows user to set columns sorting */ allowSorting?: boolean; /** Gets or sets the format of the attribute display name. `{entity}` is replaced with entity name, `{attr}` is replaced with attribute name */ attrElementFormat?: string; /** * Gets or sets the format of column's title display name. `{entity}` is replaced with entity name, `{attr}` is replaced with attribute name. * Default value is null which means that columns panel will use the same format as it's set to attrElementFormat option */ titleElementFormat?: string; /** * Defines which buttons should be shown in the column when the mouse is over. * Possible values are: * - `"enable"` - the button that allows to enable or disable certain column. * - `"delete"` - the button that allows to delete certain column. * - `"type"` - the button that allows to select a column type (simple, aggregate, etc.). * - `"sorting"` - the button that allows to set column sorting and move columns. * - `"menu"` - the button that shows menu with all available actions for the column, including the actions that are not available using other buttons. * By default the option is not set, it actually means * ``` ["enable", "delete", "function", "sorting"]``` * */ buttons?: string[]; /** Gets or sets a value indicating whether the service buttons are permanently displayed in all columns (`true`), or just in active column and the column user moves the cursor over (`false`) */ alwaysShowButtons?: boolean; /** Gets or sets a value indicating whether the active column should be backlighted and permanently display the service buttons */ accentActiveColumn?: boolean; /** */ adjustEntitiesMenuHeight?: boolean; /** Gets or sets a value indicating whether the columns may be dragged and dropped */ allowDragDrop?: boolean; domWriteItemsId?: boolean; /** Get or sets a value indication wether checkboxes must be shown */ showCheckboxes?: boolean; /** * Contains different options for popup menu that appears for selecting attributes in columns. * */ menuOptions?: PopupMenuOptions; /** * Defines where to display attributes in the tree: * `0` - attributes are displayed after entities * `1` - attributes are displayed before entities * `2` - attributes and entities are mixed, and displayed in alphabetical order. In this case the "sortEntities" option value dosn't matter. */ attrPlacement?: number; /** * Defines whether entities and attributes should be sorted alphabetically. If false, they are displayed as listed in the model. */ sortEntities?: boolean; /** * The callback that is called when the column's row has been rendered. It allows you to make any changes you need to the markup of the row. * Parameters: * `columnDiv` - jQuery object that represents the column's row div * @example * columnRenderedCallbackHandler: function (columnDiv) { * columnDiv.addClass("some-cool-class"); * } */ columnRenderedCallback?: (columnDiv: HTMLDivElement) => void; /** * Gets or sets a value which defines what text should be used for custom expressions' links. Possible values are: * `0` - show the SQL expression itself. Default behaviour. * `1` - show special [Custom SQL] text. * `2` - show column's title. */ customExpressionText?: number; allowHiddenColumns?: boolean; allowInvisible?: boolean; showAddAllForEntity?: boolean; /** Gets or sets a value indicating whether a progress indicator should appear while the model is loading */ showIndicatorOnLoad?: boolean; /** Gets or sets the edit mode option: Full, FixedList or ReadOnly */ editMode?: ColumnsEditMode; [name: string]: any; } /** Columns bar options */ export interface ColumnsBarOptions extends ColumnsPanelOptions { showColumnCaptions?: boolean; } /** Query panel options */ export interface QueryPanelOptions { /** * Gets or sets a value indicating current edit mode for QueryPanel */ editableParts?: QPEditablePart; isSubQuery?: boolean; activeCondition?: null; entitiesPopupHandler?: any; entitiesListFilter?: any; menuContainer?: HTMLElement; /** * Gets or sets a value indicating whether query panel must show a root row which represents the main group of conditions */ showRootRow?: boolean; /** * Gets or sets a value indicating whether query panel must show a special [add condition] link at the bottom */ showAddRow?: boolean; /** * Gets or sets a value indicating whether query panel must show a checkbox at the beginning of each condition row. * User will be able to use these checkboxes to enable/disable corresponding query conditions */ showCheckboxes?: boolean; /** * Gets or sets a value indicating whether query panel shows "toggle parameterization" button which aloows to mark each condition as parameterized. */ allowParameterization?: boolean; /** * Gets or sets a value indicating whether query panel allows to place some conditions in to `JOIN` clause instead of `WHERE`. */ allowInJoinConditions?: boolean; /** Allows to turn off "Powered by EasyQuery" link shown in the bottom right cornder of query panel. Works only in the full version of the script. */ showPoweredBy?: boolean; /** * Defines which buttons should be shown in the condition/predicate when the mouse is over. * Possible values are: * - `"addCondition"` - the button that allows to add new condition. Is shown in predicates only. * - `"addPredicate"` - the button that allows to add new predicate. Is shown in predicates only. * - `"enable"` - the button that allows to enable or disable certain condition. * - `"delete"` - the button that allows to delete certain condition. * - `"menu"` - the button that shows menu with all available actions for the condition/predicate, including the actions that are not available using other buttons. * The default value for this option is: * ``` * { condition: ["enable", "delete"] predicate: ["addCondition", "addPredicate", "enable", "delete"] } * ``` * */ buttons?: { condition?: string[]; group?: string[]; }; /** * If true QueryPanel widget will always show button in predicate (group) rows. * Instead of default behaviour when they are shown only on mouse over. */ alwaysShowButtonsInGroups?: boolean; /** * If true QueryPanel widget will always show button in condition rows. * Instead of default behaviour when they are shown only on mouse over. */ alwaysShowButtonsInConditions?: boolean; /** * If true QueryPanel widget will show conjunction elements (`and` or `or`) at the beginning of each condition. */ showConjunctions?: boolean; /** * If true the active condition (the one user clicked on previously) will have accent background color. */ accentActiveCondition?: boolean; /** * If `true` root predicate row become active at the beginning. */ activateRootOnStart?: boolean; /** * A string that represents the format of date values used in date/time picker widget. */ dateFormatValue?: string; /** * The format of date values used in condition rows. */ dateFormatDisplay?: string; /** * The range of years displayed in the year drop-down: either relative to today's year ("-nn:+nn"), relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn"). */ yearRange?: string; /** * If `true` and no timepicker is displayed, calendar will be closed after click on some date. Default is `true` */ oneClickDateSelection?: boolean; /** * If `true`, calendar will display an input box with date string. Default is `false` */ showDateTimeInput?: boolean; /** * The format of entity attributes used in query panel conditions. * You can set it to `{attr}` to shown only attribute part (without entity name) */ attrElementFormat?: string; /** * Contains different options for popup menu that appears for selecting attributes, operators or values in condition. */ menuOptions?: PopupMenuOptions; /** * Gets or sets a value indicating whether it's possible to drag attributes from EntitiesPanel and drop them into QueryPanel to create new conditions. */ allowDragDrop?: boolean; /** * Defines where to display attributes in the tree: * `0` - attributes are displayed after entities * `1` - attributes are displayed before entities * `2` - attributes and entities are mixed, and displayed in alphabetical order. In this case the `sortEntities` option value dosn't matter. */ attrPlacement?: number; /** Defines whether entities and attributes should be sorted alphabetically. If false, they are displayed as listed in the model. */ sortEntities?: boolean; /**Sets or gets the width of sub-query dialog */ subQueryDialogWidth?: number | string; /** * Sets or gets the height of sub-query dialog */ subQueryDialogHeight?: number | string; /** * Sets or gets the ZIndex property of the different dialogs used in QueryPanel (including the sub-query dialog) */ dialogZIndex?: number; /** * Sets or gets the symbol which is used as decimal separator */ numberDecimalSeparatorDisplay?: string; /** * Sets or gets the symbols which are recognized as list items separators * (for example when user is supposed to enter a list of values in a text box). */ numberListSeparators?: string[]; /** * If `true` the QueryPanel will automaticall show value editor for any new (just added) condition */ autoEditNewCondition?: boolean; /** If `true` the drop-down menues with available values will show item IDs together with their texts */ showIdsForListItems?: boolean; /** Gets or sets a value indicating whether a progress indicator should appear while the model is loading */ showIndicatorOnLoad?: boolean; onGetConditionRenderer?: (condition: Condition, slot?: HTMLDivElement) => ConditionRenderer | null; /** * The callback that is called when the condition's row has been rendered. It allows you to make any changes you need to the markup of the row. * Parameters: * condition - Condition object * slot - HTMLDivElement object that represents the condition's div * @example * conditionRenderedHandler: function (condition, slot) { * slot.addClass("some-cool-class"); * } */ onConditionRendered?: (condition: Condition, slot: HTMLDivElement) => void; onGetExpressionRenderer?: (queryPanel: QueryPanel, expression: Expression, editor: EqValueEditor, slot?: HTMLDivElement) => ExpressionRenderer | null; onExpressionRendered?: (expression: Expression, slot: HTMLDivElement) => void; onGetOperatorRenderer?: (condition: Condition, text: string, slot?: HTMLDivElement) => BaseElementRenderer | null; onOperatorRendered?: (condition: Condition, text: string, slot: HTMLDivElement) => void; onGetAddRowRenderer?: (slot?: HTMLDivElement) => BaseElementRenderer | null; defaultQuery?: Query; emptyTextValue?: string; emptyTextList?: string; emptyTextAttribute?: string; emptyTextOperator?: string; adjustEntitiesMenuHeight?: boolean; domWriteItemsId?: boolean; dateTimePickerResolver?: (options: DateTimePickerOptions) => DateTimePicker; /** Gets or sets the edit mode option: Full, FixedList or ReadOnly */ editMode?: ConditionsEditMode; minDate?: DateLike; maxDate?: DateLike; defaultDate?: DateLike; } /** * Grid options type. */ export interface GridOptions { /** Function called before rendering */ beforeTableRendering?: (dataTable: EasyDataTable) => void; /** Function thart formats column header */ formatColumnHeader?: (dataTable: EasyDataTable, index: number, colLabel: string) => string; /** pageItem css class */ pageItemCssClass?: string; /** Max count of buttons */ maxButtonCount?: number; /** table class */ tableClass?: string; allowDragDrop?: boolean; [name: string]: any; } export interface ChartWidgetOptions { /**Chart type: 3 - Column, 4 - Histogram, 5 - Bar, 6 - Combo, 7 - Area, 9 - Line, 10 - Pie, 12 - Donut, 17 - Gauge, 18 - Candlestick*/ chartType?: ChartType; supportedChartTypes?: ChartType[]; showOnPaging?: boolean; legend?: { show?: boolean; position?: string; }; hideSettings?: boolean; /** The chart provider. */ chartWidgetResolver?: (slot: HTMLDivElement) => Widget; } export interface FilterBarOptions { applyOnClose?: boolean; showApplyButton?: boolean; showClearButton?: boolean; applyFilterCallback?: () => void; queryPanel?: QueryPanelOptions; [name: string]: any; } export interface SortingBarOptions { /** * Gets or sets a value indicating whether query panel must show a special [add condition] link at the bottom */ showAddRow?: boolean; /** * The format of entity attributes used in query panel conditions. * You can set it to `{attr}` to shown only attribute part (without entity name) */ attrElementFormat?: string; /** * Gets or sets the format of column's title display name. `{entity}` is replaced with entity name, `{attr}` is replaced with attribute name. * Default value is null which means that columns panel will use the same format as it's set to attrElementFormat option */ titleElementFormat?: string; adjustEntitiesMenuHeight?: boolean; /** * Contains different options for popup menu that appears for selecting attributes in columns. * */ menuOptions?: PopupMenuOptions; /** Gets or sets a value indicating whether the columns may be dragged and dropped */ allowDragDrop?: boolean; domWriteItemsId?: boolean; /** * The callback that is called when the column's row has been rendered. It allows you to make any changes you need to the markup of the row. * Parameters: * `columnDiv` - jQuery object that represents the column's row div * @example * columnRenderedCallbackHandler: function (columnDiv) { * columnDiv.addClass("some-cool-class"); * } */ columnRenderedCallback?: (columnDiv: HTMLDivElement) => void; [name: string]: any; } export interface ResultFacetsPanelOptions { gridResolver?: (slot: HTMLElement, facetType: FacetType) => Widget | null | undefined; facetTypes?: FacetType[]; supportedChartTypes?: ChartType[]; showExportButton?: boolean; showRefreshButton?: boolean; showMaximizeButton?: boolean; maximize2Window?: boolean; showProcessIndicator?: boolean; [facetType: string]: any; }