UNPKG

@mescius/spread-common

Version:

SpreadJS common module

1,145 lines (1,070 loc) 3.16 MB
declare module GC{ module Data{ export interface IRelationship{ sourceTable: GC.Data.Table; sourceFieldName: string; sourceRelationshipName: string; targetTable: GC.Data.Table; targetFieldName: string; targetRelationshipName: string; } export interface ITables{ [tableName: string]: GC.Data.Table } export interface IViews{ [viewName: string]: GC.Data.View } export interface RowFormulaRule{ /** * the formula */ formula: string; /** * the row style when the formula evaluation is true */ style: GC.Data.StyleOptions; } /** * @typedef GC.Data.AverageRuleOptions - The options of average rule. * @property {"averageRule"} ruleType - The rule type if you want to use average rule. * @property {GC.Data.AverageType} type - The average type. * @property {GC.Data.StyleOptions} style - The style that is applied to the cell when the condition is met. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type AverageRuleOptions = { /** * The rule type if you want to use average rule. */ ruleType: "averageRule"; /** * The average type. */ type: GC.Data.AverageType; /** * The style that is applied to the cell when the condition is met. */ style: GC.Data.StyleOptions; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.AverageType * @type {"above"|"below"|"equalOrAbove"|"equalOrBelow"|"above1StdDev"|"below1StdDev"|"above2StdDev"|"below2StdDev"|"above3StdDev"|"below3StdDev"} * @description The average type. */ export type AverageType = "above"|"below"|"equalOrAbove"|"equalOrBelow"|"above1StdDev"|"below1StdDev"|"above2StdDev"|"below2StdDev"|"above3StdDev"|"below3StdDev" /** * @typedef GC.Data.CellButtonOptions * @property {string} position - The button's position in cell, which supports "left", "right", "leftOfText", "rightOfText". * @property {boolean} useButtonStyle - Whether the cellButton is a button style, default value is false. * @property {boolean} enabled - Whether the cell button responds to user actions, default value is true. * @property {number} width - The button's width. If it is set to null or undefined, the button width is auto fit based on the caption and image size. * @property {string} caption - The text of the button to display. * @property {string} imageSrc - When imageType is custom, can Specifies a image (base64) by imageSrc. * @property {Object} imageSize - The image's size by object {width: 16, height: 16}, default value is 16px * 16px. * @property {number} imageSize.width - The image width. * @property {number} imageSize.height - The image height. * @property {string} captionAlign - The alignment of image and caption, which supports "left", "right". * @property {string | Function} command - When click button, allow user to execute a command or user can execute a callback. * @property {string} imageType - The button's type (the type of image to display in the button). Provide some predefined type for cellButton, custom allow to Specifies icon. * It supports "none", "custom", "clear", "cancel", "ok", "dropdown", "ellipsis", "left", "right", "plus", "minus", "undo", "redo", "search", "separator", "spinLeft", "spinRight", "collapse", "expand". * @property {string} visibility - The button can be visible "always", "onSelected", "onEditing", default value is "always". * @property {string} hoverBackColor - The hover backColor of cell button when the button is visible and enable. * @property {string} buttonBackColor - The backColor of cell button when the button is enable. */ export type CellButtonOptions = { /** * The button's position in cell, which supports "left", "right", "leftOfText", "rightOfText". */ position?: "left" | "right" | "leftOfText" | "rightOfText"; /** * Whether the cellButton is a button style, default value is false. */ useButtonStyle?: boolean; /** * Whether the cell button responds to user actions, default value is true. */ enabled?: boolean; /** * The button's width. If it is set to null or undefined, the button width is auto fit based on the caption and image size. */ width?: number; /** * The text of the button to display. */ caption?: string; /** * When imageType is custom, can Specifies a image (base64) by imageSrc. */ imageSrc?: string; /** * The image's size by object {width: 16, height: 16}, default value is 16px * 16px. */ imageSize?: { width: number, height: number }; /** * The alignment of image and caption, which supports "left", "right". */ captionAlign?: "left" | "right"; /** * When click button, allow user to execute a command or user can execute a callback. */ command?: string | ((sheet: any, row: number, col: number, option: any) => void); /** * The button's type (the type of image to display in the button). Provide some predefined type for cellButton, custom allow to Specifies icon. */ imageType?: "none" | "custom" | "clear" | "cancel" | "ok" | "dropdown" | "ellipsis" | "left" | "right" | "plus" | "minus" | "undo" | "redo" | "search" | "separator" | "spinLeft" | "spinRight" | "collapse" | "expand"; /** * The button can be visible "always", "onSelected", "onEditing", default value is "always". */ visibility?: "always" | "onSelected" | "onEditing"; /** * The hover backColor of cell button when the button is visible and enable. */ hoverBackColor?: string; /** * The backColor of cell button when the button is enable. */ buttonBackColor?: string; } /** * @typedef GC.Data.CellValueComparisonOperator * @type {"equalsTo"|"notEqualsTo"|"greaterThan"|"greaterThanOrEqualsTo"|"lessThan"|"lessThanOrEqualsTo"|"between"|"notBetween"} * @description The cell value comparison operator. */ export type CellValueComparisonOperator = "equalsTo"|"notEqualsTo"|"greaterThan"|"greaterThanOrEqualsTo"|"lessThan"|"lessThanOrEqualsTo"|"between"|"notBetween" /** * @typedef GC.Data.CellValueRuleOptions - The options of cell value rule. * @property {"cellValueRule"} ruleType - The rule type if you want to use cell value rule. * @property {GC.Data.CellValueComparisonOperator} comparisonOperator - The comparison operator of cell value. * @property {GC.Data.CellValueType} value1 - The first value. * @property {GC.Data.CellValueType} value2 - The second value. * @property {GC.Data.StyleOptions} style - The style that is applied to the cell when the condition is met. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type CellValueRuleOptions = { /** * The rule type if you want to use cell value rule. */ ruleType: "cellValueRule"; /** * The comparison operator of cell value. */ comparisonOperator: GC.Data.CellValueComparisonOperator; /** * The first value. */ value1: GC.Data.CellValueType; /** * The second value. */ value2: GC.Data.CellValueType; /** * The style that is applied to the cell when the condition is met. */ style: GC.Data.StyleOptions; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.CellValueType * @type {number|string|boolean|Date|FormulaString} * @description The cell value type. */ export type CellValueType = number|string|boolean|Date|FormulaString /** * @typedef GC.Data.CheckboxOptions * @property {string} type - The type of the cell type, supports "checkbox". * @property {string} caption - The caption. * @property {string} textTrue - The text when cell value is true. * @property {string} textIndeterminate - The text when cell value is indeterminate. * @property {string} textFalse - The text when cell value is false. * @property {string} textAlign - The text alignment relative to the check box, which supports "top", "bottom", "left", "right". * @property {boolean} isThreeState - Whether the check box supports three states. * @property {number} boxSize - The check box size. */ export type CheckboxOptions = { /** * The type of the cell type, supports "checkbox". */ type: "checkbox"; /** * The caption. */ caption: string; /** * The text when cell value is true. */ textTrue: string; /** * The text when cell value is indeterminate. */ textIndeterminate: string; /** * The text when cell value is false. */ textFalse: string; /** * The text alignment relative to the check box, which supports "top", "bottom", "left", "right". */ textAlign: "top" | "bottom" | "left" | "right"; /** * Whether the check box supports three states. */ isThreeState: boolean; /** * The check box size. */ boxSize: number; } /** * @typedef GC.Data.ColorPickerGroup * @property {string} name - The group name. * @property {string[][]} colors - The group colors. * @property {boolean} needScaleColor - Whether generate scale color group. */ export type ColorPickerGroup = { /** * The group name. */ name: string; /** * The group colors. */ colors: string[][]; /** * Whether generate scale color group. */ needScaleColor: boolean; } /** * @typedef GC.Data.ColorPickerOptions * @property {number} colorBlockSize - Every color cell's size. * @property {GC.Data.ColorPickerGroup[]} groups - The group of the color picker, every group accept a name as group name, and a color array as the group's colors. */ export type ColorPickerOptions = { /** * Every color cell's size. */ colorBlockSize: number; /** * The group of the color picker, every group accept a name as group name, and a color array as the group's colors. */ groups: GC.Data.ColorPickerGroup[]; } /** * @typedef GC.Data.ColorString * @type {string} * @description The string type color. */ export type ColorString = string /** * @typedef GC.Data.ColumnBindingInfo * @property {string} name - The bound column of data through name. * @property {string} displayName - The display name of this column. * @property {string} formatter - The formatter for this column. * @property {number | string} size - The size of column. * @property {boolean} visible - The visibility of column. */ export type ColumnBindingInfo = { /** * The bound column of data through name. */ name: string; /** * The display name of this column. */ displayName?: string; /** * The formatter for this column. */ formatter?: string; /** * The size of column. */ size?: number | string; /** * The visibility of column. */ visible?: boolean; } /** * @typedef GC.Data.ComboBoxOptions * @property {string} type - The type of the cell type, supports "combobox". * @property {string} editorValueType - The editor value type, which supports "text", "index", "value". * @property {string[] | GC.Data.ItemOptions[]} items - The items, which supports string Array or Object Array which each item contains text and value. * @property {number} itemHeight - The height of each item. * @property {number} maxDropDownItems - The maximum item count of the drop-down list per page. * @property {boolean} editable - Whether the combo box is editable. */ export type ComboBoxOptions = { /** * The type of the cell type, supports "combobox". */ type: "combobox"; /** * The editor value type, which supports "text", "index", "value". */ editorValueType?: "text" | "index" | "value"; /** * The items, which supports string Array or Object Array which each item contains text and value. */ items: string[] | GC.Data.ItemOptions[]; /** * The height of each item. */ itemHeight?: number; /** * The maximum item count of the drop-down list per page. */ maxDropDownItems?: number; /** * Whether the combo box is editable. */ editable?: boolean; } /** * @typedef GC.Data.DataBarAxisPosition * @type {"automatic"|"cellMidPoint"|"none"} * @description The data bar rule axis position. */ export type DataBarAxisPosition = "automatic"|"cellMidPoint"|"none" /** * @typedef GC.Data.DataBarRuleDirection * @type {"leftToRight"|"rightToLeft"} * @description The data bar rule direction. */ export type DataBarRuleDirection = "leftToRight"|"rightToLeft" /** * @typedef GC.Data.DataBarRuleNegativeOptions - The options of data bar rule negative data options. * @property {GC.Data.ColorString} negativeFillColor - The color of the negative fill. * @property {boolean} useNegativeFillColor - Whether the negative fill color is used to paint the negative value. * @property {GC.Data.ColorString} negativeBorderColor - The color of the negative border. * @property {boolean} useNegativeBorderColor - Whether the negative border color is used to paint the border for the negative value. * @property {GC.Data.ColorString} axisColor - The axis color of the data bar. * @property {GC.Data.DataBarAxisPosition} axisPosition - The axis position of the data bar. */ export type DataBarRuleNegativeOptions = { /** * The color of the negative fill. */ negativeFillColor: GC.Data.ColorString; /** * Whether the negative fill color is used to paint the negative value. */ useNegativeFillColor: boolean; /** * The color of the negative border. */ negativeBorderColor: GC.Data.ColorString; /** * Whether the negative border color is used to paint the border for the negative value. */ useNegativeBorderColor: boolean; /** * The axis color of the data bar. */ axisColor: GC.Data.ColorString; /** * The axis position of the data bar. */ axisPosition: GC.Data.DataBarAxisPosition; } /** * @typedef GC.Data.DataBarRuleOptions - The options of data bar rule. * @property {"dataBarRule"} ruleType - The rule type if you want to use data bar rule. * @property {GC.Data.ScaleValueType} minType - The minimum scale type. * @property {number} minValue - The minimum scale value. * @property {GC.Data.ScaleValueType} maxType - The maximum scale type. * @property {number} maxValue - The maximum scale value. * @property {GC.Data.ColorString} maxColor - The maximum scale color string. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. * @property {boolean} gradient - Whether the data bar is a gradient. * @property {boolean} showBarOnly - Whether to display the data bar without text. * @property {boolean} showBorder - Whether to paint the border. * @property {GC.Data.ColorString} borderColor - The color of the border. * @property {GC.Data.DataBarRuleDirection} barDirection - The data bar direction. * @property {GC.Data.DataBarRuleNegativeOptions} negativeData - The options of data bar rule negative data options. */ export type DataBarRuleOptions = { /** * The rule type if you want to use data bar rule. */ ruleType: "dataBarRule"; /** * The minimum scale type. */ minType: GC.Data.ScaleValueType; /** * The minimum scale value. */ minValue: number; /** * The maximum scale type. */ maxType: GC.Data.ScaleValueType; /** * The maximum scale value. */ maxValue: number; color: GC.Data.ColorString; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; /** * Whether the data bar is a gradient. */ gradient: boolean; /** * Whether to display the data bar without text. */ showBarOnly: boolean; /** * Whether to paint the border. */ showBorder: boolean; /** * The color of the border. */ borderColor: GC.Data.ColorString; /** * The data bar direction. */ barDirection: GC.Data.DataBarRuleDirection; /** * The options of data bar rule negative data options. */ negativeData: GC.Data.DataBarRuleNegativeOptions; } /** * @typedef GC.Data.DateOccurringRuleOptions - The options of date occurring rule. * @property {"dateOccurringRule"} ruleType - The rule type if you want to use data occurring rule. * @property {GC.Data.DateOccurringType} type - The date occurring type. * @property {GC.Data.StyleOptions} style - The style that is applied to the cell when the condition is met. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type DateOccurringRuleOptions = { /** * The rule type if you want to use data occurring rule. */ ruleType: "dateOccurringRule"; /** * The date occurring type. */ type: GC.Data.DateOccurringType; /** * The style that is applied to the cell when the condition is met. */ style: GC.Data.StyleOptions; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.DateOccurringType * @type {"today"|"yesterday"|"tomorrow"|"last7Days"|"thisMonth"|"lastMonth"|"nextMonth"|"thisWeek"|"lastWeek"|"nextWeek"|"nextQuarter"|"thisQuarter"|"lastQuarter"|"nextYear"|"thisYear"|"lastYear"} * @description The date occurring type. */ export type DateOccurringType = "today"|"yesterday"|"tomorrow"|"last7Days"|"thisMonth"|"lastMonth"|"nextMonth"|"thisWeek"|"lastWeek"|"nextWeek"|"nextQuarter"|"thisQuarter"|"lastQuarter"|"nextYear"|"thisYear"|"lastYear" /** * @typedef GC.Data.DateTimePickerOptions * @property {boolean} showTime - Whether the calendar need to display time part. * @property {string} calendarPage - The default page, which accepts "year", "month", "day". * @property {string} startDay - The start day of week, normal the start day is monday or sunday, there user can set any day as it's start day. It accepts "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday". */ export type DateTimePickerOptions = { /** * Whether the calendar need to display time part. */ showTime: boolean; /** * The default page, which accepts "year", "month", "day". */ calendarPage: "year" | "month" | "day"; /** * The start day of week, normal the start day is monday or sunday, there user can set any day as it's start day. It accepts "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday". */ startDay: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"; } /** * @typedef GC.Data.DateValidatorOptions * @property {"date"} type - The data validator type. * @property {GC.Data.CellValueComparisonOperator} comparisonOperator - The data validator comparison operator. * @property {Date | GC.Data.FormulaString} value1 - The data validator first value. * @property {Date | GC.Data.FormulaString} value2 - The data validator second value if validator comparison operator is "between" or "notBetween". * @property {boolean} ignoreBlank - Whether to ignore empty value. * @property {boolean} inCellDropdown - Whether to display a drop-down button. * @property {GC.Data.ErrorStyle} errorStyle - The data validator error style. * @property {string} errorTitle - The data validator error title. * @property {string} errorMessage - The data validator error message. * @property {boolean} showErrorMessage - Whether to show error message. * @property {string} inputMessage - The data validator input message. * @property {string} inputTitle - The data validator input title. * @property {boolean} showInputMessage - Whether to show input message. * @property {GC.Data.HighlightStyle} highlightStyle - The data validator highlight style. */ export type DateValidatorOptions = { /** * The data validator type. */ type: "date"; /** * The data validator comparison operator. */ comparisonOperator: GC.Data.CellValueComparisonOperator; /** * The data validator first value. */ value1: Date | GC.Data.FormulaString; /** * The data validator second value if validator comparison operator is "between" or "notBetween". */ value2?: Date | GC.Data.FormulaString; /** * The data validator error style. */ errorStyle: GC.Data.ErrorStyle; /** * The data validator error title. */ errorTitle: string; /** * The data validator error message. */ errorMessage: string; /** * The data validator highlight style. */ highlightStyle: GC.Data.HighlightStyle; /** * Whether to ignore empty value. */ ignoreBlank: boolean; /** * Whether to display a drop-down button. */ inCellDropdown: boolean; /** * The data validator input message. */ inputMessage: string; /** * The data validator input title. */ inputTitle: string; /** * Whether to show error message. */ showErrorMessage: boolean; /** * Whether to show input message. */ showInputMessage: boolean; } /** * @typedef GC.Data.Decoration * @property {GC.Data.Icon[]} icons - The icons of the decoration in the style. */ export type Decoration = { /** * The icons of the decoration in the style. */ icons?: GC.Data.Icon[]; } /** * @typedef GC.Data.DropDownOptions * @property {string} type - The type of drop down, which supports "colorPicker", "dateTimePicker", "timePicker", "monthPicker", "list", "slider", "calculator", "workflowList", "multiColumn". * @property {GC.Data.ColorPickerOptions | GC.Data.DateTimePickerOptions | GC.Data.TimePickerOptions | GC.Data.MonthPickerOptions | GC.Data.ListOptions | GC.Data.SliderOptions | GC.Data.WorkFlowOptions | GC.Data.MultiColumnOptions} option - The option of drop down. * @property {Function} submitCommand - A command name or a callback function which will be executed when submit drop down's value. */ export type DropDownOptions = { /** * The type of drop down, which supports "colorPicker", "dateTimePicker", "timePicker", "monthPicker", "list", "slider", "calculator", "workflowList", "multiColumn". */ type: "colorPicker" | "dateTimePicker" | "timePicker" | "monthPicker" | "list" | "slider" | "calculator" | "workflowList" | "multiColumn"; /** * The option of drop down. */ option?: GC.Data.ColorPickerOptions | GC.Data.DateTimePickerOptions | GC.Data.TimePickerOptions | GC.Data.MonthPickerOptions | GC.Data.ListOptions | GC.Data.SliderOptions | GC.Data.WorkFlowOptions | GC.Data.MultiColumnOptions; /** * A command name or a callback function which will be executed when submit drop down's value. */ submitCommand?: string | ((sheet: any, value: any, option: any) => void); } /** * @typedef GC.Data.DuplicateRuleOptions - The options of duplicate rule. * @property {"duplicateRule"} ruleType - The rule type if you want to use duplicate rule. * @property {GC.Data.StyleOptions} style - The style that is applied to the cell when the condition is met. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type DuplicateRuleOptions = { /** * The rule type if you want to use duplicate rule. */ ruleType: "duplicateRule"; /** * The style that is applied to the cell when the condition is met. */ style: GC.Data.StyleOptions; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.ErrorStyle * @type {"stop" | "warning" | "information"} * @description The validator error style. */ export type ErrorStyle = "stop" | "warning" | "information" /** * @typedef GC.Data.FormulaListValidatorOptions * @property {"formulaList"} type - The data validator type. * @property {GC.Data.FormulaString} formula - The data validator formula if the validator type if "formula" or "formulaList". * @property {boolean} ignoreBlank - Whether to ignore empty value. * @property {boolean} inCellDropdown - Whether to display a drop-down button. * @property {GC.Data.ErrorStyle} errorStyle - The data validator error style. * @property {string} errorTitle - The data validator error title. * @property {string} errorMessage - The data validator error message. * @property {boolean} showErrorMessage - Whether to show error message. * @property {string} inputMessage - The data validator input message. * @property {string} inputTitle - The data validator input title. * @property {boolean} showInputMessage - Whether to show input message. * @property {GC.Data.HighlightStyle} highlightStyle - The data validator highlight style. */ export type FormulaListValidatorOptions = { /** * The data validator type. */ type: "formulaList"; /** * The data validator formula if the validator type if "formula" or "formulaList". */ formula: GC.Data.FormulaString; /** * The data validator error style. */ errorStyle: GC.Data.ErrorStyle; /** * The data validator error title. */ errorTitle: string; /** * The data validator error message. */ errorMessage: string; /** * The data validator highlight style. */ highlightStyle: GC.Data.HighlightStyle; /** * Whether to ignore empty value. */ ignoreBlank: boolean; /** * Whether to display a drop-down button. */ inCellDropdown: boolean; /** * The data validator input message. */ inputMessage: string; /** * The data validator input title. */ inputTitle: string; /** * Whether to show error message. */ showErrorMessage: boolean; /** * Whether to show input message. */ showInputMessage: boolean; } /** * @typedef GC.Data.FormulaRule * @property {GC.Data.FormulaString} formula - The formula. * @description The formula rule. */ export type FormulaRule = { /** * the formula string */ formula: GC.Data.FormulaString; } /** * @typedef GC.Data.FormulaRuleOptions - The options of formula rule. * @property {"formulaRule"} ruleType - The rule type if you want to use formula rule. * @property {GC.Data.FormulaString} formula - The formula. * @property {GC.Data.StyleOptions} style - The style that is applied to the cell when the condition is met. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type FormulaRuleOptions = { /** * The rule type if you want to use formula rule. */ ruleType: "formulaRule"; /** * The formula. */ formula: GC.Data.FormulaString; /** * The style that is applied to the cell when the condition is met. */ style: GC.Data.StyleOptions; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef {string} GC.Data.FormulaString - The formula type string, such as "=SUM(A1:B2)". */ export type FormulaString = string /** * @typedef GC.Data.FormulaValidatorOptions * @property {"formula"} type - The data validator type. * @property {GC.Data.FormulaString} formula - The data validator formula if the validator type if "formula" or "formulaList". * @property {boolean} ignoreBlank - Whether to ignore empty value. * @property {boolean} inCellDropdown - Whether to display a drop-down button. * @property {GC.Data.ErrorStyle} errorStyle - The data validator error style. * @property {string} errorTitle - The data validator error title. * @property {string} errorMessage - The data validator error message. * @property {boolean} showErrorMessage - Whether to show error message. * @property {string} inputMessage - The data validator input message. * @property {string} inputTitle - The data validator input title. * @property {boolean} showInputMessage - Whether to show input message. * @property {GC.Data.HighlightStyle} highlightStyle - The data validator highlight style. */ export type FormulaValidatorOptions = { /** * The data validator type. */ type: "formula"; /** * The data validator formula if the validator type if "formula" or "formulaList". */ formula: GC.Data.FormulaString; /** * The data validator error style. */ errorStyle: GC.Data.ErrorStyle; /** * The data validator error title. */ errorTitle: string; /** * The data validator error message. */ errorMessage: string; /** * The data validator highlight style. */ highlightStyle: GC.Data.HighlightStyle; /** * Whether to ignore empty value. */ ignoreBlank: boolean; /** * Whether to display a drop-down button. */ inCellDropdown: boolean; /** * The data validator input message. */ inputMessage: string; /** * The data validator input title. */ inputTitle: string; /** * Whether to show error message. */ showErrorMessage: boolean; /** * Whether to show input message. */ showInputMessage: boolean; } /** * @typedef GC.Data.GradientFillOptions * @property {number} degree - The gradient fill degree. * @property {GC.Data.GradientStop[]} stops - The gradient fill stops. */ export type GradientFillOptions = { /** * The gradient fill degree. */ degree?: number; /** * The gradient fill stops. */ stops: GC.Data.GradientStop[]; } /** * @typedef GC.Data.GradientPathFillOptions * @property {string} type - The gradient path fill type, supports "path." * @property {number} left - The gradient path fill left. * @property {number} right - The gradient path fill right. * @property {number} top - The gradient path fill top. * @property {number} bottom - The gradient path fill bottom. * @property {GC.Data.GradientStop[]} stops - The gradient path fill stops. */ export type GradientPathFillOptions = { /** * The gradient path fill type, supports "path." */ type: "path"; /** * The gradient path fill left. */ left?: number; /** * The gradient path fill right. */ right?: number; /** * The gradient path fill top. */ top?: number; /** * The gradient path fill bottom. */ bottom?: number; /** * The gradient path fill stops. */ stops: GC.Data.GradientStop[]; } /** * @typedef GC.Data.GradientStop * @property {string} color - The gradient stop color. * @property {number} position - The gradient stop position. */ export type GradientStop = { /** * The gradient stop color. */ color: string; /** * The gradient stop position. */ position: number; } /** * @typedef GC.Data.HeaderStyleOptions * @property {string | GC.Data.PatternFillOptions | GC.Data.GradientFillOptions | GC.Data.GradientPathFillOptions} backColor - The background color string or pattern fill options, gradient fill options, gradient path fill options. * @property {string} foreColor - The foreground color. * @property {string} hAlign - The horizontal alignment, which supports "left", "center", "right", "general". * @property {string} vAlign - The vertical alignment, which supports "top", "center", "bottom". * @property {string} font - The font. * @property {string} themeFont - The theme font. * @property {string} formatter - The formatter string. * @property {GC.Data.LineBorder} borderLeft - The left border. * @property {GC.Data.LineBorder} borderTop - The top border. * @property {GC.Data.LineBorder} borderRight - The right border. * @property {GC.Data.LineBorder} borderBottom - The bottom border. * @property {GC.Data.LineBorder} diagonalDown - The diagonal with LeftTop to bottomRight. * @property {GC.Data.LineBorder} diagonalUp - The diagonal with topRight to bottomLeft. * @property {boolean} locked - Whether the cell, row, or column is locked. * @property {number} textIndent - The text indent amount. * @property {boolean} wordWrap - Whether words wrap within the cell or cells. * @property {boolean} shrinkToFit - Whether content shrinks to fit the cell or cells. * @property {string} backgroundImage - The background image to display. * @property {string} backgroundImageLayout - The layout for the background image, which supports "stretch", "center", "zoom", "none". * @property {GC.Data.TextDecoration} textDecoration - The decoration added to text. * @property {string} name - The name. * @property {string} parentName - The name of the parent style. * @property {string} watermark - The watermark content. * @property {string} cellPadding - The cell padding. * @property {GC.Data.LabelOptions} labelOptions - The cell label options. * @property {boolean} isVerticalText - Whether to set the cell's text vertical. * @property {boolean} showEllipsis - Whether the text out of bounds shows ellipsis. */ export type HeaderStyleOptions = { /** * The background color string or pattern fill options, gradient fill options, gradient path fill options. */ backColor?: string | GC.Data.PatternFillOptions | GC.Data.GradientFillOptions | GC.Data.GradientPathFillOptions; /** * The foreground color. */ foreColor?: string; /** * The horizontal alignment, which supports "left", "center", "right", "general". */ hAlign?: "left" | "center" | "right" | "general"; /** * The vertical alignment, which supports "top", "center", "bottom". */ vAlign?: "top" | "center" | "bottom"; /** * The font. */ font?: string; /** * The theme font. */ themeFont?: string; /** * The formatter string. */ formatter?: string; /** * The left border. */ borderLeft?: GC.Data.LineBorder; /** * The top border. */ borderTop?: GC.Data.LineBorder; /** * The right border. */ borderRight?: GC.Data.LineBorder; /** * The bottom border. */ borderBottom?: GC.Data.LineBorder; /** * The diagonal with LeftTop to bottomRight. */ diagonalDown?: GC.Data.LineBorder; /** * The diagonal with topRight to bottomLeft. */ diagonalUp?: GC.Data.LineBorder; /** * Whether the cell, row, or column is locked. */ locked?: boolean; /** * The text indent amount. */ textIndent?: number; /** * Whether words wrap within the cell or cells. */ wordWrap?: boolean; /** * Whether content shrinks to fit the cell or cells. */ shrinkToFit?: boolean; /** * The background image to display. */ backgroundImage?: string; /** * The layout for the background image, which supports "stretch", "center", "zoom", "none". */ backgroundImageLayout?: "stretch" | "center" | "zoom" | "none"; /** * The decoration added to text. */ textDecoration?: GC.Data.TextDecoration; /** * The name. */ name?: string; /** * The name of the parent style. */ parentName?: string; /** * The watermark content. */ watermark?: string; /** * The cell padding. */ cellPadding?: string; /** * The cell label options. */ labelOptions?: GC.Data.LabelOptions; /** * Whether to set the cell's text vertical. */ isVerticalText?: boolean; /** * Whether the text out of bounds shows ellipsis. */ showEllipsis?: boolean; } /** * @typedef GC.Data.HierarchyCustomParseHandler * @param {GC.Data.IHierarchyCustomParseOptions} options - the options for the handler. * @returns {any} Returns of the parentId of the current record. * @description Get the parentId of the current record. */ export type HierarchyCustomParseHandler = (options: GC.Data.IHierarchyCustomP